From 8d3f799ff6e85d1eac66f1a7e8d2c7425d44944f Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Wed, 5 Jun 2024 12:09:19 +0200 Subject: [PATCH 01/10] make different language versions --- .gitignore | 1 + deploy/de/regexr.css | 2086 ++++ deploy/de/regexr.js | 21008 ++++++++++++++++++++++++++++++++++++++ deploy/de/regexr.js.map | 1 + deploy/en/regexr.css | 2086 ++++ deploy/en/regexr.js | 21008 ++++++++++++++++++++++++++++++++++++++ deploy/en/regexr.js.map | 1 + generate.py | 24 +- 8 files changed, 46207 insertions(+), 8 deletions(-) create mode 100644 deploy/de/regexr.css create mode 100644 deploy/de/regexr.js create mode 100644 deploy/de/regexr.js.map create mode 100644 deploy/en/regexr.css create mode 100644 deploy/en/regexr.js create mode 100644 deploy/en/regexr.js.map diff --git a/.gitignore b/.gitignore index ad6984c..07f8ce0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ __pycache__ deploy/index.html +deploy/*/index.html diff --git a/deploy/de/regexr.css b/deploy/de/regexr.css new file mode 100644 index 0000000..cec44eb --- /dev/null +++ b/deploy/de/regexr.css @@ -0,0 +1,2086 @@ +@charset "UTF-8"; +.CodeMirror { +font-family:monospace; +height:300px; +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!important; +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-rulers { +position:absolute; +left:0; +right:0; +top:-50px; +bottom:-20px; +overflow:hidden +} +.CodeMirror-ruler { +border-left:1px solid #ccc; +top:0; +bottom:0; +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-type,.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 { +color:#555 +} +.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-s-default .cm-error { +color:red +} +.cm-invalidchar { +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; +min-height:100%; +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 +} +.CodeMirror-gutter-background { +position:absolute; +top:0; +bottom:0; +z-index:4 +} +.CodeMirror-gutter-elt { +position:absolute; +cursor:default; +z-index:4 +} +.CodeMirror-gutter-wrapper ::selection { +background-color:transparent +} +.CodeMirror-gutter-wrapper ::-moz-selection { +background-color:transparent +} +.CodeMirror-lines { +cursor:text; +min-height:1px +} +.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; +-webkit-font-variant-ligatures:contextual; +font-variant-ligatures:contextual +} +.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-rtl pre { +direction:rtl +} +.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; +pointer-events:none +} +.CodeMirror-measure pre { +position:static +} +div.CodeMirror-cursors { +visibility:hidden; +position:relative; +z-index:3 +} +div.CodeMirror-dragcursors { +visibility:visible +} +.CodeMirror-focused div.CodeMirror-cursors { +visibility:visible +} +.CodeMirror-selected { +background:#d9d9d9 +} +.CodeMirror-focused .CodeMirror-selected { +background:#d7d4f0 +} +.CodeMirror-crosshair { +cursor:crosshair +} +.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection { +background:#d7d4f0 +} +.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 +} +.doc>section.text .tests .list li header,.doc>section>header,.sidebar>.min>.list>li:first-child { +display:flex; +align-items:center; +padding:0 1rem 0 1rem; +flex:0 2.5rem +} +.doc>section.text .tests .list li header h1,.doc>section>header h1,.sidebar>.min>.list>li:first-child h1 { +flex:1 +} +#cheatsheet table th,.community>header .icon,.container .header .settings,.doc>section.text .tests .list li header .icon.delete,.doc>section.tools>article .icon.help,.example svg.icon.load,.sidebar>.full .list .row,.sidebar>.full .list li,.sidebar>.full>header .icon,.sidebar>.min .list .row,.sidebar>.min .list li,.tooltip .list li,.tooltip header .help.icon,a { +transition:color .2s; +color:#d7dadc +} +#cheatsheet table th:not(.inactive),.community>header .icon:not(.inactive),.container .header .settings:not(.inactive),.doc>section.text .tests .list li header .icon.delete:not(.inactive),.doc>section.tools>article .icon.help:not(.inactive),.example svg.icon.load:not(.inactive),.sidebar>.full .list .row:not(.inactive),.sidebar>.full .list li:not(.inactive),.sidebar>.full>header .icon:not(.inactive),.sidebar>.min .list .row:not(.inactive),.sidebar>.min .list li:not(.inactive),.tooltip .list li:not(.inactive),.tooltip header .help.icon:not(.inactive),a:not(.inactive) { +cursor:pointer +} +#cheatsheet table th:not(.inactive):hover,.community>header .icon:not(.inactive):hover,.container .header .settings:not(.inactive):hover,.doc>section.text .tests .list li header .icon.delete:not(.inactive):hover,.doc>section.tools>article .icon.help:not(.inactive):hover,.example svg.icon.load:not(.inactive):hover,.sidebar>.full .list .row:not(.inactive):hover,.sidebar>.full .list li:not(.inactive):hover,.sidebar>.full>header .icon:not(.inactive):hover,.sidebar>.min .list .row:not(.inactive):hover,.sidebar>.min .list li:not(.inactive):hover,.tooltip .list li:not(.inactive):hover,.tooltip header .help.icon:not(.inactive):hover,a:not(.inactive):hover { +color:#e7e9ea +} +#cheatsheet table th:not(.inactive):hover svg.icon,.community>header .icon:not(.inactive):hover svg.icon,.container .header .settings:not(.inactive):hover svg.icon,.doc>section.text .tests .list li header .icon.delete:not(.inactive):hover svg.icon,.doc>section.tools>article .icon.help:not(.inactive):hover svg.icon,.example svg.icon.load:not(.inactive):hover svg.icon,.sidebar>.full .list .row:not(.inactive):hover svg.icon,.sidebar>.full .list li:not(.inactive):hover svg.icon,.sidebar>.full>header .icon:not(.inactive):hover svg.icon,.sidebar>.min .list .row:not(.inactive):hover svg.icon,.sidebar>.min .list li:not(.inactive):hover svg.icon,.tooltip .list li:not(.inactive):hover svg.icon,.tooltip header .help.icon:not(.inactive):hover svg.icon,a:not(.inactive):hover svg.icon { +color:currentColor +} +#cheatsheet table th svg.icon,.community>header .icon svg.icon,.container .header .settings svg.icon,.doc>section.text .tests .list li header .icon.delete svg.icon,.doc>section.tools>article .icon.help svg.icon,.example svg.icon.load svg.icon,.sidebar>.full .list .row svg.icon,.sidebar>.full .list li svg.icon,.sidebar>.full>header .icon svg.icon,.sidebar>.min .list .row svg.icon,.sidebar>.min .list li svg.icon,.tooltip .list li svg.icon,.tooltip header .help.icon svg.icon,a svg.icon { +transition:fill .2s +} +#tooltip .texthover i,.example code i { +background:#595f64; +color:#f0f1f2; +font-weight:400; +padding:0 .25em; +margin-left:.25em +} +.doc>section.tools>article .details span.hover,.doc>section.tools>article .details table tr.group:hover,.doc>section.tools>article .explain div.selected { +outline:solid 2px rgba(16,17,18,.3); +z-index:10 +} +.doc>section.tools>article .explain div.related { +outline:solid 1px rgba(16,17,18,.3); +z-index:9 +} +body,html { +margin:0; +width:100%; +height:100%; +min-height:540px; +min-width:500px; +font-family:"Roboto Condensed",sans-serif; +font-size:16px; +color:#f0f1f2; +-webkit-user-select:none; +user-select:none; +cursor:default +} +body>.container,html>.container { +height:100%; +display:flex; +flex-flow:column +} +body>.container>.app,html>.container>.app { +flex:1; +min-height:0; +display:flex; +align-items:stretch +} +::-webkit-scrollbar { +width:.5em; +height:.5em +} +::-webkit-scrollbar-track { +background:rgba(126,135,142,.25) +} +::-webkit-scrollbar-thumb { +background-color:#7e878e; +border-radius:.5em +} +.app .sidebar,.container .header,.tooltip { +-moz-osx-font-smoothing:grayscale; +-webkit-font-smoothing:antialiased +} +code,pre { +font-family:"Source Code Pro",monospace +} +pre { +margin:0 +} +a { +color:#70b0e0; +text-decoration:none +} +h1,h2 { +font-size:1rem; +font-weight:700; +margin:0 +} +.list { +display:flex; +flex-direction:column; +margin:0; +padding:0 +} +.list li { +display:block +} +hr { +border:0; +border-top:1px solid rgba(126,135,142,.25); +margin:.75em 0 1em 0 +} +span.match { +background:rgba(112,176,224,.5); +color:#101112 +} +span.error { +color:#d22; +font-weight:700 +} +span.error.warning { +color:#d22 +} +.anim-spin { +animation:1s linear infinite spin +} +@keyframes spin { +from { +transform:rotate(0) +} +to { +transform:rotate(360deg) +} + +} +#tooltip-signin ul.list li,.button,.buttonbar>*,.container .header ul.file li,.control,.segcontrol>*,input,textarea { +padding:.375rem .75rem; +font-size:.875rem; +border-radius:.125rem +} +input,textarea { +border-radius:0; +background:rgba(240,241,242,.05); +border:none; +border-bottom:solid 1px rgba(240,241,242,.05); +font-family:"Roboto Condensed",sans-serif; +font-size:1rem; +display:block; +width:100%; +box-sizing:border-box; +color:#f0f1f2; +resize:vertical +} +input::placeholder,textarea::placeholder { +color:currentColor; +opacity:.4 +} +input:focus,textarea:focus { +outline:0 +} +input:focus::placeholder,textarea:focus::placeholder { +opacity:.2 +} +.status { +display:inline-block; +color:rgba(240,241,242,.5) +} +.status .icon.success { +color:#70b0e0 +} +.status .icon.alert { +color:#d22 +} +svg.icon { +width:1.125em; +height:1.125em; +display:inline-block; +fill:currentColor; +vertical-align:middle +} +svg.icon.small { +width:.75em; +height:.75em +} +svg.icon.inline { +margin-top:-.25em +} +.control { +background:rgba(240,241,242,.2) +} +#tooltip-signin ul.list li,.button,.buttonbar>*,.container .header ul.file li,.segcontrol>* { +background:rgba(240,241,242,.35); +display:inline-block; +cursor:pointer; +transition:background-color .2s ease-out; +transition:opacity .2s ease-out; +box-shadow:0 2px 1px rgba(0,0,0,.1); +line-height:normal +} +#tooltip-signin ul.list li.default,.button.default,.buttonbar>.default,.container .header ul.file li.default,.segcontrol>.default { +font-weight:700; +background:#70b0e0; +color:#101112 +} +#tooltip-signin ul.list li.default:hover,.button.default:hover,.buttonbar>.default:hover,.container .header ul.file li.default:hover,.segcontrol>.default:hover { +background:#f0f1f2 +} +#tooltip-signin ul.list li.selected,#tooltip-signin ul.list li:hover,.button.selected,.button:hover,.buttonbar>.selected,.buttonbar>:hover,.container .header ul.file li.selected,.container .header ul.file li:hover,.segcontrol>.selected,.segcontrol>:hover { +background:rgba(240,241,242,.75) +} +#tooltip-signin ul.list li.selected>svg.icon.dropdown,#tooltip-signin ul.list li:hover>svg.icon.dropdown,.button.selected>svg.icon.dropdown,.button:hover>svg.icon.dropdown,.buttonbar>.selected>svg.icon.dropdown,.buttonbar>:hover>svg.icon.dropdown,.container .header ul.file li.selected>svg.icon.dropdown,.container .header ul.file li:hover>svg.icon.dropdown,.segcontrol>.selected>svg.icon.dropdown,.segcontrol>:hover>svg.icon.dropdown { +margin-top:.5em +} +#tooltip-signin ul.list li.disabled,.button.disabled,.buttonbar>.disabled,.container .header ul.file li.disabled,.segcontrol>.disabled { +opacity:.35; +cursor:default; +pointer-events:none +} +#tooltip-signin ul.list li>svg.icon,.button>svg.icon,.buttonbar>*>svg.icon,.container .header ul.file li>svg.icon,.segcontrol>*>svg.icon { +margin-top:-.125em +} +#tooltip-signin ul.list li>svg.icon+*,.button>svg.icon+*,.buttonbar>*>svg.icon+*,.container .header ul.file li>svg.icon+*,.segcontrol>*>svg.icon+* { +margin-left:.25em +} +#tooltip-signin ul.list li>svg.icon.dropdown,.button>svg.icon.dropdown,.buttonbar>*>svg.icon.dropdown,.container .header ul.file li>svg.icon.dropdown,.segcontrol>*>svg.icon.dropdown { +transition:margin-top .2s; +margin-top:.125em; +width:.375em; +height:.375em +} +.buttonbar,.controlbar,.segcontrol { +display:flex; +padding:0; +margin:0 +} +.buttonbar>*,.controlbar>*,.segcontrol>* { +margin-left:.25rem +} +.buttonbar>*,.segcontrol>* { +margin-left:1px; +border-radius:0; +display:inline-block +} +.buttonbar>:first-child,.segcontrol>:first-child { +border-radius:.125rem 0 0 .125rem +} +.buttonbar>:last-child,.segcontrol>:last-child { +border-radius:0 .125rem .125rem 0 +} +.segcontrol>:first-child { +border-radius:.125rem 0 0 .125rem +} +.segcontrol>:last-child { +border-radius:0 .125rem .125rem 0 +} +.tooltip { +display:flex; +flex-flow:column; +align-items:center; +z-index:10000; +position:absolute; +transform:translate(-50%,0); +transition-property:opacity,margin-top; +transition-duration:.2s +} +.tooltip>.content { +background:rgba(16,17,18,.85); +color:#f0f1f2; +padding:1rem; +border-radius:.125rem; +max-width:15rem; +box-shadow:0 3px 4px rgba(0,0,0,.25); +overflow-wrap:break-word; +-webkit-backdrop-filter:blur(3px); +backdrop-filter:blur(3px) +} +.tooltip>.content code { +font-weight:700 +} +.tooltip>.content>.warningtext { +display:block; +color:#b7bcc0; +margin-top:.5rem +} +.tooltip header { +display:flex +} +.tooltip header h1 { +flex:1 +} +.tooltip header .help.icon { +margin-left:1em; +color:#7e878e +} +.tooltip>.tip { +fill:rgba(16,17,18,.85); +width:8px; +height:8px; +transform:scale(1,-1) +} +.tooltip.flipped { +transform:translate(-50%,-100%) +} +.tooltip.flipped .tip { +transform:scale(1,1); +order:1 +} +.tooltip .list li { +color:#b7bcc0 +} +.tooltip .list li+li { +margin-top:.5em +} +.tooltip .list li .check.icon { +color:#585e63; +margin-right:.25em +} +.tooltip .list li.selected .check.icon { +color:#70b0e0 +} +.tooltip .list li:not(.inactive):hover { +color:#e7e9ea +} +.tooltip .list li em { +font-style:normal; +font-weight:700; +color:#f0f1f2; +padding:0 .15em; +background:rgba(126,135,142,.3); +border-radius:.125rem +} +.example svg.icon.load { +color:#595f64; +float:right; +display:inline-block; +padding-left:.5rem +} +.example code { +display:inline-block; +word-break:break-all; +width:100% +} +.container .header { +display:flex; +align-items:center; +justify-content:space-between; +background:#101112; +padding:0 1rem; +height:54px; +z-index:1000 +} +.container .header .logo { +flex:none; +font-size:1.125rem; +margin-top:.0625rem; +color:#70b0e0; +width:1.5em; +height:1.5em +} +.container .header .settings { +color:#70b0e0; +display:flex; +min-width:0; +max-width:20em +} +.container .header .settings .name { +margin:0 .25rem 0 .5rem; +text-overflow:ellipsis; +white-space:nowrap; +overflow:hidden +} +.container .header .settings .icon.share { +flex:none; +color:#595f64; +width:1em; +margin-right:.5rem +} +.container .header .signin.selected a { +color:#f0f1f2!important +} +.container .header ul { +padding:0; +white-space:nowrap +} +.container .header ul li { +display:inline-block +} +.container .header ul li:first-child { +margin-left:0 +} +.container .header ul.file { +text-align:right +} +.container .header ul.file li { +color:#b7bcc0; +background:#282b2d +} +.container .header ul.file li:hover { +background:#3a3e41 +} +.container .header ul.file li.save { +color:#70b0e0; +font-weight:700 +} +.container .header ul.file li.save .savekey { +font-size:.875em; +font-weight:400; +color:#7e878e +} +#tooltip-signin ul.list .container .header li.theme,.container .header #tooltip-signin ul.list li.theme,.container .header .button.theme,.container .header ul.file li.theme { +padding:.3755rem; +background:#282b2d +} +#tooltip-signin ul.list .container .header li.theme.selected .icon,.container .header #tooltip-signin ul.list li.theme.selected .icon,.container .header .button.theme.selected .icon,.container .header ul.file li.theme.selected .icon { +color:#70b0e0 +} +#tooltip-signin ul.list .container .header li.theme:hover,.container .header #tooltip-signin ul.list li.theme:hover,.container .header .button.theme:hover,.container .header ul.file li.theme:hover { +background:#3a3e41 +} +.container .header ul.etc { +flex:1; +text-align:right; +font-size:.875rem; +color:#595f64 +} +.container .header ul.etc li { +margin-left:1rem +} +#tooltip-signin ul.list li { +margin:.25rem 0; +padding:.625rem; +color:#e7e9ea; +opacity:.85 +} +#tooltip-signin ul.list li:hover { +opacity:1 +} +#tooltip-signin ul.list li[data-id=GitHub] { +background:#777!important +} +#tooltip-signin ul.list li[data-id=Google] { +background:#c94130!important +} +#tooltip-signin ul.list li>svg.icon { +margin-right:.625rem +} +#tooltip-signin .signout { +display:none +} +#tooltip-signin .signout .signoutbtn { +cursor:pointer; +color:#70b0e0; +font-weight:700 +} +#tooltip-signin .signout .signoutbtn:hover { +color:#f0f1f2 +} +#tooltip-signin.authenticated .signin { +display:none +} +#tooltip-signin.authenticated .signout { +display:block +} +#tooltip-signin .distract { +display:none; +color:#7e878e +} +#tooltip-signin .distract .distractor { +margin-right:.5rem +} +#tooltip-signin.wait .distract { +display:block +} +#tooltip-signin.wait .signin .list,#tooltip-signin.wait .signout .signoutbtn { +display:none +} +.doc { +flex:8 800px; +display:flex; +flex-flow:column +} +.doc>section { +background:#f0f1f2; +color:#585e63; +flex:1 1 0%; +min-height:0; +transition:flex .2s ease-out; +display:flex; +flex-direction:column +} +.doc>section>header { +color:#26292b; +background:#b7bcc0 +} +.doc>section>header>.max { +transition:transform .2s; +color:#7e878e; +margin-left:1rem; +cursor:pointer +} +.doc>section>header>.max:hover { +color:#f0f1f2 +} +.doc>section>article { +flex:1; +min-height:0 +} +.doc>section.closed { +flex:0 2.5rem +} +.doc>section.closed>header { +cursor:pointer +} +.doc>section.closed>header>:not(h1) { +opacity:.8 +} +.doc>section.closed>header>.max { +transform:rotate(45deg) +} +.doc.tests-mode section.tools { +display:none +} +.doc input,.doc textarea { +background:rgba(240,241,242,.05); +border-color:rgba(240,241,242,.05) +} +.doc .control { +background:rgba(240,241,242,.2) +} +#tooltip-signin ul.list .doc li,.container .header ul.file .doc li,.doc #tooltip-signin ul.list li,.doc .button,.doc .buttonbar>*,.doc .container .header ul.file li,.doc .segcontrol>* { +background:rgba(240,241,242,.35) +} +.doc .segcontrol>* { +color:#000; +font-weight:bold +} +#tooltip-signin ul.list .doc li.selected,#tooltip-signin ul.list .doc li:hover,.container .header ul.file .doc li.selected,.container .header ul.file .doc li:hover,.doc #tooltip-signin ul.list li.selected,.doc #tooltip-signin ul.list li:hover,.doc .button.selected,.doc .button:hover,.doc .buttonbar>.selected,.doc .buttonbar>:hover,.doc .container .header ul.file li.selected,.doc .container .header ul.file li:hover,.doc .segcontrol>.selected,.doc .segcontrol>:hover { +background:rgba(240,241,242,.75) +} +#tooltip-signin ul.list .doc li.default:hover,.container .header ul.file .doc li.default:hover,.doc #tooltip-signin ul.list li.default:hover,.doc .button.default:hover,.doc .buttonbar>.default:hover,.doc .container .header ul.file li.default:hover,.doc .segcontrol>.default:hover { +background:#f0f1f2 +} +.doc>section.expression { +flex:0 6.25rem +} +.doc>section.expression>header { +background:#70b0e0 +} +.doc>section.expression>.editor { +position:relative +} +.doc>section.expression>.editor .icon.alert { +display:none; +position:relative; +float:right; +margin:1.25rem; +color:#d22; +z-index:10; +-webkit-user-select:none; +user-select:none +} +.doc>section.expression>.editor>.CodeMirror { +padding:1rem 0 0 1rem; +font-weight:700 +} +.doc>section.expression>.editor.error>.icon.alert { +display:block +} +#tooltip-flags>.list li,#tooltip-flavor>.list li { +cursor:pointer; +color:#b7bcc0 +} +#tooltip-flags>.list li:hover,#tooltip-flavor>.list li:hover { +color:#f0f1f2 +} +#tooltip-flags>.list li+li,#tooltip-flavor>.list li+li { +margin-top:.5em +} +#tooltip-flags>.list li .check.icon,#tooltip-flavor>.list li .check.icon { +color:#585e63; +margin-right:.25em +} +#tooltip-flags>.list li.selected .check.icon,#tooltip-flavor>.list li.selected .check.icon { +color:#70b0e0 +} +#tooltip-flags>.list li em,#tooltip-flavor>.list li em { +font-style:normal; +font-weight:700; +color:#f0f1f2; +padding:0 .15em; +background:rgba(126,135,142,.3); +border-radius:.125rem +} +.exp-related { +border-bottom:solid 1px rgba(16,17,18,.3); +border-top:solid 1px rgba(16,17,18,.3); +margin-bottom:-1px; +margin-top:-1px +} +.exp-related-left { +border-left:solid 1px rgba(16,17,18,.3); +margin-left:-1px +} +.exp-related-right { +border-right:solid 1px rgba(16,17,18,.3); +margin-right:-1px +} +.exp-selected { +border-top:solid 2px rgba(16,17,18,.3); +border-bottom:solid 2px rgba(16,17,18,.3) +} +.exp-selected-left { +border-left:solid 2px rgba(16,17,18,.3); +margin-left:-2px +} +.exp-selected-right { +border-right:solid 2px rgba(16,17,18,.3); +margin-right:-2px +} +.exp-error { +border-bottom:solid 2px #d22 +} +.exp-warning { +border-bottom:dotted 2px #d22 +} +.exp-char { +color:#101112 +} +.exp-decorator { +color:#b7bcc0 +} +.exp-esc { +color:#c0c +} +.exp-lazy,.exp-possessive,.exp-quant { +color:#58f +} +.exp-alt { +color:#0a0 +} +.exp-anchor { +color:#840 +} +.exp-group,.exp-lookaround,.exp-ref { +color:#0a0 +} +.exp-charclass,.exp-set,.exp-subst { +color:#d70 +} +.exp-group-0 { +background:rgba(0,238,0,.11) +} +.exp-group-1 { +background:rgba(0,238,0,.22) +} +.exp-group-2 { +background:rgba(0,238,0,.33) +} +.exp-group-3 { +background:rgba(0,238,0,.44) +} +.exp-group-set { +background:rgba(255,238,0,.3) +} +.exp-comment { +color:#b7bcc0; +background:rgba(16,17,18,.05); +font-style:italic; +border-bottom:solid 3px #d7dadc +} +.exp-special { +color:#c0c +} +.doc>section.text article { +display:flex +} +.doc>section.text>header .modelist li { +font-size:1rem; +padding-top:.275rem; +padding-bottom:.275rem +} +.doc>section.text>header .modelist li:last-child::after { +transition:opacity 1s; +font-size:.625rem; +padding:.25em .5em; +display:inline-block; +position:absolute; +color:#f0f1f2; +background:#70b0e0; +letter-spacing:.075em; +transform:translate(.25rem,-.125rem); +content:"NEW" +} +#tooltip-signin ul.list .doc>section.text>header li.add,.container .header ul.file .doc>section.text>header li.add,.doc>section.text>header #tooltip-signin ul.list li.add,.doc>section.text>header .button.add,.doc>section.text>header .container .header ul.file li.add { +display:none!important +} +.doc>section.text>header .result { +font-weight:700 +} +.doc>section.text>header .result.error { +background:#d22; +color:#e7e9ea +} +.doc>section.text>header .result.error.warning { +background:#d22 +} +.doc>section.text>header .result.pass { +background:#0a0; +color:#e7e9ea +} +.doc>section.text>header .result.fail { +background:#d22; +color:#e7e9ea +} +.doc>section.text>header .result em { +font-style:normal; +font-weight:400; +opacity:.75 +} +.doc>section.text.tests-viewed>header .modelist li:last-child::after { +opacity:0 +} +.doc>section.text .editor { +position:relative; +box-sizing:border-box; +display:flex; +height:100%; +width:100%; +padding:1rem 0 1rem 1rem +} +.doc>section.text .editor>.pad { +box-sizing:border-box; +position:relative; +overflow:hidden; +width:100%; +flex:1 +} +.doc>section.text .editor>.pad>.CodeMirror { +color:#101112 +} +.doc>section.text .editor>.pad>iframe.resizedetector { +opacity:0; +z-index:-1000; +border:none; +width:100%; +height:100%; +position:absolute +} +.doc>section.text .editor>.pad>canvas.highlights { +transition:opacity .2s; +position:absolute +} +.doc>section.text .tests { +display:none; +width:100%; +background:#d7dadc; +padding:1rem; +box-sizing:border-box; +overflow:auto +} +.doc>section.text .tests .default { +transition:opacity 1s; +padding:1rem .5rem; +color:#585e63 +} +.doc>section.text .tests .list:empty~.default { +opacity:1 +} +.doc>section.text .tests.tests-added .default { +opacity:0 +} +#tooltip-signin ul.list .doc>section.text .tests li.add,.container .header ul.file .doc>section.text .tests li.add,.doc>section.text .tests #tooltip-signin ul.list li.add,.doc>section.text .tests .add.button,.doc>section.text .tests .container .header ul.file li.add { +box-sizing:border-box; +width:100%; +box-shadow:none; +opacity:.5; +background:rgba(183,188,192,.75); +color:#101112; +padding:.75rem .625rem; +margin-top:.125rem; +font-weight:700; +border-radius:.125rem +} +#tooltip-signin ul.list .doc>section.text .tests li.add:hover,.container .header ul.file .doc>section.text .tests li.add:hover,.doc>section.text .tests #tooltip-signin ul.list li.add:hover,.doc>section.text .tests .add.button:hover,.doc>section.text .tests .container .header ul.file li.add:hover { +opacity:1 +} +.doc>section.text .tests .list li { +background:#e7e9ea; +box-shadow:0 1px 2px rgba(0,0,0,.1); +transition:margin .1s linear; +margin:.125rem 0; +display:inline-block; +width:100% +} +.doc>section.text .tests .list li:first-child { +margin-top:0 +} +.doc>section.text .tests .list li:hover { +outline:solid 2px rgba(16,17,18,.3) +} +.doc>section.text .tests .list li header { +padding:.5rem .75rem +} +.doc>section.text .tests .list li header input.name { +color:#383b3f; +font-weight:700; +padding:0; +margin:0 .5rem; +background:0 0; +border:none +} +.doc>section.text .tests .list li header .icon.delete { +color:#b7bcc0 +} +.doc>section.text .tests .list li header .icon.delete:hover { +color:#d22!important +} +.doc>section.text .tests .list li header .icon.fail { +display:none; +color:#d22 +} +.doc>section.text .tests .list li header .icon.pass { +color:#0a0 +} +.doc>section.text .tests .list li header .type { +background:0 0; +text-transform:uppercase; +font-size:.75em; +color:#b7bcc0; +font-weight:700; +box-shadow:none +} +.doc>section.text .tests .list li article { +border-top:solid 1px #d7dadc; +padding:.5rem 0 .5rem .75rem; +display:none; +height:6em; +align-items:stretch +} +.doc>section.text .tests .list li article .bar { +background:#0a0; +width:0; +outline:solid 1px #0a0; +margin:.25rem .875rem .25rem .375rem +} +.doc>section.text .tests .list li article .editor { +padding:0 +} +.doc>section.text .tests .list li:not(.selected) { +cursor:pointer +} +.doc>section.text .tests .list li:not(.selected) .type .icon.dropdown { +opacity:0 +} +.doc>section.text .tests .list li:not(.selected) * { +pointer-events:none +} +.doc>section.text .tests .list li.selected { +outline:solid 2px rgba(16,17,18,.3); +background:#f0f1f2; +box-shadow:0 2px 3px rgba(0,0,0,.25); +margin:.75rem 0 +} +.doc>section.text .tests .list li.selected:first-child { +margin-top:0 +} +.doc>section.text .tests .list li.selected article { +display:flex +} +.doc>section.text .tests .list li.selected .type { +color:#585e63 +} +.doc>section.text .tests .list li.selected .type:hover { +color:#26292b +} +.doc>section.text .tests .list li.fail .icon.fail { +display:block +} +.doc>section.text .tests .list li.fail .icon.pass { +display:none +} +.doc>section.text .tests .list li.fail .bar { +outline:solid 1px #d22 +} +#tooltip-signin ul.list .doc.tests-mode>section.text>header li.add,.container .header ul.file .doc.tests-mode>section.text>header li.add,.doc.tests-mode>section.text>header #tooltip-signin ul.list li.add,.doc.tests-mode>section.text>header .button.add,.doc.tests-mode>section.text>header .container .header ul.file li.add { +display:inline-block +} +.doc.tests-mode>section.text>article>.editor { +display:none +} +.doc.tests-mode>section.text .tests { +display:block +} +#tooltip .texthover .more { +display:inline-block; +color:#b7bcc0; +font-style:italic; +margin-top:.75rem +} +.doc>section.tools>article { +display:flex; +flex-direction:column; +background:#e7e9ea +} +.doc>section.tools>article .icon.help { +position:absolute; +right:.25rem; +transform:translate(0,-50%) translate(0,1.875rem); +padding:1rem; +color:rgba(16,17,18,.25); +z-index:10 +} +.doc>section.tools>article .icon.help:hover { +color:#26292b!important +} +.doc>section.tools>article .inputtool { +display:none; +flex-direction:column; +flex:1 +} +.doc>section.tools>article .inputtool .editor { +position:relative; +flex:0 3.75rem; +background:#f0f1f2; +border-bottom:solid 1px #d7dadc +} +.doc>section.tools>article .inputtool .editor>.CodeMirror { +padding:1rem 0 0 1rem; +height:100%; +font-weight:700 +} +.doc>section.tools>article .inputtool .result { +flex:1 +} +.doc>section.tools>article .inputtool .result textarea { +box-sizing:border-box; +padding:1rem 0 1rem 1rem; +resize:none; +display:block; +border:0; +background:0 0; +width:100%; +height:100%; +margin:0; +font-family:"Source Code Pro",monospace; +font-size:16px; +color:#101112 +} +.doc>section.tools>article .inputtool .result textarea:focus { +outline:0 +} +.doc>section.tools>article .content { +flex:1 1 0%; +min-height:0; +overflow-y:auto; +display:block; +padding:1rem +} +.doc>section.tools>article.showinput .inputtool { +display:flex +} +.doc>section.tools>article.showinput .content { +display:none +} +.doc>section.tools>article .explain>.desc { +color:#7e878e; +display:block; +padding:.5rem +} +.doc>section.tools>article .explain div { +padding:.5em 1em .5em 2.5em; +margin-top:.75em; +border:solid 1px rgba(183,188,192,.5); +border-left:solid .25em rgba(183,188,192,.5); +background:#f0f1f2; +cursor:pointer +} +.doc>section.tools>article .explain div.applied { +margin-left:1em; +margin-top:0; +border:none; +background:rgba(183,188,192,.3) +} +.doc>section.tools>article .explain div.applied+div.applied { +margin-top:1px; +margin-left:2em +} +.doc>section.tools>article .explain div.error { +background:#edd2d3; +border-color:#d22 +} +.doc>section.tools>article .explain div.error .error-title { +font-weight:700 +} +.doc>section.tools>article .explain div.error .warningtext { +color:#7e878e; +margin-left:.5rem +} +.doc>section.tools>article .explain code { +font-weight:700 +} +.doc>section.tools>article .explain code.token { +display:inline-block; +min-width:1.25em; +margin:-1px .5em 0 -1.75em; +float:left +} +.doc>section.tools>article .explain div.close { +margin:0; +padding:0; +border:none; +background:0 0 +} +.doc>section.tools>article .explain .exp-group-0,.doc>section.tools>article .explain .exp-group-1,.doc>section.tools>article .explain .exp-group-2,.doc>section.tools>article .explain .exp-group-3 { +border-color:rgba(0,170,0,.25) +} +.doc>section.tools>article .explain .exp-group-0 { +background:#ddf1df +} +.doc>section.tools>article .explain .exp-group-1 { +background:#d1f1d3 +} +.doc>section.tools>article .explain .exp-group-2 { +background:#c5f0c6 +} +.doc>section.tools>article .explain .exp-group-3 { +background:#b9f0ba +} +.doc>section.tools>article .explain .exp-group-4 { +background:#383b3f; +color:#f0f1f2; +padding:1rem +} +.doc>section.tools>article .explain .exp-group-set { +background:#f4f0b6; +border-color:rgba(221,119,0,.25) +} +.doc>section.tools>article .details>div.desc { +padding:.5rem; +color:#7e878e; +margin-bottom:.5em +} +.doc>section.tools>article .details>div.desc code { +color:#585e63; +font-weight:700 +} +.doc>section.tools>article .details table { +font-family:"Source Code Pro",monospace; +width:100%; +border-spacing:0; +border:0 +} +.doc>section.tools>article .details table tr:nth-child(odd) td { +background:#e1e3e4 +} +.doc>section.tools>article .details table tr.match td { +background:#d7dadc; +border-bottom:1px dotted #b7bcc0 +} +.doc>section.tools>article .details table td { +padding:.5rem 1rem; +vertical-align:top +} +.doc>section.tools>article .details table td:first-child { +font-weight:700; +white-space:nowrap; +padding-right:0 +} +.doc>section.tools>article .details table td:nth-child(2) { +color:#7e878e; +white-space:nowrap; +border-right:1px dotted #b7bcc0 +} +.doc>section.tools>article .details table td:nth-child(3) { +white-space:pre-wrap; +width:100%; +color:#101112; +-webkit-user-select:text; +user-select:text; +-webkit-user-select:contain; +user-select:contain +} +.doc>section.tools>article .details table td:nth-child(3) em { +color:#7e878e +} +.doc>section.tools>article .details .group-1 { +background:hsla(60,100%,50%,.5) +} +.doc>section.tools>article .details .group-2 { +background:hsla(120,100%,50%,.5) +} +.doc>section.tools>article .details .group-3 { +background:hsla(230,100%,70%,.5) +} +.doc>section.tools>article .details .group-4 { +background:hsla(280,100%,60%,.5) +} +.doc>section.tools>article .details .group-5 { +background:hsla(350,100%,60%,.5) +} +.doc>section.tools>article .details .group-0 { +background:hsla(30,100%,50%,.5) +} +.doc>section.tools>article .details .group-0,.doc>section.tools>article .details .group-1,.doc>section.tools>article .details .group-2,.doc>section.tools>article .details .group-3,.doc>section.tools>article .details .group-4,.doc>section.tools>article .details .group-5 { +outline:.5px solid rgba(16,17,18,.25) +} +.sidebar>.full .list .row.active:hover,.sidebar>.full .list li.active:hover,.sidebar>.min .list .row.active:hover,.sidebar>.min .list li.active:hover { +color:#f0f1f2 +} +.sidebar>.full .list .row.active>.icon.check,.sidebar>.full .list .row.active>.icon:first-child,.sidebar>.full .list li.active>.icon.check,.sidebar>.full .list li.active>.icon:first-child,.sidebar>.min .list .row.active>.icon.check,.sidebar>.min .list .row.active>.icon:first-child,.sidebar>.min .list li.active>.icon.check,.sidebar>.min .list li.active>.icon:first-child { +color:#70b0e0 +} +.sidebar { +flex:1 0 350px; +width:350px; +transition:flex .2s ease-out; +background:#282b2d; +display:flex; +flex-direction:column; +color:#b7bcc0; +border-right:1px solid #3a3e41; +box-shadow:1px 2px 8px rgba(0,0,0,.45); +z-index:100 +} +.sidebar>.blocker { +display:none +} +.sidebar .list>li,.sidebar .row { +display:flex; +flex:0 0 auto; +padding:.5rem; +align-items:center; +justify-content:center; +border-bottom:1px solid rgba(240,241,242,.06); +transition:background .2s; +color:#b7bcc0 +} +.sidebar .list>li>*,.sidebar .row>* { +margin:0 .5rem +} +.sidebar .list>li .label,.sidebar .list>li input,.sidebar .row .label,.sidebar .row input { +flex:1 +} +.sidebar .list>li .icon,.sidebar .row .icon { +color:#595f64 +} +.sidebar header.row { +flex:0 0 2.5rem; +padding:0 +} +.sidebar header.row .backrow { +display:flex; +flex:1 0 auto; +align-items:center; +cursor:pointer; +margin:0; +padding:.5rem 0 +} +.sidebar header.row .backrow .icon { +flex:0 0 auto; +margin:0 1rem +} +.sidebar header.row .backrow:hover { +color:#f0f1f2 +} +.sidebar header.row .backrow:hover .icon { +color:currentColor +} +.sidebar header.row .close.icon { +padding:.75rem 1rem; +margin:0 +} +.sidebar code { +color:#f0f1f2 +} +.sidebar.closed { +flex:0 50px +} +.sidebar>.full .list,.sidebar>.min .list { +flex:1 1 0%; +display:flex; +align-items:stretch; +overflow-y:auto; +background:#3a3e41; +border-bottom:2px solid #3a3e41 +} +.sidebar>.full .list .row,.sidebar>.full .list li,.sidebar>.min .list .row,.sidebar>.min .list li { +color:#b7bcc0 +} +.sidebar>.full .list .row:hover:not(.inactive),.sidebar>.full .list li:hover:not(.inactive),.sidebar>.min .list .row:hover:not(.inactive),.sidebar>.min .list li:hover:not(.inactive) { +background:#4a4f53 +} +.sidebar>.full .list .row:hover:not(.inactive) .icon,.sidebar>.full .list .row:hover:not(.inactive) .rating,.sidebar>.full .list .row:hover:not(.inactive) .token,.sidebar>.full .list li:hover:not(.inactive) .icon,.sidebar>.full .list li:hover:not(.inactive) .rating,.sidebar>.full .list li:hover:not(.inactive) .token,.sidebar>.min .list .row:hover:not(.inactive) .icon,.sidebar>.min .list .row:hover:not(.inactive) .rating,.sidebar>.min .list .row:hover:not(.inactive) .token,.sidebar>.min .list li:hover:not(.inactive) .icon,.sidebar>.min .list li:hover:not(.inactive) .rating,.sidebar>.min .list li:hover:not(.inactive) .token { +color:currentColor +} +.sidebar>.full .list .row.selected,.sidebar>.full .list li.selected,.sidebar>.min .list .row.selected,.sidebar>.min .list li.selected { +background:#595f64; +color:#d7dadc +} +.sidebar>.full .list .row.selected .icon,.sidebar>.full .list .row.selected .rating,.sidebar>.full .list .row.selected .token,.sidebar>.full .list li.selected .icon,.sidebar>.full .list li.selected .rating,.sidebar>.full .list li.selected .token,.sidebar>.min .list .row.selected .icon,.sidebar>.min .list .row.selected .rating,.sidebar>.min .list .row.selected .token,.sidebar>.min .list li.selected .icon,.sidebar>.min .list li.selected .rating,.sidebar>.min .list li.selected .token { +color:currentColor +} +.sidebar>.full .list .row.selected:hover,.sidebar>.full .list li.selected:hover,.sidebar>.min .list .row.selected:hover,.sidebar>.min .list li.selected:hover { +background:#595f64; +color:#f0f1f2 +} +.sidebar>.full .list .row.disabled,.sidebar>.full .list li.disabled,.sidebar>.min .list .row.disabled,.sidebar>.min .list li.disabled { +pointer-events:none; +opacity:.35 +} +.sidebar>.full .list .row.link:not(.disabled),.sidebar>.full .list li.link:not(.disabled),.sidebar>.min .list .row.link:not(.disabled),.sidebar>.min .list li.link:not(.disabled) { +overflow:hidden +} +.sidebar>.full .list .row.link:not(.disabled) .url,.sidebar>.full .list li.link:not(.disabled) .url,.sidebar>.min .list .row.link:not(.disabled) .url,.sidebar>.min .list li.link:not(.disabled) .url { +color:#70b0e0; +margin:0 +} +.sidebar>.full .list .row.link:not(.disabled):hover,.sidebar>.full .list li.link:not(.disabled):hover,.sidebar>.min .list .row.link:not(.disabled):hover,.sidebar>.min .list li.link:not(.disabled):hover { +color:#f0f1f2 +} +.sidebar>.full .list .row.link:not(.disabled):hover .url,.sidebar>.full .list li.link:not(.disabled):hover .url,.sidebar>.min .list .row.link:not(.disabled):hover .url,.sidebar>.min .list li.link:not(.disabled):hover .url { +color:#f0f1f2 +} +.sidebar>.full .list .row.link:not(.disabled) .icon.copy,.sidebar>.full .list li.link:not(.disabled) .icon.copy,.sidebar>.min .list .row.link:not(.disabled) .icon.copy,.sidebar>.min .list li.link:not(.disabled) .icon.copy { +padding:1rem; +margin:-1rem -.5rem; +color:#595f64 +} +.sidebar>.full .list .row.link:not(.disabled) .icon.copy:hover,.sidebar>.full .list li.link:not(.disabled) .icon.copy:hover,.sidebar>.min .list .row.link:not(.disabled) .icon.copy:hover,.sidebar>.min .list li.link:not(.disabled) .icon.copy:hover { +color:#f0f1f2 +} +.sidebar>.full .list .row.loading,.sidebar>.full .list li.loading,.sidebar>.min .list .row.loading,.sidebar>.min .list li.loading { +padding:1rem; +display:block; +border:none; +color:#7e878e; +pointer-events:none +} +.sidebar>.full .list .row .token,.sidebar>.full .list li .token,.sidebar>.min .list .row .token,.sidebar>.min .list li .token { +color:#7e878e; +font-family:"Source Code Pro",monospace; +font-weight:700 +} +.sidebar>.full .list .row .rating,.sidebar>.full .list li .rating,.sidebar>.min .list .row .rating,.sidebar>.min .list li .rating { +display:flex; +align-items:center; +color:#7e878e; +font-size:.875em +} +.sidebar>.full .list .row .rating .favorites.icon,.sidebar>.full .list li .rating .favorites.icon,.sidebar>.min .list .row .rating .favorites.icon,.sidebar>.min .list li .rating .favorites.icon { +color:#70b0e0; +padding:0 .25rem +} +.sidebar>.min { +display:none; +background:#3a3e41 +} +.sidebar>.min>.list>li:first-child { +background:#282b2d; +padding:0 +} +.sidebar>.full { +display:flex; +flex-direction:column; +flex:1; +min-height:0 +} +.sidebar>.full.no-search>.search { +display:none +} +.sidebar>.full.no-list>.list { +display:none +} +.sidebar>.full>header h1 { +color:#f0f1f2 +} +.sidebar>.full>header .icon { +color:#595f64 +} +.sidebar>.full>.search { +padding:0 .5rem +} +.sidebar>.full>.search input { +background:0 0; +padding:0 +} +.sidebar>.full>.search input:focus { +border-bottom:1px dotted #3a3e41; +margin-bottom:-1px +} +.sidebar>.full>.search svg.icon { +width:1em; +height:1em; +margin-right:.375em +} +.sidebar>.full>.search svg.icon.search:hover { +color:#f0f1f2; +cursor:pointer +} +.sidebar>.full>.search svg.icon.distractor { +display:none +} +.sidebar>.full>.search.wait svg.icon.search { +display:none +} +.sidebar>.full>.search.wait svg.icon.distractor { +display:block +} +.sidebar>.full>.content { +flex:1 1 0%; +overflow-y:auto; +overflow-x:hidden; +padding:1rem; +-webkit-user-select:text; +user-select:text; +overflow-wrap:break-word; +border-top:2px solid #282b2d; +line-height:1.4em +} +.sidebar>.full>.content h1 { +margin-top:1.5em; +color:#f0f1f2 +} +.sidebar>.full>.content code em { +font-style:normal; +background:rgba(112,176,224,.5); +color:#f0f1f2; +margin-right:1px +} +.sidebar>.full>.content b { +color:#d7dadc +} +.sidebar>.full>.content ul { +padding-left:1.5em; +margin-bottom:0 +} +.sidebar>.full>.hello { +flex:0 0 0; +padding:0; +border:.25rem solid #101112; +background:#101112 +} +.sidebar>.full>.hello .noad { +padding:.75rem; +color:#7e878e +} +.sidebar>.full>.hello .noad b { +color:#b7bcc0 +} +#cheatsheet table { +width:100% +} +#cheatsheet table th { +text-align:left; +background:#3a3e41; +padding:.25rem .5rem; +color:#70b0e0 +} +#cheatsheet table tr+tr>th { +border-top:.5rem solid #282b2d +} +#cheatsheet table td { +padding:0 +} +#cheatsheet table td:first-child { +font-family:"Source Code Pro",monospace +} +#cheatsheet table a { +color:#f0f1f2 +} +#cheatsheet table a+a { +margin-left:.375em +} +.community>header { +background:#101112; +padding:1rem; +margin:-1rem; +margin-bottom:.5rem; +display:flex; +justify-content:space-between +} +.community>header .icon { +color:#595f64 +} +.community>header .icon.selected:not(:hover) { +color:#70b0e0 +} +.community>header>.name { +color:#f0f1f2; +font-weight:700; +overflow:hidden; +display:block; +white-space:nowrap; +text-overflow:ellipsis +} +.community>header>div { +display:flex +} +.community>header>div .favorites { +margin:0 1rem +} +.community .row.rate .icon.thumbdown,.community .row.rate .icon.thumbup { +cursor:pointer +} +.community .row.rate .icon.thumbdown.selected:hover,.community .row.rate .icon.thumbdown:hover,.community .row.rate .icon.thumbup.selected:hover,.community .row.rate .icon.thumbup:hover { +color:#f0f1f2 +} +.community .row.rate .icon.thumbdown.selected,.community .row.rate .icon.thumbup.selected { +color:#70b0e0 +} +.community .row.rate .icon.thumbdown { +transform:translate(0,.125em) scale(1,-1) +} +.community>.author { +margin-top:.125em; +color:#7e878e +} +.community .actions.list { +background:0; +margin:-.5rem -1rem 0 -1rem +} +.community>.desc { +margin-top:1rem +} +#share_community,#share_main { +margin:-1rem +} +#share_community .list,#share_main .list { +background:0 0; +border:none +} +#share_community .inputs input,#share_community .inputs textarea,#share_main .inputs input,#share_main .inputs textarea { +color:#f0f1f2; +margin:2px 0 +} +#share_community #tooltip-signin ul.list li,#share_community .button,#share_community .container .header ul.file li,#share_main #tooltip-signin ul.list li,#share_main .button,#share_main .container .header ul.file li,#tooltip-signin ul.list #share_community li,#tooltip-signin ul.list #share_main li,.container .header ul.file #share_community li,.container .header ul.file #share_main li { +padding-left:2rem; +padding-right:2rem +} +#share_community .buttons.wait #tooltip-signin ul.list li,#share_community .buttons.wait .button,#share_community .buttons.wait .container .header ul.file li,#share_main .buttons.wait #tooltip-signin ul.list li,#share_main .buttons.wait .button,#share_main .buttons.wait .container .header ul.file li,#tooltip-signin ul.list #share_community .buttons.wait li,#tooltip-signin ul.list #share_main .buttons.wait li,.container .header ul.file #share_community .buttons.wait li,.container .header ul.file #share_main .buttons.wait li { +opacity:.35; +pointer-events:none +} +#share_community .status,#share_main .status { +margin-left:.5rem +} +#share_main .signin.row .signout { +display:none +} +#share_main .signin.row.authenticated { +display:none +} +#share_main .row:not(.active) .icon.check { +display:none +} +#share_main .delete.row:hover { +background:rgba(221,34,34,.6) +} +#share_main>.info { +padding:1rem; +margin-bottom:.5rem; +border-bottom:solid 1px #3a3e41 +} +#share_main>.info>.row { +padding:0 0 .5rem 0; +border:0; +color:#b7bcc0; +align-items:flex-start +} +#share_main>.info>.row svg.icon { +color:currentColor; +margin:0 +} +#share_main>.save { +flex-direction:column; +align-items:flex-start; +padding:1.25rem .5rem; +margin-bottom:.5rem; +background:#3a3e41; +border:0; +box-shadow:-3px 3px 6px rgba(0,0,0,.1) +} +#share_main>.save .message { +color:#f0f1f2 +} +#share_main>.save .buttons { +padding:.5rem 0 0 0; +border:0; +color:#f0f1f2 +} +#share_main>.save .buttons #tooltip-signin ul.list li,#share_main>.save .buttons .button,#share_main>.save .buttons .container .header ul.file li,#tooltip-signin ul.list #share_main>.save .buttons li,.container .header ul.file #share_main>.save .buttons li { +margin:0 .5rem 0 0 +} +#share_community { +margin:0 .5rem +} +#share_community>.buttons { +justify-content:flex-end; +color:#f0f1f2; +border:none +} +#share_community .buttons,#share_community .inputs { +margin:1rem 0 +} +.native-js { +transition:all .25s ease-in-out; +opacity:0; +position:absolute; +top:0 +} +.native-js[data-state=visible] { +position:static; +opacity:1 +} +.native-js[data-state=visible]+.noad { +display:none +} +.native-img { +margin-right:.75rem; +max-height:40px; +max-width:27%; +border-radius:3px +} +.native-flex { +display:flex; +padding:.75rem; +text-decoration:none; +flex-flow:row nowrap; +justify-content:space-between; +align-items:center +} +.native-main { +display:flex; +flex-flow:row nowrap; +align-items:center +} +.native-details { +display:flex; +font-size:12px; +position:relative; +max-height:5em; +flex-flow:column +} +.native-company { +margin-bottom:4px; +text-transform:uppercase; +letter-spacing:1px; +font-weight:700; +font-size:11px +} +.native-desc { +letter-spacing:1px; +font-weight:300; +line-height:1.3em; +text-overflow:ellipsis; +max-height:5em; +overflow:hidden; +position:relative +} +#carbonads { +display:block; +overflow:hidden; +background-color:#101112; +font-size:13px; +line-height:1.5 +} +#carbonads a { +color:inherit; +text-decoration:none +} +#carbonads a:hover { +color:inherit +} +#carbonads span { +position:relative; +display:block; +overflow:hidden +} +.carbon-img { +display:block; +float:left; +margin:0; +line-height:1 +} +.carbon-img img { +display:block +} +.carbon-text { +display:block; +float:left; +padding:8px 1em; +max-width:calc(100% - 130px - 2em); +text-align:left; +letter-spacing:.5px +} +.carbon-poweredby { +position:absolute; +right:0; +bottom:0; +left:130px; +display:block; +padding:8px 13px; +border-top:solid 1px #282b2d; +text-transform:uppercase; +letter-spacing:1px; +font-weight:400; +font-size:9px; +line-height:1 +} +@media (max-width:900px) { +body>.container>.header>.etc>.github { +display:none +} +body>.container>.header>.file .savekey { +display:none +} +body>.container>.app { +display:block; +position:relative; +background:#e7e9ea +} +body>.container>.app>.doc { +position:absolute; +top:0; +bottom:0; +left:50px; +right:0 +} +body>.container>.app>.doc>.blocker { +display:none; +width:100%; +height:100%; +position:fixed; +background:rgba(215,218,220,.5); +z-index:10 +} +body>.container>.app>.doc.fadeback { +filter:blur(2px) +} +body>.container>.app>.doc.fadeback>.blocker { +display:block +} +body>.container>.app>.sidebar { +position:absolute; +top:0; +bottom:0; +left:0; +z-index:10000; +transition:width .2s ease-out; +width:calc(10% + 350px); +box-shadow:10px 0 12px rgba(0,0,0,.45); +background:#282b2d; +opacity:.94 +} +body>.container>.app>.sidebar.closed { +width:50px; +min-width:50px; +box-shadow:1px 2px 8px rgba(0,0,0,.45); +opacity:1 +} +body>.container>.app>.sidebar.closed:before { +content:none +} + +} +#export.theme { +color:#70b0e0 +} +#export.match { +color:rgba(112,176,224,.5) +} +#export.selected-stroke { +color:rgba(16,17,18,.3) +} +.CodeMirror { +font-family:"Source Code Pro",monospace; +background:0 0; +position:absolute; +box-sizing:border-box +} +.CodeMirror div.CodeMirror-cursor { +pointer-events:none; +border-left:1px solid #101112 +} +.CodeMirror-selected { +background:rgba(170,170,170,.55) +} +.CodeMirror-focused .CodeMirror-selected { +background:rgba(140,150,255,.8) +} +.editor.multiline .CodeMirror-line:not(:last-child)>span:after { +pointer-events:none; +color:rgba(127,127,127,.33); +content:"¬" +} +.CodeMirror-line .cm-space::before,.CodeMirror-line .cm-special::before { +color:rgba(127,127,127,.33); +content:"•"; +position:absolute +} +.CodeMirror-line .cm-special::before { +color:#d22 +} +.CodeMirror-line .cm-tab { +background:url(data:image/png; +base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6REZENEEyN0Q3NTc0MTFFNzlFMTZGQ0Q1MEREODEyREEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6REZENEEyN0U3NTc0MTFFNzlFMTZGQ0Q1MEREODEyREEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpERkQ0QTI3Qjc1NzQxMUU3OUUxNkZDRDUwREQ4MTJEQSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpERkQ0QTI3Qzc1NzQxMUU3OUUxNkZDRDUwREQ4MTJEQSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgWEz28AAABVSURBVHja7JVBCgAgCAQt+rf6cstjYN4iFxoQxJMjos3MCJlO4HyB26iqZLXyAswskQTUCmUSI7OruE4usxX9jCKELKK8w04e6Qqdmnfa/8SPmQIMANcZrZCVJGBIAAAAAElFTkSuQmCC); +background-position:100%; +background-repeat:no-repeat +} + diff --git a/deploy/de/regexr.js b/deploy/de/regexr.js new file mode 100644 index 0000000..6111932 --- /dev/null +++ b/deploy/de/regexr.js @@ -0,0 +1,21008 @@ +var regexr = (function () { + 'use strict'; + + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + + // This is CodeMirror (http://codemirror.net), a code editor + // implemented in JavaScript on top of the browser's DOM. + // + // You can find some technical background for some of the code below + // at http://marijnhaverbeke.nl/blog/#cm-internals . + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.CodeMirror = factory(); + })(window, function () { + + // Kludges for bugs and behavior differences that can't be feature + // detected are enabled based on userAgent etc sniffing. + var userAgent = navigator.userAgent; + var platform = navigator.platform; + var gecko = /gecko\/\d/i.test(userAgent); + var ie_upto10 = /MSIE \d/.test(userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); + var edge = /Edge\/(\d+)/.exec(userAgent); + var ie = ie_upto10 || ie_11up || edge; + var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); + var webkit = !edge && /WebKit\//.test(userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); + var chrome = !edge && /Chrome\//.test(userAgent); + var presto = /Opera\//.test(userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); + var phantom = /PhantomJS/.test(userAgent); + var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent); + var android = /Android/.test(userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); + var mac = ios || /Mac/.test(platform); + var chromeOS = /\bCrOS\b/.test(userAgent); + var windows = /win/i.test(platform); + var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); + if (presto_version) { + presto_version = Number(presto_version[1]); + } + if (presto_version && presto_version >= 15) { + presto = false; + webkit = true; + } + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || ie && ie_version >= 9; + function classTest(cls) { + return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); + } + var rmClass = function (node, cls) { + var current = node.className; + var match = classTest(cls).exec(current); + if (match) { + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); + } + }; + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) { + e.removeChild(e.firstChild); + } + return e; + } + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e); + } + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) { + e.className = className; + } + if (style) { + e.style.cssText = style; + } + if (typeof content == "string") { + e.appendChild(document.createTextNode(content)); + } else if (content) { + for (var i = 0; i < content.length; ++i) { + e.appendChild(content[i]); + } + } + return e; + } + // wrapper for elt, which removes the elt from the accessibility tree + function eltP(tag, content, className, style) { + var e = elt(tag, content, className, style); + e.setAttribute("role", "presentation"); + return e; + } + var range; + if (document.createRange) { + range = function (node, start, end, endNode) { + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); + return r; + }; + } else { + range = function (node, start, end) { + var r = document.body.createTextRange(); + try { + r.moveToElementText(node.parentNode); + } catch (e) { + return r; + } + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r; + }; + } + function contains(parent, child) { + if (child.nodeType == 3) + // Android browser always returns false when child is a textnode + { + child = child.parentNode; + } + if (parent.contains) { + return parent.contains(child); + } + do { + if (child.nodeType == 11) { + child = child.host; + } + if (child == parent) { + return true; + } + } while (child = child.parentNode); + } + function activeElt() { + // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. + // IE < 10 will throw when accessed while the page is loading or in an iframe. + // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var activeElement; + try { + activeElement = document.activeElement; + } catch (e) { + activeElement = document.body || null; + } + while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) { + activeElement = activeElement.shadowRoot.activeElement; + } + return activeElement; + } + function addClass(node, cls) { + var current = node.className; + if (!classTest(cls).test(current)) { + node.className += (current ? " " : "") + cls; + } + } + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) { + if (as[i] && !classTest(as[i]).test(b)) { + b += " " + as[i]; + } + } + return b; + } + var selectInput = function (node) { + node.select(); + }; + if (ios) + // Mobile Safari apparently has a bug where select() is broken. + { + selectInput = function (node) { + node.selectionStart = 0; + node.selectionEnd = node.value.length; + }; + } else if (ie) + // Suppress mysterious IE10 errors + { + selectInput = function (node) { + try { + node.select(); + } catch (_e) {} + }; + } + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function () { + return f.apply(null, args); + }; + } + function copyObj(obj, target, overwrite) { + if (!target) { + target = {}; + } + for (var prop in obj) { + if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) { + target[prop] = obj[prop]; + } + } + return target; + } + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + function countColumn(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) { + end = string.length; + } + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) { + return n + (end - i); + } + n += nextTab - i; + n += tabSize - n % tabSize; + i = nextTab + 1; + } + } + var Delayed = function () { + this.id = null; + }; + Delayed.prototype.set = function (ms, f) { + clearTimeout(this.id); + this.id = setTimeout(f, ms); + }; + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) { + if (array[i] == elt) { + return i; + } + } + return -1; + } + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerGap = 30; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = { + toString: function () { + return "CodeMirror.Pass"; + } + }; + + // Reused option objects for setSelection & friends + var sel_dontScroll = { + scroll: false + }; + var sel_mouse = { + origin: "*mouse" + }; + var sel_move = { + origin: "+move" + }; + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) { + nextTab = string.length; + } + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) { + return pos + Math.min(skipped, goal - col); + } + col += nextTab - pos; + col += tabSize - col % tabSize; + pos = nextTab + 1; + if (col >= goal) { + return pos; + } + } + } + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) { + spaceStrs.push(lst(spaceStrs) + " "); + } + return spaceStrs[n]; + } + function lst(arr) { + return arr[arr.length - 1]; + } + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) { + out[i] = f(array[i], i); + } + return out; + } + function insertSorted(array, value, score) { + var pos = 0, + priority = score(value); + while (pos < array.length && score(array[pos]) <= priority) { + pos++; + } + array.splice(pos, 0, value); + } + function nothing() {} + function createObj(base, props) { + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + nothing.prototype = base; + inst = new nothing(); + } + if (props) { + copyObj(props, inst); + } + return inst; + } + var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + function isWordCharBasic(ch) { + return /\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); + } + function isWordChar(ch, helper) { + if (!helper) { + return isWordCharBasic(ch); + } + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { + return true; + } + return helper.test(ch); + } + function isEmpty(obj) { + for (var n in obj) { + if (obj.hasOwnProperty(n) && obj[n]) { + return false; + } + } + return true; + } + + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. + var extendingChars = /[\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]/; + function isExtendingChar(ch) { + return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); + } + + // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. + function skipExtendingChars(str, pos, dir) { + while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { + pos += dir; + } + return pos; + } + + // Returns the value from the range [`from`; `to`] that satisfies + // `pred` and is closest to `from`. Assumes that at least `to` satisfies `pred`. + function findFirst(pred, from, to) { + for (;;) { + if (Math.abs(from - to) <= 1) { + return pred(from) ? from : to; + } + var mid = Math.floor((from + to) / 2); + if (pred(mid)) { + to = mid; + } else { + from = mid; + } + } + } + + // The display handles the DOM integration, both for input reading + // and content drawing. It holds references to DOM nodes and + // display-related state. + + function Display(place, doc, input) { + var d = this; + this.input = input; + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + d.scrollbarFiller.setAttribute("cm-not-content", "true"); + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); + d.gutterFiller.setAttribute("cm-not-content", "true"); + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = eltP("div", null, "CodeMirror-code"); + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure"); + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], null, "position: relative; outline: none"); + var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); + // Moved around its parent to cover visible view. + d.mover = elt("div", [lines], null, "position: relative"); + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + d.sizerWidth = null; + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { + d.gutters.style.zIndex = -1; + d.scroller.style.paddingRight = 0; + } + if (!webkit && !(gecko && mobile)) { + d.scroller.draggable = true; + } + if (place) { + if (place.appendChild) { + place.appendChild(d.wrapper); + } else { + place(d.wrapper); + } + } + + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first; + d.reportedViewFrom = d.reportedViewTo = doc.first; + // Information about the rendered lines. + d.view = []; + d.renderedView = null; + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null; + // Empty space (in pixels) above the view + d.viewOffset = 0; + d.lastWrapHeight = d.lastWrapWidth = 0; + d.updateLineNumbers = null; + d.nativeBarWidth = d.barHeight = d.barWidth = 0; + d.scrollbarsClipped = false; + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false; + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + + // True when shift is held down. + d.shift = false; + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; + d.activeTouch = null; + input.init(d); + } + + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) { + throw new Error("There is no line " + (n + doc.first) + " in the document."); + } + var chunk = doc; + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], + sz = child.chunkSize(); + if (n < sz) { + chunk = child; + break; + } + n -= sz; + } + } + return chunk.lines[n]; + } + + // Get the part of a document between two positions, as an array of + // strings. + function getBetween(doc, start, end) { + var out = [], + n = start.line; + doc.iter(start.line, end.line + 1, function (line) { + var text = line.text; + if (n == end.line) { + text = text.slice(0, end.ch); + } + if (n == start.line) { + text = text.slice(start.ch); + } + out.push(text); + ++n; + }); + return out; + } + // Get the lines between from and to, as array of strings. + function getLines(doc, from, to) { + var out = []; + doc.iter(from, to, function (line) { + out.push(line.text); + }); // iter aborts when callback returns truthy value + return out; + } + + // Update the height of a line, propagating the height change + // upwards to parent nodes. + function updateLineHeight(line, height) { + var diff = height - line.height; + if (diff) { + for (var n = line; n; n = n.parent) { + n.height += diff; + } + } + } + + // Given a line object, find its line number by walking up through + // its parent links. + function lineNo(line) { + if (line.parent == null) { + return null; + } + var cur = line.parent, + no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) { + break; + } + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first; + } + + // Find the line at the given vertical position, using the height + // information in the document tree. + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { + var child = chunk.children[i$1], + ch = child.height; + if (h < ch) { + chunk = child; + continue outer; + } + h -= ch; + n += child.chunkSize(); + } + return n; + } while (!chunk.lines); + var i = 0; + for (; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], + lh = line.height; + if (h < lh) { + break; + } + h -= lh; + } + return n + i; + } + function isLine(doc, l) { + return l >= doc.first && l < doc.first + doc.size; + } + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)); + } + + // A Pos instance represents a position within the text. + function Pos(line, ch, sticky) { + if (sticky === void 0) sticky = null; + if (!(this instanceof Pos)) { + return new Pos(line, ch, sticky); + } + this.line = line; + this.ch = ch; + this.sticky = sticky; + } + + // Compare two positions, return 0 if they are the same, a negative + // number when a is less, and a positive number otherwise. + function cmp(a, b) { + return a.line - b.line || a.ch - b.ch; + } + function equalCursorPos(a, b) { + return a.sticky == b.sticky && cmp(a, b) == 0; + } + function copyPos(x) { + return Pos(x.line, x.ch); + } + function maxPos(a, b) { + return cmp(a, b) < 0 ? b : a; + } + function minPos(a, b) { + return cmp(a, b) < 0 ? a : b; + } + + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) { + return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1)); + } + function clipPos(doc, pos) { + if (pos.line < doc.first) { + return Pos(doc.first, 0); + } + var last = doc.first + doc.size - 1; + if (pos.line > last) { + return Pos(last, getLine(doc, last).text.length); + } + return clipToLen(pos, getLine(doc, pos.line).text.length); + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) { + return Pos(pos.line, linelen); + } else if (ch < 0) { + return Pos(pos.line, 0); + } else { + return pos; + } + } + function clipPosArray(doc, array) { + var out = []; + for (var i = 0; i < array.length; i++) { + out[i] = clipPos(doc, array[i]); + } + return out; + } + + // Optimize some code when these features are not used. + var sawReadOnlySpans = false; + var sawCollapsedSpans = false; + function seeReadOnlySpans() { + sawReadOnlySpans = true; + } + function seeCollapsedSpans() { + sawCollapsedSpans = true; + } + + // TEXTMARKER SPANS + + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; + this.to = to; + } + + // Search an array of spans for a span matching the given marker. + function getMarkedSpanFor(spans, marker) { + if (spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) { + return span; + } + } + } + } + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). + function removeMarkedSpan(spans, span) { + var r; + for (var i = 0; i < spans.length; ++i) { + if (spans[i] != span) { + (r || (r = [])).push(spans[i]); + } + } + return r; + } + // Add a span to a line. + function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.attachLine(line); + } + + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). + function markedSpansBefore(old, startCh, isInsert) { + var nw; + if (old) { + for (var i = 0; i < old.length; ++i) { + var span = old[i], + marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); + (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); + } + } + } + return nw; + } + function markedSpansAfter(old, endCh, isInsert) { + var nw; + if (old) { + for (var i = 0; i < old.length; ++i) { + var span = old[i], + marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); + (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, span.to == null ? null : span.to - endCh)); + } + } + } + return nw; + } + + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. + function stretchSpansOverChange(doc, change) { + if (change.full) { + return null; + } + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) { + return null; + } + var startCh = change.from.ch, + endCh = change.to.ch, + isInsert = cmp(change.from, change.to) == 0; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, + offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) { + span.to = startCh; + } else if (sameLine) { + span.to = found.to == null ? null : found.to + offset; + } + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i$1 = 0; i$1 < last.length; ++i$1) { + var span$1 = last[i$1]; + if (span$1.to != null) { + span$1.to += offset; + } + if (span$1.from == null) { + var found$1 = getMarkedSpanFor(first, span$1.marker); + if (!found$1) { + span$1.from = offset; + if (sameLine) { + (first || (first = [])).push(span$1); + } + } + } else { + span$1.from += offset; + if (sameLine) { + (first || (first = [])).push(span$1); + } + } + } + } + // Make sure we didn't create any zero-length spans + if (first) { + first = clearEmptySpans(first); + } + if (last && last != first) { + last = clearEmptySpans(last); + } + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, + gapMarkers; + if (gap > 0 && first) { + for (var i$2 = 0; i$2 < first.length; ++i$2) { + if (first[i$2].to == null) { + (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); + } + } + } + for (var i$3 = 0; i$3 < gap; ++i$3) { + newMarkers.push(gapMarkers); + } + newMarkers.push(last); + } + return newMarkers; + } + + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. + function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) { + spans.splice(i--, 1); + } + } + if (!spans.length) { + return null; + } + return spans; + } + + // Used to 'clip' out readOnly ranges when making a change. + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function (line) { + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) { + (markers || (markers = [])).push(mark); + } + } + } + }); + if (!markers) { + return null; + } + var parts = [{ + from: from, + to: to + }]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], + m = mk.find(0); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { + continue; + } + var newParts = [j, 1], + dfrom = cmp(p.from, m.from), + dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) { + newParts.push({ + from: p.from, + to: m.from + }); + } + if (dto > 0 || !mk.inclusiveRight && !dto) { + newParts.push({ + from: m.to, + to: p.to + }); + } + parts.splice.apply(parts, newParts); + j += newParts.length - 3; + } + } + return parts; + } + + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) { + return; + } + for (var i = 0; i < spans.length; ++i) { + spans[i].marker.detachLine(line); + } + line.markedSpans = null; + } + function attachMarkedSpans(line, spans) { + if (!spans) { + return; + } + for (var i = 0; i < spans.length; ++i) { + spans[i].marker.attachLine(line); + } + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. + function extraLeft(marker) { + return marker.inclusiveLeft ? -1 : 0; + } + function extraRight(marker) { + return marker.inclusiveRight ? 1 : 0; + } + + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. + function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length; + if (lenDiff != 0) { + return lenDiff; + } + var aPos = a.find(), + bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); + if (fromCmp) { + return -fromCmp; + } + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); + if (toCmp) { + return toCmp; + } + return b.id - a.id; + } + + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. + function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, + found; + if (sps) { + for (var sp = void 0, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { + found = sp.marker; + } + } + } + return found; + } + function collapsedSpanAtStart(line) { + return collapsedSpanAtSide(line, true); + } + function collapsedSpanAtEnd(line) { + return collapsedSpanAtSide(line, false); + } + + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. + function conflictingCollapsedRange(doc, lineNo, from, to, marker) { + var line = getLine(doc, lineNo); + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { + for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (!sp.marker.collapsed) { + continue; + } + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { + continue; + } + if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) { + return true; + } + } + } + } + + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). + function visualLine(line) { + var merged; + while (merged = collapsedSpanAtStart(line)) { + line = merged.find(-1, true).line; + } + return line; + } + function visualLineEnd(line) { + var merged; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + } + return line; + } + + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + (lines || (lines = [])).push(line); + } + return lines; + } + + // Get the line number of the start of the visual line that the + // given line number is part of. + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), + vis = visualLine(line); + if (line == vis) { + return lineN; + } + return lineNo(vis); + } + + // Get the line number of the start of the next visual line after + // the given line. + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) { + return lineN; + } + var line = getLine(doc, lineN), + merged; + if (!lineIsHidden(doc, line)) { + return lineN; + } + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + } + return lineNo(line) + 1; + } + + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { + for (var sp = void 0, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) { + continue; + } + if (sp.from == null) { + return true; + } + if (sp.marker.widgetNode) { + continue; + } + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) { + return true; + } + } + } + } + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); + } + if (span.marker.inclusiveRight && span.to == line.text.length) { + return true; + } + for (var sp = void 0, i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && (sp.to == null || sp.to != span.from) && (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && lineIsHiddenInner(doc, line, sp)) { + return true; + } + } + } + + // Find the height above the given line. + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); + var h = 0, + chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) { + break; + } else { + h += line.height; + } + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i$1 = 0; i$1 < p.children.length; ++i$1) { + var cur = p.children[i$1]; + if (cur == chunk) { + break; + } else { + h += cur.height; + } + } + } + return h; + } + + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. + function lineLength(line) { + if (line.height == 0) { + return 0; + } + var len = line.text.length, + merged, + cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found$1 = merged.find(0, true); + len -= cur.text.length - found$1.from.ch; + cur = found$1.to.line; + len += cur.text.length - found$1.to.ch; + } + return len; + } + + // Find the longest line in the document. + function findMaxLine(cm) { + var d = cm.display, + doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; + doc.iter(function (line) { + var len = lineLength(line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); + } + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) { + return f(from, to, "ltr"); + } + var found = false; + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); + found = true; + } + } + if (!found) { + f(from, to, "ltr"); + } + } + var bidiOther = null; + function getBidiPartAt(order, ch, sticky) { + var found; + bidiOther = null; + for (var i = 0; i < order.length; ++i) { + var cur = order[i]; + if (cur.from < ch && cur.to > ch) { + return i; + } + if (cur.to == ch) { + if (cur.from != cur.to && sticky == "before") { + found = i; + } else { + bidiOther = i; + } + } + if (cur.from == ch) { + if (cur.from != cur.to && sticky != "before") { + found = i; + } else { + bidiOther = i; + } + } + } + return found != null ? found : bidiOther; + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = function () { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; + // Character types for codepoints 0x600 to 0x6f9 + var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; + function charType(code) { + if (code <= 0xf7) { + return lowTypes.charAt(code); + } else if (0x590 <= code && code <= 0x5f4) { + return "R"; + } else if (0x600 <= code && code <= 0x6f9) { + return arabicTypes.charAt(code - 0x600); + } else if (0x6ee <= code && code <= 0x8ac) { + return "r"; + } else if (0x2000 <= code && code <= 0x200b) { + return "w"; + } else if (code == 0x200c) { + return "b"; + } else { + return "L"; + } + } + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, + isStrong = /[LRr]/, + countsAsLeft = /[Lb1n]/, + countsAsNum = /[1n]/; + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; + this.to = to; + } + return function (str, direction) { + var outerType = direction == "ltr" ? "L" : "R"; + if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { + return false; + } + var len = str.length, + types = []; + for (var i = 0; i < len; ++i) { + types.push(charType(str.charCodeAt(i))); + } + + // 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. + for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { + var type = types[i$1]; + if (type == "m") { + types[i$1] = prev; + } else { + prev = type; + } + } + + // 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. + // W3. Change all ALs to R. + for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { + var type$1 = types[i$2]; + if (type$1 == "1" && cur == "r") { + types[i$2] = "n"; + } else if (isStrong.test(type$1)) { + cur = type$1; + if (type$1 == "r") { + types[i$2] = "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 (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { + var type$2 = types[i$3]; + if (type$2 == "+" && prev$1 == "1" && types[i$3 + 1] == "1") { + types[i$3] = "1"; + } else if (type$2 == "," && prev$1 == types[i$3 + 1] && (prev$1 == "1" || prev$1 == "n")) { + types[i$3] = prev$1; + } + prev$1 = type$2; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i$4 = 0; i$4 < len; ++i$4) { + var type$3 = types[i$4]; + if (type$3 == ",") { + types[i$4] = "N"; + } else if (type$3 == "%") { + var end = void 0; + for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} + var replace = i$4 && types[i$4 - 1] == "!" || end < len && types[end] == "1" ? "1" : "N"; + for (var j = i$4; j < end; ++j) { + types[j] = replace; + } + i$4 = end - 1; + } + } + + // 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. + for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { + var type$4 = types[i$5]; + if (cur$1 == "L" && type$4 == "1") { + types[i$5] = "L"; + } else if (isStrong.test(type$4)) { + cur$1 = type$4; + } + } + + // 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 act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i$6 = 0; i$6 < len; ++i$6) { + if (isNeutral.test(types[i$6])) { + var end$1 = void 0; + for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} + var before = (i$6 ? types[i$6 - 1] : outerType) == "L"; + var after = (end$1 < len ? types[end$1] : outerType) == "L"; + var replace$1 = before == after ? before ? "L" : "R" : outerType; + for (var j$1 = i$6; j$1 < end$1; ++j$1) { + types[j$1] = replace$1; + } + i$6 = end$1 - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], + m; + for (var i$7 = 0; i$7 < len;) { + if (countsAsLeft.test(types[i$7])) { + var start = i$7; + for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} + order.push(new BidiSpan(0, start, i$7)); + } else { + var pos = i$7, + at = order.length; + for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} + for (var j$2 = pos; j$2 < i$7;) { + if (countsAsNum.test(types[j$2])) { + if (pos < j$2) { + order.splice(at, 0, new BidiSpan(1, pos, j$2)); + } + var nstart = j$2; + for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} + order.splice(at, 0, new BidiSpan(2, nstart, j$2)); + pos = j$2; + } else { + ++j$2; + } + } + if (pos < i$7) { + order.splice(at, 0, new BidiSpan(1, pos, i$7)); + } + } + } + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } + return direction == "rtl" ? order.reverse() : order; + }; + }(); + + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. + function getOrder(line, direction) { + var order = line.order; + if (order == null) { + order = line.order = bidiOrdering(line.text, direction); + } + return order; + } + function moveCharLogically(line, ch, dir) { + var target = skipExtendingChars(line.text, ch + dir, dir); + return target < 0 || target > line.text.length ? null : target; + } + function moveLogically(line, start, dir) { + var ch = moveCharLogically(line, start.ch, dir); + return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before"); + } + function endOfLine(visually, cm, lineObj, lineNo, dir) { + if (visually) { + var order = getOrder(lineObj, cm.doc.direction); + if (order) { + var part = dir < 0 ? lst(order) : order[0]; + var moveInStorageOrder = dir < 0 == (part.level == 1); + var sticky = moveInStorageOrder ? "after" : "before"; + var ch; + // With a wrapped rtl chunk (possibly spanning multiple bidi parts), + // it could be that the last bidi part is not on the last visual line, + // since visual lines contain content order-consecutive chunks. + // Thus, in rtl, we are looking for the first (content-order) character + // in the rtl chunk that is on the last line (that is, the same line + // as the last (content-order) character). + if (part.level > 0) { + var prep = prepareMeasureForLine(cm, lineObj); + ch = dir < 0 ? lineObj.text.length - 1 : 0; + var targetTop = measureCharPrepared(cm, prep, ch).top; + ch = findFirst(function (ch) { + return measureCharPrepared(cm, prep, ch).top == targetTop; + }, dir < 0 == (part.level == 1) ? part.from : part.to - 1, ch); + if (sticky == "before") { + ch = moveCharLogically(lineObj, ch, 1); + } + } else { + ch = dir < 0 ? part.to : part.from; + } + return new Pos(lineNo, ch, sticky); + } + } + return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after"); + } + function moveVisually(cm, line, start, dir) { + var bidi = getOrder(line, cm.doc.direction); + if (!bidi) { + return moveLogically(line, start, dir); + } + if (start.ch >= line.text.length) { + start.ch = line.text.length; + start.sticky = "before"; + } else if (start.ch <= 0) { + start.ch = 0; + start.sticky = "after"; + } + var partPos = getBidiPartAt(bidi, start.ch, start.sticky), + part = bidi[partPos]; + if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { + // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, + // nothing interesting happens. + return moveLogically(line, start, dir); + } + var mv = function (pos, dir) { + return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); + }; + var prep; + var getWrappedLineExtent = function (ch) { + if (!cm.options.lineWrapping) { + return { + begin: 0, + end: line.text.length + }; + } + prep = prep || prepareMeasureForLine(cm, line); + return wrappedLineExtentChar(cm, line, prep, ch); + }; + var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch); + if (cm.doc.direction == "rtl" || part.level == 1) { + var moveInStorageOrder = part.level == 1 == dir < 0; + var ch = mv(start, moveInStorageOrder ? 1 : -1); + if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { + // Case 2: We move within an rtl part or in an rtl editor on the same visual line + var sticky = moveInStorageOrder ? "before" : "after"; + return new Pos(start.line, ch, sticky); + } + } + + // Case 3: Could not move within this bidi part in this visual line, so leave + // the current bidi part + + var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { + var getRes = function (ch, moveInStorageOrder) { + return moveInStorageOrder ? new Pos(start.line, mv(ch, 1), "before") : new Pos(start.line, ch, "after"); + }; + for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { + var part = bidi[partPos]; + var moveInStorageOrder = dir > 0 == (part.level != 1); + var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1); + if (part.from <= ch && ch < part.to) { + return getRes(ch, moveInStorageOrder); + } + ch = moveInStorageOrder ? part.from : mv(part.to, -1); + if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { + return getRes(ch, moveInStorageOrder); + } + } + }; + + // Case 3a: Look for other bidi parts on the same visual line + var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent); + if (res) { + return res; + } + + // Case 3b: Look for other bidi parts on the next visual line + var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1); + if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { + res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)); + if (res) { + return res; + } + } + + // Case 4: Nowhere to move + return null; + } + + // EVENT HANDLING + + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var noHandlers = []; + var on = function (emitter, type, f) { + if (emitter.addEventListener) { + emitter.addEventListener(type, f, false); + } else if (emitter.attachEvent) { + emitter.attachEvent("on" + type, f); + } else { + var map = emitter._handlers || (emitter._handlers = {}); + map[type] = (map[type] || noHandlers).concat(f); + } + }; + function getHandlers(emitter, type) { + return emitter._handlers && emitter._handlers[type] || noHandlers; + } + function off(emitter, type, f) { + if (emitter.removeEventListener) { + emitter.removeEventListener(type, f, false); + } else if (emitter.detachEvent) { + emitter.detachEvent("on" + type, f); + } else { + var map = emitter._handlers, + arr = map && map[type]; + if (arr) { + var index = indexOf(arr, f); + if (index > -1) { + map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); + } + } + } + } + function signal(emitter, type /*, values...*/) { + var handlers = getHandlers(emitter, type); + if (!handlers.length) { + return; + } + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < handlers.length; ++i) { + handlers[i].apply(null, args); + } + } + + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + if (typeof e == "string") { + e = { + type: e, + preventDefault: function () { + this.defaultPrevented = true; + } + }; + } + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore; + } + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) { + return; + } + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) { + if (indexOf(set, arr[i]) == -1) { + set.push(arr[i]); + } + } + } + function hasHandler(emitter, type) { + return getHandlers(emitter, type).length > 0; + } + + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. + function eventMixin(ctor) { + ctor.prototype.on = function (type, f) { + on(this, type, f); + }; + ctor.prototype.off = function (type, f) { + off(this, type, f); + }; + } + + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. + + function e_preventDefault(e) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + } + function e_stopPropagation(e) { + if (e.stopPropagation) { + e.stopPropagation(); + } else { + e.cancelBubble = true; + } + } + function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; + } + function e_stop(e) { + e_preventDefault(e); + e_stopPropagation(e); + } + function e_target(e) { + return e.target || e.srcElement; + } + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) { + b = 1; + } else if (e.button & 2) { + b = 3; + } else if (e.button & 4) { + b = 2; + } + } + if (mac && e.ctrlKey && b == 1) { + b = 3; + } + return b; + } + + // Detect drag-and-drop + var dragAndDrop = function () { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) { + return false; + } + var div = elt('div'); + return "draggable" in div || "dragDrop" in div; + }(); + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) { + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); + } + } + var node = zwspSupported ? elt("span", "\u200b") : elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); + return node; + } + + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) { + return badBidiRects; + } + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + var r1 = range(txt, 1, 2).getBoundingClientRect(); + removeChildren(measure); + if (!r0 || r0.left == r0.right) { + return false; + } // Safari returns null in some cases (#2780) + return badBidiRects = r1.right - r0.right < 3; + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { + var pos = 0, + result = [], + l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) { + nl = string.length; + } + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result; + } : function (string) { + return string.split(/\r\n?|\n/); + }; + var hasSelection = window.getSelection ? function (te) { + try { + return te.selectionStart != te.selectionEnd; + } catch (e) { + return false; + } + } : function (te) { + var range; + try { + range = te.ownerDocument.selection.createRange(); + } catch (e) {} + if (!range || range.parentElement() != te) { + return false; + } + return range.compareEndPoints("StartToEnd", range) != 0; + }; + var hasCopyEvent = function () { + var e = elt("div"); + if ("oncopy" in e) { + return true; + } + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == "function"; + }(); + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) { + return badZoomedRects; + } + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; + } + var modes = {}; + var mimeModes = {}; + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + function defineMode(name, mode) { + if (arguments.length > 2) { + mode.dependencies = Array.prototype.slice.call(arguments, 2); + } + modes[name] = mode; + } + function defineMIME(mime, spec) { + mimeModes[mime] = spec; + } + + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. + function resolveMode(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec]; + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name]; + if (typeof found == "string") { + found = { + name: found + }; + } + spec = createObj(found, spec); + spec.name = found.name; + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return resolveMode("application/xml"); + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { + return resolveMode("application/json"); + } + if (typeof spec == "string") { + return { + name: spec + }; + } else { + return spec || { + name: "null" + }; + } + } + + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. + function getMode(options, spec) { + spec = resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) { + return getMode(options, "text/plain"); + } + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) { + continue; + } + if (modeObj.hasOwnProperty(prop)) { + modeObj["_" + prop] = modeObj[prop]; + } + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + if (spec.helperType) { + modeObj.helperType = spec.helperType; + } + if (spec.modeProps) { + for (var prop$1 in spec.modeProps) { + modeObj[prop$1] = spec.modeProps[prop$1]; + } + } + return modeObj; + } + + // This can be used to attach properties to mode objects from + // outside the actual mode definition. + var modeExtensions = {}; + function extendMode(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : modeExtensions[mode] = {}; + copyObj(properties, exts); + } + function copyState(mode, state) { + if (state === true) { + return state; + } + if (mode.copyState) { + return mode.copyState(state); + } + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) { + val = val.concat([]); + } + nstate[n] = val; + } + return nstate; + } + + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. + function innerMode(mode, state) { + var info; + while (mode.innerMode) { + info = mode.innerMode(state); + if (!info || info.mode == mode) { + break; + } + state = info.state; + mode = info.mode; + } + return info || { + mode: mode, + state: state + }; + } + function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; + } + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + var StringStream = function (string, tabSize, lineOracle) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + this.lineOracle = lineOracle; + }; + StringStream.prototype.eol = function () { + return this.pos >= this.string.length; + }; + StringStream.prototype.sol = function () { + return this.pos == this.lineStart; + }; + StringStream.prototype.peek = function () { + return this.string.charAt(this.pos) || undefined; + }; + StringStream.prototype.next = function () { + if (this.pos < this.string.length) { + return this.string.charAt(this.pos++); + } + }; + StringStream.prototype.eat = function (match) { + var ch = this.string.charAt(this.pos); + var ok; + if (typeof match == "string") { + ok = ch == match; + } else { + ok = ch && (match.test ? match.test(ch) : match(ch)); + } + if (ok) { + ++this.pos; + return ch; + } + }; + StringStream.prototype.eatWhile = function (match) { + var start = this.pos; + while (this.eat(match)) {} + return this.pos > start; + }; + StringStream.prototype.eatSpace = function () { + var this$1 = this; + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { + ++this$1.pos; + } + return this.pos > start; + }; + StringStream.prototype.skipToEnd = function () { + this.pos = this.string.length; + }; + StringStream.prototype.skipTo = function (ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) { + this.pos = found; + return true; + } + }; + StringStream.prototype.backUp = function (n) { + this.pos -= n; + }; + StringStream.prototype.column = function () { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }; + StringStream.prototype.indentation = function () { + return countColumn(this.string, null, this.tabSize) - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }; + StringStream.prototype.match = function (pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function (str) { + return caseInsensitive ? str.toLowerCase() : str; + }; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) { + this.pos += pattern.length; + } + return true; + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) { + return null; + } + if (match && consume !== false) { + this.pos += match[0].length; + } + return match; + } + }; + StringStream.prototype.current = function () { + return this.string.slice(this.start, this.pos); + }; + StringStream.prototype.hideFirstChars = function (n, inner) { + this.lineStart += n; + try { + return inner(); + } finally { + this.lineStart -= n; + } + }; + StringStream.prototype.lookAhead = function (n) { + var oracle = this.lineOracle; + return oracle && oracle.lookAhead(n); + }; + var SavedContext = function (state, lookAhead) { + this.state = state; + this.lookAhead = lookAhead; + }; + var Context = function (doc, state, line, lookAhead) { + this.state = state; + this.doc = doc; + this.line = line; + this.maxLookAhead = lookAhead || 0; + }; + Context.prototype.lookAhead = function (n) { + var line = this.doc.getLine(this.line + n); + if (line != null && n > this.maxLookAhead) { + this.maxLookAhead = n; + } + return line; + }; + Context.prototype.nextLine = function () { + this.line++; + if (this.maxLookAhead > 0) { + this.maxLookAhead--; + } + }; + Context.fromSaved = function (doc, saved, line) { + if (saved instanceof SavedContext) { + return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead); + } else { + return new Context(doc, copyState(doc.mode, saved), line); + } + }; + Context.prototype.save = function (copy) { + var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; + return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state; + }; + + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. + function highlightLine(cm, line, context, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], + lineClasses = {}; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, context, function (end, style) { + return st.push(end, style); + }, lineClasses, forceToEnd); + var state = context.state; + + // Run overlays, adjust style array. + var loop = function (o) { + var overlay = cm.state.overlays[o], + i = 1, + at = 0; + context.state = true; + runMode(cm, line.text, overlay.mode, context, function (end, style) { + var start = i; + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i]; + if (i_end > end) { + st.splice(i, 1, end, st[i + 1], i_end); + } + i += 2; + at = Math.min(end, i_end); + } + if (!style) { + return; + } + if (overlay.opaque) { + st.splice(start, i - start, end, "overlay " + style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start + 1]; + st[start + 1] = (cur ? cur + " " : "") + "overlay " + style; + } + } + }, lineClasses); + }; + for (var o = 0; o < cm.state.overlays.length; ++o) loop(o); + context.state = state; + return { + styles: st, + classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null + }; + } + function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var context = getContextBefore(cm, lineNo(line)); + var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); + var result = highlightLine(cm, line, context); + if (resetState) { + context.state = resetState; + } + line.stateAfter = context.save(!resetState); + line.styles = result.styles; + if (result.classes) { + line.styleClasses = result.classes; + } else if (line.styleClasses) { + line.styleClasses = null; + } + if (updateFrontier === cm.doc.highlightFrontier) { + cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); + } + } + return line.styles; + } + function getContextBefore(cm, n, precise) { + var doc = cm.doc, + display = cm.display; + if (!doc.mode.startState) { + return new Context(doc, true, n); + } + var start = findStartLine(cm, n, precise); + var saved = start > doc.first && getLine(doc, start - 1).stateAfter; + var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); + doc.iter(start, n, function (line) { + processLine(cm, line.text, context); + var pos = context.line; + line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; + context.nextLine(); + }); + if (precise) { + doc.modeFrontier = context.line; + } + return context; + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. Used for lines that + // aren't currently visible. + function processLine(cm, text, context, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize, context); + stream.start = stream.pos = startAt || 0; + if (text == "") { + callBlankLine(mode, context.state); + } + while (!stream.eol()) { + readToken(mode, stream, context.state); + stream.start = stream.pos; + } + } + function callBlankLine(mode, state) { + if (mode.blankLine) { + return mode.blankLine(state); + } + if (!mode.innerMode) { + return; + } + var inner = innerMode(mode, state); + if (inner.mode.blankLine) { + return inner.mode.blankLine(inner.state); + } + } + function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) { + inner[0] = innerMode(mode, state).mode; + } + var style = mode.token(stream, state); + if (stream.pos > stream.start) { + return style; + } + } + throw new Error("Mode " + mode.name + " failed to advance stream."); + } + var Token = function (stream, type, state) { + this.start = stream.start; + this.end = stream.pos; + this.string = stream.current(); + this.type = type || null; + this.state = state; + }; + + // Utility for getTokenAt and getLineTokens + function takeToken(cm, pos, precise, asArray) { + var doc = cm.doc, + mode = doc.mode, + style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), + context = getContextBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize, context), + tokens; + if (asArray) { + tokens = []; + } + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos; + style = readToken(mode, stream, context.state); + if (asArray) { + tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); + } + } + return asArray ? tokens : new Token(stream, style, context.state); + } + function extractLineClasses(type, output) { + if (type) { + for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) { + break; + } + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) { + output[prop] = lineClass[2]; + } else if (!new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)").test(output[prop])) { + output[prop] += " " + lineClass[2]; + } + } + } + return type; + } + + // Run the given mode's parser over a line, calling f for each token. + function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) { + flattenSpans = cm.options.flattenSpans; + } + var curStart = 0, + curStyle = null; + var stream = new StringStream(text, cm.options.tabSize, context), + style; + var inner = cm.options.addModeClass && [null]; + if (text == "") { + extractLineClasses(callBlankLine(mode, context.state), lineClasses); + } + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false; + if (forceToEnd) { + processLine(cm, text, context, stream.pos); + } + stream.pos = text.length; + style = null; + } else { + style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); + } + if (inner) { + var mName = inner[0].name; + if (mName) { + style = "m-" + (style ? mName + " " + style : mName); + } + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 5000); + f(curStart, curStyle); + } + curStyle = style; + } + stream.start = stream.pos; + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 + // characters, and returns inaccurate measurements in nodes + // starting around 5000 chars. + var pos = Math.min(stream.pos, curStart + 5000); + f(pos, curStyle); + curStart = pos; + } + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n, precise) { + var minindent, + minline, + doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); + for (var search = n; search > lim; --search) { + if (search <= doc.first) { + return doc.first; + } + var line = getLine(doc, search - 1), + after = line.stateAfter; + if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) { + return search; + } + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline; + } + function retreatFrontier(doc, n) { + doc.modeFrontier = Math.min(doc.modeFrontier, n); + if (doc.highlightFrontier < n - 10) { + return; + } + var start = doc.first; + for (var line = n - 1; line > start; line--) { + var saved = getLine(doc, line).stateAfter; + // change is on 3 + // state on line 1 looked ahead 2 -- so saw 3 + // test 1 + 2 < 3 should cover this + if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { + start = line + 1; + break; + } + } + doc.highlightFrontier = Math.min(doc.highlightFrontier, start); + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + var Line = function (text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; + }; + Line.prototype.lineNo = function () { + return lineNo(this); + }; + eventMixin(Line); + + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) { + line.stateAfter = null; + } + if (line.styles) { + line.styles = null; + } + if (line.order != null) { + line.order = null; + } + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) { + updateLineHeight(line, estHeight); + } + } + + // Detach a line from the document tree and its markers. + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. + var styleToClassCache = {}; + var styleToClassCacheWithMode = {}; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) { + return null; + } + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + return cache[style] || (cache[style] = style.replace(/\S+/g, "cm-$&")); + } + + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = { + pre: eltP("pre", [content], "CodeMirror-line"), + content: content, + col: 0, + pos: 0, + cm: cm, + trailingSpace: false, + splitSpaces: (ie || webkit) && cm.getOption("lineWrapping") + }; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, + order = void 0; + builder.pos = 0; + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) { + builder.addToken = buildTokenBadBidi(builder.addToken, order); + } + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) { + builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); + } + if (line.styleClasses.textClass) { + builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); + } + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) { + builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); + } + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); + (lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + // See issue #2901 + if (webkit) { + var last = builder.content.lastChild; + if (/\bcm-tab\b/.test(last.className) || last.querySelector && last.querySelector(".cm-tab")) { + builder.content.className = "cm-tab-wrap-hack"; + } + } + signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) { + builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); + } + return builder; + } + function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); + return token; + } + + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, title, css) { + if (!text) { + return; + } + var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; + var special = builder.cm.state.specialChars, + mustWrap = false; + var content; + if (!special.test(text)) { + builder.col += text.length; + content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) { + mustWrap = true; + } + builder.pos += text.length; + } else { + content = document.createDocumentFragment(); + var pos = 0; + while (true) { + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) { + content.appendChild(elt("span", [txt])); + } else { + content.appendChild(txt); + } + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; + } + if (!m) { + break; + } + pos += skipped + 1; + var txt$1 = void 0; + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, + tabWidth = tabSize - builder.col % tabSize; + txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt$1.setAttribute("role", "presentation"); + txt$1.setAttribute("cm-text", "\t"); + builder.col += tabWidth; + } else if (m[0] == "\r" || m[0] == "\n") { + txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); + txt$1.setAttribute("cm-text", m[0]); + builder.col += 1; + } else { + txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); + txt$1.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) { + content.appendChild(elt("span", [txt$1])); + } else { + content.appendChild(txt$1); + } + builder.col += 1; + } + builder.map.push(builder.pos, builder.pos + 1, txt$1); + builder.pos++; + } + } + builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; + if (style || startStyle || endStyle || mustWrap || css) { + var fullStyle = style || ""; + if (startStyle) { + fullStyle += startStyle; + } + if (endStyle) { + fullStyle += endStyle; + } + var token = elt("span", [content], fullStyle, css); + if (title) { + token.title = title; + } + return builder.content.appendChild(token); + } + builder.content.appendChild(content); + } + function splitSpaces(text, trailingBefore) { + if (text.length > 1 && !/ /.test(text)) { + return text; + } + var spaceBefore = trailingBefore, + result = ""; + for (var i = 0; i < text.length; i++) { + var ch = text.charAt(i); + if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) { + ch = "\u00a0"; + } + result += ch; + spaceBefore = ch == " "; + } + return result; + } + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { + return function (builder, text, style, startStyle, endStyle, title, css) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, + end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + var part = void 0; + for (var i = 0; i < order.length; i++) { + part = order[i]; + if (part.to > start && part.from <= start) { + break; + } + } + if (part.to >= end) { + return inner(builder, text, style, startStyle, endStyle, title, css); + } + inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; + } + }; + } + function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode; + if (widget) { + builder.map.push(builder.pos, builder.pos + size, widget); + } + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) { + widget = builder.content.appendChild(document.createElement("span")); + } + widget.setAttribute("cm-marker", marker.id); + } + if (widget) { + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); + } + builder.pos += size; + builder.trailingSpace = false; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, + allText = line.text, + at = 0; + if (!spans) { + for (var i$1 = 1; i$1 < styles.length; i$1 += 2) { + builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1 + 1], builder.cm.options)); + } + return; + } + var len = allText.length, + pos = 0, + i = 1, + text = "", + style, + css; + var nextChange = 0, + spanStyle, + spanEndStyle, + spanStartStyle, + title, + collapsed; + for (;;) { + if (nextChange == pos) { + // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = title = css = ""; + collapsed = null; + nextChange = Infinity; + var foundBookmarks = [], + endStyles = void 0; + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], + m = sp.marker; + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m); + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to; + spanEndStyle = ""; + } + if (m.className) { + spanStyle += " " + m.className; + } + if (m.css) { + css = (css ? css + ";" : "") + m.css; + } + if (m.startStyle && sp.from == pos) { + spanStartStyle += " " + m.startStyle; + } + if (m.endStyle && sp.to == nextChange) { + (endStyles || (endStyles = [])).push(m.endStyle, sp.to); + } + if (m.title && !title) { + title = m.title; + } + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) { + collapsed = sp; + } + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + } + if (endStyles) { + for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) { + if (endStyles[j$1 + 1] == nextChange) { + spanEndStyle += " " + endStyles[j$1]; + } + } + } + if (!collapsed || collapsed.from == pos) { + for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) { + buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); + } + } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null); + if (collapsed.to == null) { + return; + } + if (collapsed.to == pos) { + collapsed = false; + } + } + } + if (pos >= len) { + break; + } + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); + } + if (end >= upto) { + text = text.slice(upto - pos); + pos = upto; + break; + } + pos = end; + spanStartStyle = ""; + } + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); + } + } + } + + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], + nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array; + } + var operationGroup = null; + function pushOperation(op) { + if (operationGroup) { + operationGroup.ops.push(op); + } else { + op.ownsGroup = operationGroup = { + ops: [op], + delayedCallbacks: [] + }; + } + } + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, + i = 0; + do { + for (; i < callbacks.length; i++) { + callbacks[i].call(null); + } + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) { + while (op.cursorActivityCalled < op.cursorActivityHandlers.length) { + op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); + } + } + } + } while (i < callbacks.length); + } + function finishOperation(op, endCb) { + var group = op.ownsGroup; + if (!group) { + return; + } + try { + fireCallbacksForOps(group); + } finally { + operationGroup = null; + endCb(group); + } + } + var orphanDelayedCallbacks = null; + + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. + function signalLater(emitter, type /*, values...*/) { + var arr = getHandlers(emitter, type); + if (!arr.length) { + return; + } + var args = Array.prototype.slice.call(arguments, 2), + list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); + } + var loop = function (i) { + list.push(function () { + return arr[i].apply(null, args); + }); + }; + for (var i = 0; i < arr.length; ++i) loop(i); + } + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) { + delayed[i](); + } + } + + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") { + updateLineText(cm, lineView); + } else if (type == "gutter") { + updateLineGutter(cm, lineView, lineN, dims); + } else if (type == "class") { + updateLineClasses(cm, lineView); + } else if (type == "widget") { + updateLineWidgets(cm, lineView, dims); + } + } + lineView.changes = null; + } + + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) { + lineView.text.parentNode.replaceChild(lineView.node, lineView.text); + } + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) { + lineView.node.style.zIndex = 2; + } + } + return lineView.node; + } + function updateLineBackground(cm, lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) { + cls += " CodeMirror-linebackground"; + } + if (lineView.background) { + if (cls) { + lineView.background.className = cls; + } else { + lineView.background.parentNode.removeChild(lineView.background); + lineView.background = null; + } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + cm.display.input.setUneditable(lineView.background); + } + } + + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built; + } + return buildLineContent(cm, lineView); + } + + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) { + lineView.node = built.pre; + } + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(cm, lineView); + } else if (cls) { + lineView.text.className = cls; + } + } + function updateLineClasses(cm, lineView) { + updateLineBackground(cm, lineView); + if (lineView.line.wrapClass) { + ensureLineWrapped(lineView).className = lineView.line.wrapClass; + } else if (lineView.node != lineView.text) { + lineView.node.className = ""; + } + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; + } + if (lineView.gutterBackground) { + lineView.node.removeChild(lineView.gutterBackground); + lineView.gutterBackground = null; + } + if (lineView.line.gutterClass) { + var wrap = ensureLineWrapped(lineView); + lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + dims.gutterTotalWidth + "px"); + cm.display.input.setUneditable(lineView.gutterBackground); + wrap.insertBefore(lineView.gutterBackground, lineView.text); + } + var markers = lineView.line.gutterMarkers; + if (cm.options.lineNumbers || markers) { + var wrap$1 = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"); + cm.display.input.setUneditable(gutterWrap); + wrap$1.insertBefore(gutterWrap, lineView.text); + if (lineView.line.gutterClass) { + gutterWrap.className += " " + lineView.line.gutterClass; + } + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) { + lineView.lineNumber = gutterWrap.appendChild(elt("div", lineNumberFor(cm.options, lineN), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + cm.display.lineNumInnerWidth + "px")); + } + if (markers) { + for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], + found = markers.hasOwnProperty(id) && markers[id]; + if (found) { + gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); + } + } + } + } + } + function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) { + lineView.alignable = null; + } + for (var node = lineView.node.firstChild, next = void 0; node; node = next) { + next = node.nextSibling; + if (node.className == "CodeMirror-linewidget") { + lineView.node.removeChild(node); + } + } + insertLineWidgets(cm, lineView, dims); + } + + // Build a line's DOM representation from scratch + function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) { + lineView.bgClass = built.bgClass; + } + if (built.textClass) { + lineView.textClass = built.textClass; + } + updateLineClasses(cm, lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(cm, lineView, dims); + return lineView.node; + } + + // A lineView may contain multiple logical lines (when merged by + // collapsed spans). The widgets for all of them need to be drawn. + function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); + if (lineView.rest) { + for (var i = 0; i < lineView.rest.length; i++) { + insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); + } + } + } + function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) { + return; + } + var wrap = ensureLineWrapped(lineView); + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], + node = elt("div", [widget.node], "CodeMirror-linewidget"); + if (!widget.handleMouseEvents) { + node.setAttribute("cm-ignore-events", "true"); + } + positionLineWidget(widget, node, lineView, dims); + cm.display.input.setUneditable(node); + if (allowAbove && widget.above) { + wrap.insertBefore(node, lineView.gutter || lineView.text); + } else { + wrap.appendChild(node); + } + signalLater(widget, "redraw"); + } + } + function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + (lineView.alignable || (lineView.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) { + node.style.marginLeft = -dims.gutterTotalWidth + "px"; + } + } + } + function widgetHeight(widget) { + if (widget.height != null) { + return widget.height; + } + var cm = widget.doc.cm; + if (!cm) { + return 0; + } + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) { + parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; + } + if (widget.noHScroll) { + parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; + } + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.parentNode.offsetHeight; + } + + // Return true when the given mouse event happened in a widget + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true" || n.parentNode == display.sizer && n != display.mover) { + return true; + } + } + } + + // POSITION MEASUREMENT + + function paddingTop(display) { + return display.lineSpace.offsetTop; + } + function paddingVert(display) { + return display.mover.offsetHeight - display.lineSpace.offsetHeight; + } + function paddingH(display) { + if (display.cachedPaddingH) { + return display.cachedPaddingH; + } + var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = { + left: parseInt(style.paddingLeft), + right: parseInt(style.paddingRight) + }; + if (!isNaN(data.left) && !isNaN(data.right)) { + display.cachedPaddingH = data; + } + return data; + } + function scrollGap(cm) { + return scrollerGap - cm.display.nativeBarWidth; + } + function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; + } + function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; + } + + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], + next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) { + heights.push((cur.bottom + next.top) / 2 - rect.top); + } + } + } + heights.push(rect.bottom - rect.top); + } + } + + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) { + return { + map: lineView.measure.map, + cache: lineView.measure.cache + }; + } + for (var i = 0; i < lineView.rest.length; i++) { + if (lineView.rest[i] == line) { + return { + map: lineView.measure.maps[i], + cache: lineView.measure.caches[i] + }; + } + } + for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) { + if (lineNo(lineView.rest[i$1]) > lineN) { + return { + map: lineView.measure.maps[i$1], + cache: lineView.measure.caches[i$1], + before: true + }; + } + } + } + + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view; + } + + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); + } + + // Find a line view that corresponds to the given line number. + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) { + return cm.display.view[findViewIndex(cm, lineN)]; + } + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) { + return ext; + } + } + + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) { + view = null; + } else if (view && view.changes) { + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + cm.curOp.forceUpdate = true; + } + if (!view) { + view = updateExternalMeasurement(cm, line); + } + var info = mapFromLineView(view, line, lineN); + return { + line: line, + view: view, + rect: null, + map: info.map, + cache: info.cache, + before: info.before, + hasHeights: false + }; + } + + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) { + ch = -1; + } + var key = ch + (bias || ""), + found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; + } else { + if (!prepared.rect) { + prepared.rect = prepared.view.text.getBoundingClientRect(); + } + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; + } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) { + prepared.cache[key] = found; + } + } + return { + left: found.left, + right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom + }; + } + var nullRect = { + left: 0, + right: 0, + top: 0, + bottom: 0 + }; + function nodeAndOffsetInLineMap(map, ch, bias) { + var node, start, end, collapse, mStart, mEnd; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map.length; i += 3) { + mStart = map[i]; + mEnd = map[i + 1]; + if (ch < mStart) { + start = 0; + end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) { + collapse = "right"; + } + } + if (start != null) { + node = map[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) { + collapse = bias; + } + if (bias == "left" && start == 0) { + while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2]; + collapse = "left"; + } + } + if (bias == "right" && start == mEnd - mStart) { + while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2]; + collapse = "right"; + } + } + break; + } + } + return { + node: node, + start: start, + end: end, + collapse: collapse, + coverStart: mStart, + coverEnd: mEnd + }; + } + function getUsefulRect(rects, bias) { + var rect = nullRect; + if (bias == "left") { + for (var i = 0; i < rects.length; i++) { + if ((rect = rects[i]).left != rect.right) { + break; + } + } + } else { + for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { + if ((rect = rects[i$1]).left != rect.right) { + break; + } + } + } + return rect; + } + function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, + start = place.start, + end = place.end, + collapse = place.collapse; + var rect; + if (node.nodeType == 3) { + // If it is a text node, use a range to retrieve the coordinates. + for (var i$1 = 0; i$1 < 4; i$1++) { + // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { + --start; + } + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { + ++end; + } + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) { + rect = node.parentNode.getBoundingClientRect(); + } else { + rect = getUsefulRect(range(node, start, end).getClientRects(), bias); + } + if (rect.left || rect.right || start == 0) { + break; + } + end = start; + start = start - 1; + collapse = "right"; + } + if (ie && ie_version < 11) { + rect = maybeUpdateRectForZooming(cm.display.measure, rect); + } + } else { + // If it is a widget, simply get the box for the whole widget. + if (start > 0) { + collapse = bias = "right"; + } + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) { + rect = rects[bias == "right" ? rects.length - 1 : 0]; + } else { + rect = node.getBoundingClientRect(); + } + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) { + rect = { + left: rSpan.left, + right: rSpan.left + charWidth(cm.display), + top: rSpan.top, + bottom: rSpan.bottom + }; + } else { + rect = nullRect; + } + } + var rtop = rect.top - prepared.rect.top, + rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + var i = 0; + for (; i < heights.length - 1; i++) { + if (mid < heights[i]) { + break; + } + } + var top = i ? heights[i - 1] : 0, + bot = heights[i]; + var result = { + left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, + bottom: bot + }; + if (!rect.left && !rect.right) { + result.bogus = true; + } + if (!cm.options.singleCursorHeightPerLine) { + result.rtop = rtop; + result.rbottom = rbot; + } + return result; + } + + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) { + return rect; + } + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return { + left: rect.left * scaleX, + right: rect.right * scaleX, + top: rect.top * scaleY, + bottom: rect.bottom * scaleY + }; + } + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) { + for (var i = 0; i < lineView.rest.length; i++) { + lineView.measure.caches[i] = {}; + } + } + } + } + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) { + clearLineMeasurementCacheFor(cm.display.view[i]); + } + } + function clearCaches(cm) { + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) { + cm.display.maxLineChanged = true; + } + cm.display.lineNumChars = null; + } + function pageScrollX() { + // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 + // which causes page_Offset and bounding client rects to use + // different reference viewports and invalidate our calculations. + if (chrome && android) { + return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)); + } + return window.pageXOffset || (document.documentElement || document.body).scrollLeft; + } + function pageScrollY() { + if (chrome && android) { + return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)); + } + return window.pageYOffset || (document.documentElement || document.body).scrollTop; + } + + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"./null (editor), "window", + // or "page". + function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { + if (!includeWidgets && lineObj.widgets) { + for (var i = 0; i < lineObj.widgets.length; ++i) { + if (lineObj.widgets[i].above) { + var size = widgetHeight(lineObj.widgets[i]); + rect.top += size; + rect.bottom += size; + } + } + } + if (context == "line") { + return rect; + } + if (!context) { + context = "local"; + } + var yOff = heightAtLine(lineObj); + if (context == "local") { + yOff += paddingTop(cm.display); + } else { + yOff -= cm.display.viewOffset; + } + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); + rect.left += xOff; + rect.right += xOff; + } + rect.top += yOff; + rect.bottom += yOff; + return rect; + } + + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"./null. + function fromCoordSystem(cm, coords, context) { + if (context == "div") { + return coords; + } + var left = coords.left, + top = coords.top; + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX(); + top -= pageScrollY(); + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; + } + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); + return { + left: left - lineSpaceBox.left, + top: top - lineSpaceBox.top + }; + } + function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) { + lineObj = getLine(cm.doc, pos.line); + } + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); + } + + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. + // A cursor Pos(line, char, "before") is on the same visual line as `char - 1` + // and after `char - 1` in writing order of `char - 1` + // A cursor Pos(line, char, "after") is on the same visual line as `char` + // and before `char` in writing order of `char` + // Examples (upper-case letters are RTL, lower-case are LTR): + // Pos(0, 1, ...) + // before after + // ab a|b a|b + // aB a|B aB| + // Ab |Ab A|b + // AB B|A B|A + // Every position after the last character on a line is considered to stick + // to the last character on the line. + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) { + preparedMeasure = prepareMeasureForLine(cm, lineObj); + } + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) { + m.left = m.right; + } else { + m.right = m.left; + } + return intoCoordSystem(cm, lineObj, m, context); + } + var order = getOrder(lineObj, cm.doc.direction), + ch = pos.ch, + sticky = pos.sticky; + if (ch >= lineObj.text.length) { + ch = lineObj.text.length; + sticky = "before"; + } else if (ch <= 0) { + ch = 0; + sticky = "after"; + } + if (!order) { + return get(sticky == "before" ? ch - 1 : ch, sticky == "before"); + } + function getBidi(ch, partPos, invert) { + var part = order[partPos], + right = part.level % 2 != 0; + return get(invert ? ch - 1 : ch, right != invert); + } + var partPos = getBidiPartAt(order, ch, sticky); + var other = bidiOther; + var val = getBidi(ch, partPos, sticky == "before"); + if (other != null) { + val.other = getBidi(ch, other, sticky != "before"); + } + return val; + } + + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. + function estimateCoords(cm, pos) { + var left = 0; + pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) { + left = charWidth(cm.display) * pos.ch; + } + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return { + left: left, + right: left, + top: top, + bottom: top + lineObj.height + }; + } + + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. + function PosWithInfo(line, ch, sticky, outside, xRel) { + var pos = Pos(line, ch, sticky); + pos.xRel = xRel; + if (outside) { + pos.outside = true; + } + return pos; + } + + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) { + return PosWithInfo(doc.first, 0, null, true, -1); + } + var lineN = lineAtHeight(doc, y), + last = doc.first + doc.size - 1; + if (lineN > last) { + return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1); + } + if (x < 0) { + x = 0; + } + var lineObj = getLine(doc, lineN); + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var merged = collapsedSpanAtEnd(lineObj); + var mergedPos = merged && merged.find(0, true); + if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) { + lineN = lineNo(lineObj = mergedPos.to.line); + } else { + return found; + } + } + } + function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { + var measure = function (ch) { + return intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), "line"); + }; + var end = lineObj.text.length; + var begin = findFirst(function (ch) { + return measure(ch - 1).bottom <= y; + }, end, 0); + end = findFirst(function (ch) { + return measure(ch).top > y; + }, begin, end); + return { + begin: begin, + end: end + }; + } + function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { + var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; + return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop); + } + function coordsCharInner(cm, lineObj, lineNo, x, y) { + y -= heightAtLine(lineObj); + var begin = 0, + end = lineObj.text.length; + var preparedMeasure = prepareMeasureForLine(cm, lineObj); + var pos; + var order = getOrder(lineObj, cm.doc.direction); + if (order) { + if (cm.options.lineWrapping) { + var assign; + assign = wrappedLineExtent(cm, lineObj, preparedMeasure, y), begin = assign.begin, end = assign.end, assign; + } + pos = new Pos(lineNo, Math.floor(begin + (end - begin) / 2)); + var beginLeft = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left; + var dir = beginLeft < x ? 1 : -1; + var prevDiff, + diff = beginLeft - x, + prevPos; + var steps = Math.ceil((end - begin) / 4); + outer: do { + prevDiff = diff; + prevPos = pos; + var i = 0; + for (; i < steps; ++i) { + var prevPos$1 = pos; + pos = moveVisually(cm, lineObj, pos, dir); + if (pos == null || pos.ch < begin || end <= (pos.sticky == "before" ? pos.ch - 1 : pos.ch)) { + pos = prevPos$1; + break outer; + } + } + diff = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left - x; + if (steps > 1) { + var diff_change_per_step = Math.abs(diff - prevDiff) / steps; + steps = Math.min(steps, Math.ceil(Math.abs(diff) / diff_change_per_step)); + dir = diff < 0 ? 1 : -1; + } + } while (diff != 0 && (steps > 1 || dir < 0 != diff < 0 && Math.abs(diff) <= Math.abs(prevDiff))); + if (Math.abs(diff) > Math.abs(prevDiff)) { + if (diff < 0 == prevDiff < 0) { + throw new Error("Broke out of infinite loop in coordsCharInner"); + } + pos = prevPos; + } + } else { + var ch = findFirst(function (ch) { + var box = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), "line"); + if (box.top > y) { + // For the cursor stickiness + end = Math.min(ch, end); + return true; + } else if (box.bottom <= y) { + return false; + } else if (box.left > x) { + return true; + } else if (box.right < x) { + return false; + } else { + return x - box.left < box.right - x; + } + }, begin, end); + ch = skipExtendingChars(lineObj.text, ch, 1); + pos = new Pos(lineNo, ch, ch == end ? "before" : "after"); + } + var coords = cursorCoords(cm, pos, "line", lineObj, preparedMeasure); + if (y < coords.top || coords.bottom < y) { + pos.outside = true; + } + pos.xRel = x < coords.left ? -1 : x > coords.right ? 1 : 0; + return pos; + } + var measureText; + // Compute the default text height. + function textHeight(display) { + if (display.cachedTextHeight != null) { + return display.cachedTextHeight; + } + if (measureText == null) { + measureText = elt("pre"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) { + display.cachedTextHeight = height; + } + removeChildren(display.measure); + return height || 1; + } + + // Compute the default character width. + function charWidth(display) { + if (display.cachedCharWidth != null) { + return display.cachedCharWidth; + } + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor]); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), + width = (rect.right - rect.left) / 10; + if (width > 2) { + display.cachedCharWidth = width; + } + return width || 10; + } + + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. + function getDimensions(cm) { + var d = cm.display, + left = {}, + width = {}; + var gutterLeft = d.gutters.clientLeft; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; + width[cm.options.gutters[i]] = n.clientWidth; + } + return { + fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth + }; + } + + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; + } + + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). + function estimateHeight(cm) { + var th = textHeight(cm.display), + wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function (line) { + if (lineIsHidden(cm.doc, line)) { + return 0; + } + var widgetsHeight = 0; + if (line.widgets) { + for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) { + widgetsHeight += line.widgets[i].height; + } + } + } + if (wrapping) { + return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; + } else { + return widgetsHeight + th; + } + }; + } + function estimateLineHeights(cm) { + var doc = cm.doc, + est = estimateHeight(cm); + doc.iter(function (line) { + var estHeight = est(line); + if (estHeight != line.height) { + updateLineHeight(line, estHeight); + } + }); + } + + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. + function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display; + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { + return null; + } + var x, + y, + space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { + x = e.clientX - space.left; + y = e.clientY - space.top; + } catch (e) { + return null; + } + var coords = coordsChar(cm, x, y), + line; + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); + } + return coords; + } + + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) { + return null; + } + n -= cm.display.viewFrom; + if (n < 0) { + return null; + } + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) { + return i; + } + } + } + function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()); + } + function prepareSelection(cm, primary) { + var doc = cm.doc, + result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (primary === false && i == doc.sel.primIndex) { + continue; + } + var range = doc.sel.ranges[i]; + if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { + continue; + } + var collapsed = range.empty(); + if (collapsed || cm.options.showCursorWhenSelecting) { + drawSelectionCursor(cm, range.head, curFragment); + } + if (!collapsed) { + drawSelectionRange(cm, range, selFragment); + } + } + return result; + } + + // Draws a cursor for the given range + function drawSelectionCursor(cm, head, output) { + var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } + } + + // Draws the given range as a highlighted selection + function drawSelectionRange(cm, range, output) { + var display = cm.display, + doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), + leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; + function add(left, top, width, bottom) { + if (top < 0) { + top = 0; + } + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")); + } + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias); + } + iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) { + var leftPos = coords(from, "left"), + rightPos, + left, + right; + if (from == to) { + rightPos = leftPos; + left = right = leftPos.left; + } else { + rightPos = coords(to - 1, "right"); + if (dir == "rtl") { + var tmp = leftPos; + leftPos = rightPos; + rightPos = tmp; + } + left = leftPos.left; + right = rightPos.right; + } + if (fromArg == null && from == 0) { + left = leftSide; + } + if (rightPos.top - leftPos.top > 3) { + // Different lines, draw top part + add(left, leftPos.top, null, leftPos.bottom); + left = leftSide; + if (leftPos.bottom < rightPos.top) { + add(left, leftPos.bottom, null, rightPos.top); + } + } + if (toArg == null && to == lineLen) { + right = rightSide; + } + if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) { + start = leftPos; + } + if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) { + end = rightPos; + } + if (left < leftSide + 1) { + left = leftSide; + } + add(left, rightPos.top, right - left, rightPos.bottom); + }); + return { + start: start, + end: end + }; + } + var sFrom = range.from(), + sTo = range.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); + } else { + var fromLine = getLine(doc, sFrom.line), + toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); + } + } + if (leftEnd.bottom < rightStart.top) { + add(leftSide, leftEnd.bottom, null, rightStart.top); + } + } + output.appendChild(fragment); + } + + // Cursor-blinking + function restartBlink(cm) { + if (!cm.state.focused) { + return; + } + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; + if (cm.options.cursorBlinkRate > 0) { + display.blinker = setInterval(function () { + return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; + }, cm.options.cursorBlinkRate); + } else if (cm.options.cursorBlinkRate < 0) { + display.cursorDiv.style.visibility = "hidden"; + } + } + function ensureFocus(cm) { + if (!cm.state.focused) { + cm.display.input.focus(); + onFocus(cm); + } + } + function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true; + setTimeout(function () { + if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + onBlur(cm); + } + }, 100); + } + function onFocus(cm, e) { + if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + } + if (cm.options.readOnly == "nocursor") { + return; + } + if (!cm.state.focused) { + signal(cm, "focus", cm, e); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset(); + if (webkit) { + setTimeout(function () { + return cm.display.input.reset(true); + }, 20); + } // Issue #1730 + } + cm.display.input.receivedFocus(); + } + restartBlink(cm); + } + function onBlur(cm, e) { + if (cm.state.delayingBlurEvent) { + return; + } + if (cm.state.focused) { + signal(cm, "blur", cm, e); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); + } + clearInterval(cm.display.blinker); + setTimeout(function () { + if (!cm.state.focused) { + cm.display.shift = false; + } + }, 150); + } + + // Read the actual heights of the rendered lines, and update their + // stored heights to match. + function updateHeightsInViewport(cm) { + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], + height = void 0; + if (cur.hidden) { + continue; + } + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + } + var diff = cur.line.height - height; + if (height < 2) { + height = textHeight(display); + } + if (diff > .005 || diff < -.005) { + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) { + for (var j = 0; j < cur.rest.length; j++) { + updateWidgetHeight(cur.rest[j]); + } + } + } + } + } + + // Read and store the height of line widgets associated with the + // given line. + function updateWidgetHeight(line) { + if (line.widgets) { + for (var i = 0; i < line.widgets.length; ++i) { + line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; + } + } + } + + // Compute the lines that are visible in a given viewport (defaults + // the the current scroll position). viewport may contain top, + // height, and ensure (see op.scrollToPos) properties. + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; + var from = lineAtHeight(doc, top), + to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, + ensureTo = viewport.ensure.to.line; + if (ensureFrom < from) { + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; + } + } + return { + from: from, + to: Math.max(to, from + 1) + }; + } + + // Re-align line numbers and gutter marks to compensate for + // horizontal scrolling. + function alignHorizontally(cm) { + var display = cm.display, + view = display.view; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { + return; + } + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, + left = comp + "px"; + for (var i = 0; i < view.length; i++) { + if (!view[i].hidden) { + if (cm.options.fixedGutter) { + if (view[i].gutter) { + view[i].gutter.style.left = left; + } + if (view[i].gutterBackground) { + view[i].gutterBackground.style.left = left; + } + } + var align = view[i].alignable; + if (align) { + for (var j = 0; j < align.length; j++) { + align[j].style.left = left; + } + } + } + } + if (cm.options.fixedGutter) { + display.gutters.style.left = comp + gutterW + "px"; + } + } + + // Used to ensure that the line number gutter is still the right + // size for the current document size. Returns true when an update + // is needed. + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) { + return false; + } + var doc = cm.doc, + last = lineNumberFor(cm.options, doc.first + doc.size - 1), + display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, + padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + updateGutterSpace(cm); + return true; + } + return false; + } + + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. + function maybeScrollWindow(cm, rect) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) { + return; + } + var display = cm.display, + box = display.sizer.getBoundingClientRect(), + doScroll = null; + if (rect.top + box.top < 0) { + doScroll = true; + } else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { + doScroll = false; + } + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, "position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + rect.left + "px; width: " + Math.max(2, rect.right - rect.left) + "px;"); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } + } + + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). + function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) { + margin = 0; + } + var rect; + if (!cm.options.lineWrapping && pos == end) { + // Set pos and end to the cursor positions around the character pos sticks to + // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch + // If pos == Pos(_, 0, "before"), pos and end are unchanged + pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; + end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; + } + for (var limit = 0; limit < 5; limit++) { + var changed = false; + var coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + rect = { + left: Math.min(coords.left, endCoords.left), + top: Math.min(coords.top, endCoords.top) - margin, + right: Math.max(coords.left, endCoords.left), + bottom: Math.max(coords.bottom, endCoords.bottom) + margin + }; + var scrollPos = calculateScrollPos(cm, rect); + var startTop = cm.doc.scrollTop, + startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) { + changed = true; + } + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { + changed = true; + } + } + if (!changed) { + break; + } + } + return rect; + } + + // Scroll a given set of coordinates into view (immediately). + function scrollIntoView(cm, rect) { + var scrollPos = calculateScrollPos(cm, rect); + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop); + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + } + } + + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. + function calculateScrollPos(cm, rect) { + var display = cm.display, + snapMargin = textHeight(cm.display); + if (rect.top < 0) { + rect.top = 0; + } + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), + result = {}; + if (rect.bottom - rect.top > screen) { + rect.bottom = rect.top + screen; + } + var docBottom = cm.doc.height + paddingVert(display); + var atTop = rect.top < snapMargin, + atBottom = rect.bottom > docBottom - snapMargin; + if (rect.top < screentop) { + result.scrollTop = atTop ? 0 : rect.top; + } else if (rect.bottom > screentop + screen) { + var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen); + if (newTop != screentop) { + result.scrollTop = newTop; + } + } + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); + var tooWide = rect.right - rect.left > screenw; + if (tooWide) { + rect.right = rect.left + screenw; + } + if (rect.left < 10) { + result.scrollLeft = 0; + } else if (rect.left < screenleft) { + result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); + } else if (rect.right > screenw + screenleft - 3) { + result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; + } + return result; + } + + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). + function addToScrollTop(cm, top) { + if (top == null) { + return; + } + resolveScrollToPos(cm); + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; + } + + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(); + cm.curOp.scrollToPos = { + from: cur, + to: cur, + margin: cm.options.cursorScrollMargin + }; + } + function scrollToCoords(cm, x, y) { + if (x != null || y != null) { + resolveScrollToPos(cm); + } + if (x != null) { + cm.curOp.scrollLeft = x; + } + if (y != null) { + cm.curOp.scrollTop = y; + } + } + function scrollToRange(cm, range) { + resolveScrollToPos(cm); + cm.curOp.scrollToPos = range; + } + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. + function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos; + if (range) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range.from), + to = estimateCoords(cm, range.to); + scrollToCoordsRange(cm, from, to, range.margin); + } + } + function scrollToCoordsRange(cm, from, to, margin) { + var sPos = calculateScrollPos(cm, { + left: Math.min(from.left, to.left), + top: Math.min(from.top, to.top) - margin, + right: Math.max(from.right, to.right), + bottom: Math.max(from.bottom, to.bottom) + margin + }); + scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); + } + + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. + function updateScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) { + return; + } + if (!gecko) { + updateDisplaySimple(cm, { + top: val + }); + } + setScrollTop(cm, val, true); + if (gecko) { + updateDisplaySimple(cm); + } + startWorker(cm, 100); + } + function setScrollTop(cm, val, forceScroll) { + val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val); + if (cm.display.scroller.scrollTop == val && !forceScroll) { + return; + } + cm.doc.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (cm.display.scroller.scrollTop != val) { + cm.display.scroller.scrollTop = val; + } + } + + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. + function setScrollLeft(cm, val, isScroller, forceScroll) { + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); + if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { + return; + } + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) { + cm.display.scroller.scrollLeft = val; + } + cm.display.scrollbars.setScrollLeft(val); + } + + // SCROLLBARS + + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. + function measureForScrollbars(cm) { + var d = cm.display, + gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, + clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + }; + } + var NativeScrollbars = function (place, scroll, cm) { + this.cm = cm; + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + place(vert); + place(horiz); + on(vert, "scroll", function () { + if (vert.clientHeight) { + scroll(vert.scrollTop, "vertical"); + } + }); + on(horiz, "scroll", function () { + if (horiz.clientWidth) { + scroll(horiz.scrollLeft, "horizontal"); + } + }); + this.checkedZeroWidth = false; + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) { + this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; + } + }; + NativeScrollbars.prototype.update = function (measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + var sWidth = measure.nativeBarWidth; + if (needsV) { + this.vert.style.display = "block"; + this.vert.style.bottom = needsH ? sWidth + "px" : "0"; + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; + } else { + this.vert.style.display = ""; + this.vert.firstChild.style.height = "0"; + } + if (needsH) { + this.horiz.style.display = "block"; + this.horiz.style.right = needsV ? sWidth + "px" : "0"; + this.horiz.style.left = measure.barLeft + "px"; + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); + this.horiz.firstChild.style.width = Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; + } else { + this.horiz.style.display = ""; + this.horiz.firstChild.style.width = "0"; + } + if (!this.checkedZeroWidth && measure.clientHeight > 0) { + if (sWidth == 0) { + this.zeroWidthHack(); + } + this.checkedZeroWidth = true; + } + return { + right: needsV ? sWidth : 0, + bottom: needsH ? sWidth : 0 + }; + }; + NativeScrollbars.prototype.setScrollLeft = function (pos) { + if (this.horiz.scrollLeft != pos) { + this.horiz.scrollLeft = pos; + } + if (this.disableHoriz) { + this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); + } + }; + NativeScrollbars.prototype.setScrollTop = function (pos) { + if (this.vert.scrollTop != pos) { + this.vert.scrollTop = pos; + } + if (this.disableVert) { + this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); + } + }; + NativeScrollbars.prototype.zeroWidthHack = function () { + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + this.horiz.style.height = this.vert.style.width = w; + this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; + this.disableHoriz = new Delayed(); + this.disableVert = new Delayed(); + }; + NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { + bar.style.pointerEvents = "auto"; + function maybeDisable() { + // To find out whether the scrollbar is still visible, we + // check whether the element under the pixel in the bottom + // right corner of the scrollbar box is the scrollbar box + // itself (when the bar is still visible) or its filler child + // (when the bar is hidden). If it is still visible, we keep + // it enabled, if it's hidden, we disable pointer events. + var box = bar.getBoundingClientRect(); + var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1); + if (elt != bar) { + bar.style.pointerEvents = "none"; + } else { + delay.set(1000, maybeDisable); + } + } + delay.set(1000, maybeDisable); + }; + NativeScrollbars.prototype.clear = function () { + var parent = this.horiz.parentNode; + parent.removeChild(this.horiz); + parent.removeChild(this.vert); + }; + var NullScrollbars = function () {}; + NullScrollbars.prototype.update = function () { + return { + bottom: 0, + right: 0 + }; + }; + NullScrollbars.prototype.setScrollLeft = function () {}; + NullScrollbars.prototype.setScrollTop = function () {}; + NullScrollbars.prototype.clear = function () {}; + function updateScrollbars(cm, measure) { + if (!measure) { + measure = measureForScrollbars(cm); + } + var startWidth = cm.display.barWidth, + startHeight = cm.display.barHeight; + updateScrollbarsInner(cm, measure); + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) { + updateHeightsInViewport(cm); + } + updateScrollbarsInner(cm, measureForScrollbars(cm)); + startWidth = cm.display.barWidth; + startHeight = cm.display.barHeight; + } + } + + // Re-synchronize the fake scrollbars with the actual size of the + // content. + function updateScrollbarsInner(cm, measure) { + var d = cm.display; + var sizes = d.scrollbars.update(measure); + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; + d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = sizes.bottom + "px"; + d.scrollbarFiller.style.width = sizes.right + "px"; + } else { + d.scrollbarFiller.style.display = ""; + } + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block"; + d.gutterFiller.style.height = sizes.bottom + "px"; + d.gutterFiller.style.width = measure.gutterWidth + "px"; + } else { + d.gutterFiller.style.display = ""; + } + } + var scrollbarModel = { + "native": NativeScrollbars, + "null": NullScrollbars + }; + function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear(); + if (cm.display.scrollbars.addClass) { + rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } + } + cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function () { + if (cm.state.focused) { + setTimeout(function () { + return cm.display.input.focus(); + }, 0); + } + }); + node.setAttribute("cm-not-content", "true"); + }, function (pos, axis) { + if (axis == "horizontal") { + setScrollLeft(cm, pos); + } else { + updateScrollTop(cm, pos); + } + }, cm); + if (cm.display.scrollbars.addClass) { + addClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } + } + + // Operations are used to wrap a series of changes to the editor + // state in such a way that each change won't have to update the + // cursor and display (which would be awkward, slow, and + // error-prone). Instead, display updates are batched and then all + // combined and executed at once. + + var nextOpId = 0; + // Start a new operation. + function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, + // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, + // Used to detect need to update scrollbar + forceUpdate: false, + // Used to force a redraw + updateInput: null, + // Whether to reset the input textarea + typing: false, + // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, + // Accumulated changes, for firing change events + cursorActivityHandlers: null, + // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, + // Tracks which cursorActivity handlers have been called already + selectionChanged: false, + // Whether the selection needs to be redrawn + updateMaxLine: false, + // Set when the widest line needs to be determined anew + scrollLeft: null, + scrollTop: null, + // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, + // Used to scroll to a specific position + focus: false, + id: ++nextOpId // Unique ID + }; + pushOperation(cm.curOp); + } + + // Finish an operation, updating the display and signalling delayed events + function endOperation(cm) { + var op = cm.curOp; + finishOperation(op, function (group) { + for (var i = 0; i < group.ops.length; i++) { + group.ops[i].cm.curOp = null; + } + endOperations(group); + }); + } + + // The DOM updates done when an operation finishes are batched so + // that the minimum number of relayouts are required. + function endOperations(group) { + var ops = group.ops; + for (var i = 0; i < ops.length; i++) + // Read DOM + { + endOperation_R1(ops[i]); + } + for (var i$1 = 0; i$1 < ops.length; i$1++) + // Write DOM (maybe) + { + endOperation_W1(ops[i$1]); + } + for (var i$2 = 0; i$2 < ops.length; i$2++) + // Read DOM + { + endOperation_R2(ops[i$2]); + } + for (var i$3 = 0; i$3 < ops.length; i$3++) + // Write DOM (maybe) + { + endOperation_W2(ops[i$3]); + } + for (var i$4 = 0; i$4 < ops.length; i$4++) + // Read DOM + { + endOperation_finish(ops[i$4]); + } + } + function endOperation_R1(op) { + var cm = op.cm, + display = cm.display; + maybeClipScrollbars(cm); + if (op.updateMaxLine) { + findMaxLine(cm); + } + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || op.scrollToPos.to.line >= display.viewTo) || display.maxLineChanged && cm.options.lineWrapping; + op.update = op.mustUpdate && new DisplayUpdate(cm, op.mustUpdate && { + top: op.scrollTop, + ensure: op.scrollToPos + }, op.forceUpdate); + } + function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } + function endOperation_R2(op) { + var cm = op.cm, + display = cm.display; + if (op.updatedDisplay) { + updateHeightsInViewport(cm); + } + op.barMeasure = measureForScrollbars(cm); + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + cm.display.sizerWidth = op.adjustWidthTo; + op.barMeasure.scrollWidth = Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); + } + if (op.updatedDisplay || op.selectionChanged) { + op.preparedSelection = display.input.prepareSelection(op.focus); + } + } + function endOperation_W2(op) { + var cm = op.cm; + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; + if (op.maxScrollLeft < cm.doc.scrollLeft) { + setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); + } + cm.display.maxLineChanged = false; + } + var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus()); + if (op.preparedSelection) { + cm.display.input.showSelection(op.preparedSelection, takeFocus); + } + if (op.updatedDisplay || op.startHeight != cm.doc.height) { + updateScrollbars(cm, op.barMeasure); + } + if (op.updatedDisplay) { + setDocumentHeight(cm, op.barMeasure); + } + if (op.selectionChanged) { + restartBlink(cm); + } + if (cm.state.focused && op.updateInput) { + cm.display.input.reset(op.typing); + } + if (takeFocus) { + ensureFocus(op.cm); + } + } + function endOperation_finish(op) { + var cm = op.cm, + display = cm.display, + doc = cm.doc; + if (op.updatedDisplay) { + postUpdateDisplay(cm, op.update); + } + + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) { + display.wheelStartX = display.wheelStartY = null; + } + + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null) { + setScrollTop(cm, op.scrollTop, op.forceScroll); + } + if (op.scrollLeft != null) { + setScrollLeft(cm, op.scrollLeft, true, true); + } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); + maybeScrollWindow(cm, rect); + } + + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, + unhidden = op.maybeUnhiddenMarkers; + if (hidden) { + for (var i = 0; i < hidden.length; ++i) { + if (!hidden[i].lines.length) { + signal(hidden[i], "hide"); + } + } + } + if (unhidden) { + for (var i$1 = 0; i$1 < unhidden.length; ++i$1) { + if (unhidden[i$1].lines.length) { + signal(unhidden[i$1], "unhide"); + } + } + } + if (display.wrapper.offsetHeight) { + doc.scrollTop = cm.display.scroller.scrollTop; + } + + // Fire change events, and delayed event handlers + if (op.changeObjs) { + signal(cm, "changes", cm, op.changeObjs); + } + if (op.update) { + op.update.finish(); + } + } + + // Run the given function in an operation + function runInOp(cm, f) { + if (cm.curOp) { + return f(); + } + startOperation(cm); + try { + return f(); + } finally { + endOperation(cm); + } + } + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm, f) { + return function () { + if (cm.curOp) { + return f.apply(cm, arguments); + } + startOperation(cm); + try { + return f.apply(cm, arguments); + } finally { + endOperation(cm); + } + }; + } + // Used to add methods to editor and doc instances, wrapping them in + // operations. + function methodOp(f) { + return function () { + if (this.curOp) { + return f.apply(this, arguments); + } + startOperation(this); + try { + return f.apply(this, arguments); + } finally { + endOperation(this); + } + }; + } + function docMethodOp(f) { + return function () { + var cm = this.cm; + if (!cm || cm.curOp) { + return f.apply(this, arguments); + } + startOperation(cm); + try { + return f.apply(this, arguments); + } finally { + endOperation(cm); + } + }; + } + + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) { + from = cm.doc.first; + } + if (to == null) { + to = cm.doc.first + cm.doc.size; + } + if (!lendiff) { + lendiff = 0; + } + var display = cm.display; + if (lendiff && to < display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers > from)) { + display.updateLineNumbers = from; + } + cm.curOp.viewChanged = true; + if (from >= display.viewTo) { + // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) { + resetView(cm); + } + } else if (to <= display.viewFrom) { + // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } + } else if (from <= display.viewFrom && to >= display.viewTo) { + // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { + // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } + } else if (to >= display.viewTo) { + // Bottom overlap + var cut$1 = viewCuttingPoint(cm, from, from, -1); + if (cut$1) { + display.view = display.view.slice(0, cut$1.index); + display.viewTo = cut$1.lineN; + } else { + resetView(cm); + } + } else { + // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index).concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)).concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } + } + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) { + ext.lineN += lendiff; + } else if (from < ext.lineN + ext.size) { + display.externalMeasured = null; + } + } + } + + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, + ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) { + display.externalMeasured = null; + } + if (line < display.viewFrom || line >= display.viewTo) { + return; + } + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) { + return; + } + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) { + arr.push(type); + } + } + + // Clear the view. + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; + } + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), + diff, + view = cm.display.view; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) { + return { + index: index, + lineN: newN + }; + } + var n = cm.display.viewFrom; + for (var i = 0; i < index; i++) { + n += view[i].size; + } + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) { + return null; + } + diff = n + view[index].size - oldN; + index++; + } else { + diff = n - oldN; + } + oldN += diff; + newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) { + return null; + } + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return { + index: index, + lineN: newN + }; + } + + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. + function adjustView(cm, from, to) { + var display = cm.display, + view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) { + display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); + } else if (display.viewFrom < from) { + display.view = display.view.slice(findViewIndex(cm, from)); + } + display.viewFrom = from; + if (display.viewTo < to) { + display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); + } else if (display.viewTo > to) { + display.view = display.view.slice(0, findViewIndex(cm, to)); + } + } + display.viewTo = to; + } + + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, + dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) { + ++dirty; + } + } + return dirty; + } + + // HIGHLIGHT WORKER + + function startWorker(cm, time) { + if (cm.doc.highlightFrontier < cm.display.viewTo) { + cm.state.highlight.set(time, bind(highlightWorker, cm)); + } + } + function highlightWorker(cm) { + var doc = cm.doc; + if (doc.highlightFrontier >= cm.display.viewTo) { + return; + } + var end = +new Date() + cm.options.workTime; + var context = getContextBefore(cm, doc.highlightFrontier); + var changedLines = []; + doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { + if (context.line >= cm.display.viewFrom) { + // Visible + var oldStyles = line.styles; + var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null; + var highlighted = highlightLine(cm, line, context, true); + if (resetState) { + context.state = resetState; + } + line.styles = highlighted.styles; + var oldCls = line.styleClasses, + newCls = highlighted.classes; + if (newCls) { + line.styleClasses = newCls; + } else if (oldCls) { + line.styleClasses = null; + } + var ischange = !oldStyles || oldStyles.length != line.styles.length || oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); + for (var i = 0; !ischange && i < oldStyles.length; ++i) { + ischange = oldStyles[i] != line.styles[i]; + } + if (ischange) { + changedLines.push(context.line); + } + line.stateAfter = context.save(); + context.nextLine(); + } else { + if (line.text.length <= cm.options.maxHighlightLength) { + processLine(cm, line.text, context); + } + line.stateAfter = context.line % 5 == 0 ? context.save() : null; + context.nextLine(); + } + if (+new Date() > end) { + startWorker(cm, cm.options.workDelay); + return true; + } + }); + doc.highlightFrontier = context.line; + doc.modeFrontier = Math.max(doc.modeFrontier, context.line); + if (changedLines.length) { + runInOp(cm, function () { + for (var i = 0; i < changedLines.length; i++) { + regLineChange(cm, changedLines[i], "text"); + } + }); + } + } + + // DISPLAY DRAWING + + var DisplayUpdate = function (cm, viewport, force) { + var display = cm.display; + this.viewport = viewport; + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.wrapperWidth = display.wrapper.clientWidth; + this.oldDisplayWidth = displayWidth(cm); + this.force = force; + this.dims = getDimensions(cm); + this.events = []; + }; + DisplayUpdate.prototype.signal = function (emitter, type) { + if (hasHandler(emitter, type)) { + this.events.push(arguments); + } + }; + DisplayUpdate.prototype.finish = function () { + var this$1 = this; + for (var i = 0; i < this.events.length; i++) { + signal.apply(null, this$1.events[i]); + } + }; + function maybeClipScrollbars(cm) { + var display = cm.display; + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; + display.heightForcer.style.height = scrollGap(cm) + "px"; + display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; + display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; + display.scrollbarsClipped = true; + } + } + function selectionSnapshot(cm) { + if (cm.hasFocus()) { + return null; + } + var active = activeElt(); + if (!active || !contains(cm.display.lineDiv, active)) { + return null; + } + var result = { + activeElt: active + }; + if (window.getSelection) { + var sel = window.getSelection(); + if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { + result.anchorNode = sel.anchorNode; + result.anchorOffset = sel.anchorOffset; + result.focusNode = sel.focusNode; + result.focusOffset = sel.focusOffset; + } + } + return result; + } + function restoreSelection(snapshot) { + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { + return; + } + snapshot.activeElt.focus(); + if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { + var sel = window.getSelection(), + range = document.createRange(); + range.setEnd(snapshot.anchorNode, snapshot.anchorOffset); + range.collapse(false); + sel.removeAllRanges(); + sel.addRange(range); + sel.extend(snapshot.focusNode, snapshot.focusOffset); + } + } + + // Does the actual updating of the line display. Bails out + // (returning false) when there is nothing to be done and forced is + // false. + function updateDisplayIfNeeded(cm, update) { + var display = cm.display, + doc = cm.doc; + if (update.editorIsHidden) { + resetView(cm); + return false; + } + + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && display.renderedView == display.view && countDirtyView(cm) == 0) { + return false; + } + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm); + update.dims = getDimensions(cm); + } + + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size; + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); + if (display.viewFrom < from && from - display.viewFrom < 20) { + from = Math.max(doc.first, display.viewFrom); + } + if (display.viewTo > to && display.viewTo - to < 20) { + to = Math.min(end, display.viewTo); + } + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); + } + var different = from != display.viewFrom || to != display.viewTo || display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; + adjustView(cm, from, to); + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px"; + var toUpdate = countDirtyView(cm); + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) { + return false; + } + + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var selSnapshot = selectionSnapshot(cm); + if (toUpdate > 4) { + display.lineDiv.style.display = "none"; + } + patchDisplay(cm, display.updateLineNumbers, update.dims); + if (toUpdate > 4) { + display.lineDiv.style.display = ""; + } + display.renderedView = display.view; + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + restoreSelection(selSnapshot); + + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); + display.gutters.style.height = display.sizer.style.minHeight = 0; + if (different) { + display.lastWrapHeight = update.wrapperHeight; + display.lastWrapWidth = update.wrapperWidth; + startWorker(cm, 400); + } + display.updateLineNumbers = null; + return true; + } + function postUpdateDisplay(cm, update) { + var viewport = update.viewport; + for (var first = true;; first = false) { + if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) { + viewport = { + top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top) + }; + } + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport); + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) { + break; + } + } + if (!updateDisplayIfNeeded(cm, update)) { + break; + } + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.force = false; + } + update.signal(cm, "update", cm); + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + cm.display.reportedViewFrom = cm.display.viewFrom; + cm.display.reportedViewTo = cm.display.viewTo; + } + } + function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport); + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.finish(); + } + } + + // Sync the actual display DOM structure with display.view, removing + // nodes for lines that are no longer in view, and creating the ones + // that are not there yet, and updating the ones that are out of + // date. + function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, + lineNumbers = cm.options.lineNumbers; + var container = display.lineDiv, + cur = container.firstChild; + function rm(node) { + var next = node.nextSibling; + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) { + node.style.display = "none"; + } else { + node.parentNode.removeChild(node); + } + return next; + } + var view = display.view, + lineN = display.viewFrom; + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { + // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); + } else { + // Already drawn + while (cur != lineView.node) { + cur = rm(cur); + } + var updateNumber = lineNumbers && updateNumbersFrom != null && updateNumbersFrom <= lineN && lineView.lineNumber; + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) { + updateNumber = false; + } + updateLineForChanges(cm, lineView, lineN, dims); + } + if (updateNumber) { + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); + } + cur = lineView.node.nextSibling; + } + lineN += lineView.size; + } + while (cur) { + cur = rm(cur); + } + } + function updateGutterSpace(cm) { + var width = cm.display.gutters.offsetWidth; + cm.display.sizer.style.marginLeft = width + "px"; + } + function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px"; + cm.display.heightForcer.style.top = measure.docHeight + "px"; + cm.display.gutters.style.height = measure.docHeight + cm.display.barHeight + scrollGap(cm) + "px"; + } + + // Rebuild the gutter elements, ensure the margin to the left of the + // code matches their width. + function updateGutters(cm) { + var gutters = cm.display.gutters, + specs = cm.options.gutters; + removeChildren(gutters); + var i = 0; + for (; i < specs.length; ++i) { + var gutterClass = specs[i]; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); + if (gutterClass == "CodeMirror-linenumbers") { + cm.display.lineGutter = gElt; + gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = i ? "" : "none"; + updateGutterSpace(cm); + } + + // Make sure the gutters options contains the element + // "CodeMirror-linenumbers" when the lineNumbers option is true. + function setGuttersForLineNumbers(options) { + var found = indexOf(options.gutters, "CodeMirror-linenumbers"); + if (found == -1 && options.lineNumbers) { + options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); + } else if (found > -1 && !options.lineNumbers) { + options.gutters = options.gutters.slice(0); + options.gutters.splice(found, 1); + } + } + var wheelSamples = 0; + var wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) { + wheelPixelsPerUnit = -.53; + } else if (gecko) { + wheelPixelsPerUnit = 15; + } else if (chrome) { + wheelPixelsPerUnit = -.7; + } else if (safari) { + wheelPixelsPerUnit = -1 / 3; + } + function wheelEventDelta(e) { + var dx = e.wheelDeltaX, + dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { + dx = e.detail; + } + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { + dy = e.detail; + } else if (dy == null) { + dy = e.wheelDelta; + } + return { + x: dx, + y: dy + }; + } + function wheelEventPixels(e) { + var delta = wheelEventDelta(e); + delta.x *= wheelPixelsPerUnit; + delta.y *= wheelPixelsPerUnit; + return delta; + } + function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), + dx = delta.x, + dy = delta.y; + var display = cm.display, + scroll = display.scroller; + // Quit if there's nothing to scroll here + var canScrollX = scroll.scrollWidth > scroll.clientWidth; + var canScrollY = scroll.scrollHeight > scroll.clientHeight; + if (!(dx && canScrollX || dy && canScrollY)) { + return; + } + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer; + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy && canScrollY) { + updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); + } + setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit)); + // Only prevent default scrolling if vertical scrolling is + // actually possible. Otherwise, it causes vertical scroll + // jitter on OSX trackpads when deltaX is small and deltaY + // is large (issue #3579) + if (!dy || dy && canScrollY) { + e_preventDefault(e); + } + display.wheelStartX = null; // Abort measurement, if in progress + return; + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.doc.scrollTop, + bot = top + display.wrapper.clientHeight; + if (pixels < 0) { + top = Math.max(0, top + pixels - 50); + } else { + bot = Math.min(cm.doc.height, bot + pixels + 50); + } + updateDisplaySimple(cm, { + top: top, + bottom: bot + }); + } + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; + display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; + display.wheelDY = dy; + setTimeout(function () { + if (display.wheelStartX == null) { + return; + } + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = movedY && display.wheelDY && movedY / display.wheelDY || movedX && display.wheelDX && movedX / display.wheelDX; + display.wheelStartX = display.wheelStartY = null; + if (!sample) { + return; + } + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; + display.wheelDY += dy; + } + } + } + + // Selection objects are immutable. A new one is created every time + // the selection changes. A selection is one or more non-overlapping + // (and non-touching) ranges, sorted, and an integer that indicates + // which one is the primary selection (the one that's scrolled into + // view, that getCursor returns, etc). + var Selection = function (ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; + }; + Selection.prototype.primary = function () { + return this.ranges[this.primIndex]; + }; + Selection.prototype.equals = function (other) { + var this$1 = this; + if (other == this) { + return true; + } + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { + return false; + } + for (var i = 0; i < this.ranges.length; i++) { + var here = this$1.ranges[i], + there = other.ranges[i]; + if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { + return false; + } + } + return true; + }; + Selection.prototype.deepCopy = function () { + var this$1 = this; + var out = []; + for (var i = 0; i < this.ranges.length; i++) { + out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); + } + return new Selection(out, this.primIndex); + }; + Selection.prototype.somethingSelected = function () { + var this$1 = this; + for (var i = 0; i < this.ranges.length; i++) { + if (!this$1.ranges[i].empty()) { + return true; + } + } + return false; + }; + Selection.prototype.contains = function (pos, end) { + var this$1 = this; + if (!end) { + end = pos; + } + for (var i = 0; i < this.ranges.length; i++) { + var range = this$1.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) { + return i; + } + } + return -1; + }; + var Range = function (anchor, head) { + this.anchor = anchor; + this.head = head; + }; + Range.prototype.from = function () { + return minPos(this.anchor, this.head); + }; + Range.prototype.to = function () { + return maxPos(this.anchor, this.head); + }; + Range.prototype.empty = function () { + return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; + }; + + // Take an unsorted, potentially overlapping set of ranges, and + // build a selection out of it. 'Consumes' ranges array (modifying + // it). + function normalizeSelection(ranges, primIndex) { + var prim = ranges[primIndex]; + ranges.sort(function (a, b) { + return cmp(a.from(), b.from()); + }); + primIndex = indexOf(ranges, prim); + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], + prev = ranges[i - 1]; + if (cmp(prev.to(), cur.from()) >= 0) { + var from = minPos(prev.from(), cur.from()), + to = maxPos(prev.to(), cur.to()); + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; + if (i <= primIndex) { + --primIndex; + } + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); + } + } + return new Selection(ranges, primIndex); + } + function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0); + } + + // Compute the position of the end of a change (its 'to' property + // refers to the pre-change end). + function changeEnd(change) { + if (!change.text) { + return change.to; + } + return Pos(change.from.line + change.text.length - 1, lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); + } + + // Adjust a position to refer to the post-change position of the + // same text, or the end of the change if the change covers it. + function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) { + return pos; + } + if (cmp(pos, change.to) <= 0) { + return changeEnd(change); + } + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, + ch = pos.ch; + if (pos.line == change.to.line) { + ch += changeEnd(change).ch - change.to.ch; + } + return Pos(line, ch); + } + function computeSelAfterChange(doc, change) { + var out = []; + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + out.push(new Range(adjustForChange(range.anchor, change), adjustForChange(range.head, change))); + } + return normalizeSelection(out, doc.sel.primIndex); + } + function offsetPos(pos, old, nw) { + if (pos.line == old.line) { + return Pos(nw.line, pos.ch - old.ch + nw.ch); + } else { + return Pos(nw.line + (pos.line - old.line), pos.ch); + } + } + + // Used by replaceSelections to allow moving the selection to the + // start or around the replaced test. Hint may be "start" or "around". + function computeReplacedSel(doc, changes, hint) { + var out = []; + var oldPrev = Pos(doc.first, 0), + newPrev = oldPrev; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; + if (hint == "around") { + var range = doc.sel.ranges[i], + inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); + } else { + out[i] = new Range(from, from); + } + } + return new Selection(out, doc.sel.primIndex); + } + + // Used to get the editor into a consistent state again when options change. + + function loadMode(cm) { + cm.doc.mode = getMode(cm.options, cm.doc.modeOption); + resetModeState(cm); + } + function resetModeState(cm) { + cm.doc.iter(function (line) { + if (line.stateAfter) { + line.stateAfter = null; + } + if (line.styles) { + line.styles = null; + } + }); + cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) { + regChange(cm); + } + } + + // DOCUMENT DATA STRUCTURE + + // By default, updates that start and end at the beginning of a line + // are treated specially, in order to make the association of line + // widgets and marker elements with the text behave more intuitive. + function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && (!doc.cm || doc.cm.options.wholeLineUpdateBefore); + } + + // Perform a change on the document data structure. + function updateDoc(doc, change, markedSpans, estimateHeight) { + function spansFor(n) { + return markedSpans ? markedSpans[n] : null; + } + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight); + signalLater(line, "change", line, change); + } + function linesFor(start, end) { + var result = []; + for (var i = start; i < end; ++i) { + result.push(new Line(text[i], spansFor(i), estimateHeight)); + } + return result; + } + var from = change.from, + to = change.to, + text = change.text; + var firstLine = getLine(doc, from.line), + lastLine = getLine(doc, to.line); + var lastText = lst(text), + lastSpans = spansFor(text.length - 1), + nlines = to.line - from.line; + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)); + doc.remove(text.length, doc.size - text.length); + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1); + update(lastLine, lastLine.text, lastSpans); + if (nlines) { + doc.remove(from.line, nlines); + } + if (added.length) { + doc.insert(from.line, added); + } + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + } else { + var added$1 = linesFor(1, text.length - 1); + added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added$1); + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + var added$2 = linesFor(1, text.length - 1); + if (nlines > 1) { + doc.remove(from.line + 1, nlines - 1); + } + doc.insert(from.line + 1, added$2); + } + signalLater(doc, "change", doc, change); + } + + // Call f for all linked documents. + function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) { + for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i]; + if (rel.doc == skip) { + continue; + } + var shared = sharedHist && rel.sharedHist; + if (sharedHistOnly && !shared) { + continue; + } + f(rel.doc, shared); + propagate(rel.doc, doc, shared); + } + } + } + propagate(doc, null, true); + } + + // Attach a document to an editor. + function attachDoc(cm, doc) { + if (doc.cm) { + throw new Error("This document is already in use."); + } + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + setDirectionClass(cm); + if (!cm.options.lineWrapping) { + findMaxLine(cm); + } + cm.options.mode = doc.modeOption; + regChange(cm); + } + function setDirectionClass(cm) { + (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl"); + } + function directionChanged(cm) { + runInOp(cm, function () { + setDirectionClass(cm); + regChange(cm); + }); + } + function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; + this.undone = []; + this.undoDepth = Infinity; + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0; + this.lastOp = this.lastSelOp = null; + this.lastOrigin = this.lastSelOrigin = null; + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1; + } + + // Create a history change event from an updateDoc-style change + // object. + function historyChangeFromChange(doc, change) { + var histChange = { + from: copyPos(change.from), + to: changeEnd(change), + text: getBetween(doc, change.from, change.to) + }; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function (doc) { + return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + }, true); + return histChange; + } + + // Pop all selection events off the end of a history array. Stop at + // a change event. + function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array); + if (last.ranges) { + array.pop(); + } else { + break; + } + } + } + + // Find the top change event in the history. Pop off selection + // events that are in the way. + function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done); + return lst(hist.done); + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done); + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop(); + return lst(hist.done); + } + } + + // Register a change in the history. Merges changes that are within + // a single operation, or are close together with an origin that + // allows merging (starting with "+") into a single event. + function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date(), + cur; + var last; + if ((hist.lastOp == opId || hist.lastOrigin == change.origin && change.origin && (change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay || change.origin.charAt(0) == "*")) && (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + last = lst(cur.changes); + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change); + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)); + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done); + if (!before || !before.ranges) { + pushSelectionToHistory(doc.sel, hist.done); + } + cur = { + changes: [historyChangeFromChange(doc, change)], + generation: hist.generation + }; + hist.done.push(cur); + while (hist.done.length > hist.undoDepth) { + hist.done.shift(); + if (!hist.done[0].ranges) { + hist.done.shift(); + } + } + } + hist.done.push(selAfter); + hist.generation = ++hist.maxGeneration; + hist.lastModTime = hist.lastSelTime = time; + hist.lastOp = hist.lastSelOp = opId; + hist.lastOrigin = hist.lastSelOrigin = change.origin; + if (!last) { + signal(doc, "historyAdded"); + } + } + function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0); + return ch == "*" || ch == "+" && prev.ranges.length == sel.ranges.length && prev.somethingSelected() == sel.somethingSelected() && new Date() - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); + } + + // Called whenever the selection changes, sets the new selection as + // the pending selection in the history, and pushes the old pending + // selection into the 'done' array when it was significantly + // different (in number of selected ranges, emptiness, or time). + function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, + origin = options && options.origin; + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || origin && hist.lastSelOrigin == origin && (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))) { + hist.done[hist.done.length - 1] = sel; + } else { + pushSelectionToHistory(sel, hist.done); + } + hist.lastSelTime = +new Date(); + hist.lastSelOrigin = origin; + hist.lastSelOp = opId; + if (options && options.clearRedo !== false) { + clearSelectionEvents(hist.undone); + } + } + function pushSelectionToHistory(sel, dest) { + var top = lst(dest); + if (!(top && top.ranges && top.equals(sel))) { + dest.push(sel); + } + } + + // Used to store marked span information in the history. + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], + n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { + if (line.markedSpans) { + (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; + } + ++n; + }); + } + + // When un/re-doing restores text containing marked spans, those + // that have been explicitly cleared should not be restored. + function removeClearedSpans(spans) { + if (!spans) { + return null; + } + var out; + for (var i = 0; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { + if (!out) { + out = spans.slice(0, i); + } + } else if (out) { + out.push(spans[i]); + } + } + return !out ? spans : out.length ? out : null; + } + + // Retrieve and filter the old marked spans stored in a change event. + function getOldSpans(doc, change) { + var found = change["spans_" + doc.id]; + if (!found) { + return null; + } + var nw = []; + for (var i = 0; i < change.text.length; ++i) { + nw.push(removeClearedSpans(found[i])); + } + return nw; + } + + // Used for un/re-doing changes from the history. Combines the + // result of computing the existing spans with the set of spans that + // existed in the history (so that deleting around a span and then + // undoing brings back the span). + function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); + if (!old) { + return stretched; + } + if (!stretched) { + return old; + } + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], + stretchCur = stretched[i]; + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j]; + for (var k = 0; k < oldCur.length; ++k) { + if (oldCur[k].marker == span.marker) { + continue spans; + } + } + oldCur.push(span); + } + } else if (stretchCur) { + old[i] = stretchCur; + } + } + return old; + } + + // Used both to provide a JSON-safe object in .getHistory, and, when + // detaching a document, to split the history in two + function copyHistoryArray(events, newGroup, instantiateSel) { + var copy = []; + for (var i = 0; i < events.length; ++i) { + var event = events[i]; + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); + continue; + } + var changes = event.changes, + newChanges = []; + copy.push({ + changes: newChanges + }); + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], + m = void 0; + newChanges.push({ + from: change.from, + to: change.to, + text: change.text + }); + if (newGroup) { + for (var prop in change) { + if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop]; + delete change[prop]; + } + } + } + } + } + } + return copy; + } + + // The 'scroll' parameter given to many of these indicated whether + // the new cursor position should be scrolled into view after + // modifying the selection. + + // If shift is held or the extend flag is set, extends a range to + // include a given position (and optionally a second position). + // Otherwise, simply returns the range between the given positions. + // Used for cursor motion and such. + function extendRange(range, head, other, extend) { + if (extend) { + var anchor = range.anchor; + if (other) { + var posBefore = cmp(head, anchor) < 0; + if (posBefore != cmp(other, anchor) < 0) { + anchor = head; + head = other; + } else if (posBefore != cmp(head, other) < 0) { + head = other; + } + } + return new Range(anchor, head); + } else { + return new Range(other || head, head); + } + } + + // Extend the primary selection range, discard the rest. + function extendSelection(doc, head, other, options, extend) { + if (extend == null) { + extend = doc.cm && (doc.cm.display.shift || doc.extend); + } + setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options); + } + + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, options) { + var out = []; + var extend = doc.cm && (doc.cm.display.shift || doc.extend); + for (var i = 0; i < doc.sel.ranges.length; i++) { + out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); + } + var newSel = normalizeSelection(out, doc.sel.primIndex); + setSelection(doc, newSel, options); + } + + // Updates a single range in the selection. + function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); + } + + // Reset the selection to a single range. + function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options); + } + + // Give beforeSelectionChange handlers a change to influence a + // selection update. + function filterSelectionChange(doc, sel, options) { + var obj = { + ranges: sel.ranges, + update: function (ranges) { + var this$1 = this; + this.ranges = []; + for (var i = 0; i < ranges.length; i++) { + this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), clipPos(doc, ranges[i].head)); + } + }, + origin: options && options.origin + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) { + signal(doc.cm, "beforeSelectionChange", doc.cm, obj); + } + if (obj.ranges != sel.ranges) { + return normalizeSelection(obj.ranges, obj.ranges.length - 1); + } else { + return sel; + } + } + function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, + last = lst(done); + if (last && last.ranges) { + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); + } else { + setSelection(doc, sel, options); + } + } + + // Set a new selection. + function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); + } + function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) { + sel = filterSelectionChange(doc, sel, options); + } + var bias = options && options.bias || (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); + if (!(options && options.scroll === false) && doc.cm) { + ensureCursorVisible(doc.cm); + } + } + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) { + return; + } + doc.sel = sel; + if (doc.cm) { + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); + } + signalLater(doc, "cursorActivity", doc); + } + + // Verify that the selection does not partially select any atomic + // marked ranges. + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)); + } + + // Return a selection that does not partially select any atomic + // ranges. + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) { + out = sel.ranges.slice(0, i); + } + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(out, sel.primIndex) : sel; + } + function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { + var line = getLine(doc, pos.line); + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], + m = sp.marker; + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) { + break; + } else { + --i; + continue; + } + } + } + if (!m.atomic) { + continue; + } + if (oldPos) { + var near = m.find(dir < 0 ? 1 : -1), + diff = void 0; + if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) { + near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); + } + if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) { + return skipAtomicInner(doc, near, pos, dir, mayClear); + } + } + var far = m.find(dir < 0 ? -1 : 1); + if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) { + far = movePos(doc, far, dir, far.line == pos.line ? line : null); + } + return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null; + } + } + } + return pos; + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, oldPos, bias, mayClear) { + var dir = bias || 1; + var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || !mayClear && skipAtomicInner(doc, pos, oldPos, dir, true) || skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || !mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true); + if (!found) { + doc.cantEdit = true; + return Pos(doc.first, 0); + } + return found; + } + function movePos(doc, pos, dir, line) { + if (dir < 0 && pos.ch == 0) { + if (pos.line > doc.first) { + return clipPos(doc, Pos(pos.line - 1)); + } else { + return null; + } + } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { + if (pos.line < doc.first + doc.size - 1) { + return Pos(pos.line + 1, 0); + } else { + return null; + } + } else { + return new Pos(pos.line, pos.ch + dir); + } + } + function selectAll(cm) { + cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll); + } + + // UPDATING + + // Allow "beforeChange" event handlers to influence a change + function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function () { + return obj.canceled = true; + } + }; + if (update) { + obj.update = function (from, to, text, origin) { + if (from) { + obj.from = clipPos(doc, from); + } + if (to) { + obj.to = clipPos(doc, to); + } + if (text) { + obj.text = text; + } + if (origin !== undefined) { + obj.origin = origin; + } + }; + } + signal(doc, "beforeChange", doc, obj); + if (doc.cm) { + signal(doc.cm, "beforeChange", doc.cm, obj); + } + if (obj.canceled) { + return null; + } + return { + from: obj.from, + to: obj.to, + text: obj.text, + origin: obj.origin + }; + } + + // Apply a change to a document, and add it to the document's + // history, and propagating it to all linked documents. + function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) { + return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); + } + if (doc.cm.state.suppressEdits) { + return; + } + } + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true); + if (!change) { + return; + } + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); + if (split) { + for (var i = split.length - 1; i >= 0; --i) { + makeChangeInner(doc, { + from: split[i].from, + to: split[i].to, + text: i ? [""] : change.text + }); + } + } else { + makeChangeInner(doc, change); + } + } + function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { + return; + } + var selAfter = computeSelAfterChange(doc, change); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); + } + + // Revert a change stored in a document's history. + function makeChangeFromHistory(doc, type, allowSelectionOnly) { + if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { + return; + } + var hist = doc.history, + event, + selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, + dest = type == "undo" ? hist.undone : hist.done; + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + var i = 0; + for (; i < source.length; i++) { + event = source[i]; + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) { + break; + } + } + if (i == source.length) { + return; + } + hist.lastOrigin = hist.lastSelOrigin = null; + for (;;) { + event = source.pop(); + if (event.ranges) { + pushSelectionToHistory(event, dest); + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, { + clearRedo: false + }); + return; + } + selAfter = event; + } else { + break; + } + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({ + changes: antiChanges, + generation: hist.generation + }); + hist.generation = event.generation || ++hist.maxGeneration; + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); + var loop = function (i) { + var change = event.changes[i]; + change.origin = type; + if (filter && !filterChange(doc, change, false)) { + source.length = 0; + return {}; + } + antiChanges.push(historyChangeFromChange(doc, change)); + var after = i ? computeSelAfterChange(doc, change) : lst(source); + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (!i && doc.cm) { + doc.cm.scrollIntoView({ + from: change.from, + to: changeEnd(change) + }); + } + var rebased = []; + + // Propagate to the linked documents + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); + }; + for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { + var returned = loop(i$1); + if (returned) return returned.v; + } + } + + // Sub-views need their line numbers shifted when text is added + // above or below them in the parent document. + function shiftDoc(doc, distance) { + if (distance == 0) { + return; + } + doc.first += distance; + doc.sel = new Selection(map(doc.sel.ranges, function (range) { + return new Range(Pos(range.anchor.line + distance, range.anchor.ch), Pos(range.head.line + distance, range.head.ch)); + }), doc.sel.primIndex); + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance); + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) { + regLineChange(doc.cm, l, "gutter"); + } + } + } + + // More lower-level change function, handling only a single document + // (not linked ones). + function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) { + return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); + } + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); + return; + } + if (change.from.line > doc.lastLine()) { + return; + } + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); + change = { + from: Pos(doc.first, 0), + to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], + origin: change.origin + }; + } + var last = doc.lastLine(); + if (change.to.line > last) { + change = { + from: change.from, + to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], + origin: change.origin + }; + } + change.removed = getBetween(doc, change.from, change.to); + if (!selAfter) { + selAfter = computeSelAfterChange(doc, change); + } + if (doc.cm) { + makeChangeSingleDocInEditor(doc.cm, change, spans); + } else { + updateDoc(doc, change, spans); + } + setSelectionNoUndo(doc, selAfter, sel_dontScroll); + } + + // Handle the interaction of a change to a document with the editor + // that this document is part of. + function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, + display = cm.display, + from = change.from, + to = change.to; + var recomputeMaxLength = false, + checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function (line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true; + } + }); + } + if (doc.sel.contains(change.from, change.to) > -1) { + signalCursorActivity(cm); + } + updateDoc(doc, change, spans, estimateHeight(cm)); + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function (line) { + var len = lineLength(line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) { + cm.curOp.updateMaxLine = true; + } + } + retreatFrontier(doc, from.line); + startWorker(cm, 400); + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + if (change.full) { + regChange(cm); + } else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) { + regLineChange(cm, from.line, "text"); + } else { + regChange(cm, from.line, to.line + 1, lendiff); + } + var changesHandler = hasHandler(cm, "changes"), + changeHandler = hasHandler(cm, "change"); + if (changeHandler || changesHandler) { + var obj = { + from: from, + to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }; + if (changeHandler) { + signalLater(cm, "change", cm, obj); + } + if (changesHandler) { + (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); + } + } + cm.display.selForContextMenu = null; + } + function replaceRange(doc, code, from, to, origin) { + if (!to) { + to = from; + } + if (cmp(to, from) < 0) { + var tmp = to; + to = from; + from = tmp; + } + if (typeof code == "string") { + code = doc.splitLines(code); + } + makeChange(doc, { + from: from, + to: to, + text: code, + origin: origin + }); + } + + // Rebasing/resetting history to deal with externally-sourced changes + + function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff; + } else if (from < pos.line) { + pos.line = from; + pos.ch = 0; + } + } + + // Tries to rebase an array of history events given a change in the + // document. If the change touches the same lines as the event, the + // event, and everything 'behind' it, is discarded. If the change is + // before the event, the event's positions are updated. Uses a + // copy-on-write scheme for the positions, to avoid having to + // reallocate them all on every rebase, but also avoid problems with + // shared position objects being unsafely updated. + function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], + ok = true; + if (sub.ranges) { + if (!sub.copied) { + sub = array[i] = sub.deepCopy(); + sub.copied = true; + } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); + } + continue; + } + for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { + var cur = sub.changes[j$1]; + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); + } else if (from <= cur.to.line) { + ok = false; + break; + } + } + if (!ok) { + array.splice(0, i + 1); + i = 0; + } + } + } + function rebaseHist(hist, change) { + var from = change.from.line, + to = change.to.line, + diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); + } + + // Utility for applying a change to a line by handle or number, + // returning the number and optionally registering the line as + // changed. + function changeLine(doc, handle, changeType, op) { + var no = handle, + line = handle; + if (typeof handle == "number") { + line = getLine(doc, clipLine(doc, handle)); + } else { + no = lineNo(handle); + } + if (no == null) { + return null; + } + if (op(line, no) && doc.cm) { + regLineChange(doc.cm, no, changeType); + } + return line; + } + + // The document is represented as a BTree consisting of leaves, with + // chunk of lines in them, and branches, with up to ten leaves or + // other branch nodes below them. The top node is always a branch + // node, and is the document object itself (meaning it has + // additional methods and properties). + // + // All nodes have parent links. The tree is used both to go from + // line numbers to line objects, and to go from objects to numbers. + // It also indexes by height, and is used to convert between height + // and line object, and to find the total height of the document. + // + // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + + function LeafChunk(lines) { + var this$1 = this; + this.lines = lines; + this.parent = null; + var height = 0; + for (var i = 0; i < lines.length; ++i) { + lines[i].parent = this$1; + height += lines[i].height; + } + this.height = height; + } + LeafChunk.prototype = { + chunkSize: function chunkSize() { + return this.lines.length; + }, + // Remove the n lines at offset 'at'. + removeInner: function removeInner(at, n) { + var this$1 = this; + for (var i = at, e = at + n; i < e; ++i) { + var line = this$1.lines[i]; + this$1.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); + } + this.lines.splice(at, n); + }, + // Helper used to collapse a small branch into a single leaf. + collapse: function collapse(lines) { + lines.push.apply(lines, this.lines); + }, + // Insert the given array of lines at offset 'at', count them as + // having the given height. + insertInner: function insertInner(at, lines, height) { + var this$1 = this; + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0; i < lines.length; ++i) { + lines[i].parent = this$1; + } + }, + // Used to iterate over a part of the tree. + iterN: function iterN(at, n, op) { + var this$1 = this; + for (var e = at + n; at < e; ++at) { + if (op(this$1.lines[at])) { + return true; + } + } + } + }; + function BranchChunk(children) { + var this$1 = this; + this.children = children; + var size = 0, + height = 0; + for (var i = 0; i < children.length; ++i) { + var ch = children[i]; + size += ch.chunkSize(); + height += ch.height; + ch.parent = this$1; + } + this.size = size; + this.height = height; + this.parent = null; + } + BranchChunk.prototype = { + chunkSize: function chunkSize() { + return this.size; + }, + removeInner: function removeInner(at, n) { + var this$1 = this; + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], + sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), + oldHeight = child.height; + child.removeInner(at, rm); + this$1.height -= oldHeight - child.height; + if (sz == rm) { + this$1.children.splice(i--, 1); + child.parent = null; + } + if ((n -= rm) == 0) { + break; + } + at = 0; + } else { + at -= sz; + } + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + collapse: function collapse(lines) { + var this$1 = this; + for (var i = 0; i < this.children.length; ++i) { + this$1.children[i].collapse(lines); + } + }, + insertInner: function insertInner(at, lines, height) { + var this$1 = this; + this.size += lines.length; + this.height += height; + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], + sz = child.chunkSize(); + if (at <= sz) { + child.insertInner(at, lines, height); + if (child.lines && child.lines.length > 50) { + // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. + // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. + var remaining = child.lines.length % 25 + 25; + for (var pos = remaining; pos < child.lines.length;) { + var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); + child.height -= leaf.height; + this$1.children.splice(++i, 0, leaf); + leaf.parent = this$1; + } + child.lines = child.lines.slice(0, remaining); + this$1.maybeSpill(); + } + break; + } + at -= sz; + } + }, + // When a node has grown, check whether it should be split. + maybeSpill: function maybeSpill() { + if (this.children.length <= 10) { + return; + } + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { + // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10); + me.parent.maybeSpill(); + }, + iterN: function iterN(at, n, op) { + var this$1 = this; + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], + sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) { + return true; + } + if ((n -= used) == 0) { + break; + } + at = 0; + } else { + at -= sz; + } + } + } + }; + + // Line widgets are block elements displayed above or below a line. + + var LineWidget = function (doc, node, options) { + var this$1 = this; + if (options) { + for (var opt in options) { + if (options.hasOwnProperty(opt)) { + this$1[opt] = options[opt]; + } + } + } + this.doc = doc; + this.node = node; + }; + LineWidget.prototype.clear = function () { + var this$1 = this; + var cm = this.doc.cm, + ws = this.line.widgets, + line = this.line, + no = lineNo(line); + if (no == null || !ws) { + return; + } + for (var i = 0; i < ws.length; ++i) { + if (ws[i] == this$1) { + ws.splice(i--, 1); + } + } + if (!ws.length) { + line.widgets = null; + } + var height = widgetHeight(this); + updateLineHeight(line, Math.max(0, line.height - height)); + if (cm) { + runInOp(cm, function () { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + }); + signalLater(cm, "lineWidgetCleared", cm, this, no); + } + }; + LineWidget.prototype.changed = function () { + var this$1 = this; + var oldH = this.height, + cm = this.doc.cm, + line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) { + return; + } + updateLineHeight(line, line.height + diff); + if (cm) { + runInOp(cm, function () { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)); + }); + } + }; + eventMixin(LineWidget); + function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < (cm.curOp && cm.curOp.scrollTop || cm.doc.scrollTop)) { + addToScrollTop(cm, diff); + } + } + function addLineWidget(doc, handle, node, options) { + var widget = new LineWidget(doc, node, options); + var cm = doc.cm; + if (cm && widget.noHScroll) { + cm.display.alignWidgets = true; + } + changeLine(doc, handle, "widget", function (line) { + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) { + widgets.push(widget); + } else { + widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); + } + widget.line = line; + if (cm && !lineIsHidden(doc, line)) { + var aboveVisible = heightAtLine(line) < doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) { + addToScrollTop(cm, widget.height); + } + cm.curOp.forceUpdate = true; + } + return true; + }); + signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); + return widget; + } + + // TEXTMARKERS + + // Created with markText and setBookmark methods. A TextMarker is a + // handle that can be used to clear or find a marked position in the + // document. Line objects hold arrays (markedSpans) containing + // {from, to, marker} object pointing to such marker objects, and + // indicating that such a marker is present on that line. Multiple + // lines may point to the same marker when it spans across lines. + // The spans will have null for their from/to properties when the + // marker continues beyond the start/end of the line. Markers have + // links back to the lines they currently touch. + + // Collapsed markers have unique ids, in order to be able to order + // them, which is needed for uniquely determining an outer marker + // when they overlap (they may nest, but not partially overlap). + var nextMarkerId = 0; + var TextMarker = function (doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + this.id = ++nextMarkerId; + }; + + // Clear the marker. + TextMarker.prototype.clear = function () { + var this$1 = this; + if (this.explicitlyCleared) { + return; + } + var cm = this.doc.cm, + withOp = cm && !cm.curOp; + if (withOp) { + startOperation(cm); + } + if (hasHandler(this, "clear")) { + var found = this.find(); + if (found) { + signalLater(this, "clear", found.from, found.to); + } + } + var min = null, + max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this$1); + if (cm && !this$1.collapsed) { + regLineChange(cm, lineNo(line), "text"); + } else if (cm) { + if (span.to != null) { + max = lineNo(line); + } + if (span.from != null) { + min = lineNo(line); + } + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm) { + updateLineHeight(line, textHeight(cm.display)); + } + } + if (cm && this.collapsed && !cm.options.lineWrapping) { + for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { + var visual = visualLine(this$1.lines[i$1]), + len = lineLength(visual); + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; + } + } + } + if (min != null && cm && this.collapsed) { + regChange(cm, min, max + 1); + } + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false; + if (cm) { + reCheckSelection(cm.doc); + } + } + if (cm) { + signalLater(cm, "markerCleared", cm, this, min, max); + } + if (withOp) { + endOperation(cm); + } + if (this.parent) { + this.parent.clear(); + } + }; + + // Find the position of the marker in the document. Returns a {from, + // to} object by default. Side can be passed to get a specific side + // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the + // Pos objects returned contain a line object, rather than a line + // number (used to prevent looking up the same line twice). + TextMarker.prototype.find = function (side, lineObj) { + var this$1 = this; + if (side == null && this.type == "bookmark") { + side = 1; + } + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this$1); + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from); + if (side == -1) { + return from; + } + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to); + if (side == 1) { + return to; + } + } + } + return from && { + from: from, + to: to + }; + }; + + // Signals that the marker's widget changed, and surrounding layout + // should be recomputed. + TextMarker.prototype.changed = function () { + var this$1 = this; + var pos = this.find(-1, true), + widget = this, + cm = this.doc.cm; + if (!pos || !cm) { + return; + } + runInOp(cm, function () { + var line = pos.line, + lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) { + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; + } + cm.curOp.updateMaxLine = true; + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; + if (dHeight) { + updateLineHeight(line, line.height + dHeight); + } + } + signalLater(cm, "markerChanged", cm, this$1); + }); + }; + TextMarker.prototype.attachLine = function (line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) { + (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); + } + } + this.lines.push(line); + }; + TextMarker.prototype.detachLine = function (line) { + this.lines.splice(indexOf(this.lines, line), 1); + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); + } + }; + eventMixin(TextMarker); + + // Create a marker, wire it up to the right lines, and + function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) { + return markTextShared(doc, from, to, options, type); + } + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) { + return operation(doc.cm, markText)(doc, from, to, options, type); + } + var marker = new TextMarker(doc, type), + diff = cmp(from, to); + if (options) { + copyObj(options, marker, false); + } + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) { + return marker; + } + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true; + marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) { + marker.widgetNode.setAttribute("cm-ignore-events", "true"); + } + if (options.insertLeft) { + marker.widgetNode.insertLeft = true; + } + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) { + throw new Error("Inserting collapsed marker partially overlapping an existing one"); + } + seeCollapsedSpans(); + } + if (marker.addToHistory) { + addChangeToHistory(doc, { + from: from, + to: to, + origin: "markText" + }, doc.sel, NaN); + } + var curLine = from.line, + cm = doc.cm, + updateMaxLine; + doc.iter(curLine, to.line + 1, function (line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) { + updateMaxLine = true; + } + if (marker.collapsed && curLine != from.line) { + updateLineHeight(line, 0); + } + addMarkedSpan(line, new MarkedSpan(marker, curLine == from.line ? from.ch : null, curLine == to.line ? to.ch : null)); + ++curLine; + }); + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) { + doc.iter(from.line, to.line + 1, function (line) { + if (lineIsHidden(doc, line)) { + updateLineHeight(line, 0); + } + }); + } + if (marker.clearOnEnter) { + on(marker, "beforeCursorEnter", function () { + return marker.clear(); + }); + } + if (marker.readOnly) { + seeReadOnlySpans(); + if (doc.history.done.length || doc.history.undone.length) { + doc.clearHistory(); + } + } + if (marker.collapsed) { + marker.id = ++nextMarkerId; + marker.atomic = true; + } + if (cm) { + // Sync editor state + if (updateMaxLine) { + cm.curOp.updateMaxLine = true; + } + if (marker.collapsed) { + regChange(cm, from.line, to.line + 1); + } else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) { + for (var i = from.line; i <= to.line; i++) { + regLineChange(cm, i, "text"); + } + } + if (marker.atomic) { + reCheckSelection(cm.doc); + } + signalLater(cm, "markerAdded", cm, marker); + } + return marker; + } + + // SHARED TEXTMARKERS + + // A shared marker spans multiple linked documents. It is + // implemented as a meta-marker-object controlling multiple normal + // markers. + var SharedTextMarker = function (markers, primary) { + var this$1 = this; + this.markers = markers; + this.primary = primary; + for (var i = 0; i < markers.length; ++i) { + markers[i].parent = this$1; + } + }; + SharedTextMarker.prototype.clear = function () { + var this$1 = this; + if (this.explicitlyCleared) { + return; + } + this.explicitlyCleared = true; + for (var i = 0; i < this.markers.length; ++i) { + this$1.markers[i].clear(); + } + signalLater(this, "clear"); + }; + SharedTextMarker.prototype.find = function (side, lineObj) { + return this.primary.find(side, lineObj); + }; + eventMixin(SharedTextMarker); + function markTextShared(doc, from, to, options, type) { + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], + primary = markers[0]; + var widget = options.widgetNode; + linkedDocs(doc, function (doc) { + if (widget) { + options.widgetNode = widget.cloneNode(true); + } + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); + for (var i = 0; i < doc.linked.length; ++i) { + if (doc.linked[i].isParent) { + return; + } + } + primary = lst(markers); + }); + return new SharedTextMarker(markers, primary); + } + function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { + return m.parent; + }); + } + function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], + pos = marker.find(); + var mFrom = doc.clipPos(pos.from), + mTo = doc.clipPos(pos.to); + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; + } + } + } + function detachSharedMarkers(markers) { + var loop = function (i) { + var marker = markers[i], + linked = [marker.primary.doc]; + linkedDocs(marker.primary.doc, function (d) { + return linked.push(d); + }); + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j]; + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null; + marker.markers.splice(j--, 1); + } + } + }; + for (var i = 0; i < markers.length; i++) loop(i); + } + var nextDocId = 0; + var Doc = function (text, mode, firstLine, lineSep, direction) { + if (!(this instanceof Doc)) { + return new Doc(text, mode, firstLine, lineSep, direction); + } + if (firstLine == null) { + firstLine = 0; + } + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.cleanGeneration = 1; + this.modeFrontier = this.highlightFrontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = simpleSelection(start); + this.history = new History(null); + this.id = ++nextDocId; + this.modeOption = mode; + this.lineSep = lineSep; + this.direction = direction == "rtl" ? "rtl" : "ltr"; + this.extend = false; + if (typeof text == "string") { + text = this.splitLines(text); + } + updateDoc(this, { + from: start, + to: start, + text: text + }); + setSelection(this, simpleSelection(start), sel_dontScroll); + }; + Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function (from, to, op) { + if (op) { + this.iterN(from - this.first, to - from, op); + } else { + this.iterN(this.first, this.first + this.size, from); + } + }, + // Non-public interface for adding and removing lines. + insert: function (at, lines) { + var height = 0; + for (var i = 0; i < lines.length; ++i) { + height += lines[i].height; + } + this.insertInner(at - this.first, lines, height); + }, + remove: function (at, n) { + this.removeInner(at - this.first, n); + }, + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function (lineSep) { + var lines = getLines(this, this.first, this.first + this.size); + if (lineSep === false) { + return lines; + } + return lines.join(lineSep || this.lineSeparator()); + }, + setValue: docMethodOp(function (code) { + var top = Pos(this.first, 0), + last = this.first + this.size - 1; + makeChange(this, { + from: top, + to: Pos(last, getLine(this, last).text.length), + text: this.splitLines(code), + origin: "setValue", + full: true + }, true); + if (this.cm) { + scrollToCoords(this.cm, 0, 0); + } + setSelection(this, simpleSelection(top), sel_dontScroll); + }), + replaceRange: function (code, from, to, origin) { + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); + }, + getRange: function (from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); + if (lineSep === false) { + return lines; + } + return lines.join(lineSep || this.lineSeparator()); + }, + getLine: function (line) { + var l = this.getLineHandle(line); + return l && l.text; + }, + getLineHandle: function (line) { + if (isLine(this, line)) { + return getLine(this, line); + } + }, + getLineNumber: function (line) { + return lineNo(line); + }, + getLineHandleVisualStart: function (line) { + if (typeof line == "number") { + line = getLine(this, line); + } + return visualLine(line); + }, + lineCount: function () { + return this.size; + }, + firstLine: function () { + return this.first; + }, + lastLine: function () { + return this.first + this.size - 1; + }, + clipPos: function (pos) { + return clipPos(this, pos); + }, + getCursor: function (start) { + var range = this.sel.primary(), + pos; + if (start == null || start == "head") { + pos = range.head; + } else if (start == "anchor") { + pos = range.anchor; + } else if (start == "end" || start == "to" || start === false) { + pos = range.to(); + } else { + pos = range.from(); + } + return pos; + }, + listSelections: function () { + return this.sel.ranges; + }, + somethingSelected: function () { + return this.sel.somethingSelected(); + }, + setCursor: docMethodOp(function (line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); + }), + setSelection: docMethodOp(function (anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); + }), + extendSelection: docMethodOp(function (head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); + }), + extendSelections: docMethodOp(function (heads, options) { + extendSelections(this, clipPosArray(this, heads), options); + }), + extendSelectionsBy: docMethodOp(function (f, options) { + var heads = map(this.sel.ranges, f); + extendSelections(this, clipPosArray(this, heads), options); + }), + setSelections: docMethodOp(function (ranges, primary, options) { + var this$1 = this; + if (!ranges.length) { + return; + } + var out = []; + for (var i = 0; i < ranges.length; i++) { + out[i] = new Range(clipPos(this$1, ranges[i].anchor), clipPos(this$1, ranges[i].head)); + } + if (primary == null) { + primary = Math.min(ranges.length - 1, this.sel.primIndex); + } + setSelection(this, normalizeSelection(out, primary), options); + }), + addSelection: docMethodOp(function (anchor, head, options) { + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); + }), + getSelection: function (lineSep) { + var this$1 = this; + var ranges = this.sel.ranges, + lines; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; + } + if (lineSep === false) { + return lines; + } else { + return lines.join(lineSep || this.lineSeparator()); + } + }, + getSelections: function (lineSep) { + var this$1 = this; + var parts = [], + ranges = this.sel.ranges; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) { + sel = sel.join(lineSep || this$1.lineSeparator()); + } + parts[i] = sel; + } + return parts; + }, + replaceSelection: function (code, collapse, origin) { + var dup = []; + for (var i = 0; i < this.sel.ranges.length; i++) { + dup[i] = code; + } + this.replaceSelections(dup, collapse, origin || "+input"); + }, + replaceSelections: docMethodOp(function (code, collapse, origin) { + var this$1 = this; + var changes = [], + sel = this.sel; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + changes[i] = { + from: range.from(), + to: range.to(), + text: this$1.splitLines(code[i]), + origin: origin + }; + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); + for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) { + makeChange(this$1, changes[i$1]); + } + if (newSel) { + setSelectionReplaceHistory(this, newSel); + } else if (this.cm) { + ensureCursorVisible(this.cm); + } + }), + undo: docMethodOp(function () { + makeChangeFromHistory(this, "undo"); + }), + redo: docMethodOp(function () { + makeChangeFromHistory(this, "redo"); + }), + undoSelection: docMethodOp(function () { + makeChangeFromHistory(this, "undo", true); + }), + redoSelection: docMethodOp(function () { + makeChangeFromHistory(this, "redo", true); + }), + setExtending: function (val) { + this.extend = val; + }, + getExtending: function () { + return this.extend; + }, + historySize: function () { + var hist = this.history, + done = 0, + undone = 0; + for (var i = 0; i < hist.done.length; i++) { + if (!hist.done[i].ranges) { + ++done; + } + } + for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { + if (!hist.undone[i$1].ranges) { + ++undone; + } + } + return { + undo: done, + redo: undone + }; + }, + clearHistory: function () { + this.history = new History(this.history.maxGeneration); + }, + markClean: function () { + this.cleanGeneration = this.changeGeneration(true); + }, + changeGeneration: function (forceSplit) { + if (forceSplit) { + this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; + } + return this.history.generation; + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration); + }, + getHistory: function () { + return { + done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone) + }; + }, + setHistory: function (histData) { + var hist = this.history = new History(this.history.maxGeneration); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); + }, + setGutterMarker: docMethodOp(function (line, gutterID, value) { + return changeLine(this, line, "gutter", function (line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) { + line.gutterMarkers = null; + } + return true; + }); + }), + clearGutter: docMethodOp(function (gutterID) { + var this$1 = this; + this.iter(function (line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + changeLine(this$1, line, "gutter", function () { + line.gutterMarkers[gutterID] = null; + if (isEmpty(line.gutterMarkers)) { + line.gutterMarkers = null; + } + return true; + }); + } + }); + }), + lineInfo: function (line) { + var n; + if (typeof line == "number") { + if (!isLine(this, line)) { + return null; + } + n = line; + line = getLine(this, line); + if (!line) { + return null; + } + } else { + n = lineNo(line); + if (n == null) { + return null; + } + } + return { + line: n, + handle: line, + text: line.text, + gutterMarkers: line.gutterMarkers, + textClass: line.textClass, + bgClass: line.bgClass, + wrapClass: line.wrapClass, + widgets: line.widgets + }; + }, + addLineClass: docMethodOp(function (handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : where == "gutter" ? "gutterClass" : "wrapClass"; + if (!line[prop]) { + line[prop] = cls; + } else if (classTest(cls).test(line[prop])) { + return false; + } else { + line[prop] += " " + cls; + } + return true; + }); + }), + removeLineClass: docMethodOp(function (handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : where == "gutter" ? "gutterClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) { + return false; + } else if (cls == null) { + line[prop] = null; + } else { + var found = cur.match(classTest(cls)); + if (!found) { + return false; + } + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; + } + return true; + }); + }), + addLineWidget: docMethodOp(function (handle, node, options) { + return addLineWidget(this, handle, node, options); + }), + removeLineWidget: function (widget) { + widget.clear(); + }, + markText: function (from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range"); + }, + setBookmark: function (pos, options) { + var realOpts = { + replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, + shared: options && options.shared, + handleMouseEvents: options && options.handleMouseEvents + }; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark"); + }, + findMarksAt: function (pos) { + pos = clipPos(this, pos); + var markers = [], + spans = getLine(this, pos.line).markedSpans; + if (spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && (span.to == null || span.to >= pos.ch)) { + markers.push(span.marker.parent || span.marker); + } + } + } + return markers; + }, + findMarks: function (from, to, filter) { + from = clipPos(this, from); + to = clipPos(this, to); + var found = [], + lineNo = from.line; + this.iter(from.line, to.line + 1, function (line) { + var spans = line.markedSpans; + if (spans) { + for (var i = 0; i < spans.length; i++) { + var span = spans[i]; + if (!(span.to != null && lineNo == from.line && from.ch >= span.to || span.from == null && lineNo != from.line || span.from != null && lineNo == to.line && span.from >= to.ch) && (!filter || filter(span.marker))) { + found.push(span.marker.parent || span.marker); + } + } + } + ++lineNo; + }); + return found; + }, + getAllMarks: function () { + var markers = []; + this.iter(function (line) { + var sps = line.markedSpans; + if (sps) { + for (var i = 0; i < sps.length; ++i) { + if (sps[i].from != null) { + markers.push(sps[i].marker); + } + } + } + }); + return markers; + }, + posFromIndex: function (off) { + var ch, + lineNo = this.first, + sepSize = this.lineSeparator().length; + this.iter(function (line) { + var sz = line.text.length + sepSize; + if (sz > off) { + ch = off; + return true; + } + off -= sz; + ++lineNo; + }); + return clipPos(this, Pos(lineNo, ch)); + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords); + var index = coords.ch; + if (coords.line < this.first || coords.ch < 0) { + return 0; + } + var sepSize = this.lineSeparator().length; + this.iter(this.first, coords.line, function (line) { + // iter aborts when callback returns a truthy value + index += line.text.length + sepSize; + }); + return index; + }, + copy: function (copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first, this.lineSep, this.direction); + doc.scrollTop = this.scrollTop; + doc.scrollLeft = this.scrollLeft; + doc.sel = this.sel; + doc.extend = false; + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); + } + return doc; + }, + linkedDoc: function (options) { + if (!options) { + options = {}; + } + var from = this.first, + to = this.first + this.size; + if (options.from != null && options.from > from) { + from = options.from; + } + if (options.to != null && options.to < to) { + to = options.to; + } + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction); + if (options.sharedHist) { + copy.history = this.history; + } + (this.linked || (this.linked = [])).push({ + doc: copy, + sharedHist: options.sharedHist + }); + copy.linked = [{ + doc: this, + isParent: true, + sharedHist: options.sharedHist + }]; + copySharedMarkers(copy, findSharedMarkers(this)); + return copy; + }, + unlinkDoc: function (other) { + var this$1 = this; + if (other instanceof CodeMirror) { + other = other.doc; + } + if (this.linked) { + for (var i = 0; i < this.linked.length; ++i) { + var link = this$1.linked[i]; + if (link.doc != other) { + continue; + } + this$1.linked.splice(i, 1); + other.unlinkDoc(this$1); + detachSharedMarkers(findSharedMarkers(this$1)); + break; + } + } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id]; + linkedDocs(other, function (doc) { + return splitIds.push(doc.id); + }, true); + other.history = new History(null); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); + } + }, + iterLinkedDocs: function (f) { + linkedDocs(this, f); + }, + getMode: function () { + return this.mode; + }, + getEditor: function () { + return this.cm; + }, + splitLines: function (str) { + if (this.lineSep) { + return str.split(this.lineSep); + } + return splitLinesAuto(str); + }, + lineSeparator: function () { + return this.lineSep || "\n"; + }, + setDirection: docMethodOp(function (dir) { + if (dir != "rtl") { + dir = "ltr"; + } + if (dir == this.direction) { + return; + } + this.direction = dir; + this.iter(function (line) { + return line.order = null; + }); + if (this.cm) { + directionChanged(this.cm); + } + }) + }); + + // Public alias. + Doc.prototype.eachLine = Doc.prototype.iter; + + // Kludge to work around strange IE behavior where it'll sometimes + // re-fire a series of drag-related events right after the drop (#1551) + var lastDrop = 0; + function onDrop(e) { + var cm = this; + clearDragCursor(cm); + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { + return; + } + e_preventDefault(e); + if (ie) { + lastDrop = +new Date(); + } + var pos = posFromMouse(cm, e, true), + files = e.dataTransfer.files; + if (!pos || cm.isReadOnly()) { + return; + } + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, + text = Array(n), + read = 0; + var loadFile = function (file, i) { + if (cm.options.allowDropFileTypes && indexOf(cm.options.allowDropFileTypes, file.type) == -1) { + return; + } + var reader = new FileReader(); + reader.onload = operation(cm, function () { + var content = reader.result; + if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { + content = ""; + } + text[i] = content; + if (++read == n) { + pos = clipPos(cm.doc, pos); + var change = { + from: pos, + to: pos, + text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), + origin: "paste" + }; + makeChange(cm.doc, change); + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); + } + }); + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) { + loadFile(files[i], i); + } + } else { + // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e); + // Ensure the editor is re-focused + setTimeout(function () { + return cm.display.input.focus(); + }, 20); + return; + } + try { + var text$1 = e.dataTransfer.getData("Text"); + if (text$1) { + var selected; + if (cm.state.draggingText && !cm.state.draggingText.copy) { + selected = cm.listSelections(); + } + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); + if (selected) { + for (var i$1 = 0; i$1 < selected.length; ++i$1) { + replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag"); + } + } + cm.replaceSelection(text$1, "around", "paste"); + cm.display.input.focus(); + } + } catch (e) {} + } + } + function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date() - lastDrop < 100)) { + e_stop(e); + return; + } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { + return; + } + e.dataTransfer.setData("Text", cm.getSelection()); + e.dataTransfer.effectAllowed = "copyMove"; + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (presto) { + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop; + } + e.dataTransfer.setDragImage(img, 0, 0); + if (presto) { + img.parentNode.removeChild(img); + } + } + } + function onDragOver(cm, e) { + var pos = posFromMouse(cm, e); + if (!pos) { + return; + } + var frag = document.createDocumentFragment(); + drawSelectionCursor(cm, pos, frag); + if (!cm.display.dragCursor) { + cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); + cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); + } + removeChildrenAndAdd(cm.display.dragCursor, frag); + } + function clearDragCursor(cm) { + if (cm.display.dragCursor) { + cm.display.lineSpace.removeChild(cm.display.dragCursor); + cm.display.dragCursor = null; + } + } + + // These must be handled carefully, because naively registering a + // handler for each editor will cause the editors to never be + // garbage collected. + + function forEachCodeMirror(f) { + if (!document.getElementsByClassName) { + return; + } + var byClass = document.getElementsByClassName("CodeMirror"); + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror; + if (cm) { + f(cm); + } + } + } + var globalsRegistered = false; + function ensureGlobalHandlers() { + if (globalsRegistered) { + return; + } + registerGlobalHandlers(); + globalsRegistered = true; + } + function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer; + on(window, "resize", function () { + if (resizeTimer == null) { + resizeTimer = setTimeout(function () { + resizeTimer = null; + forEachCodeMirror(onResize); + }, 100); + } + }); + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function () { + return forEachCodeMirror(onBlur); + }); + } + // Called when the window resizes + function onResize(cm) { + var d = cm.display; + if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) { + return; + } + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + d.scrollbarsClipped = false; + cm.setSize(); + } + var 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" + }; + + // Number keys + for (var i = 0; i < 10; i++) { + keyNames[i + 48] = keyNames[i + 96] = String(i); + } + // Alphabetic keys + for (var i$1 = 65; i$1 <= 90; i$1++) { + keyNames[i$1] = String.fromCharCode(i$1); + } + // Function keys + for (var i$2 = 1; i$2 <= 12; i$2++) { + keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; + } + var keyMap = {}; + keyMap.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" + }; + // Note that the save and find-related commands aren't defined by + // default. User code or addons can define them. Unknown commands + // are simply ignored. + keyMap.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" + }; + // Very basic readline/emacs-style bindings, which are standard on Mac. + keyMap.emacsy = { + "Ctrl-F": "goCharRight", + "Ctrl-B": "goCharLeft", + "Ctrl-P": "goLineUp", + "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", + "Alt-B": "goWordLeft", + "Ctrl-A": "goLineStart", + "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", + "Shift-Ctrl-V": "goPageUp", + "Ctrl-D": "delCharAfter", + "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", + "Alt-Backspace": "delWordBefore", + "Ctrl-K": "killLine", + "Ctrl-T": "transposeChars", + "Ctrl-O": "openLine" + }; + keyMap.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"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + + // KEYMAP DISPATCH + + function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/); + name = parts[parts.length - 1]; + var alt, ctrl, shift, cmd; + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i]; + if (/^(cmd|meta|m)$/i.test(mod)) { + cmd = true; + } else if (/^a(lt)?$/i.test(mod)) { + alt = true; + } else if (/^(c|ctrl|control)$/i.test(mod)) { + ctrl = true; + } else if (/^s(hift)?$/i.test(mod)) { + shift = true; + } else { + throw new Error("Unrecognized modifier name: " + mod); + } + } + if (alt) { + name = "Alt-" + name; + } + if (ctrl) { + name = "Ctrl-" + name; + } + if (cmd) { + name = "Cmd-" + name; + } + if (shift) { + name = "Shift-" + name; + } + return name; + } + + // This is a kludge to keep keymaps mostly working as raw objects + // (backwards compatibility) while at the same time support features + // like normalization and multi-stroke key bindings. It compiles a + // new normalized keymap, and then updates the old object to reflect + // this. + function normalizeKeyMap(keymap) { + var copy = {}; + for (var keyname in keymap) { + if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname]; + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { + continue; + } + if (value == "...") { + delete keymap[keyname]; + continue; + } + var keys = map(keyname.split(" "), normalizeKeyName); + for (var i = 0; i < keys.length; i++) { + var val = void 0, + name = void 0; + if (i == keys.length - 1) { + name = keys.join(" "); + val = value; + } else { + name = keys.slice(0, i + 1).join(" "); + val = "..."; + } + var prev = copy[name]; + if (!prev) { + copy[name] = val; + } else if (prev != val) { + throw new Error("Inconsistent bindings for " + name); + } + } + delete keymap[keyname]; + } + } + for (var prop in copy) { + keymap[prop] = copy[prop]; + } + return keymap; + } + function lookupKey(key, map, handle, context) { + map = getKeyMap(map); + var found = map.call ? map.call(key, context) : map[key]; + if (found === false) { + return "nothing"; + } + if (found === "...") { + return "multi"; + } + if (found != null && handle(found)) { + return "handled"; + } + if (map.fallthrough) { + if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") { + return lookupKey(key, map.fallthrough, handle, context); + } + for (var i = 0; i < map.fallthrough.length; i++) { + var result = lookupKey(key, map.fallthrough[i], handle, context); + if (result) { + return result; + } + } + } + } + + // Modifier key presses don't count as 'real' key presses for the + // purpose of keymap fallthrough. + function isModifierKey(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; + } + function addModifierNames(name, event, noShift) { + var base = name; + if (event.altKey && base != "Alt") { + name = "Alt-" + name; + } + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { + name = "Ctrl-" + name; + } + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { + name = "Cmd-" + name; + } + if (!noShift && event.shiftKey && base != "Shift") { + name = "Shift-" + name; + } + return name; + } + + // Look up the name of a key as indicated by an event object. + function keyName(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) { + return false; + } + var name = keyNames[event.keyCode]; + if (name == null || event.altGraphKey) { + return false; + } + return addModifierNames(name, event, noShift); + } + function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val; + } + + // Helper for deleting text near the selection(s), used to implement + // backspace, delete, and similar functionality. + function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, + kill = []; + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]); + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop(); + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from; + break; + } + } + kill.push(toKill); + } + // Next, remove those actual ranges. + runInOp(cm, function () { + for (var i = kill.length - 1; i >= 0; i--) { + replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); + } + ensureCursorVisible(cm); + }); + } + + // Commands are parameter-less actions that can be performed on an + // editor, mostly used for keybindings. + var commands = { + selectAll: selectAll, + singleSelection: function (cm) { + return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); + }, + killLine: function (cm) { + return deleteNearSelection(cm, function (range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length; + if (range.head.ch == len && range.head.line < cm.lastLine()) { + return { + from: range.head, + to: Pos(range.head.line + 1, 0) + }; + } else { + return { + from: range.head, + to: Pos(range.head.line, len) + }; + } + } else { + return { + from: range.from(), + to: range.to() + }; + } + }); + }, + deleteLine: function (cm) { + return deleteNearSelection(cm, function (range) { + return { + from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) + }; + }); + }, + delLineLeft: function (cm) { + return deleteNearSelection(cm, function (range) { + return { + from: Pos(range.from().line, 0), + to: range.from() + }; + }); + }, + delWrappedLineLeft: function (cm) { + return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({ + left: 0, + top: top + }, "div"); + return { + from: leftPos, + to: range.from() + }; + }); + }, + delWrappedLineRight: function (cm) { + return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({ + left: cm.display.lineDiv.offsetWidth + 100, + top: top + }, "div"); + return { + from: range.from(), + to: rightPos + }; + }); + }, + undo: function (cm) { + return cm.undo(); + }, + redo: function (cm) { + return cm.redo(); + }, + undoSelection: function (cm) { + return cm.undoSelection(); + }, + redoSelection: function (cm) { + return cm.redoSelection(); + }, + goDocStart: function (cm) { + return cm.extendSelection(Pos(cm.firstLine(), 0)); + }, + goDocEnd: function (cm) { + return cm.extendSelection(Pos(cm.lastLine())); + }, + goLineStart: function (cm) { + return cm.extendSelectionsBy(function (range) { + return lineStart(cm, range.head.line); + }, { + origin: "+move", + bias: 1 + }); + }, + goLineStartSmart: function (cm) { + return cm.extendSelectionsBy(function (range) { + return lineStartSmart(cm, range.head); + }, { + origin: "+move", + bias: 1 + }); + }, + goLineEnd: function (cm) { + return cm.extendSelectionsBy(function (range) { + return lineEnd(cm, range.head.line); + }, { + origin: "+move", + bias: -1 + }); + }, + goLineRight: function (cm) { + return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + return cm.coordsChar({ + left: cm.display.lineDiv.offsetWidth + 100, + top: top + }, "div"); + }, sel_move); + }, + goLineLeft: function (cm) { + return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + return cm.coordsChar({ + left: 0, + top: top + }, "div"); + }, sel_move); + }, + goLineLeftSmart: function (cm) { + return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({ + left: 0, + top: top + }, "div"); + if (pos.ch < cm.getLine(pos.line).search(/\S/)) { + return lineStartSmart(cm, range.head); + } + return pos; + }, sel_move); + }, + goLineUp: function (cm) { + return cm.moveV(-1, "line"); + }, + goLineDown: function (cm) { + return cm.moveV(1, "line"); + }, + goPageUp: function (cm) { + return cm.moveV(-1, "page"); + }, + goPageDown: function (cm) { + return cm.moveV(1, "page"); + }, + goCharLeft: function (cm) { + return cm.moveH(-1, "char"); + }, + goCharRight: function (cm) { + return cm.moveH(1, "char"); + }, + goColumnLeft: function (cm) { + return cm.moveH(-1, "column"); + }, + goColumnRight: function (cm) { + return cm.moveH(1, "column"); + }, + goWordLeft: function (cm) { + return cm.moveH(-1, "word"); + }, + goGroupRight: function (cm) { + return cm.moveH(1, "group"); + }, + goGroupLeft: function (cm) { + return cm.moveH(-1, "group"); + }, + goWordRight: function (cm) { + return cm.moveH(1, "word"); + }, + delCharBefore: function (cm) { + return cm.deleteH(-1, "char"); + }, + delCharAfter: function (cm) { + return cm.deleteH(1, "char"); + }, + delWordBefore: function (cm) { + return cm.deleteH(-1, "word"); + }, + delWordAfter: function (cm) { + return cm.deleteH(1, "word"); + }, + delGroupBefore: function (cm) { + return cm.deleteH(-1, "group"); + }, + delGroupAfter: function (cm) { + return cm.deleteH(1, "group"); + }, + indentAuto: function (cm) { + return cm.indentSelection("smart"); + }, + indentMore: function (cm) { + return cm.indentSelection("add"); + }, + indentLess: function (cm) { + return cm.indentSelection("subtract"); + }, + insertTab: function (cm) { + return cm.replaceSelection("\t"); + }, + insertSoftTab: function (cm) { + var spaces = [], + ranges = cm.listSelections(), + tabSize = cm.options.tabSize; + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(spaceStr(tabSize - col % tabSize)); + } + cm.replaceSelections(spaces); + }, + defaultTab: function (cm) { + if (cm.somethingSelected()) { + cm.indentSelection("add"); + } else { + cm.execCommand("insertTab"); + } + }, + // Swap the two chars left and right of each selection's head. + // Move cursor behind the two swapped characters afterwards. + // + // Doesn't consider line feeds a character. + // Doesn't scan more than one line above to find a character. + // Doesn't do anything on an empty line. + // Doesn't do anything with non-empty selections. + transposeChars: function (cm) { + return runInOp(cm, function () { + var ranges = cm.listSelections(), + newSel = []; + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) { + continue; + } + var cur = ranges[i].head, + line = getLine(cm.doc, cur.line).text; + if (line) { + if (cur.ch == line.length) { + cur = new Pos(cur.line, cur.ch - 1); + } + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1); + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), Pos(cur.line, cur.ch - 2), cur, "+transpose"); + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text; + if (prev) { + cur = new Pos(cur.line, 1); + cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + prev.charAt(prev.length - 1), Pos(cur.line - 1, prev.length - 1), cur, "+transpose"); + } + } + } + newSel.push(new Range(cur, cur)); + } + cm.setSelections(newSel); + }); + }, + newlineAndIndent: function (cm) { + return runInOp(cm, function () { + var sels = cm.listSelections(); + for (var i = sels.length - 1; i >= 0; i--) { + cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input"); + } + sels = cm.listSelections(); + for (var i$1 = 0; i$1 < sels.length; i$1++) { + cm.indentLine(sels[i$1].from().line, null, true); + } + ensureCursorVisible(cm); + }); + }, + openLine: function (cm) { + return cm.replaceSelection("\n", "start"); + }, + toggleOverwrite: function (cm) { + return cm.toggleOverwrite(); + } + }; + function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLine(line); + if (visual != line) { + lineN = lineNo(visual); + } + return endOfLine(true, cm, visual, lineN, 1); + } + function lineEnd(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLineEnd(line); + if (visual != line) { + lineN = lineNo(visual); + } + return endOfLine(true, cm, line, lineN, -1); + } + function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line, cm.doc.direction); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky); + } + return start; + } + + // Run a handler that was bound to a key. + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) { + return false; + } + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled(); + var prevShift = cm.display.shift, + done = false; + try { + if (cm.isReadOnly()) { + cm.state.suppressEdits = true; + } + if (dropShift) { + cm.display.shift = false; + } + done = bound(cm) != Pass; + } finally { + cm.display.shift = prevShift; + cm.state.suppressEdits = false; + } + return done; + } + function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); + if (result) { + return result; + } + } + return cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm) || lookupKey(name, cm.options.keyMap, handle, cm); + } + + // Note that, despite the name, this function is also used to check + // for bound mouse clicks. + + var stopSeq = new Delayed(); + function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq; + if (seq) { + if (isModifierKey(name)) { + return "handled"; + } + stopSeq.set(50, function () { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null; + cm.display.input.reset(); + } + }); + name = seq + " " + name; + } + var result = lookupKeyForEditor(cm, name, handle); + if (result == "multi") { + cm.state.keySeq = name; + } + if (result == "handled") { + signalLater(cm, "keyHandled", cm, name, e); + } + if (result == "handled" || result == "multi") { + e_preventDefault(e); + restartBlink(cm); + } + if (seq && !result && /\'$/.test(name)) { + e_preventDefault(e); + return true; + } + return !!result; + } + + // Handle a key from the keydown event. + function handleKeyBinding(cm, e) { + var name = keyName(e, true); + if (!name) { + return false; + } + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function (b) { + return doHandleBinding(cm, b, true); + }) || dispatchKey(cm, name, e, function (b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) { + return doHandleBinding(cm, b); + } + }); + } else { + return dispatchKey(cm, name, e, function (b) { + return doHandleBinding(cm, b); + }); + } + } + + // Handle a key from the keypress event + function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, function (b) { + return doHandleBinding(cm, b, true); + }); + } + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + cm.curOp.focus = activeElt(); + if (signalDOMEvent(cm, e)) { + return; + } + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) { + e.returnValue = false; + } + var code = e.keyCode; + cm.display.shift = code == 16 || e.shiftKey; + var handled = handleKeyBinding(cm, e); + if (presto) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) { + cm.replaceSelection("", null, "cut"); + } + } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) { + showCrossHair(cm); + } + } + function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv; + addClass(lineDiv, "CodeMirror-crosshair"); + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair"); + off(document, "keyup", up); + off(document, "mouseover", up); + } + } + on(document, "keyup", up); + on(document, "mouseover", up); + } + function onKeyUp(e) { + if (e.keyCode == 16) { + this.doc.sel.shift = false; + } + signalDOMEvent(this, e); + } + function onKeyPress(e) { + var cm = this; + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { + return; + } + var keyCode = e.keyCode, + charCode = e.charCode; + if (presto && keyCode == lastStoppedKey) { + lastStoppedKey = null; + e_preventDefault(e); + return; + } + if (presto && (!e.which || e.which < 10) && handleKeyBinding(cm, e)) { + return; + } + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + // Some browsers fire keypress events for backspace + if (ch == "\x08") { + return; + } + if (handleCharBinding(cm, e, ch)) { + return; + } + cm.display.input.onKeyPress(e); + } + var DOUBLECLICK_DELAY = 400; + var PastClick = function (time, pos, button) { + this.time = time; + this.pos = pos; + this.button = button; + }; + PastClick.prototype.compare = function (time, pos, button) { + return this.time + DOUBLECLICK_DELAY > time && cmp(pos, this.pos) == 0 && button == this.button; + }; + var lastClick; + var lastDoubleClick; + function clickRepeat(pos, button) { + var now = +new Date(); + if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { + lastClick = lastDoubleClick = null; + return "triple"; + } else if (lastClick && lastClick.compare(now, pos, button)) { + lastDoubleClick = new PastClick(now, pos, button); + lastClick = null; + return "double"; + } else { + lastClick = new PastClick(now, pos, button); + lastDoubleClick = null; + return "single"; + } + } + + // A mouse down can be a single click, double click, triple click, + // start of selection drag, start of text drag, new cursor + // (ctrl-click), rectangle drag (alt-drag), or xwin + // middle-click-paste. Or it might be a click on something we should + // not interfere with, such as a scrollbar or widget. + function onMouseDown(e) { + var cm = this, + display = cm.display; + if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { + return; + } + display.input.ensurePolled(); + display.shift = e.shiftKey; + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false; + setTimeout(function () { + return display.scroller.draggable = true; + }, 100); + } + return; + } + if (clickInGutter(cm, e)) { + return; + } + var pos = posFromMouse(cm, e), + button = e_button(e), + repeat = pos ? clickRepeat(pos, button) : "single"; + window.focus(); + + // #3261: make sure, that we're not starting a second selection + if (button == 1 && cm.state.selectingText) { + cm.state.selectingText(e); + } + if (pos && handleMappedButton(cm, button, pos, repeat, e)) { + return; + } + if (button == 1) { + if (pos) { + leftButtonDown(cm, pos, repeat, e); + } else if (e_target(e) == display.scroller) { + e_preventDefault(e); + } + } else if (button == 2) { + if (pos) { + extendSelection(cm.doc, pos); + } + setTimeout(function () { + return display.input.focus(); + }, 20); + } else if (button == 3) { + if (captureRightClick) { + onContextMenu(cm, e); + } else { + delayBlurEvent(cm); + } + } + } + function handleMappedButton(cm, button, pos, repeat, event) { + var name = "Click"; + if (repeat == "double") { + name = "Double" + name; + } else if (repeat == "triple") { + name = "Triple" + name; + } + name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name; + return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { + if (typeof bound == "string") { + bound = commands[bound]; + } + if (!bound) { + return false; + } + var done = false; + try { + if (cm.isReadOnly()) { + cm.state.suppressEdits = true; + } + done = bound(cm, pos) != Pass; + } finally { + cm.state.suppressEdits = false; + } + return done; + }); + } + function configureMouse(cm, repeat, event) { + var option = cm.getOption("configureMouse"); + var value = option ? option(cm, repeat, event) : {}; + if (value.unit == null) { + var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; + value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"; + } + if (value.extend == null || cm.doc.extend) { + value.extend = cm.doc.extend || event.shiftKey; + } + if (value.addNew == null) { + value.addNew = mac ? event.metaKey : event.ctrlKey; + } + if (value.moveOnDrag == null) { + value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); + } + return value; + } + function leftButtonDown(cm, pos, repeat, event) { + if (ie) { + setTimeout(bind(ensureFocus, cm), 0); + } else { + cm.curOp.focus = activeElt(); + } + var behavior = configureMouse(cm, repeat, event); + var sel = cm.doc.sel, + contained; + if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && repeat == "single" && (contained = sel.contains(pos)) > -1 && (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) { + leftButtonStartDrag(cm, event, pos, behavior); + } else { + leftButtonSelect(cm, event, pos, behavior); + } + } + + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. + function leftButtonStartDrag(cm, event, pos, behavior) { + var display = cm.display, + moved = false; + var dragEnd = operation(cm, function (e) { + if (webkit) { + display.scroller.draggable = false; + } + cm.state.draggingText = false; + off(document, "mouseup", dragEnd); + off(document, "mousemove", mouseMove); + off(display.scroller, "dragstart", dragStart); + off(display.scroller, "drop", dragEnd); + if (!moved) { + e_preventDefault(e); + if (!behavior.addNew) { + extendSelection(cm.doc, pos, null, null, behavior.extend); + } + // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) + if (webkit || ie && ie_version == 9) { + setTimeout(function () { + document.body.focus(); + display.input.focus(); + }, 20); + } else { + display.input.focus(); + } + } + }); + var mouseMove = function (e2) { + moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10; + }; + var dragStart = function () { + return moved = true; + }; + // Let the drag handler handle this. + if (webkit) { + display.scroller.draggable = true; + } + cm.state.draggingText = dragEnd; + dragEnd.copy = !behavior.moveOnDrag; + // IE's approach to draggable + if (display.scroller.dragDrop) { + display.scroller.dragDrop(); + } + on(document, "mouseup", dragEnd); + on(document, "mousemove", mouseMove); + on(display.scroller, "dragstart", dragStart); + on(display.scroller, "drop", dragEnd); + delayBlurEvent(cm); + setTimeout(function () { + return display.input.focus(); + }, 20); + } + function rangeForUnit(cm, pos, unit) { + if (unit == "char") { + return new Range(pos, pos); + } + if (unit == "word") { + return cm.findWordAt(pos); + } + if (unit == "line") { + return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); + } + var result = unit(cm, pos); + return new Range(result.from, result.to); + } + + // Normal selection, as opposed to text dragging. + function leftButtonSelect(cm, event, start, behavior) { + var display = cm.display, + doc = cm.doc; + e_preventDefault(event); + var ourRange, + ourIndex, + startSel = doc.sel, + ranges = startSel.ranges; + if (behavior.addNew && !behavior.extend) { + ourIndex = doc.sel.contains(start); + if (ourIndex > -1) { + ourRange = ranges[ourIndex]; + } else { + ourRange = new Range(start, start); + } + } else { + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; + } + if (behavior.unit == "rectangle") { + if (!behavior.addNew) { + ourRange = new Range(start, start); + } + start = posFromMouse(cm, event, true, true); + ourIndex = -1; + } else { + var range = rangeForUnit(cm, start, behavior.unit); + if (behavior.extend) { + ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); + } else { + ourRange = range; + } + } + if (!behavior.addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; + } else if (ourIndex == -1) { + ourIndex = ranges.length; + setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), { + scroll: false, + origin: "*mouse" + }); + } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { + setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), { + scroll: false, + origin: "*mouse" + }); + startSel = doc.sel; + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); + } + var lastPos = start; + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) { + return; + } + lastPos = pos; + if (behavior.unit == "rectangle") { + var ranges = [], + tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), + right = Math.max(startCol, posCol); + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); line <= end; line++) { + var text = getLine(doc, line).text, + leftPos = findColumn(text, left, tabSize); + if (left == right) { + ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); + } else if (text.length > leftPos) { + ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); + } + } + if (!ranges.length) { + ranges.push(new Range(start, start)); + } + setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), { + origin: "*mouse", + scroll: false + }); + cm.scrollIntoView(pos); + } else { + var oldRange = ourRange; + var range = rangeForUnit(cm, pos, behavior.unit); + var anchor = oldRange.anchor, + head; + if (cmp(range.anchor, anchor) > 0) { + head = range.head; + anchor = minPos(oldRange.from(), range.anchor); + } else { + head = range.anchor; + anchor = maxPos(oldRange.to(), range.head); + } + var ranges$1 = startSel.ranges.slice(0); + ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head); + setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse); + } + } + var editorSize = display.wrapper.getBoundingClientRect(); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); + if (!cur) { + return; + } + if (cmp(cur, lastPos) != 0) { + cm.curOp.focus = activeElt(); + extendTo(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) { + setTimeout(operation(cm, function () { + if (counter == curCount) { + extend(e); + } + }), 150); + } + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) { + setTimeout(operation(cm, function () { + if (counter != curCount) { + return; + } + display.scroller.scrollTop += outside; + extend(e); + }), 50); + } + } + } + function done(e) { + cm.state.selectingText = false; + counter = Infinity; + e_preventDefault(e); + display.input.focus(); + off(document, "mousemove", move); + off(document, "mouseup", up); + doc.history.lastSelOrigin = null; + } + var move = operation(cm, function (e) { + if (!e_button(e)) { + done(e); + } else { + extend(e); + } + }); + var up = operation(cm, done); + cm.state.selectingText = up; + on(document, "mousemove", move); + on(document, "mouseup", up); + } + + // Determines whether an event happened in the gutter, and fires the + // handlers for the corresponding event. + function gutterEvent(cm, e, type, prevent) { + var mX, mY; + try { + mX = e.clientX; + mY = e.clientY; + } catch (e) { + return false; + } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { + return false; + } + if (prevent) { + e_preventDefault(e); + } + var display = cm.display; + var lineBox = display.lineDiv.getBoundingClientRect(); + if (mY > lineBox.bottom || !hasHandler(cm, type)) { + return e_defaultPrevented(e); + } + mY -= lineBox.top - display.viewOffset; + for (var i = 0; i < cm.options.gutters.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.options.gutters[i]; + signal(cm, type, cm, line, gutter, e); + return e_defaultPrevented(e); + } + } + } + function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true); + } + + // CONTEXT MENU HANDLING + + // To make the context menu work, we need to briefly unhide the + // textarea (making it as unobtrusive as possible) to let the + // right-click take effect on it. + function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { + return; + } + if (signalDOMEvent(cm, e, "contextmenu")) { + return; + } + cm.display.input.onContextMenu(e); + } + function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) { + return false; + } + return gutterEvent(cm, e, "gutterContextMenu", false); + } + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } + var Init = { + toString: function () { + return "CodeMirror.Init"; + } + }; + var defaults = {}; + var optionHandlers = {}; + function defineOptions(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) { + optionHandlers[name] = notOnInit ? function (cm, val, old) { + if (old != Init) { + handle(cm, val, old); + } + } : handle; + } + } + CodeMirror.defineOption = option; + + // Passed to option handlers when there is no old value. + CodeMirror.Init = Init; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function (cm, val) { + return cm.setValue(val); + }, true); + option("mode", null, function (cm, val) { + cm.doc.modeOption = val; + loadMode(cm); + }, true); + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function (cm) { + resetModeState(cm); + clearCaches(cm); + regChange(cm); + }, true); + option("lineSeparator", null, function (cm, val) { + cm.doc.lineSep = val; + if (!val) { + return; + } + var newBreaks = [], + lineNo = cm.doc.first; + cm.doc.iter(function (line) { + for (var pos = 0;;) { + var found = line.text.indexOf(val, pos); + if (found == -1) { + break; + } + pos = found + val.length; + newBreaks.push(Pos(lineNo, found)); + } + lineNo++; + }); + for (var i = newBreaks.length - 1; i >= 0; i--) { + replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); + } + }); + option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); + if (old != Init) { + cm.refresh(); + } + }); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { + return cm.refresh(); + }, true); + option("electricChars", true); + option("inputStyle", mobile ? "contenteditable" : "textarea", function () { + throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME + }, true); + option("spellcheck", false, function (cm, val) { + return cm.getInputField().spellcheck = val; + }, true); + option("rtlMoveVisually", !windows); + option("wholeLineUpdateBefore", true); + option("theme", "default", function (cm) { + themeChanged(cm); + guttersChanged(cm); + }, true); + option("keyMap", "default", function (cm, val, old) { + var next = getKeyMap(val); + var prev = old != Init && getKeyMap(old); + if (prev && prev.detach) { + prev.detach(cm, next); + } + if (next.attach) { + next.attach(cm, prev || null); + } + }); + option("extraKeys", null); + option("configureMouse", null); + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function (cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("fixedGutter", true, function (cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("coverGutterNextToScrollbar", false, function (cm) { + return updateScrollbars(cm); + }, true); + option("scrollbarStyle", "native", function (cm) { + initScrollbars(cm); + updateScrollbars(cm); + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); + }, true); + option("lineNumbers", false, function (cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("firstLineNumber", 1, guttersChanged, true); + option("lineNumberFormatter", function (integer) { + return integer; + }, guttersChanged, true); + option("showCursorWhenSelecting", false, updateSelection, true); + option("resetSelectionOnContextMenu", true); + option("lineWiseCopyCut", true); + option("pasteLinesPerSelection", true); + option("readOnly", false, function (cm, val) { + if (val == "nocursor") { + onBlur(cm); + cm.display.input.blur(); + } + cm.display.input.readOnlyChanged(val); + }); + option("disableInput", false, function (cm, val) { + if (!val) { + cm.display.input.reset(); + } + }, true); + option("dragDrop", true, dragDropChanged); + option("allowDropFileTypes", null); + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true, resetModeState, true); + option("addModeClass", false, resetModeState, true); + option("pollInterval", 100); + option("undoDepth", 200, function (cm, val) { + return cm.doc.history.undoDepth = val; + }); + option("historyEventDelay", 1250); + option("viewportMargin", 10, function (cm) { + return cm.refresh(); + }, true); + option("maxHighlightLength", 10000, resetModeState, true); + option("moveInputWithCursor", true, function (cm, val) { + if (!val) { + cm.display.input.resetPosition(); + } + }); + option("tabindex", null, function (cm, val) { + return cm.display.input.getField().tabIndex = val || ""; + }); + option("autofocus", null); + option("direction", "ltr", function (cm, val) { + return cm.doc.setDirection(val); + }, true); + } + function guttersChanged(cm) { + updateGutters(cm); + regChange(cm); + alignHorizontally(cm); + } + function dragDropChanged(cm, value, old) { + var wasOn = old && old != Init; + if (!value != !wasOn) { + var funcs = cm.display.dragFunctions; + var toggle = value ? on : off; + toggle(cm.display.scroller, "dragstart", funcs.start); + toggle(cm.display.scroller, "dragenter", funcs.enter); + toggle(cm.display.scroller, "dragover", funcs.over); + toggle(cm.display.scroller, "dragleave", funcs.leave); + toggle(cm.display.scroller, "drop", funcs.drop); + } + } + function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap"); + cm.display.sizer.style.minWidth = ""; + cm.display.sizerWidth = null; + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap"); + findMaxLine(cm); + } + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function () { + return updateScrollbars(cm); + }, 100); + } + + // A CodeMirror instance represents an editor. This is the object + // that user code is usually dealing with. + + function CodeMirror(place, options) { + var this$1 = this; + if (!(this instanceof CodeMirror)) { + return new CodeMirror(place, options); + } + this.options = options = options ? copyObj(options) : {}; + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false); + setGuttersForLineNumbers(options); + var doc = options.value; + if (typeof doc == "string") { + doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); + } + this.doc = doc; + var input = new CodeMirror.inputStyles[options.inputStyle](this); + var display = this.display = new Display(place, doc, input); + display.wrapper.CodeMirror = this; + updateGutters(this); + themeChanged(this); + if (options.lineWrapping) { + this.display.wrapper.className += " CodeMirror-wrap"; + } + initScrollbars(this); + this.state = { + keyMaps: [], + // stores maps added by addKeyMap + overlays: [], + // highlighting overlays, as added by addOverlay + modeGen: 0, + // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, + delayingBlurEvent: false, + focused: false, + suppressEdits: false, + // used to disable editing during key handlers when in readOnly mode + pasteIncoming: false, + cutIncoming: false, + // help recognize paste/cut edits in input.poll + selectingText: false, + draggingText: false, + highlight: new Delayed(), + // stores highlight worker timeout + keySeq: null, + // Unfinished key sequence + specialChars: null + }; + if (options.autofocus && !mobile) { + display.input.focus(); + } + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) { + setTimeout(function () { + return this$1.display.input.reset(true); + }, 20); + } + registerEventHandlers(this); + ensureGlobalHandlers(); + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); + if (options.autofocus && !mobile || this.hasFocus()) { + setTimeout(bind(onFocus, this), 20); + } else { + onBlur(this); + } + for (var opt in optionHandlers) { + if (optionHandlers.hasOwnProperty(opt)) { + optionHandlers[opt](this$1, options[opt], Init); + } + } + maybeUpdateLineNumberWidth(this); + if (options.finishInit) { + options.finishInit(this); + } + for (var i = 0; i < initHooks.length; ++i) { + initHooks[i](this$1); + } + endOperation(this); + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") { + display.lineDiv.style.textRendering = "auto"; + } + } + + // The default configuration options. + CodeMirror.defaults = defaults; + // Functions to run when options are changed. + CodeMirror.optionHandlers = optionHandlers; + + // Attach the necessary event handlers when initializing the editor + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) { + on(d.scroller, "dblclick", operation(cm, function (e) { + if (signalDOMEvent(cm, e)) { + return; + } + var pos = posFromMouse(cm, e); + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { + return; + } + e_preventDefault(e); + var word = cm.findWordAt(pos); + extendSelection(cm.doc, word.anchor, word.head); + })); + } else { + on(d.scroller, "dblclick", function (e) { + return signalDOMEvent(cm, e) || e_preventDefault(e); + }); + } + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + if (!captureRightClick) { + on(d.scroller, "contextmenu", function (e) { + return onContextMenu(cm, e); + }); + } + + // Used to suppress mouse event handling when a touch happens + var touchFinished, + prevTouch = { + end: 0 + }; + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function () { + return d.activeTouch = null; + }, 1000); + prevTouch = d.activeTouch; + prevTouch.end = +new Date(); + } + } + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) { + return false; + } + var touch = e.touches[0]; + return touch.radiusX <= 1 && touch.radiusY <= 1; + } + function farAway(touch, other) { + if (other.left == null) { + return true; + } + var dx = other.left - touch.left, + dy = other.top - touch.top; + return dx * dx + dy * dy > 20 * 20; + } + on(d.scroller, "touchstart", function (e) { + if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) { + d.input.ensurePolled(); + clearTimeout(touchFinished); + var now = +new Date(); + d.activeTouch = { + start: now, + moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null + }; + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX; + d.activeTouch.top = e.touches[0].pageY; + } + } + }); + on(d.scroller, "touchmove", function () { + if (d.activeTouch) { + d.activeTouch.moved = true; + } + }); + on(d.scroller, "touchend", function (e) { + var touch = d.activeTouch; + if (touch && !eventInWidget(d, e) && touch.left != null && !touch.moved && new Date() - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), + range; + if (!touch.prev || farAway(touch, touch.prev)) + // Single tap + { + range = new Range(pos, pos); + } else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) + // Double tap + { + range = cm.findWordAt(pos); + } else + // Triple tap + { + range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); + } + cm.setSelection(range.anchor, range.head); + cm.focus(); + e_preventDefault(e); + } + finishTouch(); + }); + on(d.scroller, "touchcancel", finishTouch); + + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function () { + if (d.scroller.clientHeight) { + updateScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + } + }); + + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function (e) { + return onScrollWheel(cm, e); + }); + on(d.scroller, "DOMMouseScroll", function (e) { + return onScrollWheel(cm, e); + }); + + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function () { + return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; + }); + d.dragFunctions = { + enter: function (e) { + if (!signalDOMEvent(cm, e)) { + e_stop(e); + } + }, + over: function (e) { + if (!signalDOMEvent(cm, e)) { + onDragOver(cm, e); + e_stop(e); + } + }, + start: function (e) { + return onDragStart(cm, e); + }, + drop: operation(cm, onDrop), + leave: function (e) { + if (!signalDOMEvent(cm, e)) { + clearDragCursor(cm); + } + } + }; + var inp = d.input.getField(); + on(inp, "keyup", function (e) { + return onKeyUp.call(cm, e); + }); + on(inp, "keydown", operation(cm, onKeyDown)); + on(inp, "keypress", operation(cm, onKeyPress)); + on(inp, "focus", function (e) { + return onFocus(cm, e); + }); + on(inp, "blur", function (e) { + return onBlur(cm, e); + }); + } + var initHooks = []; + CodeMirror.defineInitHook = function (f) { + return initHooks.push(f); + }; + + // Indent the given line. The how parameter can be "smart", + // "add"/null, "subtract", or "prev". When aggressive is false + // (typically set to true for forced single-line indents), empty + // lines are not indented, and places where the mode returns Pass + // are left alone. + function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, + state; + if (how == null) { + how = "add"; + } + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) { + how = "prev"; + } else { + state = getContextBefore(cm, n).state; + } + } + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), + curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) { + line.stateAfter = null; + } + var curSpaceString = line.text.match(/^\s*/)[0], + indentation; + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0; + how = "not"; + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass || indentation > 150) { + if (!aggressive) { + return; + } + how = "prev"; + } + } + if (how == "prev") { + if (n > doc.first) { + indentation = countColumn(getLine(doc, n - 1).text, null, tabSize); + } else { + indentation = 0; + } + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit; + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit; + } else if (typeof how == "number") { + indentation = curSpace + how; + } + indentation = Math.max(0, indentation); + var indentString = "", + pos = 0; + if (cm.options.indentWithTabs) { + for (var i = Math.floor(indentation / tabSize); i; --i) { + pos += tabSize; + indentString += "\t"; + } + } + if (pos < indentation) { + indentString += spaceStr(indentation - pos); + } + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + line.stateAfter = null; + return true; + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { + var range = doc.sel.ranges[i$1]; + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos$1 = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)); + break; + } + } + } + } + + // This will be set to a {lineWise: bool, text: [string]} object, so + // that, when pasting, we know what kind of selections the copied + // text was made out of. + var lastCopied = null; + function setLastCopied(newLastCopied) { + lastCopied = newLastCopied; + } + function applyTextInput(cm, inserted, deleted, sel, origin) { + var doc = cm.doc; + cm.display.shift = false; + if (!sel) { + sel = doc.sel; + } + var paste = cm.state.pasteIncoming || origin == "paste"; + var textLines = splitLinesAuto(inserted), + multiPaste = null; + // When pasing N lines into N selections, insert one line per selection + if (paste && sel.ranges.length > 1) { + if (lastCopied && lastCopied.text.join("\n") == inserted) { + if (sel.ranges.length % lastCopied.text.length == 0) { + multiPaste = []; + for (var i = 0; i < lastCopied.text.length; i++) { + multiPaste.push(doc.splitLines(lastCopied.text[i])); + } + } + } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { + multiPaste = map(textLines, function (l) { + return [l]; + }); + } + } + var updateInput; + // Normal behavior is to insert the new text into every selection + for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { + var range = sel.ranges[i$1]; + var from = range.from(), + to = range.to(); + if (range.empty()) { + if (deleted && deleted > 0) + // Handle deletion + { + from = Pos(from.line, from.ch - deleted); + } else if (cm.state.overwrite && !paste) + // Handle overwrite + { + to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); + } else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) { + from = to = Pos(from.line, 0); + } + } + updateInput = cm.curOp.updateInput; + var changeEvent = { + from: from, + to: to, + text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, + origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input") + }; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); + } + if (inserted && !paste) { + triggerElectric(cm, inserted); + } + ensureCursorVisible(cm); + cm.curOp.updateInput = updateInput; + cm.curOp.typing = true; + cm.state.pasteIncoming = cm.state.cutIncoming = false; + } + function handlePaste(e, cm) { + var pasted = e.clipboardData && e.clipboardData.getData("Text"); + if (pasted) { + e.preventDefault(); + if (!cm.isReadOnly() && !cm.options.disableInput) { + runInOp(cm, function () { + return applyTextInput(cm, pasted, 0, null, "paste"); + }); + } + return true; + } + } + function triggerElectric(cm, inserted) { + // When an 'electric' character is inserted, immediately trigger a reindent + if (!cm.options.electricChars || !cm.options.smartIndent) { + return; + } + var sel = cm.doc.sel; + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i]; + if (range.head.ch > 100 || i && sel.ranges[i - 1].head.line == range.head.line) { + continue; + } + var mode = cm.getModeAt(range.head); + var indented = false; + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) { + if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indented = indentLine(cm, range.head.line, "smart"); + break; + } + } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) { + indented = indentLine(cm, range.head.line, "smart"); + } + } + if (indented) { + signalLater(cm, "electricInput", cm, range.head.line); + } + } + } + function copyableRanges(cm) { + var text = [], + ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = { + anchor: Pos(line, 0), + head: Pos(line + 1, 0) + }; + ranges.push(lineRange); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); + } + return { + text: text, + ranges: ranges + }; + } + function disableBrowserMagic(field, spellcheck) { + field.setAttribute("autocorrect", "off"); + field.setAttribute("autocapitalize", "off"); + field.setAttribute("spellcheck", !!spellcheck); + } + function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"); + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) { + te.style.width = "1000px"; + } else { + te.setAttribute("wrap", "off"); + } + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) { + te.style.border = "1px solid black"; + } + disableBrowserMagic(te); + return div; + } + + // The publicly visible API. Note that methodOp(f) means + // 'wrap f in an operation, performed on its `this` parameter'. + + // This is not the complete set of editor methods. Most of the + // methods defined on the Doc type are also injected into + // CodeMirror.prototype, for backwards compatibility and + // convenience. + + function addEditorMethods(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; + var helpers = CodeMirror.helpers = {}; + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function () { + window.focus(); + this.display.input.focus(); + }, + setOption: function (option, value) { + var options = this.options, + old = options[option]; + if (options[option] == value && option != "mode") { + return; + } + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) { + operation(this, optionHandlers[option])(this, value, old); + } + signal(this, "optionChange", this, option); + }, + getOption: function (option) { + return this.options[option]; + }, + getDoc: function () { + return this.doc; + }, + addKeyMap: function (map, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); + }, + removeKeyMap: function (map) { + var maps = this.state.keyMaps; + for (var i = 0; i < maps.length; ++i) { + if (maps[i] == map || maps[i].name == map) { + maps.splice(i, 1); + return true; + } + } + }, + addOverlay: methodOp(function (spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); + if (mode.startState) { + throw new Error("Overlays may not be stateful."); + } + insertSorted(this.state.overlays, { + mode: mode, + modeSpec: spec, + opaque: options && options.opaque, + priority: options && options.priority || 0 + }, function (overlay) { + return overlay.priority; + }); + this.state.modeGen++; + regChange(this); + }), + removeOverlay: methodOp(function (spec) { + var this$1 = this; + var overlays = this.state.overlays; + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec; + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1); + this$1.state.modeGen++; + regChange(this$1); + return; + } + } + }), + indentLine: methodOp(function (n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) { + dir = this.options.smartIndent ? "smart" : "prev"; + } else { + dir = dir ? "add" : "subtract"; + } + } + if (isLine(this.doc, n)) { + indentLine(this, n, dir, aggressive); + } + }), + indentSelection: methodOp(function (how) { + var this$1 = this; + var ranges = this.doc.sel.ranges, + end = -1; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (!range.empty()) { + var from = range.from(), + to = range.to(); + var start = Math.max(end, from.line); + end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; + for (var j = start; j < end; ++j) { + indentLine(this$1, j, how); + } + var newRanges = this$1.doc.sel.ranges; + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) { + replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); + } + } else if (range.head.line > end) { + indentLine(this$1, range.head.line, how, true); + end = range.head.line; + if (i == this$1.doc.sel.primIndex) { + ensureCursorVisible(this$1); + } + } + } + }), + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function (pos, precise) { + return takeToken(this, pos, precise); + }, + getLineTokens: function (line, precise) { + return takeToken(this, Pos(line), precise, true); + }, + getTokenTypeAt: function (pos) { + pos = clipPos(this.doc, pos); + var styles = getLineStyles(this, getLine(this.doc, pos.line)); + var before = 0, + after = (styles.length - 1) / 2, + ch = pos.ch; + var type; + if (ch == 0) { + type = styles[2]; + } else { + for (;;) { + var mid = before + after >> 1; + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { + after = mid; + } else if (styles[mid * 2 + 1] < ch) { + before = mid + 1; + } else { + type = styles[mid * 2 + 2]; + break; + } + } + } + var cut = type ? type.indexOf("overlay ") : -1; + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); + }, + getModeAt: function (pos) { + var mode = this.doc.mode; + if (!mode.innerMode) { + return mode; + } + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode; + }, + getHelper: function (pos, type) { + return this.getHelpers(pos, type)[0]; + }, + getHelpers: function (pos, type) { + var this$1 = this; + var found = []; + if (!helpers.hasOwnProperty(type)) { + return found; + } + var help = helpers[type], + mode = this.getModeAt(pos); + if (typeof mode[type] == "string") { + if (help[mode[type]]) { + found.push(help[mode[type]]); + } + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]]; + if (val) { + found.push(val); + } + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]); + } else if (help[mode.name]) { + found.push(help[mode.name]); + } + for (var i$1 = 0; i$1 < help._global.length; i$1++) { + var cur = help._global[i$1]; + if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1) { + found.push(cur.val); + } + } + return found; + }, + getStateAfter: function (line, precise) { + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1 : line); + return getContextBefore(this, line + 1, precise).state; + }, + cursorCoords: function (start, mode) { + var pos, + range = this.doc.sel.primary(); + if (start == null) { + pos = range.head; + } else if (typeof start == "object") { + pos = clipPos(this.doc, start); + } else { + pos = start ? range.from() : range.to(); + } + return cursorCoords(this, pos, mode || "page"); + }, + charCoords: function (pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page"); + }, + coordsChar: function (coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page"); + return coordsChar(this, coords.left, coords.top); + }, + lineAtHeight: function (height, mode) { + height = fromCoordSystem(this, { + top: height, + left: 0 + }, mode || "page").top; + return lineAtHeight(this.doc, height + this.display.viewOffset); + }, + heightAtLine: function (line, mode, includeWidgets) { + var end = false, + lineObj; + if (typeof line == "number") { + var last = this.doc.first + this.doc.size - 1; + if (line < this.doc.first) { + line = this.doc.first; + } else if (line > last) { + line = last; + end = true; + } + lineObj = getLine(this.doc, line); + } else { + lineObj = line; + } + return intoCoordSystem(this, lineObj, { + top: 0, + left: 0 + }, mode || "page", includeWidgets || end).top + (end ? this.doc.height - heightAtLine(lineObj) : 0); + }, + defaultTextHeight: function () { + return textHeight(this.display); + }, + defaultCharWidth: function () { + return charWidth(this.display); + }, + getViewport: function () { + return { + from: this.display.viewFrom, + to: this.display.viewTo + }; + }, + addWidget: function (pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, + left = pos.left; + node.style.position = "absolute"; + node.setAttribute("cm-ignore-events", "true"); + this.display.input.setUneditable(node); + display.sizer.appendChild(node); + if (vert == "over") { + top = pos.top; + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) { + top = pos.top - node.offsetHeight; + } else if (pos.bottom + node.offsetHeight <= vspace) { + top = pos.bottom; + } + if (left + node.offsetWidth > hspace) { + left = hspace - node.offsetWidth; + } + } + node.style.top = top + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") { + left = 0; + } else if (horiz == "middle") { + left = (display.sizer.clientWidth - node.offsetWidth) / 2; + } + node.style.left = left + "px"; + } + if (scroll) { + scrollIntoView(this, { + left: left, + top: top, + right: left + node.offsetWidth, + bottom: top + node.offsetHeight + }); + } + }, + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + triggerOnMouseDown: methodOp(onMouseDown), + execCommand: function (cmd) { + if (commands.hasOwnProperty(cmd)) { + return commands[cmd].call(null, this); + } + }, + triggerElectric: methodOp(function (text) { + triggerElectric(this, text); + }), + findPosH: function (from, amount, unit, visually) { + var this$1 = this; + var dir = 1; + if (amount < 0) { + dir = -1; + amount = -amount; + } + var cur = clipPos(this.doc, from); + for (var i = 0; i < amount; ++i) { + cur = findPosH(this$1.doc, cur, dir, unit, visually); + if (cur.hitSide) { + break; + } + } + return cur; + }, + moveH: methodOp(function (dir, unit) { + var this$1 = this; + this.extendSelectionsBy(function (range) { + if (this$1.display.shift || this$1.doc.extend || range.empty()) { + return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually); + } else { + return dir < 0 ? range.from() : range.to(); + } + }, sel_move); + }), + deleteH: methodOp(function (dir, unit) { + var sel = this.doc.sel, + doc = this.doc; + if (sel.somethingSelected()) { + doc.replaceSelection("", null, "+delete"); + } else { + deleteNearSelection(this, function (range) { + var other = findPosH(doc, range.head, dir, unit, false); + return dir < 0 ? { + from: other, + to: range.head + } : { + from: range.head, + to: other + }; + }); + } + }), + findPosV: function (from, amount, unit, goalColumn) { + var this$1 = this; + var dir = 1, + x = goalColumn; + if (amount < 0) { + dir = -1; + amount = -amount; + } + var cur = clipPos(this.doc, from); + for (var i = 0; i < amount; ++i) { + var coords = cursorCoords(this$1, cur, "div"); + if (x == null) { + x = coords.left; + } else { + coords.left = x; + } + cur = findPosV(this$1, coords, dir, unit); + if (cur.hitSide) { + break; + } + } + return cur; + }, + moveV: methodOp(function (dir, unit) { + var this$1 = this; + var doc = this.doc, + goals = []; + var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function (range) { + if (collapse) { + return dir < 0 ? range.from() : range.to(); + } + var headPos = cursorCoords(this$1, range.head, "div"); + if (range.goalColumn != null) { + headPos.left = range.goalColumn; + } + goals.push(headPos.left); + var pos = findPosV(this$1, headPos, dir, unit); + if (unit == "page" && range == doc.sel.primary()) { + addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); + } + return pos; + }, sel_move); + if (goals.length) { + for (var i = 0; i < doc.sel.ranges.length; i++) { + doc.sel.ranges[i].goalColumn = goals[i]; + } + } + }), + // Find the word at the given position (as returned by coordsChar). + findWordAt: function (pos) { + var doc = this.doc, + line = getLine(doc, pos.line).text; + var start = pos.ch, + end = pos.ch; + if (line) { + var helper = this.getHelper(pos, "wordChars"); + if ((pos.sticky == "before" || end == line.length) && start) { + --start; + } else { + ++end; + } + var startChar = line.charAt(start); + var check = isWordChar(startChar, helper) ? function (ch) { + return isWordChar(ch, helper); + } : /\s/.test(startChar) ? function (ch) { + return /\s/.test(ch); + } : function (ch) { + return !/\s/.test(ch) && !isWordChar(ch); + }; + while (start > 0 && check(line.charAt(start - 1))) { + --start; + } + while (end < line.length && check(line.charAt(end))) { + ++end; + } + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)); + }, + toggleOverwrite: function (value) { + if (value != null && value == this.state.overwrite) { + return; + } + if (this.state.overwrite = !this.state.overwrite) { + addClass(this.display.cursorDiv, "CodeMirror-overwrite"); + } else { + rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); + } + signal(this, "overwriteToggle", this, this.state.overwrite); + }, + hasFocus: function () { + return this.display.input.getField() == activeElt(); + }, + isReadOnly: function () { + return !!(this.options.readOnly || this.doc.cantEdit); + }, + scrollTo: methodOp(function (x, y) { + scrollToCoords(this, x, y); + }), + getScrollInfo: function () { + var scroller = this.display.scroller; + return { + left: scroller.scrollLeft, + top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), + clientWidth: displayWidth(this) + }; + }, + scrollIntoView: methodOp(function (range, margin) { + if (range == null) { + range = { + from: this.doc.sel.primary().head, + to: null + }; + if (margin == null) { + margin = this.options.cursorScrollMargin; + } + } else if (typeof range == "number") { + range = { + from: Pos(range, 0), + to: null + }; + } else if (range.from == null) { + range = { + from: range, + to: null + }; + } + if (!range.to) { + range.to = range.from; + } + range.margin = margin || 0; + if (range.from.line != null) { + scrollToRange(this, range); + } else { + scrollToCoordsRange(this, range.from, range.to, range.margin); + } + }), + setSize: methodOp(function (width, height) { + var this$1 = this; + var interpret = function (val) { + return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; + }; + if (width != null) { + this.display.wrapper.style.width = interpret(width); + } + if (height != null) { + this.display.wrapper.style.height = interpret(height); + } + if (this.options.lineWrapping) { + clearLineMeasurementCache(this); + } + var lineNo = this.display.viewFrom; + this.doc.iter(lineNo, this.display.viewTo, function (line) { + if (line.widgets) { + for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].noHScroll) { + regLineChange(this$1, lineNo, "widget"); + break; + } + } + } + ++lineNo; + }); + this.curOp.forceUpdate = true; + signal(this, "refresh", this); + }), + operation: function (f) { + return runInOp(this, f); + }, + startOperation: function () { + return startOperation(this); + }, + endOperation: function () { + return endOperation(this); + }, + refresh: methodOp(function () { + var oldHeight = this.display.cachedTextHeight; + regChange(this); + this.curOp.forceUpdate = true; + clearCaches(this); + scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this); + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) { + estimateLineHeights(this); + } + signal(this, "refresh", this); + }), + swapDoc: methodOp(function (doc) { + var old = this.doc; + old.cm = null; + attachDoc(this, doc); + clearCaches(this); + this.display.input.reset(); + scrollToCoords(this, doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; + signalLater(this, "swapDoc", this, old); + return old; + }), + 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; + } + }; + eventMixin(CodeMirror); + CodeMirror.registerHelper = function (type, name, value) { + if (!helpers.hasOwnProperty(type)) { + helpers[type] = CodeMirror[type] = { + _global: [] + }; + } + helpers[type][name] = value; + }; + CodeMirror.registerGlobalHelper = function (type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value); + helpers[type]._global.push({ + pred: predicate, + val: value + }); + }; + } + + // Used for horizontal relative motion. Dir is -1 or 1 (left or + // right), unit can be "char", "column" (like char, but doesn't + // cross line boundaries), "word" (across next word), or "group" (to + // the start of next group of word or non-word-non-whitespace + // chars). The visually param controls whether, in right-to-left + // text, direction 1 means to move towards the next index in the + // string, or towards the character to the right of the current + // position. The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosH(doc, pos, dir, unit, visually) { + var oldPos = pos; + var origDir = dir; + var lineObj = getLine(doc, pos.line); + function findNextLine() { + var l = pos.line + dir; + if (l < doc.first || l >= doc.first + doc.size) { + return false; + } + pos = new Pos(l, pos.ch, pos.sticky); + return lineObj = getLine(doc, l); + } + function moveOnce(boundToLine) { + var next; + if (visually) { + next = moveVisually(doc.cm, lineObj, pos, dir); + } else { + next = moveLogically(lineObj, pos, dir); + } + if (next == null) { + if (!boundToLine && findNextLine()) { + pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); + } else { + return false; + } + } else { + pos = next; + } + return true; + } + if (unit == "char") { + moveOnce(); + } else if (unit == "column") { + moveOnce(true); + } else if (unit == "word" || unit == "group") { + var sawType = null, + group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) { + break; + } + var cur = lineObj.text.charAt(pos.ch) || "\n"; + var type = isWordChar(cur, helper) ? "w" : group && cur == "\n" ? "n" : !group || /\s/.test(cur) ? null : "p"; + if (group && !first && !type) { + type = "s"; + } + if (sawType && sawType != type) { + if (dir < 0) { + dir = 1; + moveOnce(); + pos.sticky = "after"; + } + break; + } + if (type) { + sawType = type; + } + if (dir > 0 && !moveOnce(!first)) { + break; + } + } + } + var result = skipAtomic(doc, pos, oldPos, origDir, true); + if (equalCursorPos(oldPos, result)) { + result.hitSide = true; + } + return result; + } + + // For relative vertical movement. Dir may be -1 or 1. Unit can be + // "page" or "line". The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, + x = pos.left, + y; + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3); + y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + var target; + for (;;) { + target = coordsChar(cm, x, y); + if (!target.outside) { + break; + } + if (dir < 0 ? y <= 0 : y >= doc.height) { + target.hitSide = true; + break; + } + y += dir * 5; + } + return target; + } + + // CONTENTEDITABLE INPUT STYLE + + var ContentEditableInput = function (cm) { + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); + this.composing = null; + this.gracePeriod = false; + this.readDOMTimeout = null; + }; + ContentEditableInput.prototype.init = function (display) { + var this$1 = this; + var input = this, + cm = input.cm; + var div = input.div = display.lineDiv; + disableBrowserMagic(div, cm.options.spellcheck); + on(div, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { + return; + } + // IE doesn't fire input events, so we schedule a read for the pasted content in this way + if (ie_version <= 11) { + setTimeout(operation(cm, function () { + return this$1.updateFromDOM(); + }), 20); + } + }); + on(div, "compositionstart", function (e) { + this$1.composing = { + data: e.data, + done: false + }; + }); + on(div, "compositionupdate", function (e) { + if (!this$1.composing) { + this$1.composing = { + data: e.data, + done: false + }; + } + }); + on(div, "compositionend", function (e) { + if (this$1.composing) { + if (e.data != this$1.composing.data) { + this$1.readFromDOMSoon(); + } + this$1.composing.done = true; + } + }); + on(div, "touchstart", function () { + return input.forceCompositionEnd(); + }); + on(div, "input", function () { + if (!this$1.composing) { + this$1.readFromDOMSoon(); + } + }); + function onCopyCut(e) { + if (signalDOMEvent(cm, e)) { + return; + } + if (cm.somethingSelected()) { + setLastCopied({ + lineWise: false, + text: cm.getSelections() + }); + if (e.type == "cut") { + cm.replaceSelection("", null, "cut"); + } + } else if (!cm.options.lineWiseCopyCut) { + return; + } else { + var ranges = copyableRanges(cm); + setLastCopied({ + lineWise: true, + text: ranges.text + }); + if (e.type == "cut") { + cm.operation(function () { + cm.setSelections(ranges.ranges, 0, sel_dontScroll); + cm.replaceSelection("", null, "cut"); + }); + } + } + if (e.clipboardData) { + e.clipboardData.clearData(); + var content = lastCopied.text.join("\n"); + // iOS exposes the clipboard API, but seems to discard content inserted into it + e.clipboardData.setData("Text", content); + if (e.clipboardData.getData("Text") == content) { + e.preventDefault(); + return; + } + } + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), + te = kludge.firstChild; + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.text.join("\n"); + var hadFocus = document.activeElement; + selectInput(te); + setTimeout(function () { + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + if (hadFocus == div) { + input.showPrimarySelection(); + } + }, 50); + } + on(div, "copy", onCopyCut); + on(div, "cut", onCopyCut); + }; + ContentEditableInput.prototype.prepareSelection = function () { + var result = prepareSelection(this.cm, false); + result.focus = this.cm.state.focused; + return result; + }; + ContentEditableInput.prototype.showSelection = function (info, takeFocus) { + if (!info || !this.cm.display.view.length) { + return; + } + if (info.focus || takeFocus) { + this.showPrimarySelection(); + } + this.showMultipleSelections(info); + }; + ContentEditableInput.prototype.showPrimarySelection = function () { + var sel = window.getSelection(), + cm = this.cm, + prim = cm.doc.sel.primary(); + var from = prim.from(), + to = prim.to(); + if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { + sel.removeAllRanges(); + return; + } + var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset); + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && cmp(minPos(curAnchor, curFocus), from) == 0 && cmp(maxPos(curAnchor, curFocus), to) == 0) { + return; + } + var view = cm.display.view; + var start = from.line >= cm.display.viewFrom && posToDOM(cm, from) || { + node: view[0].measure.map[2], + offset: 0 + }; + var end = to.line < cm.display.viewTo && posToDOM(cm, to); + if (!end) { + var measure = view[view.length - 1].measure; + var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; + end = { + node: map[map.length - 1], + offset: map[map.length - 2] - map[map.length - 3] + }; + } + if (!start || !end) { + sel.removeAllRanges(); + return; + } + var old = sel.rangeCount && sel.getRangeAt(0), + rng; + try { + rng = range(start.node, start.offset, end.offset, end.node); + } catch (e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + if (!gecko && cm.state.focused) { + sel.collapse(start.node, start.offset); + if (!rng.collapsed) { + sel.removeAllRanges(); + sel.addRange(rng); + } + } else { + sel.removeAllRanges(); + sel.addRange(rng); + } + if (old && sel.anchorNode == null) { + sel.addRange(old); + } else if (gecko) { + this.startGracePeriod(); + } + } + this.rememberSelection(); + }; + ContentEditableInput.prototype.startGracePeriod = function () { + var this$1 = this; + clearTimeout(this.gracePeriod); + this.gracePeriod = setTimeout(function () { + this$1.gracePeriod = false; + if (this$1.selectionChanged()) { + this$1.cm.operation(function () { + return this$1.cm.curOp.selectionChanged = true; + }); + } + }, 20); + }; + ContentEditableInput.prototype.showMultipleSelections = function (info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); + }; + ContentEditableInput.prototype.rememberSelection = function () { + var sel = window.getSelection(); + this.lastAnchorNode = sel.anchorNode; + this.lastAnchorOffset = sel.anchorOffset; + this.lastFocusNode = sel.focusNode; + this.lastFocusOffset = sel.focusOffset; + }; + ContentEditableInput.prototype.selectionInEditor = function () { + var sel = window.getSelection(); + if (!sel.rangeCount) { + return false; + } + var node = sel.getRangeAt(0).commonAncestorContainer; + return contains(this.div, node); + }; + ContentEditableInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor") { + if (!this.selectionInEditor()) { + this.showSelection(this.prepareSelection(), true); + } + this.div.focus(); + } + }; + ContentEditableInput.prototype.blur = function () { + this.div.blur(); + }; + ContentEditableInput.prototype.getField = function () { + return this.div; + }; + ContentEditableInput.prototype.supportsTouch = function () { + return true; + }; + ContentEditableInput.prototype.receivedFocus = function () { + var input = this; + if (this.selectionInEditor()) { + this.pollSelection(); + } else { + runInOp(this.cm, function () { + return input.cm.curOp.selectionChanged = true; + }); + } + function poll() { + if (input.cm.state.focused) { + input.pollSelection(); + input.polling.set(input.cm.options.pollInterval, poll); + } + } + this.polling.set(this.cm.options.pollInterval, poll); + }; + ContentEditableInput.prototype.selectionChanged = function () { + var sel = window.getSelection(); + return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; + }; + ContentEditableInput.prototype.pollSelection = function () { + if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { + return; + } + var sel = window.getSelection(), + cm = this.cm; + // On Android Chrome (version 56, at least), backspacing into an + // uneditable block element will put the cursor in that element, + // and then, because it's not editable, hide the virtual keyboard. + // Because Android doesn't allow us to actually detect backspace + // presses in a sane way, this code checks for when that happens + // and simulates a backspace press in this case. + if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) { + this.cm.triggerOnKeyDown({ + type: "keydown", + keyCode: 8, + preventDefault: Math.abs + }); + this.blur(); + this.focus(); + return; + } + if (this.composing) { + return; + } + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); + if (anchor && head) { + runInOp(cm, function () { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); + if (anchor.bad || head.bad) { + cm.curOp.selectionChanged = true; + } + }); + } + }; + ContentEditableInput.prototype.pollContent = function () { + if (this.readDOMTimeout != null) { + clearTimeout(this.readDOMTimeout); + this.readDOMTimeout = null; + } + var cm = this.cm, + display = cm.display, + sel = cm.doc.sel.primary(); + var from = sel.from(), + to = sel.to(); + if (from.ch == 0 && from.line > cm.firstLine()) { + from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); + } + if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) { + to = Pos(to.line + 1, 0); + } + if (from.line < display.viewFrom || to.line > display.viewTo - 1) { + return false; + } + var fromIndex, fromLine, fromNode; + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + fromLine = lineNo(display.view[0].line); + fromNode = display.view[0].node; + } else { + fromLine = lineNo(display.view[fromIndex].line); + fromNode = display.view[fromIndex - 1].node.nextSibling; + } + var toIndex = findViewIndex(cm, to.line); + var toLine, toNode; + if (toIndex == display.view.length - 1) { + toLine = display.viewTo - 1; + toNode = display.lineDiv.lastChild; + } else { + toLine = lineNo(display.view[toIndex + 1].line) - 1; + toNode = display.view[toIndex + 1].node.previousSibling; + } + if (!fromNode) { + return false; + } + var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { + newText.pop(); + oldText.pop(); + toLine--; + } else if (newText[0] == oldText[0]) { + newText.shift(); + oldText.shift(); + fromLine++; + } else { + break; + } + } + var cutFront = 0, + cutEnd = 0; + var newTop = newText[0], + oldTop = oldText[0], + maxCutFront = Math.min(newTop.length, oldTop.length); + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) { + ++cutFront; + } + var newBot = lst(newText), + oldBot = lst(oldText); + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), oldBot.length - (oldText.length == 1 ? cutFront : 0)); + while (cutEnd < maxCutEnd && newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { + ++cutEnd; + } + // Try to move start of change to start of selection if ambiguous + if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { + while (cutFront && cutFront > from.ch && newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { + cutFront--; + cutEnd++; + } + } + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, ""); + newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, ""); + var chFrom = Pos(fromLine, cutFront); + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input"); + return true; + } + }; + ContentEditableInput.prototype.ensurePolled = function () { + this.forceCompositionEnd(); + }; + ContentEditableInput.prototype.reset = function () { + this.forceCompositionEnd(); + }; + ContentEditableInput.prototype.forceCompositionEnd = function () { + if (!this.composing) { + return; + } + clearTimeout(this.readDOMTimeout); + this.composing = null; + this.updateFromDOM(); + this.div.blur(); + this.div.focus(); + }; + ContentEditableInput.prototype.readFromDOMSoon = function () { + var this$1 = this; + if (this.readDOMTimeout != null) { + return; + } + this.readDOMTimeout = setTimeout(function () { + this$1.readDOMTimeout = null; + if (this$1.composing) { + if (this$1.composing.done) { + this$1.composing = null; + } else { + return; + } + } + this$1.updateFromDOM(); + }, 80); + }; + ContentEditableInput.prototype.updateFromDOM = function () { + var this$1 = this; + if (this.cm.isReadOnly() || !this.pollContent()) { + runInOp(this.cm, function () { + return regChange(this$1.cm); + }); + } + }; + ContentEditableInput.prototype.setUneditable = function (node) { + node.contentEditable = "false"; + }; + ContentEditableInput.prototype.onKeyPress = function (e) { + if (e.charCode == 0) { + return; + } + e.preventDefault(); + if (!this.cm.isReadOnly()) { + operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); + } + }; + ContentEditableInput.prototype.readOnlyChanged = function (val) { + this.div.contentEditable = String(val != "nocursor"); + }; + ContentEditableInput.prototype.onContextMenu = function () {}; + ContentEditableInput.prototype.resetPosition = function () {}; + ContentEditableInput.prototype.needsContentAttribute = true; + function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line); + if (!view || view.hidden) { + return null; + } + var line = getLine(cm.doc, pos.line); + var info = mapFromLineView(view, line, pos.line); + var order = getOrder(line, cm.doc.direction), + side = "left"; + if (order) { + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); + result.offset = result.collapse == "right" ? result.end : result.start; + return result; + } + function isInGutter(node) { + for (var scan = node; scan; scan = scan.parentNode) { + if (/CodeMirror-gutter-wrapper/.test(scan.className)) { + return true; + } + } + return false; + } + function badPos(pos, bad) { + if (bad) { + pos.bad = true; + } + return pos; + } + function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", + closing = false, + lineSep = cm.doc.lineSeparator(); + function recognizeMarker(id) { + return function (marker) { + return marker.id == id; + }; + } + function close() { + if (closing) { + text += lineSep; + closing = false; + } + } + function addText(str) { + if (str) { + close(); + text += str; + } + } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text"); + if (cmText != null) { + addText(cmText || node.textContent.replace(/\u200b/g, "")); + return; + } + var markerID = node.getAttribute("cm-marker"), + range; + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); + if (found.length && (range = found[0].find())) { + addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); + } + return; + } + if (node.getAttribute("contenteditable") == "false") { + return; + } + var isBlock = /^(pre|div|p)$/i.test(node.nodeName); + if (isBlock) { + close(); + } + for (var i = 0; i < node.childNodes.length; i++) { + walk(node.childNodes[i]); + } + if (isBlock) { + closing = true; + } + } else if (node.nodeType == 3) { + addText(node.nodeValue); + } + } + for (;;) { + walk(from); + if (from == to) { + break; + } + from = from.nextSibling; + } + return text; + } + function domToPos(cm, node, offset) { + var lineNode; + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset]; + if (!lineNode) { + return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true); + } + node = null; + offset = 0; + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) { + return null; + } + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { + break; + } + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i]; + if (lineView.node == lineNode) { + return locateNodeInLineView(lineView, node, offset); + } + } + } + function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, + bad = false; + if (!node || !contains(wrapper, node)) { + return badPos(Pos(lineNo(lineView.line), 0), true); + } + if (node == wrapper) { + bad = true; + node = wrapper.childNodes[offset]; + offset = 0; + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line; + return badPos(Pos(lineNo(line), line.text.length), bad); + } + } + var textNode = node.nodeType == 3 ? node : null, + topNode = node; + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild; + if (offset) { + offset = textNode.nodeValue.length; + } + } + while (topNode.parentNode != wrapper) { + topNode = topNode.parentNode; + } + var measure = lineView.measure, + maps = measure.maps; + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map = i < 0 ? measure.map : maps[i]; + for (var j = 0; j < map.length; j += 3) { + var curNode = map[j + 2]; + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); + var ch = map[j] + offset; + if (offset < 0 || curNode != textNode) { + ch = map[j + (offset ? 1 : 0)]; + } + return Pos(line, ch); + } + } + } + } + var found = find(textNode, topNode, offset); + if (found) { + return badPos(found, bad); + } + + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0); + if (found) { + return badPos(Pos(found.line, found.ch - dist), bad); + } else { + dist += after.textContent.length; + } + } + for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1); + if (found) { + return badPos(Pos(found.line, found.ch + dist$1), bad); + } else { + dist$1 += before.textContent.length; + } + } + } + + // TEXTAREA INPUT STYLE + + var TextareaInput = function (cm) { + this.cm = cm; + // See input.poll and input.reset + this.prevInput = ""; + + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false; + // Self-resetting timeout for the poller + this.polling = new Delayed(); + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false; + this.composing = null; + }; + TextareaInput.prototype.init = function (display) { + var this$1 = this; + var input = this, + cm = this.cm; + + // Wraps and hides input textarea + var div = this.wrapper = hiddenTextarea(); + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + var te = this.textarea = div.firstChild; + display.wrapper.insertBefore(div, display.wrapper.firstChild); + + // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) + if (ios) { + te.style.width = "0px"; + } + on(te, "input", function () { + if (ie && ie_version >= 9 && this$1.hasSelection) { + this$1.hasSelection = null; + } + input.poll(); + }); + on(te, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { + return; + } + cm.state.pasteIncoming = true; + input.fastPoll(); + }); + function prepareCopyCut(e) { + if (signalDOMEvent(cm, e)) { + return; + } + if (cm.somethingSelected()) { + setLastCopied({ + lineWise: false, + text: cm.getSelections() + }); + } else if (!cm.options.lineWiseCopyCut) { + return; + } else { + var ranges = copyableRanges(cm); + setLastCopied({ + lineWise: true, + text: ranges.text + }); + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll); + } else { + input.prevInput = ""; + te.value = ranges.text.join("\n"); + selectInput(te); + } + } + if (e.type == "cut") { + cm.state.cutIncoming = true; + } + } + on(te, "cut", prepareCopyCut); + on(te, "copy", prepareCopyCut); + on(display.scroller, "paste", function (e) { + if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { + return; + } + cm.state.pasteIncoming = true; + input.focus(); + }); + + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function (e) { + if (!eventInWidget(display, e)) { + e_preventDefault(e); + } + }); + on(te, "compositionstart", function () { + var start = cm.getCursor("from"); + if (input.composing) { + input.composing.range.clear(); + } + input.composing = { + start: start, + range: cm.markText(start, cm.getCursor("to"), { + className: "CodeMirror-composing" + }) + }; + }); + on(te, "compositionend", function () { + if (input.composing) { + input.poll(); + input.composing.range.clear(); + input.composing = null; + } + }); + }; + TextareaInput.prototype.prepareSelection = function () { + // Redraw the selection and/or cursor + var cm = this.cm, + display = cm.display, + doc = cm.doc; + var result = prepareSelection(cm); + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), + lineOff = display.lineDiv.getBoundingClientRect(); + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, headPos.top + lineOff.top - wrapOff.top)); + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, headPos.left + lineOff.left - wrapOff.left)); + } + return result; + }; + TextareaInput.prototype.showSelection = function (drawn) { + var cm = this.cm, + display = cm.display; + removeChildrenAndAdd(display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(display.selectionDiv, drawn.selection); + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px"; + this.wrapper.style.left = drawn.teLeft + "px"; + } + }; + + // Reset the input to correspond to the selection (or to be empty, + // when not typing and nothing is selected) + TextareaInput.prototype.reset = function (typing) { + if (this.contextMenuPending || this.composing) { + return; + } + var cm = this.cm; + if (cm.somethingSelected()) { + this.prevInput = ""; + var content = cm.getSelection(); + this.textarea.value = content; + if (cm.state.focused) { + selectInput(this.textarea); + } + if (ie && ie_version >= 9) { + this.hasSelection = content; + } + } else if (!typing) { + this.prevInput = this.textarea.value = ""; + if (ie && ie_version >= 9) { + this.hasSelection = null; + } + } + }; + TextareaInput.prototype.getField = function () { + return this.textarea; + }; + TextareaInput.prototype.supportsTouch = function () { + return false; + }; + TextareaInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { + try { + this.textarea.focus(); + } catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } + }; + TextareaInput.prototype.blur = function () { + this.textarea.blur(); + }; + TextareaInput.prototype.resetPosition = function () { + this.wrapper.style.top = this.wrapper.style.left = 0; + }; + TextareaInput.prototype.receivedFocus = function () { + this.slowPoll(); + }; + + // Poll for input changes, using the normal rate of polling. This + // runs as long as the editor is focused. + TextareaInput.prototype.slowPoll = function () { + var this$1 = this; + if (this.pollingFast) { + return; + } + this.polling.set(this.cm.options.pollInterval, function () { + this$1.poll(); + if (this$1.cm.state.focused) { + this$1.slowPoll(); + } + }); + }; + + // When an event has just come in that is likely to add or change + // something in the input textarea, we poll faster, to ensure that + // the change appears on the screen quickly. + TextareaInput.prototype.fastPoll = function () { + var missed = false, + input = this; + input.pollingFast = true; + function p() { + var changed = input.poll(); + if (!changed && !missed) { + missed = true; + input.polling.set(60, p); + } else { + input.pollingFast = false; + input.slowPoll(); + } + } + input.polling.set(20, p); + }; + + // Read input from the textarea, and update the document to match. + // When something is selected, it is present in the textarea, and + // selected (unless it is huge, in which case a placeholder is + // used). When nothing is selected, the cursor sits after previously + // seen text (can be empty), which is stored in prevInput (we must + // not reset the textarea when typing, because that breaks IME). + TextareaInput.prototype.poll = function () { + var this$1 = this; + var cm = this.cm, + input = this.textarea, + prevInput = this.prevInput; + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (this.contextMenuPending || !cm.state.focused || hasSelection(input) && !prevInput && !this.composing || cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) { + return false; + } + var text = input.value; + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) { + return false; + } + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset(); + return false; + } + if (cm.doc.sel == cm.display.selForContextMenu) { + var first = text.charCodeAt(0); + if (first == 0x200b && !prevInput) { + prevInput = "\u200b"; + } + if (first == 0x21da) { + this.reset(); + return this.cm.execCommand("undo"); + } + } + // Find the part of the input that is actually new + var same = 0, + l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { + ++same; + } + runInOp(cm, function () { + applyTextInput(cm, text.slice(same), prevInput.length - same, null, this$1.composing ? "*compose" : null); + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) { + input.value = this$1.prevInput = ""; + } else { + this$1.prevInput = text; + } + if (this$1.composing) { + this$1.composing.range.clear(); + this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), { + className: "CodeMirror-composing" + }); + } + }); + return true; + }; + TextareaInput.prototype.ensurePolled = function () { + if (this.pollingFast && this.poll()) { + this.pollingFast = false; + } + }; + TextareaInput.prototype.onKeyPress = function () { + if (ie && ie_version >= 9) { + this.hasSelection = null; + } + this.fastPoll(); + }; + TextareaInput.prototype.onContextMenu = function (e) { + var input = this, + cm = input.cm, + display = cm.display, + te = input.textarea; + var pos = posFromMouse(cm, e), + scrollPos = display.scroller.scrollTop; + if (!pos || presto) { + return; + } // Opera is difficult. + + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu; + if (reset && cm.doc.sel.contains(pos) == -1) { + operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); + } + var oldCSS = te.style.cssText, + oldWrapperCSS = input.wrapper.style.cssText; + input.wrapper.style.cssText = "position: absolute"; + var wrapperBox = input.wrapper.getBoundingClientRect(); + te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + var oldScrollY; + if (webkit) { + oldScrollY = window.scrollY; + } // Work around Chrome issue (#2712) + display.input.focus(); + if (webkit) { + window.scrollTo(null, oldScrollY); + } + display.input.reset(); + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) { + te.value = input.prevInput = " "; + } + input.contextMenuPending = true; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected(); + var extval = "\u200b" + (selected ? te.value : ""); + te.value = "\u21da"; // Used to catch context-menu undo + te.value = extval; + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; + te.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel; + } + } + function rehide() { + input.contextMenuPending = false; + input.wrapper.style.cssText = oldWrapperCSS; + te.style.cssText = oldCSS; + if (ie && ie_version < 9) { + display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); + } + + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || ie && ie_version < 9) { + prepareSelectAllHack(); + } + var i = 0, + poll = function () { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && te.selectionEnd > 0 && input.prevInput == "\u200b") { + operation(cm, selectAll)(cm); + } else if (i++ < 10) { + display.detectingSelectAll = setTimeout(poll, 500); + } else { + display.selForContextMenu = null; + display.input.reset(); + } + }; + display.detectingSelectAll = setTimeout(poll, 200); + } + } + if (ie && ie_version >= 9) { + prepareSelectAllHack(); + } + if (captureRightClick) { + e_stop(e); + var mouseup = function () { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); + } else { + setTimeout(rehide, 50); + } + }; + TextareaInput.prototype.readOnlyChanged = function (val) { + if (!val) { + this.reset(); + } + this.textarea.disabled = val == "nocursor"; + }; + TextareaInput.prototype.setUneditable = function () {}; + TextareaInput.prototype.needsContentAttribute = false; + function fromTextArea(textarea, options) { + options = options ? copyObj(options) : {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabIndex) { + options.tabindex = textarea.tabIndex; + } + if (!options.placeholder && textarea.placeholder) { + options.placeholder = textarea.placeholder; + } + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt(); + options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + function save() { + textarea.value = cm.getValue(); + } + var realSubmit; + if (textarea.form) { + on(textarea.form, "submit", save); + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form; + realSubmit = form.submit; + try { + var wrappedSubmit = form.submit = function () { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch (e) {} + } + } + options.finishInit = function (cm) { + cm.save = save; + cm.getTextArea = function () { + return textarea; + }; + cm.toTextArea = function () { + cm.toTextArea = isNaN; // Prevent this from being ran twice + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (typeof textarea.form.submit == "function") { + textarea.form.submit = realSubmit; + } + } + }; + }; + textarea.style.display = "none"; + var cm = CodeMirror(function (node) { + return textarea.parentNode.insertBefore(node, textarea.nextSibling); + }, options); + return cm; + } + function addLegacyProps(CodeMirror) { + CodeMirror.off = off; + CodeMirror.on = on; + CodeMirror.wheelEventPixels = wheelEventPixels; + CodeMirror.Doc = Doc; + CodeMirror.splitLines = splitLinesAuto; + CodeMirror.countColumn = countColumn; + CodeMirror.findColumn = findColumn; + CodeMirror.isWordChar = isWordCharBasic; + CodeMirror.Pass = Pass; + CodeMirror.signal = signal; + CodeMirror.Line = Line; + CodeMirror.changeEnd = changeEnd; + CodeMirror.scrollbarModel = scrollbarModel; + CodeMirror.Pos = Pos; + CodeMirror.cmpPos = cmp; + CodeMirror.modes = modes; + CodeMirror.mimeModes = mimeModes; + CodeMirror.resolveMode = resolveMode; + CodeMirror.getMode = getMode; + CodeMirror.modeExtensions = modeExtensions; + CodeMirror.extendMode = extendMode; + CodeMirror.copyState = copyState; + CodeMirror.startState = startState; + CodeMirror.innerMode = innerMode; + CodeMirror.commands = commands; + CodeMirror.keyMap = keyMap; + CodeMirror.keyName = keyName; + CodeMirror.isModifierKey = isModifierKey; + CodeMirror.lookupKey = lookupKey; + CodeMirror.normalizeKeyMap = normalizeKeyMap; + CodeMirror.StringStream = StringStream; + CodeMirror.SharedTextMarker = SharedTextMarker; + CodeMirror.TextMarker = TextMarker; + CodeMirror.LineWidget = LineWidget; + CodeMirror.e_preventDefault = e_preventDefault; + CodeMirror.e_stopPropagation = e_stopPropagation; + CodeMirror.e_stop = e_stop; + CodeMirror.addClass = addClass; + CodeMirror.contains = contains; + CodeMirror.rmClass = rmClass; + CodeMirror.keyNames = keyNames; + } + + // EDITOR CONSTRUCTOR + + defineOptions(CodeMirror); + addEditorMethods(CodeMirror); + + // Set up methods on CodeMirror's prototype to redirect to the editor's document. + var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); + for (var prop in Doc.prototype) { + if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) { + CodeMirror.prototype[prop] = function (method) { + return function () { + return method.apply(this.doc, arguments); + }; + }(Doc.prototype[prop]); + } + } + eventMixin(Doc); + + // INPUT HANDLING + + CodeMirror.inputStyles = { + "textarea": TextareaInput, + "contenteditable": ContentEditableInput + }; + + // MODE DEFINITION AND QUERYING + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + CodeMirror.defineMode = function (name /*, mode, …*/) { + if (!CodeMirror.defaults.mode && name != "null") { + CodeMirror.defaults.mode = name; + } + defineMode.apply(this, arguments); + }; + CodeMirror.defineMIME = defineMIME; + + // Minimal default mode. + CodeMirror.defineMode("null", function () { + return { + token: function (stream) { + return stream.skipToEnd(); + } + }; + }); + CodeMirror.defineMIME("text/plain", "null"); + + // EXTENSIONS + + CodeMirror.defineExtension = function (name, func) { + CodeMirror.prototype[name] = func; + }; + CodeMirror.defineDocExtension = function (name, func) { + Doc.prototype[name] = func; + }; + CodeMirror.fromTextArea = fromTextArea; + addLegacyProps(CodeMirror); + CodeMirror.version = "5.28.0"; + return CodeMirror; + }); + + /*! + * clipboard.js v1.7.1 + * https://zenorocha.github.io/clipboard.js + * + * Licensed MIT © Zeno Rocha + */ + (function (f) { + if (typeof exports === "object" && typeof module !== "undefined") { + module.exports = f(); + } else if (typeof define === "function" && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== "undefined") { + g = window; + } else if (typeof global !== "undefined") { + g = global; + } else if (typeof self !== "undefined") { + g = self; + } else { + g = this; + } + g.Clipboard = f(); + } + })(function () { + return function e(t, n, r) { + function s(o, u) { + if (!n[o]) { + if (!t[o]) { + var a = typeof require == "function" && require; + if (!u && a) return a(o, !0); + if (i) return i(o, !0); + var f = new Error("Cannot find module '" + o + "'"); + throw f.code = "MODULE_NOT_FOUND", f; + } + var l = n[o] = { + exports: {} + }; + t[o][0].call(l.exports, function (e) { + var n = t[o][1][e]; + return s(n ? n : e); + }, l, l.exports, e, t, n, r); + } + return n[o].exports; + } + var i = typeof require == "function" && require; + for (var o = 0; o < r.length; o++) s(r[o]); + return s; + }({ + 1: [function (require, module, exports) { + var DOCUMENT_NODE_TYPE = 9; + + /** + * A polyfill for Element.matches() + */ + if (typeof Element !== 'undefined' && !Element.prototype.matches) { + var proto = Element.prototype; + proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector; + } + + /** + * Finds the closest parent that matches a selector. + * + * @param {Element} element + * @param {String} selector + * @return {Function} + */ + function closest(element, selector) { + while (element && element.nodeType !== DOCUMENT_NODE_TYPE) { + if (typeof element.matches === 'function' && element.matches(selector)) { + return element; + } + element = element.parentNode; + } + } + module.exports = closest; + }, {}], + 2: [function (require, module, exports) { + var closest = require('./closest'); + + /** + * Delegates event to a selector. + * + * @param {Element} element + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @param {Boolean} useCapture + * @return {Object} + */ + function delegate(element, selector, type, callback, useCapture) { + var listenerFn = listener.apply(this, arguments); + element.addEventListener(type, listenerFn, useCapture); + return { + destroy: function () { + element.removeEventListener(type, listenerFn, useCapture); + } + }; + } + + /** + * Finds closest match and invokes callback. + * + * @param {Element} element + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @return {Function} + */ + function listener(element, selector, type, callback) { + return function (e) { + e.delegateTarget = closest(e.target, selector); + if (e.delegateTarget) { + callback.call(element, e); + } + }; + } + module.exports = delegate; + }, { + "./closest": 1 + }], + 3: [function (require, module, exports) { + /** + * Check if argument is a HTML element. + * + * @param {Object} value + * @return {Boolean} + */ + exports.node = function (value) { + return value !== undefined && (value instanceof HTMLElement || value instanceof SVGElement) && value.nodeType === 1; + }; + + /** + * Check if argument is a list of HTML elements. + * + * @param {Object} value + * @return {Boolean} + */ + exports.nodeList = function (value) { + var type = Object.prototype.toString.call(value); + return value !== undefined && (type === '[object NodeList]' || type === '[object HTMLCollection]') && 'length' in value && (value.length === 0 || exports.node(value[0])); + }; + + /** + * Check if argument is a string. + * + * @param {Object} value + * @return {Boolean} + */ + exports.string = function (value) { + return typeof value === 'string' || value instanceof String; + }; + + /** + * Check if argument is a function. + * + * @param {Object} value + * @return {Boolean} + */ + exports.fn = function (value) { + var type = Object.prototype.toString.call(value); + return type === '[object Function]'; + }; + }, {}], + 4: [function (require, module, exports) { + var is = require('./is'); + var delegate = require('delegate'); + + /** + * Validates all params and calls the right + * listener function based on its target type. + * + * @param {String|HTMLElement|HTMLCollection|NodeList} target + * @param {String} type + * @param {Function} callback + * @return {Object} + */ + function listen(target, type, callback) { + if (!target && !type && !callback) { + throw new Error('Missing required arguments'); + } + if (!is.string(type)) { + throw new TypeError('Second argument must be a String'); + } + if (!is.fn(callback)) { + throw new TypeError('Third argument must be a Function'); + } + if (is.node(target)) { + return listenNode(target, type, callback); + } else if (is.nodeList(target)) { + return listenNodeList(target, type, callback); + } else if (is.string(target)) { + return listenSelector(target, type, callback); + } else { + throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList'); + } + } + + /** + * Adds an event listener to a HTML element + * and returns a remove listener function. + * + * @param {HTMLElement} node + * @param {String} type + * @param {Function} callback + * @return {Object} + */ + function listenNode(node, type, callback) { + node.addEventListener(type, callback); + return { + destroy: function () { + node.removeEventListener(type, callback); + } + }; + } + + /** + * Add an event listener to a list of HTML elements + * and returns a remove listener function. + * + * @param {NodeList|HTMLCollection} nodeList + * @param {String} type + * @param {Function} callback + * @return {Object} + */ + function listenNodeList(nodeList, type, callback) { + Array.prototype.forEach.call(nodeList, function (node) { + node.addEventListener(type, callback); + }); + return { + destroy: function () { + Array.prototype.forEach.call(nodeList, function (node) { + node.removeEventListener(type, callback); + }); + } + }; + } + + /** + * Add an event listener to a selector + * and returns a remove listener function. + * + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @return {Object} + */ + function listenSelector(selector, type, callback) { + return delegate(document.body, selector, type, callback); + } + module.exports = listen; + }, { + "./is": 3, + "delegate": 2 + }], + 5: [function (require, module, exports) { + function select(element) { + var selectedText; + if (element.nodeName === 'SELECT') { + element.focus(); + selectedText = element.value; + } else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') { + var isReadOnly = element.hasAttribute('readonly'); + if (!isReadOnly) { + element.setAttribute('readonly', ''); + } + element.select(); + element.setSelectionRange(0, element.value.length); + if (!isReadOnly) { + element.removeAttribute('readonly'); + } + selectedText = element.value; + } else { + if (element.hasAttribute('contenteditable')) { + element.focus(); + } + var selection = window.getSelection(); + var range = document.createRange(); + range.selectNodeContents(element); + selection.removeAllRanges(); + selection.addRange(range); + selectedText = selection.toString(); + } + return selectedText; + } + module.exports = select; + }, {}], + 6: [function (require, module, exports) { + function E() { + // Keep this empty so it's easier to inherit from + // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3) + } + E.prototype = { + on: function (name, callback, ctx) { + var e = this.e || (this.e = {}); + (e[name] || (e[name] = [])).push({ + fn: callback, + ctx: ctx + }); + return this; + }, + once: function (name, callback, ctx) { + var self = this; + function listener() { + self.off(name, listener); + callback.apply(ctx, arguments); + } + listener._ = callback; + return this.on(name, listener, ctx); + }, + emit: function (name) { + var data = [].slice.call(arguments, 1); + var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); + var i = 0; + var len = evtArr.length; + for (i; i < len; i++) { + evtArr[i].fn.apply(evtArr[i].ctx, data); + } + return this; + }, + off: function (name, callback) { + var e = this.e || (this.e = {}); + var evts = e[name]; + var liveEvents = []; + if (evts && callback) { + for (var i = 0, len = evts.length; i < len; i++) { + if (evts[i].fn !== callback && evts[i].fn._ !== callback) liveEvents.push(evts[i]); + } + } + + // Remove event from queue to prevent memory leak + // Suggested by https://github.com/lazd + // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910 + + liveEvents.length ? e[name] = liveEvents : delete e[name]; + return this; + } + }; + module.exports = E; + }, {}], + 7: [function (require, module, exports) { + (function (global, factory) { + if (typeof exports !== "undefined") { + factory(module, require('select')); + } else { + var mod = { + exports: {} + }; + factory(mod, global.select); + global.clipboardAction = mod.exports; + } + })(this, function (module, _select) { + + var _select2 = _interopRequireDefault(_select); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + var ClipboardAction = function () { + /** + * @param {Object} options + */ + function ClipboardAction(options) { + _classCallCheck(this, ClipboardAction); + this.resolveOptions(options); + this.initSelection(); + } + + /** + * Defines base properties passed from constructor. + * @param {Object} options + */ + + _createClass(ClipboardAction, [{ + key: 'resolveOptions', + value: function resolveOptions() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + this.action = options.action; + this.container = options.container; + this.emitter = options.emitter; + this.target = options.target; + this.text = options.text; + this.trigger = options.trigger; + this.selectedText = ''; + } + }, { + key: 'initSelection', + value: function initSelection() { + if (this.text) { + this.selectFake(); + } else if (this.target) { + this.selectTarget(); + } + } + }, { + key: 'selectFake', + value: function selectFake() { + var _this = this; + var isRTL = document.documentElement.getAttribute('dir') == 'rtl'; + this.removeFake(); + this.fakeHandlerCallback = function () { + return _this.removeFake(); + }; + this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true; + this.fakeElem = document.createElement('textarea'); + // Prevent zooming on iOS + this.fakeElem.style.fontSize = '12pt'; + // Reset box model + this.fakeElem.style.border = '0'; + this.fakeElem.style.padding = '0'; + this.fakeElem.style.margin = '0'; + // Move element out of screen horizontally + this.fakeElem.style.position = 'absolute'; + this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px'; + // Move element to the same position vertically + var yPosition = window.pageYOffset || document.documentElement.scrollTop; + this.fakeElem.style.top = yPosition + 'px'; + this.fakeElem.setAttribute('readonly', ''); + this.fakeElem.value = this.text; + this.container.appendChild(this.fakeElem); + this.selectedText = (0, _select2.default)(this.fakeElem); + this.copyText(); + } + }, { + key: 'removeFake', + value: function removeFake() { + if (this.fakeHandler) { + this.container.removeEventListener('click', this.fakeHandlerCallback); + this.fakeHandler = null; + this.fakeHandlerCallback = null; + } + if (this.fakeElem) { + this.container.removeChild(this.fakeElem); + this.fakeElem = null; + } + } + }, { + key: 'selectTarget', + value: function selectTarget() { + this.selectedText = (0, _select2.default)(this.target); + this.copyText(); + } + }, { + key: 'copyText', + value: function copyText() { + var succeeded = void 0; + try { + succeeded = document.execCommand(this.action); + } catch (err) { + succeeded = false; + } + this.handleResult(succeeded); + } + }, { + key: 'handleResult', + value: function handleResult(succeeded) { + this.emitter.emit(succeeded ? 'success' : 'error', { + action: this.action, + text: this.selectedText, + trigger: this.trigger, + clearSelection: this.clearSelection.bind(this) + }); + } + }, { + key: 'clearSelection', + value: function clearSelection() { + if (this.trigger) { + this.trigger.focus(); + } + window.getSelection().removeAllRanges(); + } + }, { + key: 'destroy', + value: function destroy() { + this.removeFake(); + } + }, { + key: 'action', + set: function set() { + var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy'; + this._action = action; + if (this._action !== 'copy' && this._action !== 'cut') { + throw new Error('Invalid "action" value, use either "copy" or "cut"'); + } + }, + get: function get() { + return this._action; + } + }, { + key: 'target', + set: function set(target) { + if (target !== undefined) { + if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) { + if (this.action === 'copy' && target.hasAttribute('disabled')) { + throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); + } + if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { + throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); + } + this._target = target; + } else { + throw new Error('Invalid "target" value, use a valid Element'); + } + } + }, + get: function get() { + return this._target; + } + }]); + return ClipboardAction; + }(); + module.exports = ClipboardAction; + }); + }, { + "select": 5 + }], + 8: [function (require, module, exports) { + (function (global, factory) { + if (typeof exports !== "undefined") { + factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener')); + } else { + var mod = { + exports: {} + }; + factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener); + global.clipboard = mod.exports; + } + })(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) { + + var _clipboardAction2 = _interopRequireDefault(_clipboardAction); + var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter); + var _goodListener2 = _interopRequireDefault(_goodListener); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var Clipboard = function (_Emitter) { + _inherits(Clipboard, _Emitter); + + /** + * @param {String|HTMLElement|HTMLCollection|NodeList} trigger + * @param {Object} options + */ + function Clipboard(trigger, options) { + _classCallCheck(this, Clipboard); + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this)); + _this.resolveOptions(options); + _this.listenClick(trigger); + return _this; + } + + /** + * Defines if attributes would be resolved using internal setter functions + * or custom functions that were passed in the constructor. + * @param {Object} options + */ + + _createClass(Clipboard, [{ + key: 'resolveOptions', + value: function resolveOptions() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + this.action = typeof options.action === 'function' ? options.action : this.defaultAction; + this.target = typeof options.target === 'function' ? options.target : this.defaultTarget; + this.text = typeof options.text === 'function' ? options.text : this.defaultText; + this.container = _typeof(options.container) === 'object' ? options.container : document.body; + } + }, { + key: 'listenClick', + value: function listenClick(trigger) { + var _this2 = this; + this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) { + return _this2.onClick(e); + }); + } + }, { + key: 'onClick', + value: function onClick(e) { + var trigger = e.delegateTarget || e.currentTarget; + if (this.clipboardAction) { + this.clipboardAction = null; + } + this.clipboardAction = new _clipboardAction2.default({ + action: this.action(trigger), + target: this.target(trigger), + text: this.text(trigger), + container: this.container, + trigger: trigger, + emitter: this + }); + } + }, { + key: 'defaultAction', + value: function defaultAction(trigger) { + return getAttributeValue('action', trigger); + } + }, { + key: 'defaultTarget', + value: function defaultTarget(trigger) { + var selector = getAttributeValue('target', trigger); + if (selector) { + return document.querySelector(selector); + } + } + }, { + key: 'defaultText', + value: function defaultText(trigger) { + return getAttributeValue('text', trigger); + } + }, { + key: 'destroy', + value: function destroy() { + this.listener.destroy(); + if (this.clipboardAction) { + this.clipboardAction.destroy(); + this.clipboardAction = null; + } + } + }], [{ + key: 'isSupported', + value: function isSupported() { + var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; + var actions = typeof action === 'string' ? [action] : action; + var support = !!document.queryCommandSupported; + actions.forEach(function (action) { + support = support && !!document.queryCommandSupported(action); + }); + return support; + } + }]); + return Clipboard; + }(_tinyEmitter2.default); + + /** + * Helper function to retrieve attribute value. + * @param {String} suffix + * @param {Element} element + */ + function getAttributeValue(suffix, element) { + var attribute = 'data-clipboard-' + suffix; + if (!element.hasAttribute(attribute)) { + return; + } + return element.getAttribute(attribute); + } + module.exports = Clipboard; + }); + }, { + "./clipboard-action": 7, + "good-listener": 4, + "tiny-emitter": 6 + }] + }, {}, [8])(8); + }); + + window._native = function () { + var _options = {}; + var _construct = function _construct(e) { + var defaultOptions = { + carbonZoneKey: '', + fallback: '', + ignore: 'false', + placement: '', + prefix: 'native', + targetClass: 'native-ad' + }; + if (typeof e === 'undefined') return defaultOptions; + Object.keys(defaultOptions).forEach(function (key, index) { + if (typeof e[key] === 'undefined') { + e[key] = defaultOptions[key]; + } + }); + return e; + }; + var init = function init(zone, options) { + _options = _construct(options); + var jsonUrl = 'https://srv.buysellads.com/ads/' + zone + '.json?callback=_native_go'; + if (_options['placement'] !== '') { + jsonUrl += '&segment=placement:' + _options['placement']; + } + if (_options['ignore'] === 'true') { + jsonUrl += '&ignore=yes'; + } + var srv = document.createElement('script'); + srv.src = jsonUrl; + document.getElementsByTagName('head')[0].appendChild(srv); + }; + var carbon = function carbon(e) { + var srv = document.createElement('script'); + srv.src = '//cdn.carbonads.com/carbon.js?serve=' + e['carbonZoneKey'] + '&placement=' + e['placement']; + srv.id = '_carbonads_js'; + return srv; + }; + var sanitize = function sanitize(ads) { + return ads.filter(function (ad) { + return Object.keys(ad).length > 0; + }).filter(function (ad) { + return ad.hasOwnProperty('statlink'); + }); + }; + var pixel = function pixel(p, timestamp) { + var c = ''; + if (p) { + p.split('||').forEach(function (pixel, index) { + c += ''; + }); + } + return c; + }; + var options = function options() { + return _options; + }; + return { + carbon: carbon, + init: init, + options: options, + pixel: pixel, + sanitize: sanitize + }; + }(); + window._native_go = function (json) { + var options = _native.options(); + var ads = _native.sanitize(json['ads']); + var selectedClass = document.querySelectorAll('.' + options['targetClass']); + if (ads.length < 1) { + selectedClass.forEach(function (className, index) { + var selectedTarget = document.getElementsByClassName(options['targetClass'])[index]; + if (options['fallback'] !== '' || options['carbonZoneKey'] !== '') selectedTarget.setAttribute('data-state', 'visible'); + selectedTarget.innerHTML = options['fallback']; + if (options['carbonZoneKey'] !== '') selectedTarget.appendChild(_native.carbon(options)); + }); + + // End at this line if no ads are found, avoiding unnecessary steps + return; + } + selectedClass.forEach(function (className, index) { + var selectedTarget = document.getElementsByClassName(options['targetClass'])[index]; + var adElement = selectedTarget.innerHTML || ""; + var prefix = options['prefix']; + var ad = ads[index]; + if (ad && className) { + var adInnerHtml = adElement.replace(new RegExp('#' + prefix + '_bg_color#', 'g'), ad['backgroundColor']).replace(new RegExp('#' + prefix + '_bg_color_hover#', 'g'), ad['backgroundHoverColor']).replace(new RegExp('#' + prefix + '_company#', 'g'), ad['company']).replace(new RegExp('#' + prefix + '_cta#', 'g'), ad['callToAction']).replace(new RegExp('#' + prefix + '_cta_bg_color#', 'g'), ad['ctaBackgroundColor']).replace(new RegExp('#' + prefix + '_cta_bg_color_hover#', 'g'), ad['ctaBackgroundHoverColor']).replace(new RegExp('#' + prefix + '_cta_color#', 'g'), ad['ctaTextColor']).replace(new RegExp('#' + prefix + '_cta_color_hover#', 'g'), ad['ctaTextColorHover']).replace(new RegExp('#' + prefix + '_desc#', 'g'), ad['description']).replace(new RegExp('#' + prefix + '_index#', 'g'), prefix + '-' + ad['i']).replace(new RegExp('#' + prefix + '_img#', 'g'), ad['image']).replace(new RegExp('#' + prefix + '_small_img#', 'g'), ad['smallImage']).replace(new RegExp('#' + prefix + '_link#', 'g'), ad['statlink']).replace(new RegExp('#' + prefix + '_logo#', 'g'), ad['logo']).replace(new RegExp('#' + prefix + '_color#', 'g'), ad['textColor']).replace(new RegExp('#' + prefix + '_color_hover#', 'g'), ad['textColorHover']).replace(new RegExp('#' + prefix + '_title#', 'g'), ad['title']); + selectedTarget.innerHTML = adInnerHtml + _native.pixel(ad['pixel'], ad['timestamp']); + selectedTarget.setAttribute('data-state', 'visible'); + } else { + selectedTarget.innerHTML = ""; + } + }); + }; + + /* + * Event + * Visit http://createjs.com/ for documentation, updates and examples. + * + * Copyright (c) 2010 gskinner.com, inc. + * + * 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. + */ + + /** + * A collection of Classes that are shared across all the CreateJS libraries. The classes are included in the minified + * files of each library and are available on the createjs namespace directly. + * + *

Example

+ * + * myObject.addEventListener("change", createjs.proxy(myMethod, scope)); + * + * @module CreateJS + * @main CreateJS + */ + + /** + * Contains properties and methods shared by all events for use with + * {{#crossLink "EventDispatcher"}}{{/crossLink}}. + * + * Note that Event objects are often reused, so you should never + * rely on an event object's state outside of the call stack it was received in. + * @class Event + * @param {String} type The event type. + * @param {Boolean} bubbles Indicates whether the event will bubble through the display list. + * @param {Boolean} cancelable Indicates whether the default behaviour of this event can be cancelled. + * @constructor + **/ + class Event { + constructor(type, bubbles, cancelable) { + // public properties: + /** + * The type of event. + * @property type + * @type String + **/ + this.type = type; + + /** + * The object that generated an event. + * @property target + * @type Object + * @default null + * @readonly + */ + this.target = null; + + /** + * The current target that a bubbling event is being dispatched from. For non-bubbling events, this will + * always be the same as target. For example, if childObj.parent = parentObj, and a bubbling event + * is generated from childObj, then a listener on parentObj would receive the event with + * target=childObj (the original target) and currentTarget=parentObj (where the listener was added). + * @property currentTarget + * @type Object + * @default null + * @readonly + */ + this.currentTarget = null; + + /** + * For bubbling events, this indicates the current event phase:
    + *
  1. capture phase: starting from the top parent to the target
  2. + *
  3. at target phase: currently being dispatched from the target
  4. + *
  5. bubbling phase: from the target to the top parent
  6. + *
+ * @property eventPhase + * @type Number + * @default 0 + * @readonly + */ + this.eventPhase = 0; + + /** + * Indicates whether the event will bubble through the display list. + * @property bubbles + * @type Boolean + * @default false + * @readonly + */ + this.bubbles = !!bubbles; + + /** + * Indicates whether the default behaviour of this event can be cancelled via + * {{#crossLink "Event/preventDefault"}}{{/crossLink}}. This is set via the Event constructor. + * @property cancelable + * @type Boolean + * @default false + * @readonly + */ + this.cancelable = !!cancelable; + + /** + * The epoch time at which this event was created. + * @property timeStamp + * @type Number + * @default 0 + * @readonly + */ + this.timeStamp = new Date().getTime(); + + /** + * Indicates if {{#crossLink "Event/preventDefault"}}{{/crossLink}} has been called + * on this event. + * @property defaultPrevented + * @type Boolean + * @default false + * @readonly + */ + this.defaultPrevented = false; + + /** + * Indicates if {{#crossLink "Event/stopPropagation"}}{{/crossLink}} or + * {{#crossLink "Event/stopImmediatePropagation"}}{{/crossLink}} has been called on this event. + * @property propagationStopped + * @type Boolean + * @default false + * @readonly + */ + this.propagationStopped = false; + + /** + * Indicates if {{#crossLink "Event/stopImmediatePropagation"}}{{/crossLink}} has been called + * on this event. + * @property immediatePropagationStopped + * @type Boolean + * @default false + * @readonly + */ + this.immediatePropagationStopped = false; + + /** + * Indicates if {{#crossLink "Event/remove"}}{{/crossLink}} has been called on this event. + * @property removed + * @type Boolean + * @default false + * @readonly + */ + this.removed = false; + } + + // public methods: + /** + * Sets {{#crossLink "Event/defaultPrevented"}}{{/crossLink}} to true if the event is cancelable. + * Mirrors the DOM level 2 event standard. In general, cancelable events that have `preventDefault()` called will + * cancel the default behaviour associated with the event. + * @method preventDefault + **/ + preventDefault() { + this.defaultPrevented = this.cancelable && true; + } + /** + * Sets {{#crossLink "Event/propagationStopped"}}{{/crossLink}} to true. + * Mirrors the DOM event standard. + * @method stopPropagation + **/ + stopPropagation() { + this.propagationStopped = true; + } + /** + * Sets {{#crossLink "Event/propagationStopped"}}{{/crossLink}} and + * {{#crossLink "Event/immediatePropagationStopped"}}{{/crossLink}} to true. + * Mirrors the DOM event standard. + * @method stopImmediatePropagation + **/ + stopImmediatePropagation() { + this.immediatePropagationStopped = this.propagationStopped = true; + } + /** + * Causes the active listener to be removed via removeEventListener(); + * + * myBtn.addEventListener("click", function(evt) { + * // do stuff... + * evt.remove(); // removes this listener. + * }); + * + * @method remove + **/ + remove() { + this.removed = true; + } + /** + * Returns a clone of the Event instance. + * @method clone + * @return {Event} a clone of the Event instance. + **/ + clone() { + return new Event(this.type, this.bubbles, this.cancelable); + } + /** + * Provides a chainable shortcut method for setting a number of properties on the instance. + * + * @method set + * @param {Object} props A generic object containing properties to copy to the instance. + * @return {Event} Returns the instance the method is called on (useful for chaining calls.) + * @chainable + */ + set(props) { + for (let n in props) { + this[n] = props[n]; + } + return this; + } + /** + * Returns a string representation of this object. + * @method toString + * @return {String} a string representation of the instance. + **/ + toString() { + return "[Event (type=" + this.type + ")]"; + } + } + + /* + * EventDispatcher + * Visit http://createjs.com/ for documentation, updates and examples. + * + * Copyright (c) 2010 gskinner.com, inc. + * + * 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. + */ + class EventDispatcher { + constructor() { + // private properties: + /** + * @protected + * @property _listeners + * @type Object + **/ + this._listeners = null; + + /** + * @protected + * @property _captureListeners + * @type Object + **/ + this._captureListeners = null; + + /** + * A shortcut to the removeEventListener method, with the same parameters and return value. This is a companion to the + * .on method. + * + * IMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener. See + * {{#crossLink "EventDispatcher/on"}}{{/crossLink}} for an example. + * + * @method off + * @param {String} type The string type of the event. + * @param {Function | Object} listener The listener function or object. + * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + **/ + this.off = this.removeEventListener; + } + + // static public methods: + /** + * Static initializer to mix EventDispatcher methods into a target object or prototype. + * + * EventDispatcher.initialize(MyClass.prototype); // add to the prototype of the class + * EventDispatcher.initialize(myObject); // add to a specific instance + * + * @method initialize + * @static + * @param {Object} target The target object to inject EventDispatcher methods into. This can be an instance or a + * prototype. + **/ + static EventDispatcher(target) { + target.addEventListener = p.addEventListener; + target.on = p.on; + target.removeEventListener = target.off = p.removeEventListener; + target.removeAllEventListeners = p.removeAllEventListeners; + target.hasEventListener = p.hasEventListener; + target.dispatchEvent = p.dispatchEvent; + target._dispatchEvent = p._dispatchEvent; + target.willTrigger = p.willTrigger; + } + // public methods: + /** + * Adds the specified event listener. Note that adding multiple listeners to the same function will result in + * multiple callbacks getting fired. + * + *

Example

+ * + * displayObject.addEventListener("click", handleClick); + * function handleClick(event) { + * // Click happened. + * } + * + * @method addEventListener + * @param {String} type The string type of the event. + * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when + * the event is dispatched. + * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + * @return {Function | Object} Returns the listener for chaining or assignment. + **/ + addEventListener(type, listener, useCapture) { + let listeners; + if (useCapture) { + listeners = this._captureListeners = this._captureListeners || {}; + } else { + listeners = this._listeners = this._listeners || {}; + } + let arr = listeners[type]; + if (arr) { + this.removeEventListener(type, listener, useCapture); + } + arr = listeners[type]; // remove may have deleted the array + if (!arr) { + listeners[type] = [listener]; + } else { + arr.push(listener); + } + return listener; + } + /** + * A shortcut method for using addEventListener that makes it easier to specify an execution scope, have a listener + * only run once, associate arbitrary data with the listener, and remove the listener. + * + * This method works by creating an anonymous wrapper function and subscribing it with addEventListener. + * The wrapper function is returned for use with `removeEventListener` (or `off`). + * + * IMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener, or use + * {{#crossLink "Event/remove"}}{{/crossLink}}. Likewise, each time you call `on` a NEW wrapper function is subscribed, so multiple calls + * to `on` with the same params will create multiple listeners. + * + *

Example

+ * + * var listener = myBtn.on("click", handleClick, null, false, {count:3}); + * function handleClick(evt, data) { + * data.count -= 1; + * console.log(this == myBtn); // true - scope defaults to the dispatcher + * if (data.count == 0) { + * alert("clicked 3 times!"); + * myBtn.off("click", listener); + * // alternately: evt.remove(); + * } + * } + * + * @method on + * @param {String} type The string type of the event. + * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when + * the event is dispatched. + * @param {Object} [scope] The scope to execute the listener in. Defaults to the dispatcher/currentTarget for function listeners, and to the listener itself for object listeners (ie. using handleEvent). + * @param {Boolean} [once=false] If true, the listener will remove itself after the first time it is triggered. + * @param {*} [data] Arbitrary data that will be included as the second parameter when the listener is called. + * @param {Boolean} [useCapture=false] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + * @return {Function} Returns the anonymous function that was created and assigned as the listener. This is needed to remove the listener later using .removeEventListener. + **/ + on(type, listener, scope, once, data, useCapture) { + if (listener.handleEvent) { + scope = scope || listener; + listener = listener.handleEvent; + } + scope = scope || this; + return this.addEventListener(type, function (evt) { + listener.call(scope, evt, data); + once && evt.remove(); + }, useCapture); + } + /** + * Removes the specified event listener. + * + * Important Note: that you must pass the exact function reference used when the event was added. If a proxy + * function, or function closure is used as the callback, the proxy/closure reference must be used - a new proxy or + * closure will not work. + * + *

Example

+ * + * displayObject.removeEventListener("click", handleClick); + * + * @method removeEventListener + * @param {String} type The string type of the event. + * @param {Function | Object} listener The listener function or object. + * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + **/ + removeEventListener(type, listener, useCapture) { + let listeners = useCapture ? this._captureListeners : this._listeners; + if (!listeners) { + return; + } + let arr = listeners[type]; + if (!arr) { + return; + } + for (let i = 0, l = arr.length; i < l; i++) { + if (arr[i] === listener) { + if (l == 1) { + delete listeners[type]; + } // allows for faster checks. + else { + arr.splice(i, 1); + } + break; + } + } + } + /** + * Removes all listeners for the specified type, or all listeners of all types. + * + *

Example

+ * + * // Remove all listeners + * displayObject.removeAllEventListeners(); + * + * // Remove all click listeners + * displayObject.removeAllEventListeners("click"); + * + * @method removeAllEventListeners + * @param {String} [type] The string type of the event. If omitted, all listeners for all types will be removed. + **/ + removeAllEventListeners(type) { + if (!type) { + this._listeners = this._captureListeners = null; + } else { + if (this._listeners) { + delete this._listeners[type]; + } + if (this._captureListeners) { + delete this._captureListeners[type]; + } + } + } + /** + * Dispatches the specified event to all listeners. + * + *

Example

+ * + * // Use a string event + * this.dispatchEvent("complete"); + * + * // Use an Event instance + * var event = new Event("progress"); + * this.dispatchEvent(event); + * + * @method dispatchEvent + * @param {Object | String | Event} eventObj An object with a "type" property, or a string type. + * While a generic object will work, it is recommended to use a CreateJS Event instance. If a string is used, + * dispatchEvent will construct an Event instance if necessary with the specified type. This latter approach can + * be used to avoid event object instantiation for non-bubbling events that may not have any listeners. + * @param {Boolean} [bubbles] Specifies the `bubbles` value when a string was passed to eventObj. + * @param {Boolean} [cancelable] Specifies the `cancelable` value when a string was passed to eventObj. + * @return {Boolean} Returns false if `preventDefault()` was called on a cancelable event, true otherwise. + **/ + dispatchEvent(eventObj, bubbles, cancelable) { + if (typeof eventObj == "string") { + // skip everything if there's no listeners and it doesn't bubble: + let listeners = this._listeners; + if (!bubbles && (!listeners || !listeners[eventObj])) { + return true; + } + eventObj = new Event(eventObj, bubbles, cancelable); + } else if (eventObj.target && eventObj.clone) { + // redispatching an active event object, so clone it: + eventObj = eventObj.clone(); + } + + // TODO: it would be nice to eliminate this. Maybe in favour of evtObj instanceof Event? Or !!evtObj.createEvent + try { + eventObj.target = this; + } catch (e) {} // try/catch allows redispatching of native events + + if (!eventObj.bubbles || !this.parent) { + this._dispatchEvent(eventObj, 2); + } else { + let top = this, + list = [top]; + while (top.parent) { + list.push(top = top.parent); + } + let i, + l = list.length; + + // capture & atTarget + for (i = l - 1; i >= 0 && !eventObj.propagationStopped; i--) { + list[i]._dispatchEvent(eventObj, 1 + (i == 0)); + } + // bubbling + for (i = 1; i < l && !eventObj.propagationStopped; i++) { + list[i]._dispatchEvent(eventObj, 3); + } + } + return !eventObj.defaultPrevented; + } + /** + * Indicates whether there is at least one listener for the specified event type. + * @method hasEventListener + * @param {String} type The string type of the event. + * @return {Boolean} Returns true if there is at least one listener for the specified event. + **/ + hasEventListener(type) { + let listeners = this._listeners, + captureListeners = this._captureListeners; + return !!(listeners && listeners[type] || captureListeners && captureListeners[type]); + } + /** + * Indicates whether there is at least one listener for the specified event type on this object or any of its + * ancestors (parent, parent's parent, etc). A return value of true indicates that if a bubbling event of the + * specified type is dispatched from this object, it will trigger at least one listener. + * + * This is similar to {{#crossLink "EventDispatcher/hasEventListener"}}{{/crossLink}}, but it searches the entire + * event flow for a listener, not just this object. + * @method willTrigger + * @param {String} type The string type of the event. + * @return {Boolean} Returns `true` if there is at least one listener for the specified event. + **/ + willTrigger(type) { + let o = this; + while (o) { + if (o.hasEventListener(type)) { + return true; + } + o = o.parent; + } + return false; + } + /** + * @method toString + * @return {String} a string representation of the instance. + **/ + toString() { + return "[EventDispatcher]"; + } + // private methods: + /** + * @method _dispatchEvent + * @param {Object | Event} eventObj + * @param {Object} eventPhase + * @protected + **/ + _dispatchEvent(eventObj, eventPhase) { + let l, + arr, + listeners = eventPhase <= 2 ? this._captureListeners : this._listeners; + if (eventObj && listeners && (arr = listeners[eventObj.type]) && (l = arr.length)) { + try { + eventObj.currentTarget = this; + } catch (e) {} + try { + eventObj.eventPhase = eventPhase | 0; + } catch (e) {} + eventObj.removed = false; + arr = arr.slice(); // to avoid issues with items being removed or added during the dispatch + for (let i = 0; i < l && !eventObj.immediatePropagationStopped; i++) { + let o = arr[i]; + if (o.handleEvent) { + o.handleEvent(eventObj); + } else { + o(eventObj); + } + if (eventObj.removed) { + this.off(eventObj.type, o, eventPhase == 1); + eventObj.removed = false; + } + } + } + if (eventPhase === 2) { + this._dispatchEvent(eventObj, 2.1); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + let DOMUtils = {}, + $ = DOMUtils; + $.query = function (query, element = document.body) { + return query[0] === ">" ? $._childQuery(query, element, $.query) : element.querySelector(query); + }; + $.queryAll = function (query, element = document.body) { + return query[0] === ">" ? $._childQuery(query, element, $.queryAll) : element.querySelectorAll(query); + }; + $.removeClass = function (element, className) { + if ($._runOnNodeList($.removeClass, element, className)) { + return element; + } + if (className instanceof RegExp) { + let arr = (element.getAttribute("class") || "").split(" "), + re = className; + element.setAttribute("class", arr.filter(s => !re.test(s)).join(" ")); + } else { + let list = element.classList; + list.remove.apply(list, className.split(" ")); + } + return element; + }; + $.addClass = function (element, className) { + if ($._runOnNodeList($.addClass, element, className)) { + return element; + } + $.removeClass(element, className); + let names = className.split(" "); + for (let i = 0; i < names.length; i++) { + element.classList.add(names[i]); + } + return element; + }; + $.toggleClass = function (element, className, value) { + if ($._runOnNodeList($.toggleClass, element, className, value)) { + return element; + } + let curValue = $.hasClass(element, className); + if (value == null) { + value = !curValue; + } else if (value === curValue) { + return; + } + if (value) { + $.addClass(element, className); + } else { + $.removeClass(element, className); + } + }; + $.hasClass = function (element, className) { + return !!(element.getAttribute("class") || "").match(new RegExp("\\b\\s?" + className + "\\b", "g")); + }; + $.swapClass = function (element, oldClass, newClass) { + $.removeClass(element, oldClass); + $.addClass(element, newClass); + return element; + }; + $.remove = function (element) { + if ($._runOnNodeList($.remove, element)) { + return element; + } + if (element.remove) { + element.remove(); + } else if (element.parentNode) { + element.parentNode.removeChild(element); + } + return element; + }; + $.on = function (element, event, listener) { + if ($._runOnNodeList($.on, element, event, listener)) { + return element; + } + element.addEventListener(event, listener); + }; + $.off = function (element, event, listener) { + if ($._runOnNodeList($.off, element, event, listener)) { + return element; + } + element.removeEventListener(event, listener); + }; + + /* + Remove all children from an element. + When using .innerHTML = ""; IE fails when adding new dom elements via appendChild(); + */ + $.empty = function (element) { + if ($._runOnNodeList($.empty, element)) { + return element; + } + while (element.firstChild) { + element.removeChild(element.firstChild); + } + return element; + }; + $.create = function (type, className, content, parent) { + let element = document.createElement(type || "div"); + if (className) { + element.className = className; + } + if (content) { + if (content instanceof HTMLElement) { + element.appendChild(content); + } else { + element.innerHTML = content; + } + } + if (parent) { + parent.appendChild(element); + } + return element; + }; + $.getEl = function (query, scope) { + if (query instanceof HTMLElement || !query) { + return query; + } + return $.query(query, scope); + }; + $.togglePanel = function (element, openEl, closedEl, open) { + let el1 = $.getEl(openEl, element), + el2 = $.getEl(closedEl, element), + tmp, + isOpen = !$.hasClass(element, "closed"); + if (open === undefined) { + open = !isOpen; + } else { + open = !!open; + } + if (open === isOpen) { + return; + } + if (open) { + $.removeClass(element, "closed"); + tmp = el2; + el2 = el1; + el1 = tmp; + } else { + $.addClass(element, "closed"); + } + el1 && (el1.style.display = "none"); + if (el2) { + let f = function (evt) { + if (evt.target !== element) { + return; + } + el2.style.display = "flex"; + element.removeEventListener("transitionend", f); + }; + element.addEventListener("transitionend", f); + } + }; + $.transition = function (target, className, then) { + let f = evt => { + if (evt.target !== target) { + return; + } + target.removeEventListener("transition", f); + then(); + }; + target.addEventListener("transitionend", f); + $.addClass(target, className); + }; + $.template = function (strings, ...keys) { + return o => { + let result = strings[0]; + for (let i = 0, l = keys.length; i < l; i++) { + result += o[keys[i]] + strings[i + 1]; + } + return result; + }; + }; + + // TODO: evaluate whether this belongs here. Feels awkward given its specific DOM dependencies. + $.getCSSValue = function (name, prop) { + let el = $.create("div", name); + el.style.display = "none"; + el.id = "export"; + document.body.appendChild(el); + let val = window.getComputedStyle(el).getPropertyValue(prop); + $.remove(el); + return val; + }; + $._runOnNodeList = function (f, nodelist, ...rest) { + if (!nodelist) { + return true; + } + if (nodelist.length === undefined) { + return false; + } + for (let i = 0, l = nodelist.length; i < l; i++) { + f.call(DOMUtils, nodelist[i], ...rest); + } + return true; + }; + $._childQuery = function (query, el, f) { + if (!el.id) { + el.id = "___tmp_id"; + } + let result = f("#" + el.id + " " + query, el.parentNode); + if (el.id === "___tmp_id") { + el.id = ""; + } + return result; + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + let Utils = {}; + Utils.prepMenuContent = function (content, idMap) { + if (!idMap.__next_id) { + idMap.__next_id = 1; + } + let kids = content.kids; + for (let i = 0, l = kids.length; i < l; i++) { + let o = kids[i]; + // current list implementation requires everything to have an id: + if (!o.id) { + o.id = "__id_" + idMap.__next_id++; + } + idMap[o.id] = o; + o.parent = content; + if (o.kids) { + Utils.prepMenuContent(o, idMap); + } + } + return content; + }; + Utils.find = function (arr, f) { + for (let i = 0, l = arr.length; i < l; i++) { + if (f(arr[i])) { + return arr[i]; + } + } + }; + Utils.findIndex = function (arr, f) { + for (let i = 0, l = arr.length; i < l; i++) { + if (f(arr[i])) { + return i; + } + } + return -1; + }; + Utils.copy = function (target, source) { + for (let n in source) { + target[n] = source[n]; + } + return target; + }; + Utils.clone = function (o) { + // this seems hacky, but it's the fastest, easiest approach for now: + return JSON.parse(JSON.stringify(o)); + }; + Utils.searchRank = function (o, search) { + let test = Utils.searchTest; + search = search.toLowerCase(); + if (o.access) { + // pattern (My Favorites). + // text? pattern? + return test((o.keywords || "") + " " + (o.name || ""), search, 16) + test((o.description || "") + " " + (o.author || ""), search, 8); + } else { + // reference. + return test(o.token, search, 16) + test((o.id || "") + " " + (o.label || ""), search, 8) + test((o.desc || "") + " " + (o.ext || ""), search, 4); + } + }; + Utils.searchTest = function (str, search, weight = 1) { + return str && str.toLowerCase().indexOf(search) !== -1 ? weight : 0; + }; + Utils.htmlSafe = function (str) { + return str == null ? "" : ("" + str).replace(/&/g, "&").replace(/ 0 && str.length > length; + if (b) { + str = str.substr(0, length - 1); + } + if (htmlSafe) { + str = Utils.htmlSafe(str); + } + return !b ? str : str + (tag && "<" + tag + ">") + "\u2026" + (tag && ""); + }; + Utils.unescSubstStr = function (str) { + if (!str) { + return ""; + } + return str.replace(Utils.SUBST_ESC_RE, (a, b, c) => Utils.SUBST_ESC_CHARS[b] || String.fromCharCode(parseInt(c, 16))); + }; + Utils.getRegExp = function (str) { + // returns a JS RegExp object. + let match = str.match(/^\/(.+)\/([a-z]+)?$/), + regex = null; + try { + regex = match ? new RegExp(match[1], match[2] || "") : new RegExp(str, "g"); + } catch (e) {} + return regex; + }; + Utils.decomposeRegEx = function (str, delim = "/") { + let re = new RegExp("^" + delim + "(.*)" + delim + "([igmsuUxy]*)$"); + let match = re.exec(str); + if (match) { + return { + source: match[1], + flags: match[2] + }; + } else { + return { + source: str, + flags: "g" + }; + } + }; + Utils.isMac = function () { + return !!navigator.userAgent.match(/Mac\sOS/i); + }; + Utils.getCtrlKey = function () { + return Utils.isMac() ? "cmd" : "ctrl"; + }; + Utils.now = function () { + return window.performance ? performance.now() : Date.now(); + }; + Utils.getUrlParams = function () { + let match, + re = /([^&=]+)=?([^&]*)/g, + params = {}; + let url = window.location.search.substr(1).replace(/\+/g, " "); + while (match = re.exec(url)) { + params[decodeURIComponent(match[1])] = decodeURIComponent(match[2]); + } + return params; + }; + let deferIds = {}; + Utils.defer = function (f, id, t = 1) { + clearTimeout(deferIds[id]); + if (f === null) { + delete deferIds[id]; + return; + } + deferIds[id] = setTimeout(() => { + delete deferIds[id]; + f(); + }, t); + }; + Utils.getHashCode = function (s) { + let hash = 0, + l = s.length, + i; + for (i = 0; i < l; i++) { + hash = (hash << 5) - hash + s.charCodeAt(i) | 0; + } + return hash; + }; + Utils.getPatternURL = function (pattern) { + let a = Utils.isLocal ? "?id=" : "/"; + let url = window.location.origin, + id = pattern && pattern.id || ""; + return url + a + id; + }; + Utils.isLocal = window.location.hostname === "localhost"; + Utils.getPatternURLStr = function (pattern) { + if (!pattern || !pattern.id) { + return null; + } + let a = Utils.isLocal ? "?id=" : "/"; + let url = window.location.host, + id = pattern.id; + return url + a + id; + }; + Utils.getForkName = function (name) { + let res = / ?\(fork ?(\d*)\)$/.exec(name); + if (res) { + let num = (res[1] || 1) * 1 + 1; + return name.substr(0, res.index) + " (fork " + num + ")"; + } + return name + " (fork)"; + }; + Utils.SUBST_ESC_CHARS = { + // this is just the list supported in Replace. Others: b, f, ", etc. + n: "\n", + r: "\r", + t: "\t", + "\\": "\\" + }; + Utils.SUBST_ESC_RE = /\\([nrt\\]|u([A-Z0-9]{4}))/ig; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Tooltip { + constructor(el, transition = false) { + this.el = DOMUtils.remove(el); + this.transition = transition; + this.contentEl = DOMUtils.query(".content", el); + this.tipEl = DOMUtils.query(".tip", el); + this.hideF = evt => Date.now() > this._showT && this.handleBodyClick(evt); + this.curId = null; + } + toggle(id, content, x, y, autohide, th) { + if (id === this.curId) { + return this.hide(id); + } + this.show(id, content, x, y, autohide, th); + } + toggleOn(id, content, el, autohide, th) { + if (id === this.curId) { + return this.hide(id); + } + this.showOn(id, content, el, autohide, th); + this.toggleEl = el; + DOMUtils.addClass(el, "selected"); + } + hide(id) { + if (id && this.curId !== id) { + return; + } + let el = this.el, + elStyle = el.style; + DOMUtils.empty(DOMUtils.query(".content", DOMUtils.remove(el))); + DOMUtils.removeClass(el, "flipped"); + document.body.removeEventListener("mousedown", this.hideF); + if (this.toggleEl) { + DOMUtils.removeClass(this.toggleEl, "selected"); + this.toggleEl = null; + } + + // reset position and width so that content wrapping resolves properly: + elStyle.left = elStyle.top = "0"; + elStyle.width = ""; + if (this.transition) { + elStyle.opacity = 0; + elStyle.marginTop = "-0.25em"; + } + this.curId = null; + } + show(id, content, x, y, autohide = false, th = 0) { + this.hide(); + if (!content) { + return; + } + let el = this.el, + elStyle = el.style, + contentEl = this.contentEl, + body = document.body, + pad = 8; + if (content instanceof HTMLElement) { + contentEl.appendChild(content); + } else { + contentEl.innerHTML = content; + } + if (autohide) { + this._showT = Date.now() + 30; // ignore double clicks and events in the current stack. + body.addEventListener("mousedown", this.hideF); + } + body.appendChild(el); + let wh = window.innerHeight, + ww = window.innerWidth; + let rect = el.getBoundingClientRect(), + w = rect.right - rect.left, + h = rect.bottom - rect.top, + off = 0; + if (y + h > wh - pad) { + DOMUtils.addClass(el, "flipped"); + y -= th; + } + if (x - w / 2 < pad) { + off = pad - x + w / 2; + } else if (x + w / 2 > ww - pad) { + off = ww - pad - x - w / 2; + } + this.tipEl.style.marginRight = Math.max(-w / 2 + 10, Math.min(w / 2 - 10, off)) * 2 + "px"; + elStyle.width = Math.ceil(w / 2) * 2 + "px"; + elStyle.top = Math.round(y) + "px"; + elStyle.left = Math.round(x + off) + "px"; + if (this.transition) { + elStyle.opacity = 1; + elStyle.marginTop = 0; + } + this.curId = id; + } + showOn(id, content, el, autohide, th = 0) { + let rect = el.getBoundingClientRect(); + let x = Math.round((rect.left + rect.right) / 2); + let y = rect.bottom + th; + let h = rect.bottom - rect.top; + this.show(id, content, x, y, autohide, h); + } + handleBodyClick(evt) { + let id = this.curId; + if (this.el.contains(evt.target) || this.toggleEl && this.toggleEl.contains(evt.target)) { + return; + } + this.hide(id); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Server { + // regex: + static solve(req) { + return Server._getRequest("regex/solve", { + data: JSON.stringify(req) + }); + } + static version(flavor) { + return Server._getRequest("regex/version", { + flavor: flavor + }); + } + + // patterns: + static communitySearch(str) { + return Server._getRequest("patterns/search", { + query: str || "", + startIndex: 0, + limit: 100 + }, data => { + this._processPatternList(data); + }); + } + static load(id) { + return Server._getRequest("patterns/load", { + patternId: id + }, data => this._processPattern(data)); + } + static save(pattern, fork, community) { + // clone and prep the pattern object: + let o = this._prepPattern(pattern, fork, community); + return Server._getRequest("patterns/save", o, data => this._processPattern(data)); + } + static rate(id, rating) { + return Server._getRequest("patterns/rate", { + patternId: id, + userRating: rating + }, data => data.rating = Number(data.rating)); + } + static delete(id) { + return Server._getRequest("patterns/delete", { + patternId: id + }); + } + static favorite(id, value) { + return Server._getRequest("patterns/favorite", { + patternId: id, + favorite: !!value + }); + } + static private(id, value) { + return Server.setAccess(id, value ? "private" : "protected"); + } + static setAccess(id, value) { + return Server._getRequest("patterns/setAccess", { + patternId: id, + access: value + }); + } + static multiFavorite(ids) { + return Server._getRequest("patterns/multiFavorite", { + patternIds: JSON.stringify(ids) + }); + } + + // account: + static login(service) { + window.location = Server.url + "?action=account/login&type=" + service; + } + static logout() { + return Server._getRequest("account/logout", {}); + } + static verify() { + return Server._getRequest("account/verify", {}); + } + static patterns() { + return Server._getRequest("account/patterns", {}, data => { + this._processPatternList(data); + data.results.sort((a, b) => { + return b.favorite - a.favorite || b.dateAdded - a.dateAdded || 1 - 2 * (a.id > b.id); + }); + }); + } + + // helpers: + static _processPatternList(data) { + data.results.forEach(this._processPattern); + } + static _processPattern(o) { + // parse values: + o.rating = Number(o.rating); + o.userRating = Number(o.userRating); + o.flavor = o.flavor || "js"; + o.mode = o.mode || "text"; + o.text = o.text || null; + if (o.tool && o.tool.id) { + o.tool.id = o.tool.id.toLowerCase(); + } + } + static _prepPattern(o, fork, community) { + o = Utils.clone(o); + if (fork) { + o.parentId = o.id; + delete o.id; + if (!community) { + o.name = Utils.getForkName(o.name); + } + } + // clear null values: + if (!o.id) { + delete o.id; + } + if (!o.parentId) { + delete o.parentId; + } + delete o.userId; // this gets added by the server + o.tool = o.tool && JSON.stringify(o.tool); + o.tests = o.tests && JSON.stringify(o.tests); + return o; + } + + // private methods: + static _getRequest(action, data = {}, postprocess) { + let req = new XMLHttpRequest(), + p = new ServerPromise(req, postprocess), + params = []; + req.open("POST", Server.url); + req.setRequestHeader("Content-type", "application/x-www-form-urlencoded", true); + req.timeout = 30 * 1000; + data.action = action; + if (Server.isLocal && Server.useBeta) { + data.userId = 111; + } + for (let n in data) { + params.push(n + "=" + encodeURIComponent(data[n])); + } + if (Server.isLocal) { + console.log(data); + } + req.send(params.join("&")); + return p; + } + } + class ServerPromise { + constructor(req, postprocess) { + this._req = req; + this._postprocess = postprocess; + req.addEventListener("load", () => this._load()); + req.addEventListener("timeout", evt => this._error("servercomm")); + req.addEventListener("error", evt => this._error("servercomm")); + } + then(f, cf, ff) { + this._loadF = f; + if (cf) { + this.catch(cf); + } + if (this._data) { + f(this._data); + } + if (ff) { + this.finally(ff); + } + return this; + } + catch(f) { + this._errorF = f; + if (this._err) { + f(this._err); + } + return this; + } + finally(f) { + this._finallyF = f; + if (this._complete) { + f(); + } + return this; + } + abort() { + if (this._complete) { + return; + } + this._complete = true; + this._req.abort(); + this._finallyF && this._finallyF(); + this._loadF = this._errorF = this._finallyF = null; // just to make sure. + } + _load() { + let json; + this._complete = true; + if (Server.isLocal) { + console.log(this._req.response || this._req.responseText); + } + try { + json = JSON.parse(this._req.response || this._req.responseText); + } catch (e) { + return this._error(e); + } + if (!json.success) { + return this._error(json.data); + } + this._postprocess && this._postprocess(json.data); + this._data = json.data; + this._loadF && this._loadF(this._data); + this._finallyF && this._finallyF(); + } + _error(e) { + this._err = e.data && e.data.error || e.message || e.detail || e.type || String(e); + this._errorF && this._errorF(this._err); + this._finallyF && this._finallyF(); + } + } + Server.isLocal = Utils.isLocal; + Server.useBeta = Server.isLocal || window.location.hostname === "beta.regexr.com"; + Server.host = "https://" + (Server.useBeta ? "beta." : "") + "regexr.com"; + Server.url = Server.host + "/server/api.php"; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + let CMUtils = {}; + CMUtils.create = function (target, opts = {}, width = "100%", height = "100%") { + let keys = {}, + ctrlKey = Utils.getCtrlKey(); + //keys[ctrlKey + "-Z"] = keys[ctrlKey + "-Y"] = keys["Shift-" + ctrlKey + "-Z"] = () => false; // block CM handling + + let o = Utils.copy({ + lineNumbers: false, + tabSize: 3, + indentWithTabs: true, + extraKeys: keys, + specialChars: /[ \u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/, + specialCharPlaceholder: ch => DOMUtils.create("span", ch === " " ? "cm-space" : "cm-special", " ") // needs to be a space so wrapping works + }, opts); + let cm = CodeMirror(target, o); + cm.setSize(width, height); + if (cm.getOption("maxLength")) { + cm.on("beforeChange", CMUtils.enforceMaxLength); + } + if (cm.getOption("singleLine")) { + cm.on("beforeChange", CMUtils.enforceSingleLine); + } + return cm; + }; + CMUtils.getCharIndexAt = function (cm, winX, winY) { + let pos = cm.coordsChar({ + left: winX, + top: winY + }, "page"); + // test current and prev character, since CM seems to use the center of each character for coordsChar: + for (let i = 0; i <= 1; i++) { + let rect = cm.charCoords(pos, "page"); + if (winX >= rect.left && winX <= rect.right && winY >= rect.top && winY <= rect.bottom) { + return cm.indexFromPos(pos); + } + if (pos.ch-- <= 0) { + break; + } + } + return null; + }; + /* + // unused? + CMUtils.getEOLPos = function (cm, pos) { + if (!isNaN(pos)) { + pos = cm.posFromIndex(pos); + } + let rect = cm.charCoords(pos, "local"), w = cm.getScrollInfo().width; + return cm.coordsChar({left: w - 1, top: rect.top}, "local"); + }; + */ + CMUtils.getCharRect = function (cm, index) { + if (index == null) { + return null; + } + let pos = cm.posFromIndex(index), + rect = cm.charCoords(pos); + rect.x = rect.left; + rect.y = rect.top; + rect.width = rect.right - rect.left; + rect.height = rect.bottom - rect.top; + return rect; + }; + CMUtils.enforceMaxLength = function (cm, change) { + let maxLength = cm.getOption("maxLength"); + if (maxLength && change.update) { + let str = change.text.join("\n"); + let delta = str.length - (cm.indexFromPos(change.to) - cm.indexFromPos(change.from)); + if (delta <= 0) { + return true; + } + delta = cm.getValue().length + delta - maxLength; + if (delta > 0) { + str = str.substr(0, str.length - delta); + change.update(change.from, change.to, str.split("\n")); + } + } + return true; + }; + CMUtils.enforceSingleLine = function (cm, change) { + if (change.update) { + let str = change.text.join("").replace(/(\n|\r)/g, ""); + change.update(change.from, change.to, [str]); + } + return true; + }; + CMUtils.selectAll = function (cm) { + cm.focus(); + cm.setSelection({ + ch: 0, + line: 0 + }, { + ch: 0, + line: cm.lineCount() + }); + }; + CMUtils.calcRangePos = function (cm, i, l = 0, o = {}) { + let doc = cm.getDoc(); + o.startPos = doc.posFromIndex(i); + o.endPos = doc.posFromIndex(i + l); + return o; + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + let Track = {}; + Track.GA_ID = "UA-3579542-6"; + Track.page = function (path) { + gtag("config", Track.GA_ID, { + "page_path": "/" + path + }); + }; + + // https://developers.google.com/analytics/devguides/collection/gtagjs/events + Track.event = function (name, category, label) { + let o = {}; + if (category) { + o.event_category = category; + } + if (label) { + o.event_label = label; + } + gtag("event", name, o); + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class List extends EventDispatcher { + constructor(el, opts) { + super(); + this.el = el; + this.multi = opts.multi; + this.template = opts.template; + this.data = opts.data; + if (opts.selected) { + this.selected = opts.selected; + } + } + set data(data) { + DOMUtils.empty(this.el); + this._data = data; + if (!data || !data.length) { + return; + } + for (let i = 0, l = data.length; i < l; i++) { + this.addItem(data[i]); + } + } + get data() { + return this._data; + } + set selected(ids) { + DOMUtils.removeClass(DOMUtils.queryAll(".selected", this.el), "selected"); + if (!(ids instanceof Array)) { + ids = [ids]; + } + ids.forEach(id => DOMUtils.addClass(DOMUtils.query("[data-id='" + id + "']", this.el), "selected")); + if (!this.multi) { + this.scrollTo(ids[0]); + } + } + get selected() { + let els = DOMUtils.queryAll("li.selected", this.el); + if (!els[0]) { + return null; + } + if (!this.multi) { + return els[0].dataset.id; + } + let ids = []; + for (let i = 0, l = els.length; i < l; i++) { + ids.push(els[i].dataset.id); + } + return ids; + } + set selectedIndex(index) { + let data = this.data; + this.selected = data && data[index] && data[index].id; + } + get selectedIndex() { + let el = this.selectedEl, + id = el && el.dataset.id; + return id === null ? -1 : this.data.findIndex(o => o.id === id); + } + get selectedItem() { + let el = this.selectedEl; + return el && el.item; + } + get selectedEl() { + return DOMUtils.query("li.selected", this.el); + } + refresh() { + let sel = this.selected; + this.data = this._data; + this.selected = sel; + } + addItem(o, selected = null) { + let label, id, sel; + let f = evt => this.handleClick(evt), + template = this.template; + if (typeof o === "string") { + id = o; + label = template ? template(o) : o; + } else { + if (o.hide) { + return; + } + id = o.id || o.label; + label = template ? template(o) : o.label; + if (selected === null) { + sel = o.selected; + } + } + let item = DOMUtils.create("li", sel ? "selected" : null, label, this.el); + item.dataset.id = id; + item.item = o; + item.addEventListener("click", f); + item.addEventListener("dblclick", f); + if (selected) { + this.selected = o.id; + } + } + removeItem(id) { + let el = DOMUtils.query("[data-id='" + id + "']", this.el); + el && el.remove(); + } + handleClick(evt) { + let id = evt.currentTarget.dataset.id, + old = this.selected; + if (!this.getEl(id)) { + return; + } + if (evt.type === "dblclick") { + if (id != null) { + this.dispatchEvent("dblclick"); + } + return; + } else if (this.multi) { + DOMUtils.toggleClass(evt.currentTarget, "selected"); + } else if (old === id) { + if (id != null) { + this.dispatchEvent("selclick"); + } + return; + } else { + this.selected = id; + } + if (!this.dispatchEvent("change", false, true)) { + this.selected = old; + } + } + scrollTo(id = this.selected) { + let el = this.getEl(id); + if (!el) { + return; + } + //el.scrollIntoView(); // this is too jumpy, but would handle horizontal. + + let scrollEl = this.scrollEl || this.el; + let top = el.offsetTop - scrollEl.offsetTop; + if (top + el.offsetHeight > scrollEl.scrollTop + scrollEl.offsetHeight) { + scrollEl.scrollTop = top + el.offsetHeight - scrollEl.offsetHeight + 10; + } else if (top < scrollEl.scrollTop) { + scrollEl.scrollTop = top - 10; + } + } + getEl(id) { + return DOMUtils.query("[data-id='" + id + "']", this.el); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class ExpressionLexer { + constructor() { + this.profile = null; + } + set profile(profile) { + this._profile = profile; + this.string = this.token = this.errors = this.captureGroups = this.namedGroups = null; + } + parse(str) { + if (!this._profile) { + return null; + } + if (str === this.string) { + return this.token; + } + this.token = null; + this._modes = {}; + this.string = str; + this.errors = []; + let capgroups = this.captureGroups = []; + let namedgroups = this.namedGroups = {}; + let brgroups = this.branchResetGroups = []; + let groups = [], + refs = [], + i = 0, + l = str.length; + let o, + c, + token, + charset = null; + // previous is the previous token, prv is the previous "active" token (!ignore) + let prev = null, + prv = null; + let profile = this._profile, + unquantifiable = profile.unquantifiable; + let charTypes = profile.charTypes; + let closeIndex = str.lastIndexOf("/"); + for (let i = closeIndex + 1; i < l; i++) { + this._modes[str[i]] = true; + } + while (i < l) { + c = str[i]; + token = { + i: i, + l: 1, + prev: prev, + prv: prv, + modes: this._modes + }; + if (prev) { + prev.next = token; + } else { + this.token = token; + } + if (i === 0 || i >= closeIndex) { + this.parseFlag(str, token); + } else if (c === "(" && !charset) { + this.parseParen(str, token); + if (token.close === null) { + token.depth = groups.length; + groups.push(token); + } + if (token.capture) { + this.addCaptureGroup(token, groups); + } + } else if (c === ")" && !charset) { + token.type = "groupclose"; + if (groups.length) { + o = token.open = groups.pop(); + o.close = token; + if (o.type === "branchreset") { + brgroups.pop(); + } + } else { + token.error = { + id: "groupclose" + }; + } + } else if (c === "[") { + charset = this.parseSquareBracket(str, token, charset); + } else if (c === "]" && charset) { + token.type = "setclose"; + token.open = charset; + charset.close = token; + charset = null; + } else if (c === "+" && prv && prv.clss === "quant" && profile.tokens.possessive) { + token.type = "possessive"; + token.related = [prv]; + } else if ((c === "+" || c === "*") && !charset) { + token.type = charTypes[c]; + token.clss = "quant"; + token.min = c === "+" ? 1 : 0; + token.max = -1; + } else if (c === "{" && !charset && str.substr(i).search(/^{\d+,?\d*}/) !== -1) { + this.parseQuant(str, token); + } else if (c === "\\") { + this.parseBackSlash(str, token, charset, closeIndex); + } else if (c === "?" && !charset) { + if (!prv || prv.clss !== "quant") { + token.type = charTypes[c]; + token.clss = "quant"; + token.min = 0; + token.max = 1; + } else { + token.type = "lazy"; + token.related = [prv]; + } + } else if (c === "-" && charset && prv.code !== undefined && prv.prv && prv.prv.type !== "range") { + // this may be the start of a range, but we'll need to validate after the next token. + token.type = "range"; + } else { + this.parseChar(str, token, charset); + if (!charset && this._modes.x && /\s/.test(c)) { + token.ignore = true; + token.type = "ignorews"; + } + } + + // post process token: + // quantifier: + if (token.clss === "quant") { + if (!prv || prv.close !== undefined || unquantifiable[prv.type] || prv.open && unquantifiable[prv.open.type]) { + token.error = { + id: "quanttarg" + }; + } else { + token.related = [prv.open || prv]; + } + } + + // reference: + if (token.group === true) { + refs.push(token); + } + + // conditional: + let curGroup = groups.length ? groups[groups.length - 1] : null; + if (curGroup && (curGroup.type === "conditional" || curGroup.type === "conditionalgroup") && token.type === "alt") { + if (!curGroup.alt) { + curGroup.alt = token; + } else { + token.error = { + id: "extraelse" + }; + } + token.related = [curGroup]; + token.type = "conditionalelse"; + token.clss = "special"; + } else if (curGroup && curGroup.type === "branchreset") { + // reset group + curGroup.curGroupNum = curGroup.inGroupNum; + } + + // range: + if (prv && prv.type === "range" && prv.l === 1) { + this.validateRange(str, token); + } + + // js warnings: + // TODO: this isn't ideal, but I'm hesitant to write a more robust solution for a couple of edge cases. + if (profile.id === "js") { + this.addJSWarnings(token); + } + + // general: + if (token.open && !token.clss) { + token.clss = token.open.clss; + } + if (token.error) { + this.addError(token); + } + i += token.l; + prev = token; + if (!token.ignore) { + prv = token; + } + } + + // post processing: + while (groups.length) { + this.addError(groups.pop(), { + id: "groupopen" + }); + } + this.matchRefs(refs, capgroups, namedgroups); + if (charset) { + this.addError(charset, { + id: "setopen" + }); + } + return this.token; + } + addError(token, error = token.error) { + token.error = error; + this.errors.push(token); + } + addJSWarnings(token) { + if (token.error) { + return; + } + if (token.type === "neglookbehind" || token.type === "poslookbehind" || token.type === "sticky" || token.type === "unicode" || token.type == "dotall" || token.type === "unicodecat" || token.type === "unicodescript" || token.type === "namedgroup") { + token.error = { + id: "jsfuture", + warning: true + }; + } + } + addCaptureGroup(token, groups) { + // it would be nice to make branch reset groups actually highlight all of the groups that share the same number + // that would require switching to arrays of groups for each group num - requires rearchitecture throughout the app. + let capgroups = this.captureGroups, + brgroups = this.branchResetGroups, + namedgroups = this.namedGroups; + let curGroup = groups.length ? groups[groups.length - 1] : null; + if (brgroups.length) { + let brgroup = brgroups[brgroups.length - 1]; + token.num = ++brgroup.curGroupNum; + } else { + token.num = capgroups.length + 1; + } + if (!capgroups[token.num - 1]) { + capgroups.push(token); + } + if (token.name && !token.error) { + if (/\d/.test(token.name[0])) { + token.error = { + id: "badname" + }; + } else if (namedgroups[token.name]) { + token.error = { + id: "dupname" + }; + token.related = [namedgroups[token.name]]; + } else { + namedgroups[token.name] = token; + } + } + } + getRef(token, str) { + token.clss = "ref"; + token.group = true; + token.relIndex = this.captureGroups.length; + token.name = str; + } + matchRefs(refs, indexes, names) { + while (refs.length) { + let token = refs.pop(), + name = token.name, + group = names[name]; + if (!group && !isNaN(name)) { + let sign = name[0], + index = parseInt(name) + (sign === "+" || sign === "-" ? token.relIndex : 0); + if (sign === "-") { + index++; + } + group = indexes[index - 1]; + } + if (group) { + token.group = group; + token.related = [group]; + token.dir = token.i < group.i ? 1 : !group.close || token.i < group.close.i ? 0 : -1; + } else { + delete token.group; + delete token.relIndex; + this.refToOctal(token); + if (token.error) { + this.errors.push(token.error); + } + } + } + } + refToOctal(token) { + // PCRE: \# unmatched, \0 \00 \## = octal + // JS: \# \0 \00 \## = octal + // PCRE matches \8 \9 to "8" "9" + // JS: without the u flag \8 \9 match "8" "9" in IE, FF & Chrome, and "\8" "\9" in Safari. We support the former. + // JS: with the u flag, Chrome & FF throw an esc error, Safari does not. + + // TODO: handle \0 for PCRE? Would need more testing. + // TODO: this doesn't handle two digit refs with 8/9 in them. Ex. \18 - not even sure what this is interpreted as. + let name = token.name, + profile = this._profile; + if (token.type !== "numref") { + // not a simple \4 style reference, so can't decompose into an octal. + token.error = { + id: "unmatchedref" + }; + } else if (/^[0-7]{2}$/.test(name) || profile.config.reftooctalalways && /^[0-7]$/.test(name)) { + // octal + let next = token.next, + char = String.fromCharCode(next.code); + if (next.type === "char" && char >= "0" && char <= "7" && parseInt(name + char, 8) <= 255) { + name += char; + this.mergeNext(token); + } + token.code = parseInt(name, 8); + token.clss = "esc"; + token.type = "escoctal"; + delete token.name; + } else if (name === "8" || name === "9") { + this.parseEscChar(token, name); + delete token.name; + } else { + token.error = { + id: "unmatchedref" + }; + } + } + mergeNext(token) { + let next = token.next; + token.next = next.next; + token.next.prev = token; + token.l++; + } + parseFlag(str, token) { + // note that this doesn't deal with misformed patterns or incorrect flags. + let i = token.i, + c = str[i]; + if (str[i] === "/") { + token.type = i === 0 ? "open" : "close"; + if (i !== 0) { + token.related = [this.token]; + this.token.related = [token]; + } + } else { + token.type = this._profile.flags[c]; + } + //token.clear = true; + } + parseChar(str, token, charset) { + let c = str[token.i]; + token.type = !charset && this._profile.charTypes[c] || "char"; + if (!charset && c === "/") { + token.error = { + id: "fwdslash" + }; + } + if (token.type === "char") { + token.code = c.charCodeAt(0); + } else if (ExpressionLexer.ANCHOR_TYPES[token.type]) { + token.clss = "anchor"; + } else if (token.type === "dot") { + token.clss = "charclass"; + } + return token; + } + parseSquareBracket(str, token, charset) { + let match; + if (this._profile.tokens.posixcharclass && (match = str.substr(token.i).match(/^\[(:|\.)([^\]]*?)\1]/))) { + // posixcharclass: [:alpha:] + // posixcollseq: [.ch.] + // currently neither flavor supports posixcollseq, but PCRE does flag as an error: + // TODO: the expression above currently does not catch [.\].] + token.l = match[0].length; + token.value = match[2]; + token.clss = "charclass"; + if (match[1] === ":") { + token.type = "posixcharclass"; + if (!this._profile.posixCharClasses[match[2]]) { + token.error = { + id: "posixcharclassbad" + }; + } else if (!charset) { + token.error = { + id: "posixcharclassnoset" + }; + } + } else { + token.type = "posixcollseq"; + // TODO: can this be generalized? Right now, no, because we assign ids that aren't in the profile. + token.error = { + id: "notsupported" + }; + } + } else if (!charset) { + // set [a-z] [aeiou] + // setnot [^a-z] + token.type = token.clss = "set"; + if (str[token.i + 1] === "^") { + token.l++; + token.type += "not"; + } + charset = token; + } else { + // [[] (square bracket inside a set) + this.parseChar(str, token, charset); + } + return charset; + } + parseParen(str, token) { + /* + core: + . group: + . lookahead: ?= ?! + . noncap: ?: + PCRE: + . lookbehind: ?<= ? ?'name' ? + . namedref: ?P=name Also: \g'name' \k'name' etc + . comment: ?# + . atomic: ?> + . recursion: ?0 ?R Also: \g<0> + . define: ?(DEFINE) + . subroutine: ?1 ?-1 ?&name ?P>name + conditionalgroup: ?(1)a|b ?(-1)a|b ?(name)a|b + conditional: ?(?=if)then|else + mode: ?c-i + branchreset: ?| + */ + + token.clss = token.type = "group"; + if (str[token.i + 1] !== "?") { + token.close = null; // indicates that it needs a close token. + token.capture = true; + return token; + } + let sub = str.substr(token.i + 2), + match, + s = sub[0]; + if (s === ":") { + // (?:foo) + token.type = "noncapgroup"; + token.close = null; + token.l = 3; + } else if (s === ">") { + // (?>foo) + token.type = "atomic"; + token.close = null; + token.l = 3; + } else if (s === "|") { + // (?|(a)|(b)) + token.type = "branchreset"; + token.close = null; + token.l = 3; + token.inGroupNum = token.curGroupNum = this.captureGroups.length; + this.branchResetGroups.push(token); + } else if (s === "#" && (match = sub.match(/[^)]*\)/))) { + // (?#foo) + token.clss = token.type = "comment"; + token.ignore = true; + token.l = 2 + match[0].length; + } else if (/^(R|0)\)/.test(sub)) { + // (?R) (?0) + token.clss = "ref"; + token.type = "recursion"; + token.l = 4; + } else if (match = sub.match(/^P=(\w+)\)/i)) { + // (?P=name) + token.type = "namedref"; + this.getRef(token, match[1]); + token.l = match[0].length + 2; + } else if (/^\(DEFINE\)/.test(sub)) { + // (?(DEFINE)foo) + token.type = "define"; + token.close = null; + token.l = 10; + } else if (match = sub.match(/^/)) || this._profile.config.namedgroupalt && ((match = sub.match(/^'(\w+)'/)) || (match = sub.match(/^P<(\w+)>/)))) { + // (?foo) (?'name'foo) (?Pfoo) + token.type = "namedgroup"; + token.close = null; + token.name = match[1]; + token.capture = true; + token.l = match[0].length + 2; + } else if ((match = sub.match(/^([-+]?\d\d?)\)/)) || (match = sub.match(/^(?:&|P>)(\w+)\)/))) { + // (?1) (?-1) (?&name) (?P>name) + token.type = (isNaN(match[1]) ? "named" : "num") + "subroutine"; + this.getRef(token, match[1]); + token.l = match[0].length + 2; + } else if ((match = sub.match(/^\(([-+]?\d\d?)\)/)) || (match = sub.match(/^\((\w+)\)/))) { + // (?(1)a|b) (?(-1)a|b) (?(name)a|b) + this.getRef(token, match[1]); + token.clss = "special"; + token.type = "conditionalgroup"; + token.close = null; + token.l = match[0].length + 2; + } else if (/^\(\?255). In theory it should allow 4? + if (isNaN(val) || val > 255 || /[^\da-f]/i.test(match[1])) { + token.error = { + id: "esccharbad" + }; + } else { + token.code = val; + } + } else if (match = sub.match(/^x([\da-fA-F]{0,2})/)) { + // hex ascii: \xFF + token.type = "eschexadecimal"; + token.l += match[0].length; + token.code = parseInt(match[1] || 0, 16); + } else if (match = sub.match(/^c([a-zA-Z])?/)) { + // control char: \cA \cz + // also handles: \c + // not supported in JS strings + token.type = "esccontrolchar"; + if (match[1]) { + token.code = match[1].toUpperCase().charCodeAt(0) - 64; // A=65 + token.l += 2; + } else if (profile.config.ctrlcodeerr) { + token.l++; + token.error = { + id: "esccharbad" + }; + } else { + return this.parseChar(str, token, charset); // this builds the "/" token + } + } else if (match = sub.match(/^[0-7]{1,3}/)) { + // octal ascii: \011 + token.type = "escoctal"; + sub = match[0]; + if (parseInt(sub, 8) > 255) { + sub = sub.substr(0, 2); + } + token.l += sub.length; + token.code = parseInt(sub, 8); + } else if (profile.tokens.escoctalo && (match = sub.match(/^o\{(.*?)}/i))) { + // \o{377} + token.type = "escoctal"; + token.l += match[0].length; + val = parseInt(match[1], 8); + if (isNaN(val) || val > 255 || /[^0-7]/.test(match[1])) { + token.error = { + id: "esccharbad" + }; + } else { + token.code = val; + } + } else { + // single char + if (token.type = profile.escCharTypes[c]) { + token.l++; + token.clss = ExpressionLexer.ANCHOR_TYPES[token.type] ? "anchor" : "charclass"; + return token; + } + token.code = profile.escCharCodes[c]; + if (token.code === undefined || token.code === false) { + // unrecognized. + return this.parseEscChar(token, c); + } + + // update SubstLexer if this changes: + token.l++; + token.type = "esc_" + token.code; + } + token.clss = "esc"; + return token; + } + parseEscChar(token, c) { + // unrecognized escchar: \u \a \8, etc + // JS: allowed except if u flag set, Safari still allows \8 \9 + // PCRE: allows \8 \9 but not others // TODO: support? + let profile = this._profile; + token.l = 2; + if (!profile.badEscChars[c] && profile.tokens.escchar && !this._modes.u || profile.escChars[c]) { + token.type = "escchar"; + token.code = c.charCodeAt(0); + token.clss = "esc"; + } else { + token.error = { + id: "esccharbad" + }; + } + } + parseRef(token, sub) { + // namedref: \k \k'name' \k{name} \g{name} + // namedsubroutine: \g \g'name' + // numref: \g1 \g+2 \g{2} + // numsubroutine: \g<-1> \g'1' + // recursion: \g<0> \g'0' + let c = sub[0], + s = "", + match; + if (match = sub.match(/^[gk](?:'\w*'|<\w*>|{\w*})/)) { + s = match[0].substr(2, match[0].length - 3); + if (c === "k" && !isNaN(s)) { + s = ""; + } // TODO: specific error for numeric \k? + } else if (match = sub.match(/^g(?:({[-+]?\d+}|<[-+]?\d+>|'[-+]?\d+')|([-+]?\d+))/)) { + s = match[2] !== undefined ? match[2] : match[1].substr(1, match[1].length - 2); + } + let isRef = c === "k" || !(sub[1] === "'" || sub[1] === "<"); + if (!isRef && s == 0) { + token.type = "recursion"; + token.clss = "ref"; + } else { + // namedref, extnumref, namedsubroutine, numsubroutine + token.type = (isNaN(s) ? "named" : (isRef ? "ext" : "") + "num") + (isRef ? "ref" : "subroutine"); + this.getRef(token, s); + } + token.l += match ? match[0].length : 1; + } + parseUnicode(token, sub) { + // unicodescript: \p{Cherokee} + // unicodecat: \p{Ll} \pL + // not: \P{Ll} \p{^Lu} + let match = sub.match(/p\{\^?([^}]*)}/i), + val = match && match[1], + not = sub[0] === "P"; + if (!match && (match = sub.match(/[pP]([LMZSNPC])/))) { + val = match[1]; + } else { + not = not !== (sub[2] === "^"); + } + token.l += match ? match[0].length : 1; + token.type = "unicodecat"; + if (this._profile.unicodeScripts[val]) { + token.type = "unicodescript"; + } else if (!this._profile.unicodeCategories[val]) { + val = null; + } + if (not) { + token.type = "not" + token.type; + } + if (!this._profile.config.unicodenegated && sub[2] === "^" || !val) { + token.error = { + id: "unicodebad" + }; + } + token.value = val; + token.clss = "charclass"; + return token; + } + parseMode(token, sub) { + // (?i-x) + // supported modes in PCRE: i-caseinsens, x-freespacing, s-dotall, m-multiline, U-switchlazy, [J-samename] + let match = sub.match(/^[-a-z]+\)/i); + if (!match) { + return; + } + let supModes = this._profile.modes; + let modes = Utils.copy({}, this._modes), + bad = false, + not = false, + s = match[0], + c; + token.on = token.off = ""; + for (let i = 0, l = s.length - 1; i < l; i++) { + c = s[i]; + if (c === "-") { + not = true; + continue; + } + if (!supModes[c]) { + bad = true; + break; + } + modes[c] = !not; + token.on = token.on.replace(c, ""); + if (not) { + token.off = token.off.replace(c, ""); + token.off += c; + } else { + token.on += c; + } + } + token.clss = "special"; + token.type = "mode"; + token.l = match[0].length + 2; + if (bad) { + token.error = { + id: "modebad" + }; + token.errmode = c; + } else { + this._modes = modes; + } + return token; + } + parseQuant(str, token) { + // quantifier: {0,3} {3} {1,} + token.type = token.clss = "quant"; + let i = token.i; + let end = str.indexOf("}", i + 1); + token.l += end - i; + let arr = str.substring(i + 1, end).split(","); + token.min = parseInt(arr[0]); + token.max = arr[1] === undefined ? token.min : arr[1] === "" ? -1 : parseInt(arr[1]); + if (token.max !== -1 && token.min > token.max) { + token.error = { + id: "quantrev" + }; + } + return token; + } + validateRange(str, end) { + // char range: [a-z] [\11-\n] + let next = end, + token = end.prv, + prv = token.prv; + if (prv.code === undefined || next.code === undefined) { + // not a range, rewrite as a char: + this.parseChar(str, token); + } else { + token.clss = "set"; + if (prv.code > next.code) { + // this gets added here because parse has already moved to the next token: + this.errors.push(token.error = { + id: "rangerev" + }); + } + // preserve as separate tokens, but treat as one in the UI: + next.proxy = prv.proxy = token; + token.set = [prv, token, next]; + } + } + } + ExpressionLexer.ANCHOR_TYPES = { + "bof": true, + "eof": true, + "bos": true, + "eos": true, + "abseos": true, + "wordboundary": true, + "notwordboundary": true, + "prevmatchend": true + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class ExpressionHighlighter extends EventDispatcher { + constructor(cm) { + super(); + this.cm = cm; + this._activeMarks = []; + this._hoverMarks = []; + this._hoverToken = null; + } + clear() { + this.cm.operation(() => { + let marks = this._activeMarks; + for (var i = 0, l = marks.length; i < l; i++) { + marks[i].clear(); + } + marks.length = 0; + }); + } + draw(token) { + let cm = this.cm, + pre = ExpressionHighlighter.CSS_PREFIX; + this.clear(); + cm.operation(() => { + let groupClasses = ExpressionHighlighter.GROUP_CLASS_BY_TYPE; + let doc = cm.getDoc(), + endToken, + marks = this._activeMarks; + while (token) { + if (token.clear) { + token = token.next; + continue; + } + token = this._calcTokenPos(token); + var className = pre + (token.clss || token.type); + if (token.error) { + className += " " + pre + (token.error.warning ? "warning" : "error"); + } + if (className) { + marks.push(doc.markText(token.startPos, token.endPos, { + className: className + })); + } + if (token.close) { + endToken = this._calcTokenPos(token.close); + className = groupClasses[token.clss || token.type]; + if (className) { + className = className.replace("%depth%", token.depth); + marks.push(doc.markText(token.startPos, endToken.endPos, { + className: className + })); + } + } + token = token.next; + } + }); + } + set hoverToken(token) { + if (token === this._hoverToken) { + return; + } + if (token && token.set && token.set.indexOf(this._hoverToken) !== -1) { + return; + } + while (this._hoverMarks.length) { + this._hoverMarks.pop().clear(); + } + this._hoverToken = token; + if (token) { + if (token.open) { + this._drawSelect(token.open); + } else { + this._drawSelect(token); + } + if (token.related) { + for (let i = 0, l = token.related.length; i < l; i++) { + this._drawSelect(token.related[i], ExpressionHighlighter.CSS_PREFIX + "related"); + } + } + } + this.dispatchEvent("hover"); + } + get hoverToken() { + return this._hoverToken; + } + + // private methods: + _drawSelect(token, style = ExpressionHighlighter.CSS_PREFIX + "selected") { + let doc = this.cm.getDoc(), + endToken = token.close || token; + if (token.set) { + endToken = token.set[token.set.length - 1]; + token = token.set[0]; + } + this._calcTokenPos(endToken); + this._calcTokenPos(token); + this._hoverMarks.push(doc.markText(token.startPos, endToken.endPos, { + className: style, + startStyle: style + "-left", + endStyle: style + "-right" + })); + } + _calcTokenPos(token) { + if (token.startPos || token == null) { + return token; + } + CMUtils.calcRangePos(this.cm, token.i, token.l, token); + return token; + } + } + ExpressionHighlighter.CSS_PREFIX = "exp-"; + ExpressionHighlighter.GROUP_CLASS_BY_TYPE = { + set: ExpressionHighlighter.CSS_PREFIX + "group-set", + setnot: ExpressionHighlighter.CSS_PREFIX + "group-set", + group: ExpressionHighlighter.CSS_PREFIX + "group-%depth%", + lookaround: ExpressionHighlighter.CSS_PREFIX + "group-%depth%" + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class ExpressionHover { + constructor(editor, highlighter) { + this.editor = editor; + this.highlighter = highlighter; + this.isMouseDown = false; + this.token = null; + let o = editor.display.lineDiv; + o.addEventListener("mousemove", evt => this._handleMouseMove(evt)); + o.addEventListener("mouseout", evt => this._handleMouseOut(evt)); + o.addEventListener("mousedown", evt => this._handleMouseDown(evt)); + } + + // private methods: + _handleMouseMove(evt) { + if (this.isMouseDown) { + return; + } + let index, + editor = this.editor, + token = this.token, + target = null; + if (evt && token && (index = CMUtils.getCharIndexAt(editor, evt.clientX, evt.clientY + window.pageYOffset)) != null) { + while (token) { + if (index >= token.i && index < token.i + token.l) { + target = token; + break; + } + token = token.next; + } + } + while (target) { + if (target.open) { + target = target.open; + } else if (target.proxy) { + target = target.proxy; + } else { + break; + } + } + this.highlighter.hoverToken = target; + let rect = index != null && CMUtils.getCharRect(editor, index); + if (rect) { + rect.right = rect.left = evt.clientX; + } + app.tooltip.hover.show("ExpressionHover", app.reference.tipForToken(target), evt.clientX, rect.bottom, true, 0); + } + _handleMouseOut(evt) { + this.highlighter.hoverToken = null; + app.tooltip.hover.hide("ExpressionHover"); + } + _handleMouseDown(evt) { + // TODO: Should this also be in TextHover? + if (evt.which !== 1 && evt.button !== 1) { + return; + } + this.isMouseDown = true; + let f, + t = window.addEventListener ? window : document; + t.addEventListener("mouseup", f = () => { + t.removeEventListener("mouseup", f); + this.isMouseDown = false; + }); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + /* + The core profile essentially defines every feature we support, and is then pared down by other profiles. All values should be y (true). + + It also acts in part as pseudo documentation for all of the "type" values. + */ + let y = true, + n = false; + let core = { + id: "core", + flags: { + "g": "global", + // note that this is not a real flag in some flavors, but a different method call + "i": "caseinsensitive", + "m": "multiline", + "s": "dotall", + "u": "unicode", + "y": "sticky", + "x": "extended", + "U": "ungreedy" + }, + // reserved characters that need to be escaped: + escChars: "+*?^$\\.[]{}()|/".split("").reduce((o, c) => { + o[c] = y; + return o; + }, {}), + // escape chars that are specifically not supported by the flavor: + badEscChars: n, + escCharCodes: { + "0": 0, + // null + "a": 7, + // bell + "t": 9, + // tab + "n": 10, + // lf + "v": 11, + // vertical tab + "f": 12, + // form feed + "r": 13, + // cr + "e": 27 // escape + }, + escCharTypes: { + "A": "bos", + "b": "wordboundary", + "B": "notwordboundary", + "d": "digit", + "D": "notdigit", + "G": "prevmatchend", + "h": "hwhitespace", + "H": "nothwhitespace", + "K": "keepout", + "N": "notlinebreak", + "R": "linebreak", + "s": "whitespace", + "S": "notwhitespace", + "v": "vwhitespace", + "V": "notvwhitespace", + "w": "word", + "W": "notword", + "X": "unicodegrapheme", + "Z": "eos", + "z": "abseos" + }, + charTypes: { + ".": "dot", + "|": "alt", + "$": "eof", + "^": "bof", + "?": "opt", + // also: "lazy" + "+": "plus", + // also: "possessive" + "*": "star" + }, + unquantifiable: { + // all group/set open tokens are unquantifiable by default (ie. tokens with a .close value) + "quant": y, + "plus": y, + "star": y, + "opt": y, + "lazy": y, + "possessive": y, + "eof": y, + "bof": y, + "eos": y, + "abseos": y, + "alt": y, + "open": y, + "mode": y, + "comment": y, + // TODO: this should actually be ignored by quantifiers. + "condition": y + }, + unicodeScripts: { + // from: http://www.pcre.org/original/doc/html/pcrepattern.html + "Arabic": y, + "Armenian": y, + "Avestan": y, + "Balinese": y, + "Bamum": y, + "Bassa_Vah": y, + "Batak": y, + "Bengali": y, + "Bopomofo": y, + "Brahmi": y, + "Braille": y, + "Buginese": y, + "Buhid": y, + "Canadian_Aboriginal": y, + "Carian": y, + "Caucasian_Albanian": y, + "Chakma": y, + "Cham": y, + "Cherokee": y, + "Common": y, + "Coptic": y, + "Cuneiform": y, + "Cypriot": y, + "Cyrillic": y, + "Deseret": y, + "Devanagari": y, + "Duployan": y, + "Egyptian_Hieroglyphs": y, + "Elbasan": y, + "Ethiopic": y, + "Georgian": y, + "Glagolitic": y, + "Gothic": y, + "Grantha": y, + "Greek": y, + "Gujarati": y, + "Gurmukhi": y, + "Han": y, + "Hangul": y, + "Hanunoo": y, + "Hebrew": y, + "Hiragana": y, + "Imperial_Aramaic": y, + "Inherited": y, + "Inscriptional_Pahlavi": y, + "Inscriptional_Parthian": y, + "Javanese": y, + "Kaithi": y, + "Kannada": y, + "Katakana": y, + "Kayah_Li": y, + "Kharoshthi": y, + "Khmer": y, + "Khojki": y, + "Khudawadi": y, + "Lao": y, + "Latin": y, + "Lepcha": y, + "Limbu": y, + "Linear_A": y, + "Linear_B": y, + "Lisu": y, + "Lycian": y, + "Lydian": y, + "Mahajani": y, + "Malayalam": y, + "Mandaic": y, + "Manichaean": y, + "Meetei_Mayek": y, + "Mende_Kikakui": y, + "Meroitic_Cursive": y, + "Meroitic_Hieroglyphs": y, + "Miao": y, + "Modi": y, + "Mongolian": y, + "Mro": y, + "Myanmar": y, + "Nabataean": y, + "New_Tai_Lue": y, + "Nko": y, + "Ogham": y, + "Ol_Chiki": y, + "Old_Italic": y, + "Old_North_Arabian": y, + "Old_Permic": y, + "Old_Persian": y, + "Old_South_Arabian": y, + "Old_Turkic": y, + "Oriya": y, + "Osmanya": y, + "Pahawh_Hmong": y, + "Palmyrene": y, + "Pau_Cin_Hau": y, + "Phags_Pa": y, + "Phoenician": y, + "Psalter_Pahlavi": y, + "Rejang": y, + "Runic": y, + "Samaritan": y, + "Saurashtra": y, + "Sharada": y, + "Shavian": y, + "Siddham": y, + "Sinhala": y, + "Sora_Sompeng": y, + "Sundanese": y, + "Syloti_Nagri": y, + "Syriac": y, + "Tagalog": y, + "Tagbanwa": y, + "Tai_Le": y, + "Tai_Tham": y, + "Tai_Viet": y, + "Takri": y, + "Tamil": y, + "Telugu": y, + "Thaana": y, + "Thai": y, + "Tibetan": y, + "Tifinagh": y, + "Tirhuta": y, + "Ugaritic": y, + "Vai": y, + "Warang_Citi": y, + "Yi": y + }, + unicodeCategories: { + // from: http://www.pcre.org/original/doc/html/pcrepattern.html + "C": y, + // Other + "Cc": y, + // Control + "Cf": y, + // Format + "Cn": y, + // Unassigned + "Co": y, + // Private use + "Cs": y, + // Surrogate + "L": y, + // Letter + "L&": y, + // Any letter + "Ll": y, + // Lower case letter + "Lm": y, + // Modifier letter + "Lo": y, + // Other letter + "Lt": y, + // Title case letter + "Lu": y, + // Upper case letter + "M": y, + // Mark + "Mc": y, + // Spacing mark + "Me": y, + // Enclosing mark + "Mn": y, + // Non-spacing mark + "N": y, + // Number + "Nd": y, + // Decimal number + "Nl": y, + // Letter number + "No": y, + // Other number + "P": y, + // Punctuation + "Pc": y, + // Connector punctuation + "Pd": y, + // Dash punctuation + "Pe": y, + // Close punctuation + "Pf": y, + // Final punctuation + "Pi": y, + // Initial punctuation + "Po": y, + // Other punctuation + "Ps": y, + // Open punctuation + "S": y, + // Symbol + "Sc": y, + // Currency symbol + "Sk": y, + // Modifier symbol + "Sm": y, + // Mathematical symbol + "So": y, + // Other symbol + "Z": y, + // Separator + "Zl": y, + // Line separator + "Zp": y, + // Paragraph separator + "Zs": y // Space separator + }, + posixCharClasses: { + // from: http://www.pcre.org/original/doc/html/pcrepattern.html + "alnum": y, + // letters and digits + "alpha": y, + // letters + "ascii": y, + // character codes 0 - 127 + "blank": y, + // space or tab only + "cntrl": y, + // control characters + "digit": y, + // decimal digits (same as \d) + "graph": y, + // printing characters, excluding space + "lower": y, + // lower case letters + "print": y, + // printing characters, including space + "punct": y, + // printing characters, excluding letters and digits and space + "space": y, + // white space (the same as \s from PCRE 8.34) + "upper": y, + // upper case letters + "word": y, + // "word" characters (same as \w) + "xdigit": y // hexadecimal digits + }, + modes: { + "i": "caseinsensitive", + "s": "dotall", + "m": "multiline", + "x": "freespacing", + "J": "samename", + "U": "switchlazy" + }, + tokens: { + // note that not all of these are actively used in the lexer, but are included for completeness. + "open": y, + // opening / + "close": y, + // closing / + "char": y, + // abc + + // classes: + // also in escCharTypes and charTypes + "set": y, + // [a-z] + "setnot": y, + // [^a-z] + "setclose": y, + // ] + "range": y, + // [a-z] + "unicodecat": y, + // \p{Ll} \P{^Ll} \pL + "notunicodecat": y, + // \P{Ll} \p{^Ll} \PL + "unicodescript": y, + // \p{Cherokee} \P{^Cherokee} + "notunicodescript": y, + // \P{Cherokee} \p{^Cherokee} + "posixcharclass": y, + // [[:alpha:]] + // not in supported flavors: "posixcollseq": y, // [[.foo.]] // this is recognized by the lexer, currently returns "notsupported" error + // not in supported flavors: "unicodeblock": y, // \p{InThai} \p{IsThai} and NOT \P + // not in supported flavors: "subtract": y, // [base-[subtract]] + // not in supported flavors: "intersect": y, // [base&&[intersect]] + + // esc: + // also in escCharCodes and escCharTypes + "escoctal": y, + // \11 + "escunicodeu": y, + // \uFFFF + "escunicodeub": y, + // \u{00A9} + "escunicodexb": y, + // \x{00A9} + "escsequence": y, + // \Q...\E + "eschexadecimal": y, + // \xFF + "esccontrolchar": y, + // \cA + "escoctalo": y, + // \o{377} // resolved to escoctal in lexer, no docs required + "escchar": y, + // \m (unrecognized escapes) // no reference documentation required + + // group: + "group": y, + // (foo) + "groupclose": y, + // ) + "noncapgroup": y, + // (?:foo) + "namedgroup": y, + // (?Pfoo) (?foo) (?'name'foo) + "atomic": y, + // (?>foo|bar) + "define": y, + // (?(DEFINE)foo) + "branchreset": y, + // (?|(a)|(b)) + + // lookaround: + "poslookbehind": y, + // (?<=foo) + "neglookbehind": y, + // (? \k'name' \k{name} (?P=name) \g{name} + "numref": y, + // \1 + "extnumref": y, + // \g{-1} \g{+1} \g{1} \g1 \g-1 + "recursion": y, + // (?R) (?0) \g<0> \g'0' + "numsubroutine": y, + // \g<1> \g'-1' (?1) (?-1) + "namedsubroutine": y, + // \g \g'name' (?&name) (?P>name) + + // quantifiers: + // also in specialChars + "quant": y, + // {1,2} + "possessive": y, + // ++ + "lazy": y, + // ? + + // special: + "conditional": y, + // (?(?=if)then|else) + "condition": y, + // (?=if) any lookaround + "conditionalelse": y, + // | + "conditionalgroup": y, + // (?(1)a|b) (?(-1)a|b) (?(name)a|b) + "mode": y, + // (?i-x) see modes above + "comment": y, + // (?#comment) + + // meta: + "matchanyset": y // [\s\S] + }, + substTokens: { + // named references aren't supported in JS or PCRE / PHP + "subst_$esc": y, + // $$ + "subst_$&match": y, + // $& + "subst_$before": y, + // $` + "subst_$after": y, + // $' + "subst_$group": y, + // $1 $99 // resolved to subst_group in lexer, no docs required + "subst_$bgroup": y, + // ${1} ${99} // resolved to subst_group in lexer, no docs required + "subst_bsgroup": y, + // \1 \99 // resolved to subst_group in lexer, no docs required + "subst_group": y, + // $1 \1 \{1} // combined in docs, not used by lexer + "subst_0match": y, + // $0 \0 \{0} + + // this isn't a feature of the engine, but of RegExr: + "subst_esc": y // \n \r \u1234 + }, + config: { + "forwardref": y, + // \1(a) + "nestedref": y, + // (\1a|b)+ + "ctrlcodeerr": y, + // does \c error? (vs decompose) + "reftooctalalways": y, + // does a single digit reference \1 become an octal? (vs remain an unmatched ref) + "substdecomposeref": y, + // will a subst reference decompose? (ex. \3 becomes "\" & "3" if < 3 groups) + "looseesc": y, + // should unrecognized escape sequences match the character (ex. \u could match "u") // disabled when `u` flag is set + "unicodenegated": y, + // \p{^etc}" + "namedgroupalt": y // if false, only support (?foo) + }, + docs: { + // for example: + //possessive: {desc: "+This will be appended to the existing entry." }, + //namedgroup: {tip: "This will overwrite the existing entry." } + } + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + /* + The PCRE profile is almost a straight copy of the core profile. + */ + let y$1 = true, + n$1 = false; + let pcre = { + id: "pcre", + label: "PCRE", + browser: false, + flags: { + "u": n$1, + "y": n$1 + }, + badEscChars: "uUlLN".split("").reduce((o, c) => { + o[c] = y$1; + return o; + }, {}), + escCharCodes: { + "v": n$1 // vertical tab // PCRE support \v as vertical whitespace + }, + tokens: { + "escunicodeu": n$1, + // \uFFFF + "escunicodeub": n$1 // \u{00A9} + // octalo PCRE 8.34+ + }, + substTokens: { + "subst_$esc": n$1, + // $$ + "subst_$&match": n$1, + // $& + "subst_$before": n$1, + // $` + "subst_$after": n$1 // $' + }, + config: { + "reftooctalalways": n$1, + // does a single digit reference \1 become an octal? (vs remain an unmatched ref) + "substdecomposeref": n$1, + // will a subst reference decompose? (ex. \3 becomes "\" & "3" if < 3 groups) + "looseesc": n$1 // should unrecognized escape sequences match the character (ex. \u could match "u") // disabled when `u` flag is set + }, + docs: { + "escoctal": { + ext: "+

The syntax \\o{FFF} is also supported.

" + }, + "numref": { + ext: "

There are multiple syntaxes for this feature: \\1 \\g1 \\g{1}.

" + "

The latter syntaxes support relative values preceded by + or -. For example \\g-1 would match the group preceding the reference.

" + }, + "lazy": { + ext: "+

This behaviour is reversed by the ungreedy (U) flag/modifier.

" + } + } + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + /* + The javascript profile disables a large number of features. + + Note that JS warnings are currently added in addJSWarnings in the ExpresssionLexer. + */ + + let n$2 = false; + function test(expr, flag) { + try { + return new RegExp(expr, flag) && undefined; + } catch (e) { + return n$2; + } + } + function testFlag(flag) { + return test(".", flag); + } + let unicodeFlag = testFlag("u"); + let stickyFlag = testFlag("y"); + let dotallFlag = testFlag("s"); + let lookbehind = test("(?<=A)"); + let namedgroup = test("(?B)"); + let unicodecat = test("\\p{Ll}", "u"); // disabled when `u` flag is not set + + let javascript = { + id: "js", + label: "JavaScript", + browser: true, + flags: { + "s": dotallFlag, + // warning + "x": n$2, + "u": unicodeFlag, + // warning + "y": stickyFlag, + // warning + "U": n$2 + }, + escCharCodes: { + "a": n$2, + // bell + "e": n$2 // escape + }, + escCharTypes: { + "A": n$2, + // bos + "G": n$2, + // prevmatchend + "h": n$2, + // hwhitespace + "H": n$2, + // nothwhitespace + "K": n$2, + // keepout + "N": n$2, + // notlinebreak + "R": n$2, + // newline + "v": n$2, + // vwhitespace + "V": n$2, + // notvwhitespace + "X": n$2, + // unicodegrapheme + "Z": n$2, + // eos + "z": n$2 // abseos + }, + unicodeScripts: unicodecat, + unicodeCategories: unicodecat, + posixCharClasses: n$2, + modes: n$2, + tokens: { + // classes: + // also in escCharSpecials and specialChars + "unicodecat": unicodecat, + // \p{Ll} \P{^Ll} \pL + "notunicodecat": unicodecat, + // \P{Ll} \p{^Ll} \PL + "unicodescript": unicodecat, + // \p{Cherokee} \P{^Cherokee} + "notunicodescript": unicodecat, + // \P{Cherokee} \p{^Cherokee} + "posixcharclass": n$2, + // [[:alpha:]] + + // esc: + // also in escCharCodes and escCharSpecials + "escunicodeub": unicodeFlag, + // \u{00A9} + "escunicodexb": n$2, + // \x{00A9} + "escsequence": n$2, + // \Q...\E + "escoctalo": n$2, + // \o{377} + + // group: + "namedgroup": namedgroup, + // (?Pfoo) (?foo) (?'name'foo) + "atomic": n$2, + // (?>foo|bar) + "define": n$2, + // (?(DEFINE)foo) + "branchreset": n$2, + // (?|(a)|(b)) + + // lookaround: + "poslookbehind": lookbehind, + // (?<=foo) // warning + "neglookbehind": lookbehind, + // (? \k'name' \k{name} (?P=name) \g{name} + "extnumref": n$2, + // \g{-1} \g{+1} \g{1} \g1 \g-1 + "recursion": n$2, + // (?R) (?0) \g<0> \g'0' + "numsubroutine": n$2, + // \g<1> \g'-1' (?1) (?-1) + "namedsubroutine": n$2, + // \g \g'name' (?&name) (?P>name) + + // quantifiers: + // also in specialChars + "possessive": n$2, + // special: + "conditional": n$2, + // (?(?=if)then|else) + "conditionalif": n$2, + // (?=if) any lookaround + "conditionalelse": n$2, + // | + "conditionalgroup": n$2, + // (?(1)a|b) (?(-1)a|b) (?(name)a|b) + "mode": n$2, + // (?i-x) see modes above + "comment": n$2 // (?#comment) + }, + config: { + "forwardref": n$2, + // \1(a) + "nestedref": n$2, + // (\1a|b)+ + "ctrlcodeerr": n$2, + // does \c error, or decompose? + "unicodenegated": n$2, + // \p{^etc} + "namedgroupalt": n$2 // if false, only support (?foo) + }, + substTokens: { + "subst_0match": n$2, + // $0 \0 \{0} + "subst_$bgroup": n$2, + // ${1} ${99} + "subst_bsgroup": n$2 // \1 \99 + }, + docs: { + "subst_group": { + ext: "" + }, + // remove other syntaxes. + "namedgroup": { + ext: "" + }, + // remove other syntaxes. + "unicodecat": { + ext: "

Requires the u flag.

" + "

For a list of values, see this MDN page.

" + } + // notunicodecat, unicodescript, notunicodescript are copied from unicodecat below. + } + }; + javascript.docs.notunicodecat = javascript.docs.unicodescript = javascript.docs.notunicodescript = javascript.docs.unicodecat; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + let profiles = { + core + }; + profiles.pcre = merge(core, pcre); + profiles.js = merge(core, javascript); + function merge(p1, p2) { + // merges p1 into p2, essentially just a simple deep copy without array support. + for (let n in p1) { + if (p2[n] === false) { + continue; + } else if (typeof p1[n] === "object") { + p2[n] = merge(p1[n], p2[n] || {}); + } else if (p2[n] === undefined) { + p2[n] = p1[n]; + } + } + return p2; + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Expression extends EventDispatcher { + constructor(el) { + super(); + this.el = el; + this.delim = "/"; + this.lexer = new ExpressionLexer(); + this._initUI(el); + app.flavor.on("change", () => this._onFlavorChange()); + this._onFlavorChange(); + } + set value(expression) { + let regex = Utils.decomposeRegEx(expression || Expression.DEFAULT_EXPRESSION, this.delim); + this.pattern = regex.source; + this.flags = regex.flags; + } + get value() { + return this.editor.getValue(); + } + set pattern(pattern) { + let index = this.editor.getValue().lastIndexOf(this.delim); + this.editor.replaceRange(pattern, { + line: 0, + ch: 1 + }, { + line: 0, + ch: index + }); + this._deferUpdate(); + } + get pattern() { + return Utils.decomposeRegEx(this.editor.getValue(), this.delim).source; + } + set flags(flags) { + flags = app.flavor.validateFlagsStr(flags); + let str = this.editor.getValue(), + index = str.lastIndexOf(this.delim); + this.editor.replaceRange(flags, { + line: 0, + ch: index + 1 + }, { + line: 0, + ch: str.length + }); // this doesn't work if readOnly is false. + } + get flags() { + return Utils.decomposeRegEx(this.editor.getValue(), this.delim).flags; + } + get token() { + return this.lexer.token; + } + showFlags() { + this.flagsList.selected = this.flags.split(""); + app.tooltip.toggle.toggleOn("flags", this.flagsEl, this.flagsBtn, true, -2); + } + toggleFlag(s) { + let flags = this.flags, + i = flags.indexOf(s); + this.flags = i >= 0 ? flags.replace(s, "") : flags + s; + } + showFlavors() { + app.tooltip.toggle.toggleOn("flavor", this.flavorEl, this.flavorBtn, true, -2); + } + insert(str) { + this.editor.replaceSelection(str, "end"); + } + selectAll() { + CMUtils.selectAll(this.editor); + } + + // private methods: + _initUI(el) { + this.editorEl = DOMUtils.query("> .editor", el); + let editor = this.editor = CMUtils.create(this.editorEl, { + autofocus: true, + maxLength: 2500, + singleLine: true + }, "100%", "100%"); + editor.on("mousedown", (cm, evt) => this._onEditorMouseDown(cm, evt)); + editor.on("change", (cm, evt) => this._onEditorChange(cm, evt)); + editor.on("keydown", (cm, evt) => this._onEditorKeyDown(cm, evt)); + // hacky method to disable overwrite mode on expressions to avoid overwriting flags: + editor.toggleOverwrite = () => {}; + this.errorEl = DOMUtils.query(".icon.alert", this.editorEl); + this.errorEl.addEventListener("mouseenter", evt => this._onMouseError(evt)); + this.errorEl.addEventListener("mouseleave", evt => this._onMouseError(evt)); + this.highlighter = new ExpressionHighlighter(editor); + this.hover = new ExpressionHover(editor, this.highlighter); + this._setInitialExpression(); + this._initTooltips(el); + this.value = Expression.DEFAULT_EXPRESSION; + } + _setInitialExpression() { + let editor = this.editor; + editor.setValue("/./g"); + + // leading / + editor.getDoc().markText({ + line: 0, + ch: 0 + }, { + line: 0, + ch: 1 + }, { + className: "exp-decorator", + readOnly: true, + atomic: true, + inclusiveLeft: true + }); + + // trailing /g + editor.getDoc().markText({ + line: 0, + ch: 2 + }, { + line: 0, + ch: 4 + }, { + className: "exp-decorator", + readOnly: false, + atomic: true, + inclusiveRight: true + }); + this._deferUpdate(); + } + _deferUpdate() { + Utils.defer(() => this._update(), "Expression._update"); + } + _update() { + let expr = this.editor.getValue(); + this.lexer.profile = app.flavor.profile; + let token = this.lexer.parse(expr); + DOMUtils.toggleClass(this.editorEl, "error", !!this.lexer.errors.length); + this.hover.token = token; + this.highlighter.draw(token); + this.dispatchEvent("change"); + } + _initTooltips(el) { + const template = DOMUtils.template` ${"label"}`; + let flavorData = app.flavor.profiles.map(o => ({ + id: o.id, + label: o.label + " (" + (o.browser ? "Browser" : "Server") + ")" + })); + this.flavorBtn = DOMUtils.query("section.expression .button.flavor", el); + this.flavorEl = DOMUtils.query("#library #tooltip-flavor"); + this.flavorList = new List(DOMUtils.query("ul.list", this.flavorEl), { + data: flavorData, + template + }); + this.flavorList.on("change", () => this._onFlavorListChange()); + this.flavorBtn.addEventListener("click", evt => this.showFlavors()); + DOMUtils.query(".icon.help", this.flavorEl).addEventListener("click", () => app.sidebar.goto("engine")); + this.flagsBtn = DOMUtils.query("section.expression .button.flags", el); + this.flagsEl = DOMUtils.query("#library #tooltip-flags"); + this.flagsList = new List(DOMUtils.query("ul.list", this.flagsEl), { + data: [], + multi: true, + template + }); + this.flagsList.on("change", () => this._onFlagListChange()); + this.flagsBtn.addEventListener("click", evt => this.showFlags()); + DOMUtils.query(".icon.help", this.flagsEl).addEventListener("click", () => app.sidebar.goto("flags")); + } + + // event handlers: + _onFlavorListChange() { + app.tooltip.toggle.hide("flavor"); + app.flavor.value = this.flavorList.selected; + Track.page("flavor/" + this.flavorList.selected); + } + _onFlagListChange() { + let sel = this.flagsList.selected; + this.flags = sel ? sel.join("") : ""; + Track.event("set_flags", "engagement", this.flags); + } + _onFlavorChange() { + let flavor = app.flavor, + profile = flavor.profile; + this.flavorList.selected = profile.id; + DOMUtils.query("> .label", this.flavorBtn).innerText = profile.label; + let supported = Expression.FLAGS.split("").filter(n => !!profile.flags[n]); + let labels = Expression.FLAG_LABELS; + this.flagsList.data = supported.map(n => ({ + id: n, + label: labels[n] + })); + this.flags = this.flags.split("").filter(n => !!profile.flags[n]).join(""); + } + _onEditorMouseDown(cm, evt) { + // offset by half a character to make accidental clicks less likely: + let index = CMUtils.getCharIndexAt(cm, evt.clientX - cm.defaultCharWidth() * 0.6, evt.clientY); + if (index >= cm.getValue().lastIndexOf(this.delim)) { + this.showFlags(); + } + } + _onEditorChange(cm, evt) { + // catches pasting full expressions in. + // TODO: will need to be updated to work with other delimeters + this._deferUpdate(); + let str = evt.text[0]; + if (str.length < 3 || !str.match(/^\/.+[^\\]\/[a-z]*$/ig) || evt.from.ch !== 1 || evt.to.ch != 1 + evt.removed[0].length) { + // not pasting a full expression. + return; + } + this.value = str; + } + _onEditorKeyDown(cm, evt) { + // Ctrl or Command + D by default, will delete the expression and the flags field, Re: https://github.com/gskinner/regexr/issues/74 + // So we just manually reset to nothing here. + if ((evt.ctrlKey || evt.metaKey) && evt.keyCode == 68) { + evt.preventDefault(); + this.pattern = ""; + } + } + _onMouseError(evt) { + let tt = app.tooltip.hover, + errs = this.lexer.errors; + if (evt.type === "mouseleave") { + return tt.hide("error"); + } + if (errs.length === 0) { + return; + } + let err = errs.length === 1 && errs[0].error; + let str = err ? app.reference.getError(err, errs[0]) : "Problems in the Expression are underlined in red. Roll over them for details."; + let label = err && err.warning ? "WARNING" : "PARSE ERROR"; + tt.showOn("error", "" + label + ": " + str, this.errorEl); + } + } + Expression.DEFAULT_EXPRESSION = "/(Erst|Zweit)versuch/g"; + Expression.FLAGS = "gimsuxyU"; // for flag order + Expression.FLAG_LABELS = { + "g": "global", + "i": "case insensitive", + "m": "multiline", + "s": "single line (dotall)", + "u": "unicode", + "x": "extended", + "y": "sticky", + "U": "Ungreedy" + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + let UID = { + _next: 0, + get id() { + return Date.now() + "_" + this._next++; + }, + assign(list, force = false) { + list.forEach(o => o.id = o.id == null || force ? this.id : o.id); + } + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class TextHighlighter { + constructor(editor, canvas, fill = "#6CF", stroke = "#888") { + this.lineSpacing = 2; + this.capWidth = 4; + this.lastBottom = -1; + this.lastRight = -1; + this.editor = editor; + this.canvas = canvas; + this.fill = fill; + this.stroke = stroke; + } + set matches(val) { + this._matches = val; + this._deferUpdate(); + } + set hoverMatch(val) { + this._hoverMatch = val; + this._deferUpdate(); + } + set selectedMatch(val) { + this._selectedMatch = val; + this._deferUpdate(); + } + redraw() { + this._update(); + } + _deferUpdate() { + Utils.defer(() => this._update(), "TextHighlighter._update"); + } + _update() { + this.clear(); + let matches = this._matches, + hoverMatch = this._hoverMatch, + selectedMatch = this._selectedMatch; + if (!matches || !matches.length) { + return; + } + let cm = this.editor, + doc = cm.getDoc(); + let ctx = this.canvas.getContext("2d"); + ctx.fillStyle = this.fill; + ctx.strokeStyle = this.stroke; + ctx.lineWidth = 2; + + // find the range of the visible text: + let scroll = cm.getScrollInfo(); + let top = cm.indexFromPos(cm.coordsChar({ + left: 0, + top: scroll.top + }, "local")); + let bottom = cm.indexFromPos(cm.coordsChar({ + left: scroll.clientWidth, + top: scroll.top + scroll.clientHeight + }, "local")); + for (let i = 0, l = matches.length; i < l; i++) { + let match = matches[i], + start = match.i, + end = match.i + match.l - 1; + if (start > bottom) { + break; + } // all done. + if (end < top || end < start) { + continue; + } // not visible, so don't mark. + let startPos = match.startPos || (match.startPos = doc.posFromIndex(start)); + let endPos = match.endPos || (match.endPos = doc.posFromIndex(end)); + let emphasis = match === hoverMatch || match === selectedMatch; + let startRect = cm.charCoords(startPos, "local"), + endRect = cm.charCoords(endPos, "local"); + if (startRect.bottom === endRect.bottom) { + this.drawHighlight(ctx, startRect.left, startRect.top, endRect.right, endRect.bottom, scroll.top, false, false, emphasis); + } else { + let lw = cm.getScrollInfo().width, + lh = cm.defaultTextHeight(); + // render first line: + this.drawHighlight(ctx, startRect.left, startRect.top, lw - 2, startRect.bottom, scroll.top, false, true, emphasis); // startRect.top+lh + // render lines in between: + let y = startRect.top; + while ((y += lh) < endRect.top - 1) { + // the -1 is due to fractional issues on FF + this.drawHighlight(ctx, 0, y, lw - 2, y + startRect.bottom - startRect.top, scroll.top, true, true, emphasis); // lh + } + // render last line: + this.drawHighlight(ctx, 0, endRect.top, endRect.right, endRect.bottom, scroll.top, true, false, emphasis); + // CMUtils.getEOLPos(this.sourceCM, startPos); + } + } + } + drawHighlight(ctx, left, top, right, bottom, scrollY, startCap, endCap, emphasis) { + let capW = this.capWidth; + if (right < 0 || left + 1 >= right) { + return; + } // weird bug in CodeMirror occasionally returns negative values + left = left + 0.5 | 0; + right = right + 0.5 | 0; + top = (top + 0.5 | 0) + this.lineSpacing; + bottom = bottom + 0.5 | 0; + if (top + 1 > this.lastBottom) { + this.lastBottom = bottom; + } else if (left < this.lastRight) { + left = this.lastRight; + } + this.lastRight = right; + let a = ctx.globalAlpha; + if (startCap) { + ctx.globalAlpha = a * 0.5; + ctx.fillRect(left + 1 | 0, top - scrollY, capW + 1, bottom - top); + left += capW; + } + if (endCap) { + ctx.globalAlpha = a * 0.5; + ctx.fillRect(right - capW - 1 | 0, top - scrollY, capW + 1, bottom - top); + right -= capW; + } + ctx.globalAlpha = a; + ctx.fillRect(left + 1, top - scrollY, right - left - 1, bottom - top); + if (emphasis) { + ctx.strokeRect(left + 1, top - scrollY, right - left - 1, bottom - top); + } + } + clear() { + this.canvas.width = this.canvas.width; + this.lastBottom = -1; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class TextHover { + constructor(editor, highlighter) { + this.editor = editor; + this.highlighter = highlighter; + this._matches = this._x = null; + let o = editor.display.lineDiv; + o.addEventListener("mousemove", evt => this._handleMouseMove(evt)); + o.addEventListener("mouseout", evt => this._handleMouseOut(evt)); + } + set matches(val) { + this._matches = val; + this._update(); + } + + // private methods: + _handleMouseMove(evt) { + this._x = evt.clientX; + this._y = evt.clientY + window.pageYOffset; + this._update(); + } + _handleMouseOut(evt) { + this._x = null; + this._update(); + } + _update() { + if (this._x === null) { + this.highlighter.hoverMatch = null; + app.tooltip.hover.hide("TextHover"); + return; + } + let index, + cm = this.editor, + match, + matches = this._matches, + x = this._x, + y = this._y; + if (matches && matches.length && (index = CMUtils.getCharIndexAt(cm, x, y)) != null) { + match = this.highlighter.hoverMatch = app.text.getMatchAt(index); + } + let rect = index != null && CMUtils.getCharRect(cm, index); + if (rect) { + rect.right = rect.left = x; + } + let tip = app.reference.tipForMatch(match, cm.getValue()); + if (tip) { + let div = DOMUtils.create("div", "texthover", tip); + app.tooltip.hover.show("TextHover", div, x, rect.bottom, true, 0); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Text extends EventDispatcher { + constructor(el) { + super(); + this.el = el; + this._initUI(el); + this._initTestUI(el); + app.on("result", () => this._setResult(app.result)); + app.theme.on("change", () => this._handleThemeChange()); + } + set value(val) { + this.editor.setValue(val || this.defaultText); + } + get value() { + return this.editor.getValue(); + } + set tests(val) { + if (!(val instanceof Array)) { + val = []; + DOMUtils.removeClass(this.testsEl, "tests-added"); + } + this._tests = this.testList.data = val; + this._testMatches = null; + this._reselectTest(); + } + get tests() { + return this._tests; + } + set mode(val) { + if (val === this.mode) { + return; + } + this.modeList.selected = val || "text"; + this._handleModeChange(); + } + get mode() { + return this.modeList.selected; + } + get selectedMatch() { + let cm = this.editor; + return this.getMatchAt(cm.indexFromPos(cm.getCursor()), true); + } + getMatchValue(match) { + // this also works for groups. + return match ? this.value.substr(match.i, match.l) : null; + } + getMatchAt(index, inclusive) { + // also used by TextHover + let match, + offset = inclusive ? -1 : 0, + matches = this._result && this._result.matches; + if (!matches) { + return null; + } + for (let i = 0, l = matches.length; i < l; i++) { + match = matches[i]; + if (match.l + match.i - 1 < index + offset) { + continue; + } + if (match.i > index) { + break; + } + return match; + } + return null; + } + getEmptyTest() { + return { + id: UID.id, + name: "", + text: "Enter your test text here.", + type: "any" + }; + } + + // private methods: + _initUI(el) { + this.resultEl = DOMUtils.query("> header .result", el); + this.resultEl.addEventListener("mouseenter", evt => this._mouseResult(evt)); + this.resultEl.addEventListener("mouseleave", evt => this._mouseResult(evt)); + this.modeListEl = DOMUtils.query("> header .modelist", el); + let data = ["Text"].map(val => ({ + label: val, + id: val.toLowerCase() + })); + this.modeList = new List(this.modeListEl, { + data + }); + this.modeList.on("change", () => this._handleModeChange()); + this.modeList.selected = "text"; + let textEl = DOMUtils.query(".editor > .pad", el); + this.defaultText = DOMUtils.query("textarea", textEl).value; + let editor = this.editor = CMUtils.create(DOMUtils.empty(textEl), { + lineWrapping: true + }, "100%", "100%"); + editor.setValue(this.defaultText); + editor.on("change", () => this._change()); + editor.on("scroll", () => this._update()); + editor.on("cursorActivity", () => this._updateSelected()); + let detector = DOMUtils.create("iframe", "resizedetector", null, textEl), + win = detector.contentWindow; + let canvas = this.canvas = DOMUtils.create("canvas", "highlights", null, textEl); + textEl.appendChild(editor.display.wrapper); // move the editor on top of the iframe & canvas. + + win.onresize = () => { + let w = win.innerWidth | 0, + h = win.innerHeight | 0; + this._startResize(); + Utils.defer(() => this._handleResize(w, h), "text_resize", 250); + }; + win.onresize(); + this.highlighter = new TextHighlighter(editor, canvas, DOMUtils.getCSSValue("match", "color"), DOMUtils.getCSSValue("selected-stroke", "color")); + this.hover = new TextHover(editor, this.highlighter); + } + _handleThemeChange() { + this.highlighter.fill = DOMUtils.getCSSValue("match", "color"); + this.highlighter.stroke = DOMUtils.getCSSValue("selected-stroke", "color"); + this.highlighter.redraw(); + } + _handleModeChange(evt) { + this.dispatchEvent("modechange"); + if (this.mode === "text") { + this.editor.refresh(); + } else { + DOMUtils.addClass(this.el, "tests-viewed"); + } + Track.page("mode/" + this.mode); + } + _setResult(val) { + this._result = val; + this._testMatches = null; + if (this.mode !== val.mode) { + return; + } + if (val.mode === "tests") { + this._updateTests(); + } else { + // mode === "text" + this._updateEmptyCount(); + this._updateResult(); + this._updateSelected(); + this._deferUpdate(); + } + } + _deferUpdate() { + Utils.defer(() => this._update(), "Text._update"); + } + _update() { + let result = this._result, + matches = result && result.matches; + if (result && result.mode === "tests") { + this._updateTests(); + } else { + // mode === "text" + this.hover.matches = this.highlighter.matches = matches; + } + } + _updateResult() { + let result = this._result, + matches = result && result.matches, + l = matches && matches.length, + text; + if (l && result && !result.error) { + text = l + " match" + (l > 1 ? "es" : "") + (this._emptyCount ? "*" : ""); + } else if (!result || !result.error) { + text = "No match"; + } + this._showResult(text); + } + _showResult(text, clss) { + let result = this._result, + el = this.resultEl; + DOMUtils.removeClass(el, "error warning matches pass fail"); + if (result && result.error) { + if (!text) { + text = result.error.warning ? "WARNING" : "ERROR"; + } + DOMUtils.addClass(el, "error"); + if (result.error.warning) { + DOMUtils.addClass(el, "warning"); + } + } + if (clss) { + DOMUtils.addClass(el, clss); + } + el.innerHTML = text; + if (result.time != null) { + el.innerHTML += " (" + parseFloat(result.time).toFixed(1) + "ms)"; + } + } + _updateSelected() { + let match = this.selectedMatch; + if (this.highlighter.selectedMatch === match) { + return; + } + this.highlighter.selectedMatch = match; + this.dispatchEvent("select"); + } + _change() { + this.dispatchEvent("change"); + } + _startResize() { + let canvas = this.canvas, + style = canvas.style; + style.visibility = "hidden"; + style.opacity = 0; + // keeps it from causing scrollbars: + canvas.width = canvas.height = 1; + } + _mouseResult(evt) { + let tt = app.tooltip.hover, + res = this._result, + err = res && res.error, + str = ""; + if (evt.type === "mouseleave") { + return tt.hide("result"); + } + if (err && !err.warning) { + str = "EXEC ERROR: " + this._errorText(err); + } else { + if (err && err.warning) { + str = "WARNING: " + this._errorText(err) + "
"; + } + let l = this._tests.length; + if (this.mode === "tests") { + if (this._tests.length === 0) { + str += "Use the 'Add Test' button to create a new test."; + } else if (this._testFails) { + str += this._testFails + " out of " + l + " tests failed."; + } else { + str += "All " + l + " tests passed."; + } + } else { + str += (l || "No") + " match" + (l > 1 ? "es" : "") + " found in " + this.value.length + " characters"; + str += this._emptyCount ? ", including " + this._emptyCount + " empty matches (* not displayed)." : "."; + let cm = this.editor, + sel = cm.listSelections()[0], + pos = sel.head; + let i0 = cm.indexFromPos(pos), + i1 = cm.indexFromPos(sel.anchor), + range = Math.abs(i0 - i1); + str += "
Insertion point: line " + pos.line + ", col " + pos.ch + ", index " + i0; + str += range > 0 ? " (" + range + " character" + (range === 1 ? "" : "s") + " selected)" : ""; + } + } + tt.showOn("result", str, this.resultEl, false, -2); + } + _updateEmptyCount() { + let result = this._result, + matches = result && result.matches; + this._emptyCount = matches ? matches.reduce((v, o) => v + (o.l ? 0 : 1), 0) : 0; + } + _errorText(err) { + return err.message || app.reference.getError(err); + } + _handleResize(w, h) { + let canvas = this.canvas, + style = canvas.style; + style.visibility = style.opacity = ""; + canvas.width = w; + canvas.height = h; + this.editor.refresh(); + this._deferUpdate(); + } + + // Test mode: + _initTestUI(el) { + const types = [{ + id: "all", + label: "Match Full" + }, { + id: "any", + label: "Match Any" + }, + // {id:"start", label:"Match Start"}, + { + id: "none", + label: "Match None" + }]; + this.typeLabels = types.reduce((o, t) => { + o[t.id] = t.label; + return o; + }, {}); + this.testsEl = DOMUtils.query(".tests", el); + this.testItemEl = DOMUtils.query("#library > #tests_item"); + this.testListEl = DOMUtils.query(".list", this.testsEl); + this.testList = new List(this.testListEl, { + template: o => this._testItemTemplate(o) + }); + this.testList.scrollEl = this.testsEl; + this.testList.on("change", evt => this._handleTestChange(evt)); + DOMUtils.on(DOMUtils.queryAll(".button.add", el), "click", () => this._addTest()); + const template = DOMUtils.template` ${"label"}`; + this.typesEl = DOMUtils.query("#library #tooltip-testtypes"); + this.typesList = new List(DOMUtils.query("ul.list", this.typesEl), { + data: types, + template + }); + this.typesList.on("change", () => this._handleTypesChange()); + this.tests = null; + } + _updateTests() { + let result = this._result; + if (result.error) { + return this._showResult(); + } + let data = this._tests, + l = data.length; + if (!data || !l) { + return this._showResult("No tests."); + } + let matches = result.matches.reduce((o, t) => { + o[t.id] = t; + return o; + }, {}), + fails = 0; + for (let i = 0; i < l; i++) { + let test = data[i], + match = matches[test.id], + pass = false, + el = this.testList.getEl(test.id); + if (test.type === "none") { + pass = match.i == null; + } else if (test.type === "all") { + pass = match.l === test.text.length; + } else if (test.type === "start") { + pass = match.i === 0; + } else { + // any + pass = match.i != null; + } + DOMUtils.toggleClass(el, "fail", !pass); + if (!pass) { + fails++; + } + } + this._testFails = fails; + this._testMatches = matches; + if (fails) { + this._showResult(fails + " FAILED", "fail"); + } else { + this._showResult("PASSED", "pass"); + } + this._updateSelTest(); + } + _updateSelTest() { + if (this._testMark) { + this._testMark.clear(); + } + let matches = this._testMatches, + el = this.testList.selectedEl; + if (!el || !matches) { + return; + } + let match = matches[this.testList.selected], + cm = this.testEditor; + if (match && match.i != null) { + let pos = CMUtils.calcRangePos(cm, match.i, match.l); + this._testMark = this.testEditor.getDoc().markText(pos.startPos, pos.endPos, { + className: "match" + }); + } + } + _testItemTemplate(o) { + let el = this.testItemEl.cloneNode(true); + let typeBtn = DOMUtils.query("header .button.type", el); + typeBtn.addEventListener("click", evt => this._showTypes(typeBtn, o)); + let delBtn = DOMUtils.query("header .delete", el); + delBtn.addEventListener("click", evt => this._deleteTest(o)); + let nameFld = DOMUtils.query("header .name", el); + nameFld.addEventListener("input", () => this._handleTestNameChange(nameFld, o)); + this._updateTestHeader(o, el, false); + return el; + } + _updateTestHeader(o, el, edit) { + let nameFld = DOMUtils.query("header .name", el); + nameFld.value = o.name || ""; + nameFld.placeholder = o.text && !edit ? o.text.substr(0, 100) : "Untitled Test"; + let typeLbl = DOMUtils.query("header .button.type .label", el); + typeLbl.innerText = this.typeLabels[o.type]; + } + _addTest() { + const o = this.getEmptyTest(); + this._tests.push(o); + this.testList.addItem(o, true); + this._handleTestChange(); + this.testEditor.execCommand("selectAll"); + DOMUtils.addClass(this.testsEl, "tests-added"); + this._change(); + } + _reselectTest() { + if (this._selTest) { + this.testList.selected = this._selTest.id; + } + if (!this._selTest || this.testList.selected == null) { + this.testList.selectedIndex = 0; + } + this._selTest = null; + this._handleTestChange(); + } + _handleTestChange() { + let el, o; + if (this._selTest) { + o = this._selTest; + el = this.testList.getEl(o.id); + this._updateTestHeader(o, el, false); + } + el = this.testList.selectedEl; + o = this._selTest = this.testList.selectedItem; + if (!o) { + return; + } + this._getTestEditor(DOMUtils.query("article .editor .pad", el), o); + this._updateTestHeader(o, el, true); + this._updateSelTest(); + this.testEditor.focus(); + this.testEditor.setCursor(this.testEditor.lineCount(), 0); + } + _handleTestNameChange(fld, o) { + o.name = fld.value; + this._change(); + } + _handleTypesChange() { + let el = this.testList.selectedEl, + o = this.testList.selectedItem; + o.type = this.typesList.selectedItem.id; + app.tooltip.toggle.hide("testtypes"); + this._updateTestHeader(o, el, true); + this._change(); + } + _handleTestTextChange(change) { + this._selTest.text = this.testEditor.getValue(); + if (change.origin !== "setValue") { + this._change(); + } + } + _showTypes(el, o) { + this.typesList.selected = o.type; + app.tooltip.toggle.toggleOn("testtypes", this.typesEl, el, true, -2); + } + _deleteTest(o) { + let data = this._tests; + let i = data.indexOf(o); + data.splice(i, 1); + this._selTest = null; + this.testList.removeItem(o.id); + if (data.length) { + this.testList.selected = data[Math.min(i, data.length - 1)].id; + } + this._updateTests(); + this._handleTestChange(); + this._change(); + } + _getTestEditor(el, o) { + let cm = this.testEditor; + if (!cm) { + cm = this.testEditor = CMUtils.create(DOMUtils.empty(el), { + lineWrapping: true + }, "100%", "100%"); + cm.on("change", (a, b) => this._handleTestTextChange(b)); + } else { + el.appendChild(cm.getWrapperElement()); + } + cm.setValue(o.text); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Explain { + constructor(el) { + this.el = el; + DOMUtils.addClass(el, "explain"); + this._update(); + this._bound_handleEvent = evt => this._handleEvent(evt); + app.expression.addEventListener("change", this._bound_handleEvent); + app.expression.highlighter.addEventListener("hover", this._bound_handleEvent); + } + cleanup() { + DOMUtils.empty(this.el); + DOMUtils.removeClass(this.el, "explain"); + app.expression.removeEventListener("change", this._bound_handleEvent); + app.expression.highlighter.removeEventListener("hover", this._bound_handleEvent); + } + + // private methods: + _update() { + let el = DOMUtils.empty(this.el), + token = app.expression.token, + expr = app.expression.value; + this._divs = []; + if (!token || token.next.type === "close") { + el.innerHTML = "Enter an Expression above and it will be explained here."; + return; + } + el.innerHTML = "Roll-over elements below to highlight in the Expression above. Click to open in Reference."; + while ((token = token.next) && token.type !== "close") { + if (token.proxy || token.open && token.open.proxy) { + continue; + } + let groupClasses = ExpressionHighlighter.GROUP_CLASS_BY_TYPE, + pre = ExpressionHighlighter.CSS_PREFIX; + let i = token.i, + end = token.i + token.l, + content = expr.substring(i, end).replace("<", "<"); + if (token.set) { + let set0 = token.set[0], + set2 = token.set[2]; + content = "" + expr.substring(set0.i, set0.i + set0.l) + ""; + content += expr.substring(i, end); + content += "" + expr.substring(set2.i, set2.i + set2.l) + ""; + } + let className = pre + (token.clss || token.type); + content = "" + content + " "; + if (!token.open) { + content += app.reference.tipForToken(token); + } else { + content += " "; + } + let div = DOMUtils.create("div", null, content, el); + if (token.close) { + className = groupClasses[token.clss || token.type]; + if (className) { + className = className.replace("%depth%", Math.min(4, token.depth)); + DOMUtils.addClass(div, className); + } + if (token.depth > 3) { + div.innerHTML = "So... you wanted to see what would happen if you just kept nesting groups, eh? Well, this is it." + " I was going to reward your curiosity with a RegEx joke, but a quick search on google reveals that not even" + " the collective wisdom of the internet can make regular expressions funny. Well, except the whole 'now you've got two problems'" + " shtick, but you've probably heard that one already. Wasn't really worth the effort, was it?"; + token = token.close.prv; + this._divs.push(div); + el = div; + continue; + } + el = div; + } + div.token = token; + if (token.open) { + DOMUtils.addClass(div, "close"); + div.proxy = el; + el = el.parentNode; + } + if (token.error) { + DOMUtils.addClass(div, "error"); + if (token.error.warning) { + DOMUtils.addClass(div, "warning"); + } + } + if (!token.open) { + div.addEventListener("mouseover", this._handleMouseEvent); + div.addEventListener("mouseout", this._handleMouseEvent); + div.addEventListener("click", this._handleMouseEvent); + } + if (token.clss === "quant" || token.type === "lazy" || token.type === "possessive") { + this._insertApplied(div); + } else { + this._divs.push(div); + } + } + } + _insertApplied(div) { + let divs = this._divs, + prv = div.token.prv, + d, + i = divs.length; + while ((d = divs[--i]) && d.token !== prv) {} // search backwards for efficiency + d = d.proxy || d; + divs.splice(i, 0, div); + d.insertAdjacentElement("afterend", div); + DOMUtils.addClass(div, "applied"); + } + _handleHoverChange() { + let token = app.expression.highlighter.hoverToken; + DOMUtils.removeClass(DOMUtils.queryAll("div.selected", this.el), "selected"); + DOMUtils.removeClass(DOMUtils.queryAll("div.related", this.el), "related"); + if (!token) { + return; + } + let div = this._findDiv(token); + DOMUtils.addClass(div, "selected"); + if (token.related) { + for (let i = 0, l = token.related.length; i < l; i++) { + DOMUtils.addClass(this._findDiv(token.related[i]), "related"); + } + } + } + _findDiv(token) { + return Utils.find(this._divs, div => div.token === token); + } + _handleMouseEvent(evt) { + let type = evt.type, + token = evt.currentTarget.token; + if (type == "click") { + app.sidebar.showToken(token); + } else { + app.expression.highlighter.hoverToken = type === "mouseout" ? null : token; + } + evt.stopPropagation(); + } + _handleEvent(evt) { + if (evt.type === "change") { + this._update(); + } else if (evt.type === "hover") { + this._handleHoverChange(); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Details { + constructor(el) { + this.el = el; + DOMUtils.addClass(el, "details"); + this._update(); + this._bound_handleEvent = evt => this._handleEvent(evt); + app.addEventListener("result", this._bound_handleEvent); + app.text.addEventListener("select", this._bound_handleEvent); + } + cleanup() { + DOMUtils.empty(this.el); + DOMUtils.removeClass(this.el, "details"); + app.removeEventListener("result", this._bound_handleEvent); + app.text.removeEventListener("select", this._bound_handleEvent); + Utils.defer(null, "Details._update"); + } + + // private methods: + _update() { + DOMUtils.empty(this.el); + DOMUtils.create("div", "desc", "Click a match above to display match & group details. Mouse over a Group row to highlight it in the Expression.", this.el); + this._addMatch(app.text.selectedMatch, app.text.value); + } + _addMatch(match, textVal) { + if (!match) { + return; + } + let groups = match.groups, + l = groups && groups.length, + ext = l && groups[0].i != null, + matchVal = this._getMatchVal(match, textVal), + extStr = "", + me = match.i + match.l; + let groupTokens = app.expression.lexer.captureGroups; + let tableEl = DOMUtils.create("table", null, null, this.el); + let matchEl = DOMUtils.create("tr", "match", "Match " + match.num + "" + this._getRangeStr(match) + "", tableEl); + if (l) { + let inGroups = [], + lastIndex = match.i; + for (let i = 0; i <= l; i++) { + let group = groups[i], + index = group ? group.i : me, + num = i + 1, + token = groupTokens[i]; + if (ext) { + for (let j = inGroups.length - 1; j >= 0; j--) { + let inGroup = inGroups[j], + ge = inGroup.i + inGroup.l; + if (ge > index) { + break; + } + inGroups.pop(); + extStr += Utils.htmlSafe(textVal.substring(lastIndex, ge)) + ""; + lastIndex = ge; + } + } + if (!group) { + break; + } + if (group.l) { + extStr += Utils.htmlSafe(textVal.substring(lastIndex, index)) + ""; + inGroups.push(group); + lastIndex = index; + } + let val = "" + this._getMatchVal(group, textVal) + ""; + let label = token.name ? "'" + token.name + "'" : "Group " + num; + let tr = DOMUtils.create("tr", "group", "" + label + "" + this._getRangeStr(group) + "" + val + "", tableEl); + tr.token = token; + tr.addEventListener("mouseover", this._handleMouseEvent); + tr.addEventListener("mouseout", this._handleMouseEvent); + } + if (ext) { + extStr += Utils.htmlSafe(textVal.substring(lastIndex, me)); + } + } else { + DOMUtils.create("tr", "nogroup", "No groups.", tableEl); + } + DOMUtils.query("td:last-child", matchEl).innerHTML = extStr || matchVal; + } + _getMatchVal(match, str) { + let val = match.s || (match.i === undefined ? "" : str.substr(match.i, match.l)); + return val ? Utils.htmlSafe(val) : "<empty>"; + } + _getRangeStr(match) { + // we could check for match.l>0 to catch empty matches, but having a weird range might be more accurate. + return match.i != null ? match.i + "-" + (match.i + match.l - 1) : "n/a"; + } + _handleEvent(evt) { + Utils.defer(() => this._update(), "Details._update"); + } + _handleMouseEvent(evt) { + let type = evt.type, + token = evt.currentTarget.token; + app.expression.highlighter.hoverToken = type === "mouseout" ? null : token; + if (type === "mouseover") { + DOMUtils.addClass(DOMUtils.query("span.num-" + token.num, this.el), "hover"); + } else { + DOMUtils.removeClass(DOMUtils.query("span.hover", this.el), "hover"); + } + evt.stopPropagation(); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Replace { + constructor(el, cm) { + this.el = el; + this.editor = cm; + this._bound_handleEvent = evt => this._handleEvent(evt); + app.addEventListener("result", this._bound_handleEvent); + this._initUI(); + this._update(); + } + cleanup() { + DOMUtils.empty(this.el); + this.output.value = ""; + DOMUtils.removeClass(this.el, "details"); + app.removeEventListener("result", this._bound_handleEvent); + Utils.defer(null, "Replace._update"); + } + + // private methods: + _initUI() { + this.output = DOMUtils.create("textarea", null, null, this.el); + this.output.readOnly = true; + } + _update() { + let o = app.result && app.result.tool, + result = o && o.result; + this.output.value = result || "no result"; + } + _handleEvent(evt) { + Utils.defer(() => this._update(), "Replace._update"); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class SubstLexer { + constructor() { + this.profile = null; + } + set profile(profile) { + this._profile = profile; + this.string = this.token = this.errors = null; + } + parse(str) { + if (!this._profile) { + return null; + } + this.token = null; + this.string = str; + this.errors = []; + + // TODO: should this be passed in from Tools? + let capGroups = app.expression.lexer.captureGroups; + let prev = null, + token, + c; + for (let i = 0, l = str.length; i < l; i += token.l) { + c = str[i]; + token = { + prev: prev, + i: i, + l: 1, + subst: true + }; + if (c === "$" && i + 1 < l) { + this.parseDollar(str, token, capGroups); + } else if (c == "\\" && i + 1 < l) { + this.parseBackSlash(str, token, capGroups); + } + if (!token.type) { + token.type = "char"; + token.code = c.charCodeAt(0); + } + if (prev) { + prev.next = token; + } + if (!this.token) { + this.token = token; + } + if (token.error) { + // SubstLexer currently doesn't generate any errors. + this.errors.push(token.error); + } + prev = token; + } + return this.token; + } + parseBackSlash(str, token, capGroups) { + let match, + sub = str.substr(token.i), + profile = this._profile; + if (profile.substTokens.subst_bsgroup && (match = sub.match(/^\\(\d\d?)/))) { + this._getRef(match[1], token, capGroups, "subst_bsgroup"); + } else if (match = sub.match(SubstLexer.SUBST_ESC_RE)) { + if (match[1][0] === "u") { + token.type = "escunicode"; + token.code = parseInt(match[2], 16); + } else { + token.code = profile.escCharCodes[match[1]]; + token.type = "esc_" + token.code; + } + if (token.type) { + token.clss = "esc"; + token.l += match[1].length; + } + } + } + parseDollar(str, token, capGroups) { + // Note: Named groups are not supported in PCRE or JS. + let match = str.substr(token.i + 1).match(/^([$&`']|\d\d?|{\d\d?})/); + if (!match) { + return; + } + let d = match[1], + type = SubstLexer.$_TYPES[d], + profile = this._profile; + if (type) { + if (!profile.substTokens[type]) { + return; + } + token.type = type; + token.clss = "subst"; + token.l += d.length; + } else { + this._getRef(d, token, capGroups, d[0] === "{" ? "subst_$bgroup" : "subst_$group"); + } + } + _getRef(numStr, token, capGroups, type) { + if (!this._profile.substTokens[type]) { + return; + } + let num = parseInt(numStr.match(/\d\d?/)[0]), + l = 0; + if (!this._profile.config.substdecomposeref || capGroups[num - 1]) { + l = numStr.length; + } else if (num >= 10 && capGroups[(num = num / 10 | 0) - 1]) { + l = numStr.length - 1; + } + if (l) { + token.l += l; + // we don't assign the original type, because the docs combine them all into one id: + token.type = num > 0 ? "subst_group" : "subst_0match"; + token.clss = "subst"; + if (num > 0) { + token.group = capGroups[num - 1]; + } + } + } + } + SubstLexer.$_TYPES = { + "$": "subst_$esc", + "&": "subst_$&match", + "`": "subst_$before", + "'": "subst_$after", + "0": "subst_0match" + }; + SubstLexer.SUBST_ESC_RE = new RegExp("^" + Utils.SUBST_ESC_RE.source, "i"); + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Tools extends EventDispatcher { + constructor(el) { + super(); + this.el = el; + this._initUI(); + this.value = null; + DOMUtils.togglePanel(this.el, 'article'); + } + set value(o) { + if (!o) { + this.show("explain"); + this._toolValues = Utils.copy({}, Tools.DEFAULT_VALUES); + } else { + this.show(o.id); + if (o.input != null) { + this.editor.setValue(o.input); + } + } + } + get value() { + return { + id: this._toolId, + input: this.input + }; + } + get input() { + return this.hasInput ? this.editor.getValue() : null; + } + get hasInput() { + let id = this._toolId; + return id === "replace" || id === "list"; + } + show(id) { + if (!id || id === this._toolId) { + return; + } + this.toolList.selected = this._toolId = id; + let input = id === "replace" || id === "list"; + if (this._tool) { + this._tool.cleanup(); + } + DOMUtils.toggleClass(DOMUtils.query("> article", this.el), "showinput", input); + if (input) { + this.editor.setValue(this._toolValues[id]); + this.editor.refresh(); + this.editor.focus(); + } + if (id === "explain") { + this._tool = new Explain(this.contentEl); + } else if (id === "details") { + this._tool = new Details(this.contentEl); + } else if (id === "replace" || id === "list") { + this._tool = new Replace(this.resultEl, this.editor); + } + this._toolId = id; + this._updateHighlights(); + } + _initUI() { + let el = this.el; + this.headerEl = DOMUtils.query("header", this.el); + this.headerEl.addEventListener("click", evt => this._handleHeaderClick(evt)); + this.contentEl = DOMUtils.query("> article > .content", el); + this.resultEl = DOMUtils.query("> article > .inputtool > .result", el); + this.toolListEl = DOMUtils.query(".toollist", this.headerEl); + let data = ["List", "Explain"].map(val => ({ + label: val, + id: val.toLowerCase() + })); + this.toolList = new List(this.toolListEl, { + data + }); + this.toolList.on("change", () => this._handleListChange()); + let editor = this.editor = CMUtils.create(DOMUtils.query(".inputtool .editor", el), { + maxLength: 2500, + singleLine: true + }, "100%", "100%"); + DOMUtils.query(".help.icon", el).addEventListener("click", () => app.sidebar.goto(this._toolId)); + + // TODO: evaluate this living here or in Replace: + editor.on("change", () => this._handleEditorChange()); + app.flavor.on("change", () => this._updateHighlights()); + app.expression.on("change", () => this._updateHighlights()); + this.lexer = new SubstLexer(); + this.highlighter = new ExpressionHighlighter(editor); + this.hover = new ExpressionHover(editor, this.highlighter); + } + _handleEditorChange() { + this._updateHighlights(); + this._toolValues[this._toolId] = this.editor.getValue(); + this.dispatchEvent("change"); + } + _updateHighlights() { + if (!this.hasInput) { + return; + } // only for Replace & List + this.lexer.profile = app.flavor.profile; + let token = this.lexer.parse(this.editor.getValue()); + this.highlighter.draw(token); + this.hover.token = token; + } + _handleListChange() { + this.show(this.toolList.selected); + Track.page("tool/" + this.toolList.selected); + } + _handleHeaderClick(evt) { + if (DOMUtils.hasClass(this.el, "closed") || !this.toolListEl.contains(evt.target)) { + DOMUtils.togglePanel(this.el, 'article'); + } + } + } + Tools.DEFAULT_VALUES = { + replace: "<< $& >>", + list: "$&\\n" + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + let home = {}; + home.id = "home"; + home.label = "Menu"; + home.desc = "[from HTML]"; + home.kids = [{ + label: "Pattern Settings", + id: "share", + el: "#share_main", + list: false, + kids: [{ + label: "Save to my Favorites", + id: "share_favorites", + el: "#share_favorites" + }, { + label: "Share with the Community", + id: "share_community", + el: "#share_community" + }] + }, { + label: "My Patterns", + id: "favorites", + desc: "The list above will display any patterns that you create or favorite." + "

To edit a pattern you created, click its URL or double-click it in the list to load it, then open Save / Share to edit and save.

", + search: true, + kids: [] + }, { + label: "Cheatsheet", + id: "cheatsheet", + el: "#cheatsheet" + }, { + // injected from Reference + id: "reference" + }, { + label: "Community Patterns", + id: "community", + desc: "Welcome to Community Patterns, a searchable database of patterns submitted by users like you." + "

After selecting a pattern, click its URL or double-click it in the list to load the full pattern. Or use the right arrow icon to load just the expression or text.

" + "

Help make the Community better by rating patterns, and submitting your own via Search & Share in the menu.

", + search: true, + kids: [] + }, { + label: "Help", + id: "help", + desc: "Help for the RegExr application. See the RegEx Reference for help with Regular Expressions.", + kids: [{ + label: "About", + desc: "RegExr v3.8.0 (May 10, 2024)." + "

Created by Grant Skinner and the gskinner team, using the CreateJS & CodeMirror libraries.

" + "

You can provide feedback or log bugs on GitHub.

" + }, { + label: "Getting started", + desc: "RegExr provides real-time visual results, syntax highlighting, tooltips, and undo/redo ({{getCtrlKey()}}-Z / Y) so it's easy and fun to explore Regular Expressions." + "

Browse through the RegEx Reference and test different tokens to see what they do, then check out Community Patterns to see examples.

" + "

You can also Save your patterns for later reference, or to share with others. Sign In to ensure you don't lose your patterns.

" + "

Modify your pattern's details, share it with the Community, or make it private, or delete it in Pattern Settings

", + kids: [{ + label: "Expression panel", + desc: "This is where you enter a regular expression to test. The results in the Text and Tools panel will update as you type." + "Roll over the expression for information on each token." + "

The buttons to the right allow you to switch RegEx engines, or edit the expression flags.

" + }, { + label: "Text panel", + desc: "This is where you enter text to test your expression against. Drag & drop a text file to load its contents." + "

Matches will be highlighted as you type. Roll over a match for information on the match and its capture groups. The match count and execution time are shown in the title bar.

" + "

Lighter colored caps at the start or end of a line indicate the match continues between lines.

" + }, { + label: "Tests panel", + desc: "This allows you to create a suite of tests that you can use to validate your Expression in real time." + "

A test can check if the pattern matches anything, matches everything, or matches nothing in the test text.

" + "

Access this panel with the toggle at the top of the Text panel. When you save, both your Text and Tests will be saved.

" + }, { + label: "Tools panel", + desc: "Click the Tools title bar below the Text panel to show or hide the Tools panel." + "

Tools provide different ways of working with or exploring your results.

", + kids: [{ + label: "Replace", + id: "replace", + desc: "The Replace tool replaces matches with a specified string or pattern." + "

Matches in the Text panel are replaced by the substitution string & displayed as you type.

" + "

Substitution tokens and escaped characters are supported, such as \\n, \\t & \\u0009.

" + "

Roll over tokens for information, and check out the RegEx Reference for more information.

" + }, { + label: "List", + id: "list", + desc: "The List tool lists all found matches." + "

You can specify either a simple delimiter (ex. , or \\n), or use substitution tokens to generate more advanced reports. For example, $1\\n would list all group 1 results (in the JavaScript engine).

" + "

Escaped characters are supported, such as \\n, \\t & \\u0009.

" + "

Roll over tokens for information.

" + }, { + label: "Details", + id: "details", + desc: "The Details tool displays the full text of a match and its capture groups." + "

Click on a highlighted match in the Text panel to display the details for that match.

" + "

Roll over a group row to highlight that group in your Expression.

" + }, { + label: "Explain", + id: "explain", + desc: "The Explain tool displays a detailed breakdown of the Expression." + "

Mouse over the explanation to highlight the related tokens in the Expression panel and vice versa.

" + "

Click an item in the explanation to show more info in the RegEx Reference.

" + }] + }, { + label: "Menu", + desc: "The Menu (this panel) includes Help, a full RegEx Reference, a Cheatsheet, and Pattern Settings features." + "

Double-click a selected item in the RegEx Reference to insert it into your Expression. Click the arrow beside an example to load it.

" + "

The menu also includes searchable Community Patterns, and patterns you've created or favorited in My Patterns.

" + }] + }, { + label: "Signing in", + id: "signin", + desc: "Before you sign in, RegExr creates a temporary account which relies on a browser cookie. This means you can't access your patterns on other computers, and that you could lose your patterns if your cookies are deleted or expire." + "

Signing in creates a permanent account, so you can access your patterns anywhere, anytime.

" + "

Your existing patterns & favorites will automatically be assigned to the new account.

" + "

We don't use your info for anything other than signing you into your RegExr account.

" + }, { + id: "engine", + label: "RegEx engines", + desc: "While the core feature set of regular expressions is fairly consistent, different implementations (ex. Perl vs Java) may have different features or behaviours." + "

RegExr currently supports JavaScript RegExp executed in your browser and PCRE via PHP.

" + "

You can switch engines using the dropdown in Expression.

", + kids: [{ + label: "JavaScript", + desc: "Your browser's JavaScript engine is used to execute RegEx in an asynchronous worker using RegExp.exec()." + "

Note that while implementations are mostly consistent, there are small variations between browsers. Here is a short list of known differences:

    " + "
  • Older browsers don't support the u or y flags
  • " + "
  • Differences in handling of certain ambiguous escapes: \\8 \\9
  • " + "
  • Chrome handles \\x & \\u escapes slightly differently than other browsers
  • " + "
  • Chrome supports lookbehind, but it isn't yet in the JS spec
  • " + "
  • Safari ignores leading zeros in octal escapes (ex. \\00020)
  • " + "

" + }, { + label: "PCRE (PHP)", + desc: "PHP {{getPHPVersion()}} and PCRE {{getPCREVersion()}} are used to execute your pattern on our server." + }] + }, { + label: "Query string support", + desc: "In addition to the built in Save mechanism which creates a shareable link, RegExr also supports the ability to pre-populate a pattern via the query string." + "

The following query string params are recognized:

    " + "
  • engine - the RegEx engine to use (js or pcre)
  • " + "
  • expression - populates the Expression area. It is recommended to pass a full expression with flags (/.*/ig) not just the pattern (.*)
  • " + "
  • text - populates the Text area
  • " + "
  • tool - sets the tool (replace, list, details, or explain)
  • " + "
  • input - populates the tool input field
  • " + "

" + "Ex. regexr.com/?expression=/./g&text=test" + }] + }]; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class LinkRow { + constructor(el) { + this.el = el; + this._initUI(); + this.url = null; + } + set pattern(val) { + let url = Utils.getPatternURLStr(val); + this._pattern = val; + DOMUtils.query(".url", this.el).innerText = url || ""; + DOMUtils.toggleClass(this.el, "disabled", !url); + DOMUtils.toggleClass(this.el, "active", !!url); + } + showMessage(message) { + // for some reason this displays one line too low if it's synchronous: + setTimeout(() => app.tooltip.toggle.showOn("linkrow", message, DOMUtils.query(".copy.icon", this.el), true, 0), 1); + } + _initUI() { + this.el.onclick = evt => this._onClick(evt); + let fld = DOMUtils.query(".url", this.el), + copyBtn = DOMUtils.query(".copy", this.el); + let clipboard = new Clipboard(copyBtn, { + target: () => fld + }); + clipboard.on("success", () => app.tooltip.toggle.toggleOn("copy", "Copied to clipboard.", copyBtn, true, 3)); + clipboard.on("error", e => app.tooltip.toggle.toggleOn("copy", Utils.getCtrlKey() + "-C to copy.", copyBtn, true, 3)); // TODO: cmd/ctrl + } + _onClick(evt) { + if (DOMUtils.query(".copy", this.el).contains(evt.target)) { + return; + } + if (evt.which === 2 || evt.metaKey || evt.ctrlKey) { + window.open(Utils.getPatternURL(this._pattern)); + } else { + app.load(this._pattern); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Example { + constructor(title, ex) { + this.el = DOMUtils.create("div", "example"); + this.title = title; + this.example = ex; + } + set example(ex) { + if (ex === this._example) { + return; + } + this._example = ex; + let str = "", + txt, + exp, + regex; + if (ex) { + exp = ex[0]; + txt = ex[1]; + regex = Utils.getRegExp(exp, "g"); + if (this.title) { + str += "

" + this.title + "


"; + } + str += "Load expression" + Utils.htmlSafe(exp) + ""; + if (txt && regex) { + let over = Math.max(0, txt.length - 160), + s = txt; + if (over) { + s = Utils.htmlSafe(s.substr(0, 159)); + } + if (regex) { + s = s.replace(regex, "$&"); + } + // TODO: this won't match on html elements: + str += "
Load text" + s + (over ? "\u2026" : "") + ""; + } + } + this.el.innerHTML = str; + if (exp) { + DOMUtils.query("code.expression > .load", this.el).addEventListener("click", () => { + // TODO: this will need to be updated when we support other delimiters: + app.expression.value = exp[0] === "/" ? exp : "/" + exp + "/g"; + }); + } + if (txt) { + DOMUtils.query("code.text > .load", this.el).addEventListener("click", () => app.text.value = txt); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + // also used for My Patterns. + class CommunityContent { + constructor(el) { + this.el = el; + this.example = new Example(); + el.appendChild(this.example.el); + DOMUtils.query(".icon.thumbup", el).addEventListener("click", () => this._rate(1)); + DOMUtils.query(".icon.thumbdown", el).addEventListener("click", () => this._rate(-1)); + DOMUtils.query(".icon.favorites", el).addEventListener("click", () => this._favorite()); + this.linkRow = new LinkRow(DOMUtils.query(".row.link", el)); + DOMUtils.query(".icon.share", el).addEventListener("click", () => this._share()); + } + set item(o) { + let el = this.el; + this._pattern = o; + DOMUtils.query(".author", el).innerText = o.author ? "by " + o.author : ""; + DOMUtils.query(".name.label", el).innerText = o.name; + DOMUtils.query(".desc", el).innerText = o.description || "No description available."; + this._updateRating(); + this._updateFavorite(); + this.example.example = [o.expression, o.text]; + this.linkRow.pattern = o; + } + + // private methods: + _updateRating() { + let o = this._pattern, + el = this.el; + DOMUtils.query(".rating", el).innerText = o.rating.toFixed(1); + DOMUtils.removeClass(DOMUtils.query(".icon.rate.selected", el), "selected"); + if (o.userRating === 1) { + DOMUtils.addClass(DOMUtils.query(".icon.thumbup", el), "selected"); + } else if (o.userRating === -1) { + DOMUtils.addClass(DOMUtils.query(".icon.thumbdown", el), "selected"); + } + } + _updateFavorite() { + let o = this._pattern, + el = this.el; + DOMUtils.toggleClass(DOMUtils.query(".icon.favorites", el), "selected", !!o.favorite); + } + _rate(val) { + let o = this._pattern; + o.userRating = val === o.userRating ? 0 : val; + this._updateRating(); + Server.rate(o.id, o.userRating).then(data => this._handleRate(data)); + } + _share() { + app.load(this._pattern); + app.share.show(); + } + _handleRate(data) { + if (data.id === this._pattern.id) { + this._pattern.rating = data.rating; + this._updateRating(); + } + } + _favorite() { + let o = this._pattern; + Server.favorite(o.id, !o.favorite).then(data => this._handleFavorite(data)); + } + _handleFavorite(data) { + if (data.id === this._pattern.id) { + this._pattern.favorite = data.favorite; + this._updateFavorite(); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Status { + constructor(el) { + if (!el) { + el = document.createElement("div"); + } + this.el = el; + DOMUtils.addClass(el, "status"); + el.addEventListener("mouseover", () => this._showTooltip()); + el.addEventListener("mouseout", () => this._hideTooltip()); + } + distract() { + this.el.innerHTML = ''; + this._show(); + return this; + } + hide(t = 0) { + this._clearTimeout(); + if (t) { + this._timeoutId = setTimeout(() => this._hide(), t * 1000); + } else { + this._hide(); + } + return this; + } + success() { + this.el.innerHTML = ''; + this._show(); + return this; + } + error(msg) { + let el = this.el; + el.innerHTML = ''; + this._show(); + this._ttMsg = msg; + return this; + } + _showTooltip() { + if (!this._ttMsg) { + return; + } + app.tooltip.hover.showOn("status", this._ttMsg, this.el, true, 0); + } + _hideTooltip() { + app.tooltip.hover.hide("status"); + } + _show() { + this.el.style.display = null; + this._ttMsg = null; + this._hideTooltip(); + this._clearTimeout(); + } + _hide() { + this.el.style.display = "none"; + this._hideTooltip(); + this._clearTimeout(); + } + _clearTimeout() { + if (this._timeoutId == null) { + return; + } + clearTimeout(this._timeoutId); + this._timeoutId = null; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Account extends EventDispatcher { + constructor() { + super(); + this._value = {}; + this._initUI(); + } + get value() { + return this._value; + } + set value(val = {}) { + this._value = val; + this._updateUI(); + this.dispatchEvent("change"); + } + get userId() { + return this._value.userId; + } + get author() { + return this._value.author || this._value.username || ""; + } + get username() { + return this._value.username || ""; + } + get authenticated() { + return !!this._value.username; + } // this._value.authenticated; + get type() { + return this._value.type; + } + showTooltip() { + app.tooltip.toggle.toggleOn("signin", this.tooltipEl, this.signinBtn, true, 20); + } + + // private methods: + _initUI() { + let template = o => '' + o; + this.signinBtn = DOMUtils.query(".header .signin"); + this.tooltipEl = DOMUtils.query("#library > #tooltip-signin"); + this.signinEl = DOMUtils.query(".signin", this.tooltipEl); + this.signoutEl = DOMUtils.query(".signout", this.tooltipEl); + DOMUtils.query(".signoutbtn", this.signoutEl).addEventListener("click", evt => this._doSignout()); + this.signinBtn.addEventListener("click", evt => this.showTooltip()); + DOMUtils.query(".icon.help", this.signinEl).addEventListener("click", () => app.sidebar.goto("signin")); + this.signinList = new List(DOMUtils.query("ul.list", this.signinEl), { + data: ["GitHub", "Google"], + template + }); + this.signinList.on("change", () => this._signinListChange()); + } + _updateUI() { + let auth = this.authenticated; + DOMUtils.toggleClass(this.tooltipEl, "authenticated", auth); + DOMUtils.query(".label", this.signinBtn).innerText = auth ? "Sign Out" : "Sign In"; + if (auth) { + DOMUtils.query(".username", this.signoutEl).innerText = this.username; + DOMUtils.query(".type", this.signoutEl).innerText = this.type; + } + } + _doSignout() { + DOMUtils.addClass(this.tooltipEl, "wait"); + Server.logout().then(data => { + this._handleSignout(data); + }).finally(() => this._cleanSignout()); + } + _handleSignout(data) { + this.value = data; + } + _cleanSignout(err) { + DOMUtils.removeClass(this.tooltipEl, "wait"); + } + _signinListChange() { + let service = this.signinList.selected.toLowerCase(); + DOMUtils.addClass(this.tooltipEl, "wait"); + Track.event("login", "access", service); + setTimeout(() => Server.login(service), 100); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Share extends EventDispatcher { + constructor(el) { + super(); + this.el = el; + this._pattern = false; + this._initUI(); + app.on("change", () => this._handleAppChange()); + app.on("load", () => this._handleAppLoad()); + app.account.on("change", () => this._handleAccountChange()); + } + + // public methods: + get value() { + return { + id: this._pattern ? this._pattern.id : null, + name: this.name, + author: this.author, + description: this.description, + keywords: this.keywords + }; + } + set pattern(o) { + this._pattern = o; + this.name = o.name; + this.description = o.description; + this.keywords = o.keywords; + this._updateUI(); + this._pushHistory(o); + } + get name() { + return this.nameFld.value; + } + set name(val) { + this.nameFld.value = val || ""; + this.hNameFld.innerText = val || "Untitled Pattern"; + } + get author() { + return this.authorFld.value; + } + set author(val) { + this.authorFld.value = val || ""; + } + get description() { + return this.descriptionFld.value; + } + set description(val) { + this.descriptionFld.value = val || ""; + } + get keywords() { + return this.keywordsFld.value; + } + set keywords(val) { + this.keywordsFld.value = val || ""; + } + show() { + app.sidebar.goto("share"); + } + + // private methods: + _initUI() { + let el = this.el; + let mainEl = this.mainEl = DOMUtils.query("> #share_main", el); + let comEl = this.communityEl = DOMUtils.query("> #share_community", el); + + // set up header: + let hEl = DOMUtils.query(".header"); + this.hNewBtn = DOMUtils.query(".new", hEl); + this.hForkBtn = DOMUtils.query(".fork", hEl); + this.hSaveBtn = DOMUtils.query(".save", hEl); + this.hNameFld = DOMUtils.query(".name", hEl); + DOMUtils.query(".settings", hEl).addEventListener("click", () => this.show()); + DOMUtils.query(".savekey", this.hSaveBtn).innerText = "(" + Utils.getCtrlKey() + "-s)"; + this.hSaveBtn.addEventListener("click", () => this._doSave()); + this.hNewBtn.addEventListener("click", () => this._doNew()); + this._defaultName = this.hNameFld.innerText; + + // set up main: + this._privateRow = DOMUtils.query(".row.private", this.mainEl); + this._privateRow.addEventListener("click", () => this._doPrivate()); + this._privateStatus = new Status(DOMUtils.query(".status", this._privateRow)); + this._favoritesRow = DOMUtils.query(".row.favorites", this.mainEl); + this._favoritesRow.addEventListener("click", () => this._doFavorite()); + this._favoritesStatus = new Status(DOMUtils.query(".status", this._favoritesRow)); + this._communityRow = DOMUtils.query(".row.community", this.mainEl); + this._communityRow.addEventListener("click", () => this._showCommunity()); + this._deleteRow = DOMUtils.query(".row.delete", this.mainEl); + this._deleteRow.addEventListener("click", () => this._doDelete()); + this._deleteStatus = new Status(DOMUtils.query(".status", this._deleteRow)); + DOMUtils.query(".row.signin a", this.mainEl).addEventListener("click", () => this._doSignin()); + + // set up link row: + this._linkRow = new LinkRow(DOMUtils.query(".link.row", mainEl)); + + // set up save buttons: + let saveEl = this.saveEl = DOMUtils.query("> .save", mainEl); + this.saveBtn = DOMUtils.query(".button.save", saveEl); + this.forkBtn = DOMUtils.query(".button.fork", saveEl); + this.saveBtn.addEventListener("click", () => this._doSave()); + this.forkBtn.addEventListener("click", () => this._doSave(true)); + this.saveStatus = new Status(DOMUtils.query(".status", saveEl)); + this.saveMessage = DOMUtils.query(".message", saveEl); + + // set up input fields: + let infoEl = this.infoEl = DOMUtils.query("> .info", mainEl); + this.nameFld = DOMUtils.query(".name", infoEl); + this.authorFld = DOMUtils.query(".author", infoEl); + this.descriptionFld = DOMUtils.query(".description", infoEl); + this.keywordsFld = DOMUtils.query(".keywords", infoEl); + + // listen for changes: + this.nameFld.addEventListener("input", () => this._handleChange()); + this.authorFld.addEventListener("input", () => this._handleChange()); + this.descriptionFld.addEventListener("input", () => this._handleChange()); + this.keywordsFld.addEventListener("input", () => this._handleChange()); + + /// set up community: + let comInputsEl = DOMUtils.query(".inputs", comEl); + DOMUtils.query(".button.cancel", comEl).addEventListener("click", () => app.sidebar.goto("share")); + DOMUtils.query(".button.share", comEl).addEventListener("click", () => this._doComSave()); + this.comSaveStatus = new Status(DOMUtils.query(".status", comEl)); + this._comNameFld = DOMUtils.query(".name", comInputsEl); + this._comAuthorFld = DOMUtils.query(".author", comInputsEl); + this._comDescriptionFld = DOMUtils.query(".description", comInputsEl); + this._comKeywordsFld = DOMUtils.query(".keywords", comInputsEl); + + // set up cmd-s listener: + window.document.addEventListener("keydown", evt => this._handleKey(evt)); + } + _updateUI() { + let o = this._pattern, + text; + let isChanged = this._isChanged(), + isNew = this._isNew(), + isOwned = this._isOwned(); + DOMUtils.toggleClass([this.forkBtn, this.hForkBtn], "disabled", !this._canFork()); + DOMUtils.toggleClass(this.saveBtn, "disabled", !this._canSave()); + DOMUtils.toggleClass(this.hSaveBtn, "disabled", !this._canSave() && isOwned); + DOMUtils.query(".action", this.hSaveBtn).innerText = isOwned ? "Save" : "Fork"; + if (!isOwned) { + text = "This pattern was created by '" + (o.author || "[anonymous]") + "'."; + } else if (!isChanged) { + text = "No unsaved changes."; + } else if (isNew) { + text = "Save will create a shareable public link."; + } else { + text = "Save will update the current link."; + } + if (!isOwned && !isChanged) { + text += " Fork to create your own copy."; + } else if (!isNew) { + text += " Fork will create a new copy" + (isChanged ? " with your changes." : "."); + } + this._setSaveText(text); + this._linkRow.pattern = this._pattern.id && this._pattern; + DOMUtils.toggleClass(this._privateRow, "disabled", isNew || !isOwned); + DOMUtils.toggleClass(this._favoritesRow, "disabled", isNew || !isOwned); + DOMUtils.toggleClass(this._communityRow, "disabled", isNew || !isOwned); + DOMUtils.toggleClass(this._deleteRow, "disabled", isNew || !isOwned); + DOMUtils.toggleClass(this._privateRow, "active", o.access === "private"); + DOMUtils.toggleClass(this._favoritesRow, "active", !!o.favorite); + } + _isNew() { + return !this._pattern.id; + } + _isOwned() { + let o = this._pattern; + return this._isNew() || o.userId === app.account.userId; + } + _isChanged() { + return app.unsaved; + } + _canSave() { + return this._isChanged() && this._isOwned(); + } + _canFork() { + return !this._isNew(); + } + _pushHistory(pattern) { + let history = window.history, + url = Utils.getPatternURL(pattern); + let title = "RegExr: " + (pattern.name || "Learn, Build, & Test RegEx"); + if (history.state && pattern.id === history.state.id) { + history.replaceState(pattern, title, url); + } else { + history.pushState(pattern, title, url); + } + window.document.title = title; + } + _handleKey(evt) { + let mac = Utils.isMac(); + if (evt.key === "s" && (mac && evt.metaKey || !mac && evt.ctrlKey)) { + this._doSave(false); + evt.preventDefault(); + } + } + _doSave(fork) { + // if we can't save for some reason, then show the panel. + if (!fork && !this._canSave()) { + app.sidebar.goto("share"); + return; + } + if (fork && !this._canFork()) { + return; + } + let o = app.state; + DOMUtils.addClass(DOMUtils.query(".buttons", this.saveEl), "wait"); + this.saveStatus.distract(); + Server.save(o, fork).then(data => this._handleSave(data)).catch(err => this._handleSaveErr(err)); + } + _handleSave(data) { + let isNew = this._pattern.id == null, + isFork = !isNew && data.id !== this._pattern.id; + DOMUtils.removeClass(DOMUtils.query(".buttons", this.saveEl), "wait"); + this.saveStatus.hide(); + app.state = data; + if (isFork || isNew) { + this.show(); + if (isFork || !this.name) { + this.nameFld.focus(); + this.nameFld.select(); + } + this._linkRow.showMessage("Saved. New share link created. Click to copy to clipboard."); + } + } + _handleSaveErr(err) { + DOMUtils.removeClass(DOMUtils.query(".buttons", this.saveEl), "wait"); + this.saveStatus.error(this._getErrMsg(err)); + } + _doNew() { + app.newDoc(); + } + _doPrivate() { + let o = this._pattern; + this._privateStatus.distract(); + Server.private(o.id, o.access !== "private").then(data => this._handlePrivate(data)).catch(err => this._handleErr(err, this._privateStatus)); + } + _handlePrivate(data) { + if (data.id === this._pattern.id) { + this._pattern.access = data.access; + this._privateStatus.hide(); + this._updateUI(); + } + } + _doFavorite() { + let o = this._pattern; + this._favoritesStatus.distract(); + Server.favorite(o.id, !o.favorite).then(data => this._handleFavorite(data)).catch(err => this._handleErr(err, this._favoritesStatus)); + } + _handleFavorite(data) { + if (data.id === this._pattern.id) { + this._pattern.favorite = data.favorite; + this._favoritesStatus.hide(); + this._updateUI(); + } + } + _doDelete() { + let o = this._pattern; + if (!confirm("Are you sure you want to permanently delete this pattern?")) { + return; + } + this._deleteStatus.distract(); + Server.delete(o.id).then(data => this._handleDelete(data)).catch(err => this._handleErr(err, this._deleteStatus)); + } + _handleDelete(data) { + this._deleteStatus.hide(); + app.state = { + flavor: app.flavor.value + }; + setTimeout(() => app.tooltip.toggle.showOn("delete", "Pattern was permanently deleted.", this._deleteRow, true, 0), 1); + } + _handleErr(err, status) { + status.error(this._getErrMsg(err)).hide(6); + } + _showCommunity() { + app.sidebar.goto("share_community"); + this._comNameFld.value = this.name; + this._comAuthorFld.value = this.author; + this._comDescriptionFld.value = this.description; + this._comKeywordsFld.value = this.keywords; + } + _doComSave() { + if (!this._comNameFld.value) { + this._comNameFld.focus(); + return; + } + let o = app.state; + this.name = o.name = this._comNameFld.value; + this.author = o.author = this._comAuthorFld.value; + this.description = o.description = this._comDescriptionFld.value; + this.keywords = o.keywords = this._comKeywordsFld.value; + o.access = "public"; + DOMUtils.addClass(DOMUtils.query(".buttons", this.communityEl), "wait"); + this.comSaveStatus.distract(); + Server.save(o, true, true).then(data => this._handleComSave(data)).catch(err => this._handleComSaveErr(err)); + } + _handleComSave(data) { + DOMUtils.removeClass(DOMUtils.query(".buttons", this.communityEl), "wait"); + this.comSaveStatus.hide(); + this.show(); + } + _handleComSaveErr(err) { + DOMUtils.removeClass(DOMUtils.query(".buttons", this.communityEl), "wait"); + this.comSaveStatus.error(this._getErrMsg(err)); + } + _handleChange() { + this.dispatchEvent("change"); + } + _handleAppChange() { + this._updateUI(); + } + _handleAccountChange() { + let acc = app.account, + rowEl = DOMUtils.query(".signin.row", this.mainEl); + if (!this.authorFld.value) { + this.authorFld.value = acc.author || acc.username; + } + DOMUtils.toggleClass(rowEl, "authenticated", acc.authenticated); + DOMUtils.query(".username", rowEl).innerText = acc.username; + } + _handleAppLoad() { + DOMUtils.toggleClass(DOMUtils.query(".save .actions", this.mainEl), "disabled"); + } + _doSignin() { + app.account.showTooltip(); + } + _setSaveText(str) { + this.saveMessage.innerText = str; + } + _getErrMsg(err) { + return "ERROR: " + app.reference.getError("servercomm"); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Sidebar { + constructor(el) { + this.el = el; + this.itemEl = null; + this.openReq = null; + this._initUI(el); + this._content = this._prepContent(home); + this.minList.data = [{ + id: "menu", + label: "Menu" + }].concat(home.kids); + app.flavor.on("change", () => this._onFlavorChange()); + let id = app.prefs.read("side"); + if (!id || !this._idMap[id] || id === "share") { + id = "home"; + } + this.goto(id); + this.minimize(true, false); + } + minimize(val = true, track = true) { + if (val === this._minimized) { + return; + } + if (val && track) { + Track.event("minimize_menu", "engagement"); + } + DOMUtils.togglePanel(this.el, '.full', '.min', !val); + this._minimized = val; + this._updateUI(); + } + goto(id) { + this.show(this._idMap[id]); + } + showToken(token) { + this.goto(app.reference.idForToken(token)); + } + show(item) { + if (!item) { + return; + } + if (item.hide) { + return this.show(item.parent); + } + if (!item || item.id === "menu") { + return; + } // expand button on the min menu + this.minimize(false); + if (item.id) { + if (item.id === "home" || item.parent && item.parent.id === "home" || this._isInReference(item)) { + app.prefs.write("side", item.id); + } + } + if (!item.el && !item.kids) { + if (this.searchMode || !item.parent || item.parent === this.curItem) { + // in a search, community / favorites, of selecting a leaf child from a list. + this.selItem = item; + this.menuList.selected = item.id; + return this._showContent(item); + } else if (item.parent !== this.curItem) { + // trying to jump to a leaf child without previously showing parent. + this.show(item.parent); + return this.show(item); + } + } + this._resetFull(); + this.curItem = item; + DOMUtils.query("h1", this.titleEl).innerText = item.label; + DOMUtils.query("svg.back.icon use", this.titleEl).setAttribute("xlink:href", "#" + (item.parent ? "arrowleft" : "menu")); + if (item.el) { + this._showEl(DOMUtils.query("#library " + item.el)); + } else { + this._showContent(item); + } + if (item.kids && item.list !== false) { + DOMUtils.removeClass(this.fullEl, "no-list"); + this.menuList.data = item.kids || item.parent.kids; + } + if (item.search) { + DOMUtils.removeClass(this.fullEl, "no-search"); + } + + // special handling: + if (item.id === "community") { + this.menuList.template = this.communityListTemplate; + this._onSearchSubmit(); + } else if (item.id === "favorites") { + this.menuList.template = this.communityListTemplate; + this._loadFavorites(); + } + } + back() { + if (this.curItem.parent) { + this.show(this.curItem.parent); + } else { + this.minimize(true); + } + } + menuListTemplate(o) { + return (o.parent && o.parent.id === "home" ? '' : "") + '' + (o.label || o.id) + "" + (o.token ? '' + o.token.replace("<", "<") + '' : "") + (o.kids || o.el ? '' : ""); + } + communityListTemplate(o) { + return '' + Utils.htmlSafe(o.name) + "" + '' + (o.favorite ? '' : '') + '' + o.rating.toFixed(1) + ''; + } + + // private methods: + _initUI(el) { + // set up full width content: + this.fullEl = DOMUtils.query("> .full", el); + + // title bar: + this.titleEl = DOMUtils.query("> header", this.fullEl); + DOMUtils.query("> .close.icon", this.titleEl).addEventListener("click", () => this.minimize(true)); + DOMUtils.query("> .backrow", this.titleEl).addEventListener("click", () => this.back()); + + // search: + this.searchEl = DOMUtils.query("> .search", this.fullEl); + this.searchFld = DOMUtils.query("> .search > input", this.fullEl); + this.searchFld.addEventListener("input", () => this._onSearchChange()); + this.searchFld.addEventListener("keyup", evt => evt.keyCode === 13 && this._onSearchSubmit()); + let searchBtn = DOMUtils.query("> svg.icon.search", this.searchEl); + searchBtn.addEventListener("click", () => this._onSearchSubmit()); + + // list & content: + this.listEl = DOMUtils.query("> .list", this.fullEl); + this.menuList = new List(this.listEl, { + data: home.kids, + template: this.menuListTemplate + }); + this.menuList.on("change", () => { + const lastId = this.curItem.id; + this.show(this.menuList.selectedItem); + if (lastId !== this.curItem.id) { + Track.page("sidebar/" + this.curItem.id); + } + }); + this.menuList.on("dblclick", () => this._onDblClick(this.menuList.selectedItem)); + this.contentEl = DOMUtils.query("> .content", this.fullEl); + + // set up minimized sidebar: + this.minEl = DOMUtils.query("> .min", el); + this.minEl.addEventListener("click", () => this.minimize(false)); + let template = DOMUtils.template``; + this.minList = new List(DOMUtils.query("> .list", this.minEl), { + template + }); + this.minList.on("change", evt => { + this.show(this.minList.selectedItem); + evt.preventDefault(); + Track.page("sidebar/" + this.curItem.id); + }); + + // set up special content: + this.community = new CommunityContent(DOMUtils.query("#library > #community")); + this.share = new Share(DOMUtils.query("#library > #share")); + this._prepCheatsheet(); // TODO: switch to a Cheatsheet class. + + DOMUtils.query(".doc > .blocker").addEventListener("mousedown", evt => { + this.minimize(true); + }); + } + _updateUI() { + // TODO: this is cheating a bit: + let doc = DOMUtils.query(".doc"); + DOMUtils.toggleClass(doc, "fadeback", !this._minimized); + } + _resetFull() { + if (this.itemEl) { + DOMUtils.query("#library").appendChild(this.itemEl); + this.itemEl = null; + } + this._abortReq(); + DOMUtils.addClass(this.fullEl, "no-search no-list"); + this.searchFld.value = ""; + this.searchMode = false; + this.menuList.template = this.menuListTemplate; + DOMUtils.removeClass(this.searchEl, "wait"); + } + _showContent(o) { + if ((this.curItem.id === "community" || this.curItem.id === "favorites") && o !== this.curItem) { + this._showEl(this.community.el); + this.community.item = o; + } else { + let ref = app.reference; + this.contentEl.innerHTML = this._isInReference(o) ? ref.getContent(o.id) : ref.fillTags((o.desc || "") + (o.ext || ""), o, ref); + if (o.example) { + this.contentEl.appendChild(new Example("Example", o.example).el); + } + } + } + _isInReference(o) { + return this._isIn(o, "reference"); + } + _isIn(o, id) { + do { + if (o.id === id) { + return true; + } + } while (o = o.parent); + return false; + } + _onDblClick(o) { + if (o.token) { + let expr = app.expression; + if (o.parent.id === "flags") { + expr.toggleFlag(o.token); + } else { + expr.insert(o.token); + } + } else if (this.curItem.id === "community" || this.curItem.id === "favorites") { + app.load(o); + } + } + _showEl(el) { + if (this.itemEl === el) { + return; + } + this.itemEl = el; + DOMUtils.empty(this.contentEl).appendChild(el); + } + _prepContent(content) { + // inject reference: + let i = Utils.findIndex(content.kids, o => o.id === "reference"); + content.kids.splice(i, 1, app.reference.content); + // grab home content from HTML: + content.desc = this.contentEl.innerHTML; + // build idMap: + this._idMap = { + home: content + }; + return Utils.prepMenuContent(content, this._idMap); + } + _prepCheatsheet() { + let els = DOMUtils.queryAll("#cheatsheet *[data-id]"); + let f = evt => this.goto(evt.target.dataset.id); + for (let i = 0, l = els.length; i < l; i++) { + els[i].addEventListener("click", f); + } + els = DOMUtils.queryAll("#cheatsheet tr td:first-child"); + f = evt => app.expression.insert(evt.target.innerText); + for (let i = 0, l = els.length; i < l; i++) { + let el = els[i], + tokens = el.innerText.split(" "); + DOMUtils.empty(el); + for (let j = 0; j < tokens.length; j++) { + let span = DOMUtils.create("a", null, tokens[j], el); + span.addEventListener("click", f); + } + } + } + _onSearchChange() { + let id = this.curItem.id, + search = this.searchFld.value; + if (id === "reference") { + this._searchReference(search); + } else if (id === "favorites") { + this._searchFavorites(search); + } else { + return; + } + // TODO: this is a hacky way to reset the content: + this.contentEl.innerHTML = this.curItem.desc; + this.itemEl = null; + } + _searchReference(search) { + let result = app.reference.search(search); + this.searchMode = !!search; + this.menuList.data = search ? result : this.curItem.kids; + // TODO: would be nice to show a "no match" message, but difficult to do with `hide=true` entries + } + _searchFavorites(search) { + let data = this.menuList.data, + rank = Utils.searchRank; + data.forEach(o => o.hide = !rank(o, search)); + this.menuList.data = data; + } + _onFlavorChange() { + let item = this.selItem || this.curItem; + if (!this._isInReference(item)) { + return; + } + this.selItem = this.curItem = null; + this.show(item); + } + _onSearchSubmit() { + this._abortReq(); + let val = this.searchFld.value; + if (this.curItem.id === "community") { + if (val) { + Track.event("search", "engagement", { + search_term: val, + target: "community" + }); + } + DOMUtils.addClass(this.searchEl, "wait"); + this._showListMsg(); + this.openReq = Server.communitySearch(val).then(data => this._showServerResults(data)).catch(msg => this._showListMsg(msg)).finally(() => this._reqCleanup()); + } + this.searchFld.select(); + } + _loadFavorites() { + this._abortReq(); + let val = this.searchFld.value; + this.openReq = Server.patterns().then(data => this._showServerResults(data)).catch(msg => this._showListMsg(msg)).finally(() => this._reqCleanup()); + this._showListMsg(); + } + _showListMsg(msg = "Loading...") { + this.listEl.innerHTML = "
  • " + msg + "
  • "; + } + _abortReq() { + if (this.openReq) { + this.openReq.abort(); + } + this.openReq = null; + } + _showServerResults(data) { + this.menuList.data = data.results; + if (data.results.length === 0) { + this._showListMsg(this.curItem.id === "community" ? "No matches." : "No patterns created or favorited."); + } + } + _reqCleanup(msg) { + DOMUtils.removeClass(this.searchEl, "wait"); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Theme extends EventDispatcher { + constructor(el) { + super(); + this.el = el; + this.urlTemplate = "./assets/themes/%name%.css"; + this.targetNode = this._node = null; + this._dark = false; + this._initUI(); + this.dark = !!app.prefs.read("dark"); + } + set dark(val) { + val = !!val; + if (this._dark === val) { + return; + } + this._dark = val; + this._load(val ? "dark" : null); + DOMUtils.toggleClass(this.themeBtn, "selected", val); + app.prefs.write("dark", val); + } + get dark() { + return this._dark; + } + _initUI() { + this.themeBtn = DOMUtils.query(".header .button.theme", this.el); + this.themeBtn.addEventListener("click", evt => this._toggleTheme()); + } + _load(id) { + if (id === this._id) { + return; + } + this._id = id; + if (this._node) { + this._node.remove(); + } + if (!id) { + this._change(); + return; + } + let tmpl = this.urlTemplate, + n = DOMUtils.create("link"); + n.addEventListener("load", () => this._change()); + n.rel = "stylesheet"; + n.type = "text/css"; + n.href = tmpl ? tmpl.replace(/%name%/g, id) : id; + this._node = (this.targetNode || document.head).appendChild(n); + } + _change() { + this.dispatchEvent("change"); + } + _toggleTheme() { + this.dark = !this.dark; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Reference { + constructor(content, flavor, config) { + this._config = config; + this._flavor = flavor; + this._flavor.on("change", () => this._flavorChange()); + this._injectEscChars(content); + this._idMap = { + reference: content + }; + this._content = Utils.prepMenuContent(content, this._idMap); + this._misc = Utils.prepMenuContent(content.misc, this._idMap); + this._flavorChange(); + } + get content() { + return this._content; + } + search(searchStr) { + function srch(kids, results) { + for (let i = 0, l = kids.length; i < l; i++) { + let kid = kids[i], + points = 0; + if (kid.kids) { + srch(kid.kids, results); + continue; + } + if (points = Utils.searchRank(kid, searchStr)) { + kid.__searchPoints = points; + results.push(kid); + } + } + return results; + } + return srch(this.content.kids, []).sort((a, b) => b.__searchPoints - a.__searchPoints); + } + idForToken(token) { + let errId = token.error && token.error.id; + if (this._idMap[errId]) { + return errId; + } + if (this._idMap[token.type]) { + return token.type; + } + if (this._idMap[token.clss]) { + return token.clss; + } + return errId || token.type || token.clss; + } + + // methods used in fillTags: + getChar(token) { + let chr = Reference.NONPRINTING_CHARS[token.code]; + return chr ? chr : "\"" + String.fromCharCode(token.code) + "\""; + } + getQuant(token) { + let min = token.min, + max = token.max; + return min === max ? min : max === -1 ? min + " or more" : "between " + min + " and " + max; + } + getUniCat(token) { + return Reference.UNICODE_CATEGORIES[token.value] || "[Unrecognized]"; + } + getModes(token) { + let str = token.on ? " Enable \"" + token.on + "\"." : ""; + if (token.off) { + str += " Disable \"" + token.off + "\"."; + } + return str; + } + getInsensitive(token) { + if (token.code) { + let chr = String.fromCharCode(token.code); + if (chr.toLowerCase() === chr.toUpperCase()) { + return ""; + } + } + return token.modes ? `Case ${token.modes.i ? "in" : ""}sensitive.` : ""; + } + getDotAll(token) { + return (token.modes.s ? "including" : "except") + " line breaks"; + } + getLabel(token) { + let node = this.getNodeForToken(token); + return node ? node.label || node.id || "" : token.type; + } + getDesc(token) { + return this.getVal(this.getNodeForToken(token), "desc"); + } + getLazy(token) { + return token.modes.U ? "greedy" : "lazy"; + } + getLazyFew(token) { + return token.modes.U ? "many" : "few"; + } + getPHPVersion() { + return this._config.PHPVersion; + } + getPCREVersion() { + return this._config.PCREVersion; + } + getCtrlKey() { + return Utils.getCtrlKey(); + } + getEscChars() { + let o = this._flavor.profile.escChars, + str = ""; + for (let n in o) { + str += n; + } + return str; + } + + /* + Searches for tags in the string in the format: + `{{prop.prop}}` or `{{method(prop.prop)}}` + + The first format will inject the specified property of the data object. + For example, `{{a.b}}` would inject the value of `data.a.b`. + + The second will inject the results of calling the specified function on the functs object with a property of the data object as it's parameter (or the data object itself if empty). + For example, `{{myMethod(a.b)}}` would inject the return value of `functs.myMethod(data.a.b)`. + + Currently only supports a single param. + */ + fillTags(str, data, functs, maxLength = 20, htmlSafe = true) { + let match; + while (match = str.match(/{{~?[\w.()]+}}/)) { + let val, + f, + safe = false; + val = match[0].substring(2, match[0].length - 2); + if (val[0] === "~") { + val = val.substr(1); + safe = true; + } + let match2 = val.match(/\([\w.]*\)/); + if (match2) { + f = val.substr(0, match2.index); + val = match2[0].substring(1, match2[0].length - 1); + } else { + f = null; + } + let o = data, + arr = val.split("."); + for (let i = 0; i < arr.length; i++) { + let prop = arr[i]; + if (prop && o) { + o = o[prop]; + } + } + val = o; + if (f) { + if (functs[f]) { + val = functs[f](val); + } else { + val = " [" + f + "] "; + } + } + if (!safe && (maxLength || htmlSafe)) { + val = Utils.shorten(val, maxLength, htmlSafe, "i"); + } + str = str.replace(match[0], val); + } + return str; + } + + // returns doc props from the profile or reference as appropriate (ex. tip, desc, ext) + getVal(node, prop) { + if (!node) { + return ""; + } + let pDocs = this._flavor.getDocs(node.id), + pRef = pDocs && pDocs[prop]; + if (pRef != null && pRef[0] !== "+") { + return pRef; + } + let ref = node && node[prop] || ""; + return pRef != null ? ref + pRef.substr(1) : ref; + } + getNodeForToken(token) { + let id = this.idForToken(token), + clss = token.clss; + + // Special cases: + if (clss === "quant") { + id = clss; + } + if (clss === "esc" && token.type !== "escsequence") { + id = "escchar"; + } + return this.getNode(id); + } + getNode(id) { + let map = this._idMap, + node = map[id]; + while (node && node.proxy) { + node = map[node.proxy]; + } + return node; + } + getError(error, token) { + let errId = error && error.id; + let str = this._content.errors[errId] || "no docs for error='" + errId + "'"; + if (token) { + str = this.fillTags(str, token, this, 20); + } + return str; + } + tipForToken(token) { + if (!token) { + return null; + } + let node = this.getNodeForToken(token), + label, + tip; + if (token.error && !token.error.warning) { + label = "ERROR: "; + tip = this.getError(token.error, token); + } else { + label = node ? node.label || node.id || "" : token.type; + tip = this.getVal(node, "tip") || this.getVal(node, "desc"); + tip = this.fillTags(tip, token, this, 20); + if (token.type === "group") { + label += " #" + token.num; + } + label = "" + label[0].toUpperCase() + label.substr(1) + ". "; + if (token.error) { + tip += "WARNING: " + this.getError(token.error, token) + ""; + } + } + return tip ? label + tip : "no docs for id='" + this.idForToken(token) + "'"; + } + getContent(id) { + let node = this.getNode(id); + return this.fillTags(this.getVal(node, "desc") + this.getVal(node, "ext"), node, this); + } + + // TODO: this isn't necessarily the most ideal place for this method (has nothing to do with Reference). Maybe move into Text? + tipForMatch(match, text) { + if (!match) { + return null; + } + let more = match.l > 150; + let str = "match: " + Utils.shorten(text.substr(match.i, match.l), 150, true, "i") + "
    range: " + match.i + "-" + (match.i + match.l - 1) + ""; + let groups = match.groups, + l = groups && groups.length; + for (let i = 0; i < l; i++) { + if (i > 3 && l > 5) { + more = false; + str += "
    see Details for " + (l - i) + " more"; + break; + } + let group = groups[i], + s; + s = group.i !== undefined ? text.substr(group.i, group.l) : group.s; + more = more || s && s.length > 50; + str += i > 0 ? "
    " : "
    "; + str += "group #" + (i + 1) + ": " + Utils.shorten(s, 50, true, "i"); + } + if (more) { + str += "
    see Details for full matches"; + } + return str; + } + // private methods: + _flavorChange() { + this._updateHide(this.content); + } + _updateHide(o, list) { + // the list param is for debugging, it is populated with the ids of all nodes that were hidden. + // parent nodes aren't hidden unless all their children are. + let kids = o.kids, + hide = true; + if (kids) { + for (let i = 0, l = kids.length; i < l; i++) { + hide = this._updateHide(kids[i], list) && hide; + } + } else { + hide = o.show === false || o.show !== true && o.id && !this._flavor.isTokenSupported(o.id); + } + if (list && hide) { + list.push(o.id); + } + return o.hide = hide; + } + _injectEscChars(content) { + let kids = Utils.find(content.kids, o => o.id === "escchars").kids; + let template = Utils.find(content.misc.kids, o => o.id === "escchar").tip; + // \x07 - bell, \x1b - esc + let chars = "\t\n\v\f\r\0\x07\x1b", + tokens = "tnvfr0ae"; // .\\+*?^$[]{}()|/ + for (let i = 0, l = chars.length; i < l; i++) { + kids.push(this._getEscCharDocs(chars[i], tokens[i], template)); + } + } + _getEscCharDocs(c, t, template) { + let code = c.charCodeAt(0), + chr = Reference.NONPRINTING_CHARS[code] || c; + return { + id: "esc_" + code, + token: "\\" + (t || c), + label: chr.toLowerCase(), + desc: this.fillTags(template, { + code: code + }, this) + }; + } + } + Reference.NONPRINTING_CHARS = { + "0": "NULL", + "1": "SOH", + "2": "STX", + "3": "ETX", + "4": "EOT", + "5": "ENQ", + "6": "ACK", + "7": "BELL", + "8": "BS", + "9": "TAB", + // + "10": "LINE FEED", + // + "11": "VERTICAL TAB", + "12": "FORM FEED", + "13": "CARRIAGE RETURN", + // + "14": "SO", + "15": "SI", + "16": "DLE", + "17": "DC1", + "18": "DC2", + "19": "DC3", + "20": "DC4", + "21": "NAK", + "22": "SYN", + "23": "ETB", + "24": "CAN", + "25": "EM", + "26": "SUB", + "27": "ESC", + "28": "FS", + "29": "GS", + "30": "RS", + "31": "US", + "32": "SPACE", + // + "127": "DEL" + }; + Reference.UNICODE_CATEGORIES = { + // from: http://www.pcre.org/original/doc/html/pcrepattern.html + "C": "Other", + "Cc": "Control", + "Cf": "Format", + "Cn": "Unassigned", + "Co": "Private use", + "Cs": "Surrogate", + "L": "Letter", + "L&": "Any letter ", + "Ll": "Lower case letter", + "Lm": "Modifier letter", + "Lo": "Other letter", + "Lt": "Title case letter", + "Lu": "Upper case letter", + "M": "Mark", + "Mc": "Spacing mark", + "Me": "Enclosing mark", + "Mn": "Non-spacing mark", + "N": "Number", + "Nd": "Decimal number", + "Nl": "Letter number", + "No": "Other number", + "P": "Punctuation", + "Pc": "Connector punctuation", + "Pd": "Dash punctuation", + "Pe": "Close punctuation", + "Pf": "Final punctuation", + "Pi": "Initial punctuation", + "Po": "Other punctuation", + "Ps": "Open punctuation", + "S": "Symbol", + "Sc": "Currency symbol", + "Sk": "Modifier symbol", + "Sm": "Mathematical symbol", + "So": "Other symbol", + "Z": "Separator", + "Zl": "Line separator", + "Zp": "Paragraph separator", + "Zs": "Space separator" + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + // this is just raw content for the Reference. + // right now all examples are executed in-browser, so they need to be compatible. Maybe swap to XRegExp at some point. + // TODO: rewrite to use multiline template literals? + + let reference_content = {}, + o = reference_content; + o.label = "RegEx Reference"; + o.id = "reference"; + o.search = true, o.desc = `Information on all of the tokens available to create regular expressions. +

    Double-click an item in the list to insert it into your Expression.

    +

    Click the arrow beside an example to load it.

    `; + o.kids = [{ + label: "Character classes", + id: "charclasses", + desc: "Character classes match a character from a specific set. There are a number of predefined character classes and you can also define your own sets.", + kids: [{ + id: "set", + label: "character set", + desc: "Match any character in the set.", + example: ["[aeiou]", "glib jocks vex dwarves!"], + token: "[ABC]" + }, { + id: "setnot", + label: "negated set", + desc: "Match any character that is not in the set.", + example: ["[^aeiou]", "glib jocks vex dwarves!"], + token: "[^ABC]" + }, { + id: "range", + tip: "Matches a character in the range {{getChar(prev)}} to {{getChar(next)}} (char code {{prev.code}} to {{next.code}}). {{getInsensitive()}}", + example: ["[g-s]", "abcdefghijklmnopqrstuvwxyz"], + desc: "Matches a character having a character code between the two specified characters inclusive.", + token: "[A-Z]" + }, { + id: "posixcharclass", + tip: "Matches any character in the '{{value}}' POSIX class.", + label: "POSIX class", + desc: "Matches any character in the specified POSIX class. Must be in a character set. For example, [[:alnum:]$] will match alphanumeric characters and $.", + ext: "

    For a list of classes, see the PCRE spec.

    ", + token: "[:alnum:]" + }, { + id: "dot", + tip: "Matches any character {{getDotAll()}}.", + desc: "Matches any character except linebreaks.", + ext: " Equivalent to [^\\n\\r].", + example: [".", "glib jocks vex dwarves!"], + token: "." + }, { + id: "matchanyset", + label: "match any", + desc: "A character set that can be used to match any character, including line breaks, without the dotall flag (s)." + "

    An alternative is [^], but it is not supported in all browsers.

    ", + example: ["[\\s\\S]", "glib jocks vex dwarves!"], + token: "[\\s\\S]" + }, { + id: "unicodegrapheme", + label: "unicode grapheme", + desc: "Matches any single unicode grapheme (ie. character).", + ext: " This includes line breaks (regardless of the dotall mode) and graphemes encoded as multiple code points.", + token: "\\X" + }, { + id: "word", + desc: "Matches any word character (alphanumeric & underscore).", + ext: " Only matches low-ascii characters (no accented or non-roman characters). Equivalent to [A-Za-z0-9_]", + example: ["\\w", "bonjour, mon fr\u00E8re"], + token: "\\w" + }, { + id: "notword", + label: "not word", + desc: "Matches any character that is not a word character (alphanumeric & underscore).", + ext: " Equivalent to [^A-Za-z0-9_]", + example: ["\\W", "bonjour, mon fr\u00E8re"], + token: "\\W" + }, { + id: "digit", + desc: "Matches any digit character (0-9).", + ext: " Equivalent to [0-9].", + example: ["\\d", "+1-(444)-555-1234"], + token: "\\d" + }, { + id: "notdigit", + label: "not digit", + desc: "Matches any character that is not a digit character (0-9).", + ext: " Equivalent to [^0-9].", + example: ["\\D", "+1-(444)-555-1234"], + token: "\\D" + }, { + id: "whitespace", + desc: "Matches any whitespace character (spaces, tabs, line breaks).", + example: ["\\s", "glib jocks vex dwarves!"], + token: "\\s" + }, { + id: "notwhitespace", + label: "not whitespace", + desc: "Matches any character that is not a whitespace character (spaces, tabs, line breaks).", + example: ["\\S", "glib jocks vex dwarves!"], + token: "\\S" + }, { + id: "hwhitespace", + label: "horizontal whitespace", + desc: "Matches any horizontal whitespace character (spaces, tabs).", + token: "\\h" + }, { + id: "nothwhitespace", + label: "not horizontal whitespace", + desc: "Matches any character that is not a horizontal whitespace character (spaces, tabs).", + token: "\\H" + }, { + id: "vwhitespace", + label: "vertical whitespace", + desc: "Matches any vertical whitespace character (line breaks).", + token: "\\v" + }, { + id: "notvwhitespace", + label: "not vertical whitespace", + desc: "Matches any character that is not a vertical whitespace character (line breaks).", + token: "\\V" + }, { + id: "linebreak", + label: "line break", + desc: "Matches any line break character, including the CRLF pair, and CR / LF individually.", + token: "\\R" + }, { + id: "notlinebreak", + label: "not line break", + desc: "Matches any character that is not a line break.", + ext: " Similar to dot (.) but is unaffected by the dotall flag (s).", + token: "\\N" + }, { + id: "unicodecat", + tip: "Matches any character in the '{{getUniCat()}}' unicode category.", + label: "unicode category", + desc: "Matches a character in the specified unicode category. For example, \\p{Ll} will match any lowercase letter.", + ext: "

    For a list of categories, see the PCRE spec.

    " + "

    There are multiple syntaxes for this feature:

    \\p{L} \\pL

    ", + token: "\\p{L}" + }, { + id: "notunicodecat", + tip: "Matches any character that is not in the '{{getUniCat()}}' unicode category.", + label: "not unicode category", + desc: "Matches any character that is not in the specified unicode category.", + ext: "

    For a list of categories, see the PCRE spec.

    " + "

    There are multiple syntaxes for this feature:

    \\P{L} \\p{^L} \\PL

    ", + token: "\\P{L}" + }, { + id: "unicodescript", + tip: "Matches any character in the '{{value}}' unicode script.", + label: "unicode script", + desc: "Matches any character in the specified unicode script. For example, \\p{Arabic} will match characters in the Arabic script.", + ext: "

    For a list of scripts, see the PCRE spec.

    ", + token: "\\p{Han}" + }, { + id: "notunicodescript", + tip: "Matches any character that is not in the '{{value}}' unicode script.", + label: "not unicode script", + desc: "Matches any character that is not in the specified unicode script.", + ext: "

    For a list of scripts, see the PCRE spec.

    " + "

    There are multiple syntaxes for this feature:

    \\P{Han} \\p{^Han}", + token: "\\P{Han}" + }] + }, { + label: "Anchors", + id: "anchors", + desc: "Anchors are unique in that they match a position within a string, not a character.", + kids: [{ + id: "bos", + label: "beginning of string", + desc: "Matches the beginning of the string.", + ext: " Unlike ^, this is unaffected by the multiline flag (m). This matches a position, not a character.", + token: "\\A" + }, { + id: "eos", + label: "end of string", + desc: "Matches the end of the string.", + ext: " Unlike $, this is unaffected by the multiline flag (m). This matches a position, not a character.", + token: "\\Z" + }, { + id: "abseos", + label: "strict end of string", + desc: "Matches the end of the string. Unlike $ or \\Z, it does not allow for a trailing newline.", + ext: " This is unaffected by the multiline flag (m). This matches a position, not a character.", + token: "\\z" + }, { + id: "bof", + label: "beginning", + desc: "Matches the beginning of the string, or the beginning of a line if the multiline flag (m) is enabled.", + ext: " This matches a position, not a character.", + example: ["^\\w+", "she sells seashells"], + token: "^" + }, { + id: "eof", + label: "end", + desc: "Matches the end of the string, or the end of a line if the multiline flag (m) is enabled.", + ext: " This matches a position, not a character.", + example: ["\\w+$", "she sells seashells"], + token: "$" + }, { + id: "wordboundary", + label: "word boundary", + desc: "Matches a word boundary position between a word character and non-word character or position (start / end of string).", + ext: " See the word character class (\w) for more info.", + example: ["s\\b", "she sells seashells"], + token: "\\b" + }, { + id: "notwordboundary", + label: "not word boundary", + desc: "Matches any position that is not a word boundary.", + ext: " This matches a position, not a character.", + example: ["s\\B", "she sells seashells"], + token: "\\B" + }, { + id: "prevmatchend", + label: "previous match end", + desc: "Matches the end position of the previous match.", + ext: " This matches a position, not a character.", + token: "\\G" + }] + }, { + label: "Escaped characters", + id: "escchars", + desc: "Escape sequences can be used to insert reserved, special, and unicode characters. All escaped characters begin with the \\ character.", + kids: [{ + id: "reservedchar", + label: "reserved characters", + desc: "The following character have special meaning, and should be preceded by a \\ (backslash) to represent a literal character:" + "

    {{getEscChars()}}

    " + "

    Within a character set, only \\, -, and ] need to be escaped.

    ", + example: ["\\+", "1 + 1 = 2"], + token: "\\+", + show: true + }, { + id: "escoctal", + label: "octal escape", + desc: "Octal escaped character in the form \\000.", + ext: " Value must be less than 255 (\\377).", + // PCRE profile adds to ext. + example: ["\\251", "RegExr is \u00A92014"], + token: "\\000" + }, { + id: "eschexadecimal", + label: "hexadecimal escape", + desc: "Hexadecimal escaped character in the form \\xFF.", + example: ["\\xA9", "RegExr is \u00A92014"], + token: "\\xFF" + }, { + id: "escunicodeu", + label: "unicode escape", + desc: "Unicode escaped character in the form \\uFFFF", + example: ["\\u00A9", "RegExr is \u00A92014"], + token: "\\uFFFF" + }, { + id: "escunicodeub", + label: "extended unicode escape", + desc: "Unicode escaped character in the form \\u{FFFF}.", + ext: " Supports a full range of unicode point escapes with any number of hex digits.

    Requires the unicode flag (u).

    ", + token: "\\u{FFFF}" + }, { + id: "escunicodexb", + label: "unicode escape", + desc: "Unicode escaped character in the form \\x{FF}.", + token: "\\x{FF}" + }, { + id: "esccontrolchar", + label: "control character escape", + desc: "Escaped control character in the form \\cZ.", + ext: " This can range from \\cA (SOH, char code 1) to \\cZ (SUB, char code 26).

    Example:

    \\cI matches TAB (char code 9).", + token: "\\cI" + }, { + id: "escsequence", + label: "escape sequence", + tip: "Matches the literal string '{{value}}'.", + desc: "All characters between the \\Q and the \\E are interpreted as a literal string. If \\E is omitted, it continues to the end of the expression.", + ext: " For example, the expression /\\Q(?.)\\E/ will match the string (?.).", + token: "\\Q...\\E" + }] + }, { + label: "Groups & References", + id: "groups", + desc: "Groups allow you to combine a sequence of tokens to operate on them together. Capture groups can be referenced by a backreference and accessed separately in the results.", + kids: [{ + id: "group", + label: "capturing group", + desc: "Groups multiple tokens together and creates a capture group for extracting a substring or using a backreference.", + example: ["(ha)+", "hahaha haa hah!"], + token: "(ABC)" + }, { + id: "namedgroup", + label: "named capturing group", + tip: "Creates a capturing group named '{{name}}'.", + desc: "Creates a capturing group that can be referenced via the specified name.", + ext: "

    There are multiple syntaxes for this feature:

    (?'name'ABC) (?P<name>ABC) (?<name>ABC)

    ", + token: "(?ABC)" + }, { + id: "namedref", + label: "named reference", + tip: "Matches the results of the capture group named '{{group.name}}'.", + desc: "Matches the results of a named capture group.", + ext: "

    There are multiple syntaxes for this feature:

    \\k'name' \\k<name> \\k{name} \\g{name} (?P=name)

    ", + token: "\\k'name'" + }, { + id: "numref", + label: "numeric reference", + tip: "Matches the results of capture group #{{group.num}}.", + desc: "Matches the results of a capture group. For example \\1 matches the results of the first capture group & \\3 matches the third.", + // PCRE adds relative and alternate syntaxes in ext + example: ["(\\w)a\\1", "hah dad bad dab gag gab"], + token: "\\1" + }, { + id: "branchreset", + label: "branch reset group", + desc: "Define alternative groups that share the same group numbers.", + ext: "

    For example, in (?|(a)|(b)) both groups (a and b) would be counted as group #1.", + token: "(?|(a)|(b))" + }, { + id: "noncapgroup", + label: "non-capturing group", + desc: "Groups multiple tokens together without creating a capture group.", + example: ["(?:ha)+", "hahaha haa hah!"], + token: "(?:ABC)" + }, { + id: "atomic", + label: "atomic group", + desc: "Non-capturing group that discards backtracking positions once matched.", + ext: "

    For example, /(?>ab|a)b/ will match abb but not ab because once the ab option has matched, the atomic group prevents backtracking to retry with the a option.

    ", + token: "(?>ABC)" + }, { + id: "define", + desc: "Used to define named groups for use as subroutines without including them in the match.", + ext: "

    For example, /A(?(DEFINE)(?'foo'Z))B\\g'foo'/ will match ABZ, because the define group is ignored in the match except to define the foo subroutine that is referenced later with \\g'foo'.

    ", + token: "(?(DEFINE)(?'foo'ABC))" + }, { + id: "numsubroutine", + label: "numeric subroutine", + tip: "Matches the expression in capture group #{{group.num}}.", + desc: "Matches the expression in a capture group. Compare this to a reference, that matches the result." + " For example /(a|b)\\g'1'/ can match ab, because the expression a|b is evaluated again.", + ext: "

    There are multiple syntaxes for this feature: \\g<1> \\g'1' (?1).

    " + "

    Relative values preceded by + or - are also supported. For example \\g<-1> would match the group preceding the reference.

    ", + token: "\\g'1'" + }, { + id: "namedsubroutine", + label: "named subroutine", + tip: "Matches the expression in the capture group named '{{group.name}}'.", + desc: "Matches the expression in a capture group. Compare this to a reference, that matches the result.", + ext: "

    There are multiple syntaxes for this feature: \\g<name> \\g'name' (?&name) (?P>name).

    ", + token: "\\g'name'" + }] + }, { + label: "Lookaround", + id: "lookaround", + desc: "Lookaround lets you match a group before (lookbehind) or after (lookahead) your main pattern without including it in the result." + "

    Negative lookarounds specify a group that can NOT match before or after the pattern.

    ", + kids: [{ + id: "poslookahead", + label: "positive lookahead", + desc: "Matches a group after the main expression without including it in the result.", + example: ["\\d(?=px)", "1pt 2px 3em 4px"], + token: "(?=ABC)" + }, { + id: "neglookahead", + label: "negative lookahead", + desc: "Specifies a group that can not match after the main expression (if it matches, the result is discarded).", + example: ["\\d(?!px)", "1pt 2px 3em 4px"], + token: "(?!ABC)" + }, { + id: "poslookbehind", + label: "positive lookbehind", + desc: "Matches a group before the main expression without including it in the result.", + token: "(?<=ABC)" + }, { + id: "neglookbehind", + label: "negative lookbehind", + desc: "Specifies a group that can not match before the main expression (if it matches, the result is discarded).", + token: "(?/o\\Kbar/ will match bar within the string foobar", + token: "\\K" + }] + }, { + label: "Quantifiers & Alternation", + id: "quants", + desc: "Quantifiers indicate that the preceding token must be matched a certain number of times. By default, quantifiers are greedy, and will match as many characters as possible." + "
    Alternation acts like a boolean OR, matching one sequence or another.", + kids: [{ + id: "plus", + desc: "Matches 1 or more of the preceding token.", + example: ["b\\w+", "b be bee beer beers"], + token: "+" + }, { + id: "star", + desc: "Matches 0 or more of the preceding token.", + example: ["b\\w*", "b be bee beer beers"], + token: "*" + }, { + id: "quant", + label: "quantifier", + tip: "Match {{getQuant()}} of the preceding token.", + desc: "Matches the specified quantity of the previous token. " + "{1,3} will match 1 to 3. " + "{3} will match exactly 3. " + "{3,} will match 3 or more. ", + example: ["b\\w{2,3}", "b be bee beer beers"], + token: "{1,3}" + }, { + id: "opt", + label: "optional", + desc: "Matches 0 or 1 of the preceding token, effectively making it optional.", + example: ["colou?r", "color colour"], + token: "?" + }, { + id: "lazy", + tip: "Makes the preceding quantifier {{getLazy()}}, causing it to match as {{getLazyFew()}} characters as possible.", + desc: "Makes the preceding quantifier lazy, causing it to match as few characters as possible.", + ext: " By default, quantifiers are greedy, and will match as many characters as possible.", + example: ["b\\w+?", "b be bee beer beers"], + token: "?" + }, { + id: "possessive", + desc: "Makes the preceding quantifier possessive. It will match as many characters as possible, and will not release them to match subsequent tokens.", + ext: "

    For example /.*a/ would match aaa, but /.*+a/ would not, because the repeating dot would match and not release the last character to match a.

    ", + token: "+" + }, { + id: "alt", + label: "alternation", + desc: "Acts like a boolean OR. Matches the expression before or after the |.", + ext: "

    It can operate within a group, or on a whole expression. The patterns will be tested in order.

    ", + example: ["b(a|e|i)d", "bad bud bod bed bid"], + token: "|" + }] + }, { + label: "Special", + id: "other", + desc: "Tokens that don't quite fit anywhere else.", + kids: [{ + id: "comment", + desc: "Allows you to insert a comment into your expression that is ignored when finding a match.", + token: "(?#foo)" + }, { + id: "conditional", + desc: "Conditionally matches one of two options based on whether a lookaround is matched.", + ext: "

    For example, /(?(?=a)ab|..)/ will match ab and zx but not ax, because if the first character matches the condition a then it evaluates the pattern ab.

    " + "

    Any lookaround can be used as the condition. A lookahead will start the subsequent match at the start of the condition, a lookbehind will start it after.

    ", + token: "(?(?=A)B|C)" + }, { + id: "conditionalgroup", + label: "group conditional", + desc: "Conditionally matches one of two options based on whether group '{{name}}' matched.", + ext: "

    For example, /(z)?(?(1)a|b)/ will match za because the first capture group matches z successfully, which causes the conditional to match the first option a.

    " + "

    The same pattern will also match b on its own, because group 1 doesn't match, so it instead tries to match the second option b.

    " + "

    You can reference a group by name, number, or relative position (ex. -1).

    ", + token: "(?(1)B|C)" + }, { + id: "recursion", + desc: "Attempts to match the full expression again at the current position.", + ext: "

    For example, /a(?R)?b/ will match any number of a followed by the same number of z: the full text of az or aaaazzzz, but not azzz.

    " + "

    There are multiple syntaxes for this feature:

    (?R) (?0) \\g<0> \\g'0'

    ", + token: "(?R)" + }, { + id: "mode", + label: "mode modifier", + tip: "{{~getDesc()}}{{~getModes()}}", + desc: "Enables or disables modes for the remainder of the expression.", + ext: "Matching modes generally map to expression flags. For example (?i) would enable case insensitivity for the remainder of the expression." + "

    Multiple modifiers can be specified, and any modifiers that follow - are disabled. For example (?im-s) would enable case insensitivity & multiline modes, and disable dotall.

    " + "

    Supported modifiers are: i - case insensitive, s - dotall, m - multiline, x - free spacing, J - allow duplicate names, U - ungreedy.

    ", + token: "(?i)" + }] + }, { + label: "Substitution", + desc: "These tokens are used in a substitution string to insert different parts of the match.", + target: "subst", + id: "subst", + kids: [{ + id: "subst_$&match", + label: "match", + desc: "Inserts the matched text.", + token: "$&" + }, { + id: "subst_0match", + label: "match", + desc: "Inserts the matched text.", + ext: "

    There are multiple syntaxes for this feature:

    $0 \\0 \\{0}

    ", + token: "$0" + }, { + id: "subst_group", + label: "capture group", + tip: "Inserts the results of capture group #{{group.num}}.", + desc: "Inserts the results of the specified capture group. For example, $3 would insert the third capture group.", + // NOTE: javascript profile overrides this: + ext: "

    There are multiple syntaxes for this feature:

    $1 \\1 \\{1}

    ", + token: "$1" + }, { + id: "subst_$before", + label: "before match", + desc: "Inserts the portion of the source string that precedes the match.", + token: "$`" + }, { + id: "subst_$after", + label: "after match", + desc: "Inserts the portion of the source string that follows the match.", + token: "$'" + }, { + id: "subst_$esc", + label: "escaped $", + desc: "Inserts a dollar sign character ($).", + token: "$$" + }, { + id: "subst_esc", + label: "escaped characters", + token: "\\n", + desc: "For convenience, these escaped characters are supported in the Replace string in RegExr: \\n, \\r, \\t, \\\\, and unicode escapes \\uFFFF. This may vary in your deploy environment." + }] + }, { + id: "flags", + label: "Flags", + tooltip: "Expression flags change how the expression is interpreted. Click to edit.", + desc: "Expression flags change how the expression is interpreted. Flags follow the closing forward slash of the expression (ex. /.+/igm ).", + target: "flags", + kids: [{ + id: "caseinsensitive", + label: "ignore case", + desc: "Makes the whole expression case-insensitive.", + ext: " For example, /aBc/i would match AbC.", + token: "i" + }, { + id: "global", + label: "global search", + tip: "Retain the index of the last match, allowing iterative searches.", + desc: "Retain the index of the last match, allowing subsequent searches to start from the end of the previous match." + "

    Without the global flag, subsequent searches will return the same match.


    " + "RegExr only searches for a single match when the global flag is disabled to avoid infinite match errors.", + token: "g" + }, { + id: "multiline", + tip: "Beginning/end anchors (^/$) will match the start/end of a line.", + desc: "When the multiline flag is enabled, beginning and end anchors (^ and $) will match the start and end of a line, instead of the start and end of the whole string." + "

    Note that patterns such as /^[\\s\\S]+$/m may return matches that span multiple lines because the anchors will match the start/end of any line.

    ", + token: "m" + }, { + id: "unicode", + tip: "Enables \\x{FFFFF} unicode escapes.", + desc: "When the unicode flag is enabled, you can use extended unicode escapes in the form \\x{FFFFF}." + "

    It also makes other escapes stricter, causing unrecognized escapes (ex. \\j) to throw an error.

    ", + token: "u" + }, { + id: "sticky", + desc: "The expression will only match from its lastIndex position and ignores the global (g) flag if set.", + ext: " Because each search in RegExr is discrete, this flag has no further impact on the displayed results.", + token: "y" + }, { + id: "dotall", + desc: "Dot (.) will match any character, including newline.", + token: "s" + }, { + id: "extended", + desc: "Literal whitespace characters are ignored, except in character sets.", + token: "x" + }, { + id: "ungreedy", + tip: "Makes quantifiers ungreedy (lazy) by default.", + desc: "Makes quantifiers ungreedy (lazy) by default. Quantifiers followed by ? will become greedy.", + token: "U" + }] + }]; + + // content that isn't included in the Reference menu item: + o.misc = { + kids: [{ + id: "ignorews", + label: "ignored whitespace", + tip: "Whitespace character ignored due to the extended flag or mode." + }, { + id: "extnumref", + // alternative syntaxes. + proxy: "numref" + }, { + id: "char", + label: "character", + tip: "Matches a {{getChar()}} character (char code {{code}}). {{getInsensitive()}}" + }, { + id: "escchar", + label: "escaped character", + tip: "Matches a {{getChar()}} character (char code {{code}})." + }, { + id: "open", + tip: "Indicates the start of a regular expression." + }, { + id: "close", + tip: "Indicates the end of a regular expression and the start of expression flags." + }, { + id: "condition", + tip: "The lookaround to match in resolving the enclosing conditional statement. See 'conditional' in the Reference for info." + }, { + id: "conditionalelse", + label: "conditional else", + tip: "Delimits the 'else' portion of the conditional." + }, { + id: "ERROR", + tip: "Errors in the expression are underlined in red. Roll over errors for more info." + }, { + id: "PREG_INTERNAL_ERROR", + tip: "Internal PCRE error" + }, { + id: "PREG_BACKTRACK_LIMIT_ERROR", + tip: "Backtrack limit was exhausted." + }, { + id: "PREG_RECURSION_LIMIT_ERROR", + tip: "Recursion limit was exhausted" + }, { + id: "PREG_BAD_UTF8_ERROR", + tip: "Malformed UTF-8 data" + }, { + id: "PREG_BAD_UTF8_OFFSET_ERROR", + tip: "Malformed UTF-8 data" + }] + }; + o.errors = { + groupopen: "Unmatched opening parenthesis.", + groupclose: "Unmatched closing parenthesis.", + setopen: "Unmatched opening square bracket.", + rangerev: "Range values reversed. Start char code is greater than end char code.", + quanttarg: "Invalid target for quantifier.", + quantrev: "Quantifier minimum is greater than maximum.", + esccharopen: "Dangling backslash.", + esccharbad: "Unrecognized or malformed escape character.", + unicodebad: "Unrecognized unicode category or script.", + posixcharclassbad: "Unrecognized POSIX character class.", + posixcharclassnoset: "POSIX character class must be in a character set.", + notsupported: "The \"{{~getLabel()}}\" feature is not supported in this flavor of RegEx.", + fwdslash: "Unescaped forward slash. This may cause issues if copying/pasting this expression into code.", + esccharbad: "Invalid escape sequence.", + servercomm: "An error occurred while communicating with the server.", + extraelse: "Extra else in conditional group.", + unmatchedref: "Reference to non-existent group \"{{name}}\".", + modebad: "Unrecognized mode flag \"{{errmode}}\".", + badname: "Group name can not start with a digit.", + dupname: "Duplicate group name.", + branchreseterr: "Branch Reset. Results will be ok, but RegExr's parser does not number branch reset groups correctly. Coming soon!", + timeout: "The expression took longer than 250ms to execute.", + // TODO: can we couple this to the help content somehow? + + // warnings: + jsfuture: "The \"{{~getLabel()}}\" feature may not be supported in all browsers.", + infinite: "The expression can return empty matches, and may match infinitely in some use cases." // TODO: can we couple this to the help content somehow? + }; + + /* + classes: + quant + set + special + ref + esc + anchor + charclass + group + comment + */ + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class BrowserSolver { + constructor() { + const workerBlob = new Blob([document.querySelector('#regexWorker').textContent], { + type: "text/javascript" + }); + this._workerObjectURL = URL.createObjectURL(workerBlob); + } + solve(o, callback) { + this._callback = callback; + this._req = o; + let regex, + text = o.text, + tests = o.tests, + mode = o.mode; + try { + this._regex = regex = new RegExp(o.pattern, o.flags); + } catch (e) { + return this._onRegExComplete({ + id: "regexparse", + name: e.name, + message: e.message + }, null, mode); + } + if (window.Worker) { + const worker = new Worker(this._workerObjectURL); + worker.onmessage = evt => { + if (evt.data === "onload") { + this._startTime = Utils.now(); + this._timeoutId = setTimeout(() => { + worker.terminate(); + this._onRegExComplete({ + id: "timeout" + }, null, mode); // TODO: make this a warning, and return all results so far. + }, 250); + } else { + clearTimeout(this._timeoutId); + worker.terminate(); + this._onRegExComplete(evt.data.error, evt.data.matches, evt.data.mode); + } + }; + + // we need to pass the pattern and flags as text, because Safari strips the unicode flag when passing a RegExp to a Worker + worker.postMessage({ + pattern: o.pattern, + flags: o.flags, + text, + tests, + mode + }); + } else { + this._startTime = Utils.now(); + + // shared between BrowserSolver & RegExWorker + var matches = [], + match, + index, + error; + if (mode === "tests") { + for (var i = 0, l = tests.length; i < l; i++) { + let test = tests[i]; + text = test.text; + regex.lastIndex = 0; + match = regex.exec(text); + matches[i] = match ? { + i: match.index, + l: match[0].length, + id: test.id + } : { + id: test.id + }; + } + } else { + while (match = regex.exec(text)) { + if (index === regex.lastIndex) { + error = { + id: "infinite", + warning: true + }; + ++regex.lastIndex; + } + index = regex.lastIndex; + var groups = match.reduce(function (arr, s, i) { + return (i === 0 || arr.push({ + s: s + })) && arr; + }, []); + matches.push({ + i: match.index, + l: match[0].length, + groups: groups + }); + if (!regex.global) { + break; + } // or it will become infinite. + } + } + // end share + + this._onRegExComplete(error, matches, mode); + } + } + _onRegExComplete(error, matches, mode) { + let result = { + time: error ? null : Utils.now() - this._startTime, + error, + mode, + matches + }; + let tool = this._req.tool; + if (tool) { + result.tool = { + id: tool.id + }; + if (!error || error.warning && tool.input != null) { + let str = Utils.unescSubstStr(tool.input); + result.tool.result = tool.id === "replace" ? this._getReplace(str) : this._getList(str); + } + } + this._callback(result); + } + _getReplace(str) { + return this._req.text.replace(this._regex, str); + } + _getList(str) { + // TODO: should we move this into a worker? + let source = this._req.text, + result = "", + repl, + ref, + trimR = 0, + regex; + + // build a RegExp without the global flag: + try { + regex = new RegExp(this._req.pattern, this._req.flags.replace("g", "")); + } catch (e) { + return null; + } + if (str.search(/\$[&1-9`']/) === -1) { + trimR = str.length; + str = "$&" + str; + } + do { + ref = source.replace(regex, "\b"); // bell char - just a placeholder to find + let index = ref.indexOf("\b"), + empty = ref.length > source.length; + if (index === -1) { + break; + } + repl = source.replace(regex, str); + result += repl.substr(index, repl.length - ref.length + 1); + source = ref.substr(index + (empty ? 2 : 1)); + } while (source.length); + if (trimR) { + result = result.substr(0, result.length - trimR); + } + return result; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class ServerSolver { + solve(o, callback) { + // unescape tool input: + if (o.tool && o.tool.input != null) { + o.tool.input = Utils.unescSubstStr(o.tool.input); + } + if (this._serverPromise) { + this._serverPromise.abort(); + } + Utils.defer(() => this._solve(o, callback), "ServerSolver._solve", 250); + } + _solve(o, callback) { + this._callback = callback; + this._serverPromise = Server.solve(o).then(o => this._onLoad(o)).catch(o => this._onError(o)); + } + _onLoad(data) { + this._callback(data); + } + _onError(msg) { + this._callback({ + error: { + id: msg + } + }); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Flavor extends EventDispatcher { + constructor(flavor) { + super(); + this.value = app.prefs.read("flavor"); + this._browserSolver = new BrowserSolver(); + this._serverSolver = new ServerSolver(); + } + set value(id) { + let profile = profiles[id && id.toLowerCase() || "js"]; + if (!profile || profile === this._profile) { + return; + } + this._profile = profile; + this._buildSupportMap(profile); + app.prefs.write("flavor", id); + this.dispatchEvent("change"); + } + get value() { + return this._profile.id; + } + get profile() { + return this._profile; + } + get profiles() { + return [profiles.js, profiles.pcre]; + } + get solver() { + return this._profile.browser ? this._browserSolver : this._serverSolver; + } + isTokenSupported(id) { + return !!this._profile._supportMap[id]; + } + getDocs(id) { + return this._profile.docs[id]; + } + validateFlags(list) { + let flags = this._profile.flags, + dupes = {}; + return list.filter(id => !!flags[id] && !dupes[id] && (dupes[id] = true)); + } + validateFlagsStr(str) { + return this.validateFlags(str.split("")).join(""); + } + isFlagSupported(id) { + return !!this._profile.flags[id]; + } + _buildSupportMap(profile) { + if (profile._supportMap) { + return; + } + let map = profile._supportMap = {}, + props = Flavor.SUPPORT_MAP_PROPS, + n; + for (n in props) { + this._addToSupportMap(map, profile[n], !!props[n]); + } + let o = profile.escCharCodes, + esc = profile.escChars; + for (n in o) { + map["esc_" + o[n]] = true; + } + for (n in esc) { + map["esc_" + esc[n]] = true; + } + } + _addToSupportMap(map, o, rev) { + if (rev) { + for (let n in o) { + map[o[n]] = true; + } + } else { + for (let n in o) { + map[n] = o[n]; + } + } + } + } + Flavor.SUPPORT_MAP_PROPS = { + // 1 = reverse, 0 - normal + flags: 1, + // escape is handled separately + // escCharCodes is handled separately + escCharTypes: 1, + charTypes: 1, + // unquantifiables not included + // unicodeScripts not included + // unicodeCategories not included + // posixCharClasses not included + // modes not included + tokens: 0, + substTokens: 0 + // config not included + // docs not included + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class RefCoverage { + constructor() { + app.flavor._buildSupportMap(core); + let ref = app.reference._idMap, + undoc = [], + unused = [], + all = core._supportMap; + let ignore = { + "escchar": true, + // literal char + "groupclose": true, + "setclose": true, + "condition": true, + // proxies to conditional + "conditionalelse": true, + // proxies to conditional + subst_$group: true, + // resolved to subst_group + subst_$bgroup: true, + // resolved to subst_group + subst_bsgroup: true, + // resolved to subst_group + escoctalo: true // resolved to escoctal + }; + for (let n in all) { + if (!ref[n] && !ignore[n]) { + undoc.push(n); + } + } + for (let n in ref) { + if (!all[n] && !ref[n].kids) { + unused.push(n); + } + } + console.log("--- UNDOCUMENTED IDS ---\n" + undoc.join("\n") + "\n\n--- UNUSED DOCS? ---\n" + unused.join("\n")); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + class Prefs { + constructor(el) { + this._load(); + } + read(key) { + return this._data[key]; + } + write(key, value) { + if (this._data[key] === value) { + return; + } + this._data[key] = value; + this._save(); + } + clear(key) { + delete this._data[key]; + this._save(); + } + _load() { + let match = /(?:^|;\s*)prefs=\s*([^;]*)/.exec(document.cookie); + if (match && match[1]) { + try { + this._data = JSON.parse(unescape(match[1])); + return; + } catch (e) {} + } + this._data = {}; + } + _save() { + let str = escape(JSON.stringify(this._data)); + document.cookie = "prefs=" + str + "; expires=Fri, 31 Dec 9999 23:59:59 GMT;"; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class RegExr extends EventDispatcher { + constructor() { + super(); + } + init(state, account, config = {}) { + this.prefs = new Prefs(); + this.flavor = new Flavor(); + this.reference = new Reference(reference_content, this.flavor, config); + this._migrateFavorites(); + this._initUI(); + this.account.value = account; + if (state === false) { + this._localInit(); + } else if (this.account.authenticated && !state) { + this.newDoc(false); + } else { + this.state = state; + } + this._savedHash = null; + let params = Utils.getUrlParams(); + if (Utils.isLocal && params.id) { + Server.load(params.id).then(o => this.state = o); + params = {}; + } + if (params.engine) { + this.flavor.value = params.engine; + } + if (params.expression) { + this.expression.value = params.expression; + } + if (params.text) { + this.text.value = params.text; + } + if (params.tool) { + this.tools.value = { + id: params.tool, + input: params.input + }; + } + window.onbeforeunload = e => this.unsaved ? "You have unsaved changes." : null; + this.resetUnsaved(); + setTimeout(() => this._initAds(), 100); + } + _initAds() { + _native && _native.init("CK7D65QM", { + // "CK7D65QM" use "CK7D4KQE" to test Carbon ads + carbonZoneKey: 'CK7DPKQU', + targetClass: 'native-js' + }); + } + _localInit() { + console.log("local init"); + //Server.verify().then((data) => this.account.value = data); + new RefCoverage(); + } + + // getter / setters: + get state() { + console.log(this.text.mode); + let o = { + expression: this.expression.value, + text: this.text.value, + tests: this.text.tests, + flavor: this.flavor.value, + tool: this.tools.value, + mode: this.text.mode + }; + // copy share values onto the pattern object: + return Utils.copy(this.share.value, o); + } + set state(o) { + if (!o) { + return; + } + this.flavor.value = o.flavor; + this.expression.value = o.expression; + this.text.value = o.text; + this.text.tests = o.tests; + this.text.mode = o.mode; + this.tools.value = o.tool; + this.share.pattern = o; + this.resetUnsaved(); + } + get hash() { + let share = this.share; + return Utils.getHashCode(this.expression.value + "\t" + this.text.value + "\t" + this.flavor.value + "\t" + share.author + "\t" + share.name + "\t" + share.description + "\t" + share.keywords + "\t" + JSON.stringify(this.text.tests) + "\t" + //+ this.tools.value.input+"\t" + //+ this.tools.value.id+"\t" + ); + } + get unsaved() { + return this.hash !== this._savedHash; + } + get isNarrow() { + return this._matchList.matches; + } + + // public methods: + resetUnsaved() { + this._savedHash = this.hash; + } + newDoc(warn = true) { + this.load({ + flavor: this.flavor.value, + expression: ".", + text: "Text" + }, warn); + this.expression.selectAll(); + } + load(state, warn = true) { + if (warn === true) { + warn = "You have unsaved changes. Continue without saving?"; + } + if (warn && this.unsaved && !confirm(warn)) { + return; + } + this.state = Utils.clone(state); + } + + // private methods: + _initUI() { + // TODO: break into own Device class? Rename mobile.scss too? + // mobile setup + // keep synced with "mobile.scss": + if (screen.width < 500) { + document.getElementById("viewport").setAttribute("content", "width=500, user-scalable=0"); + } + this._matchList = window.matchMedia("(max-width: 900px)"); + this._matchList.addListener(q => this.dispatchEvent("narrow")); // currently unused. + + // UI: + this.el = DOMUtils.query(".container"); + this.tooltip = { + hover: new Tooltip(DOMUtils.query("#library #tooltip").cloneNode(true)), + toggle: new Tooltip(DOMUtils.query("#library #tooltip"), true) + }; + this.theme = new Theme(this.el); + let el = this.docEl = DOMUtils.query(".app > .doc", this.el); + this.expression = new Expression(DOMUtils.query("> section.expression", el)); + this.text = new Text(DOMUtils.query("> section.text", el)); + this.tools = new Tools(DOMUtils.query("> section.tools", el)); + this.account = new Account(); + this.sidebar = new Sidebar(DOMUtils.query(".app > .sidebar", this.el)); + this.share = this.sidebar.share; + this.expression.on("change", () => this._change()); + this.text.on("change", () => this._change()); + this.text.on("modechange", () => this._modeChange()); + this.flavor.on("change", () => this._change()); + this.tools.on("change", () => this._change()); + this.share.on("change", () => this._change()); + } + _migrateFavorites() { + let ls = window.localStorage, + l = ls.length; + if (!l || ls.getItem("f_v3") >= "1") { + return; + } + let ids = []; + for (let i = 0; i < l; i++) { + let key = ls.key(i), + val = ls.getItem(key); + if (key[0] === "f" && val === "1") { + ids.push(key.substr(1)); + } + } + if (!ids.length) { + ls.setItem("f_v3", "1"); + return; + } + Server.multiFavorite(ids).then(() => ls.setItem("f_v3", "1")); + } + _change() { + this.dispatchEvent("change"); + let solver = this.flavor.solver, + exp = this.expression; + let o = { + pattern: exp.pattern, + flags: exp.flags, + mode: this.text.mode + }; + if (o.mode === "tests") { + o.tests = this.text.tests; + } else { + o.text = this.text.value; + o.tool = this.tools.value; + } + solver.solve(o, result => this._handleResult(result)); + } + _modeChange() { + DOMUtils.toggleClass(this.docEl, "tests-mode", this.text.mode === "tests"); + this._change(); + } + _handleResult(result) { + this.result = this._processResult(result); + this.dispatchEvent("result"); + } + _processResult(result) { + if (result.mode === "text") { + result.matches && result.matches.forEach((o, i) => o.num = i); + } + return result; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + let app = new RegExr(); + + return app; + +}()); +//# sourceMappingURL=regexr.js.map diff --git a/deploy/de/regexr.js.map b/deploy/de/regexr.js.map new file mode 100644 index 0000000..819f3d6 --- /dev/null +++ b/deploy/de/regexr.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexr.js","sources":["../dev/lib/codemirror.js","../dev/lib/clipboard.js","../dev/lib/native.js","../dev/src/events/Event.js","../dev/src/events/EventDispatcher.js","../dev/src/utils/DOMUtils.js","../dev/src/utils/Utils.js","../dev/src/controls/Tooltip.js","../dev/src/net/Server.js","../dev/src/utils/CMUtils.js","../dev/src/utils/Track.js","../dev/src/controls/List.js","../dev/src/ExpressionLexer.js","../dev/src/views/ExpressionHighlighter.js","../dev/src/views/ExpressionHover.js","../dev/src/profiles/core.js","../dev/src/profiles/pcre.js","../dev/src/profiles/javascript.js","../dev/src/profiles/profiles.js","../dev/src/views/Expression.js","../dev/src/utils/UID.js","../dev/src/views/TextHighlighter.js","../dev/src/views/TextHover.js","../dev/src/views/Text.js","../dev/src/views/tools/Explain.js","../dev/src/views/tools/Details.js","../dev/src/views/tools/Replace.js","../dev/src/SubstLexer.js","../dev/src/views/Tools.js","../dev/src/docs/sidebar_content.js","../dev/src/controls/LinkRow.js","../dev/src/views/Example.js","../dev/src/views/Community.js","../dev/src/controls/Status.js","../dev/src/views/Account.js","../dev/src/views/Share.js","../dev/src/views/Sidebar.js","../dev/src/views/Theme.js","../dev/src/docs/Reference.js","../dev/src/docs/reference_content.js","../dev/src/helpers/BrowserSolver.js","../dev/src/helpers/ServerSolver.js","../dev/src/Flavor.js","../dev/src/RefCoverage.js","../dev/src/helpers/Prefs.js","../dev/src/RegExr.js","../dev/src/app.js"],"sourcesContent":["// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n// This is CodeMirror (http://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n// Kludges for bugs and behavior differences that can't be feature\n// detected are enabled based on userAgent etc sniffing.\nvar userAgent = navigator.userAgent\nvar platform = navigator.platform\n\nvar gecko = /gecko\\/\\d/i.test(userAgent)\nvar ie_upto10 = /MSIE \\d/.test(userAgent)\nvar ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent)\nvar edge = /Edge\\/(\\d+)/.exec(userAgent)\nvar ie = ie_upto10 || ie_11up || edge\nvar ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1])\nvar webkit = !edge && /WebKit\\//.test(userAgent)\nvar qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent)\nvar chrome = !edge && /Chrome\\//.test(userAgent)\nvar presto = /Opera\\//.test(userAgent)\nvar safari = /Apple Computer/.test(navigator.vendor)\nvar mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent)\nvar phantom = /PhantomJS/.test(userAgent)\n\nvar ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent)\nvar android = /Android/.test(userAgent)\n// This is woefully incomplete. Suggestions for alternative methods welcome.\nvar mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)\nvar mac = ios || /Mac/.test(platform)\nvar chromeOS = /\\bCrOS\\b/.test(userAgent)\nvar windows = /win/i.test(platform)\n\nvar presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/)\nif (presto_version) { presto_version = Number(presto_version[1]) }\nif (presto_version && presto_version >= 15) { presto = false; webkit = true }\n// Some browsers use the wrong event properties to signal cmd/ctrl on OS X\nvar flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11))\nvar captureRightClick = gecko || (ie && ie_version >= 9)\n\nfunction classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\nvar rmClass = function(node, cls) {\n var current = node.className\n var match = classTest(cls).exec(current)\n if (match) {\n var after = current.slice(match.index + match[0].length)\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\")\n }\n}\n\nfunction removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild) }\n return e\n}\n\nfunction removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n}\n\nfunction elt(tag, content, className, style) {\n var e = document.createElement(tag)\n if (className) { e.className = className }\n if (style) { e.style.cssText = style }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)) }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } }\n return e\n}\n// wrapper for elt, which removes the elt from the accessibility tree\nfunction eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style)\n e.setAttribute(\"role\", \"presentation\")\n return e\n}\n\nvar range\nif (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange()\n r.setEnd(endNode || node, end)\n r.setStart(node, start)\n return r\n} }\nelse { range = function(node, start, end) {\n var r = document.body.createTextRange()\n try { r.moveToElementText(node.parentNode) }\n catch(e) { return r }\n r.collapse(true)\n r.moveEnd(\"character\", end)\n r.moveStart(\"character\", start)\n return r\n} }\n\nfunction contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n}\n\nfunction activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement\n try {\n activeElement = document.activeElement\n } catch(e) {\n activeElement = document.body || null\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement }\n return activeElement\n}\n\nfunction addClass(node, cls) {\n var current = node.className\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls }\n}\nfunction joinClasses(a, b) {\n var as = a.split(\" \")\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i] } }\n return b\n}\n\nvar selectInput = function(node) { node.select() }\nif (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } }\nelse if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select() } catch(_e) {} } }\n\nfunction bind(f) {\n var args = Array.prototype.slice.call(arguments, 1)\n return function(){return f.apply(null, args)}\n}\n\nfunction copyObj(obj, target, overwrite) {\n if (!target) { target = {} }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop] } }\n return target\n}\n\n// Counts the column offset in a string, taking tabs into account.\n// Used mostly to find indentation.\nfunction countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/)\n if (end == -1) { end = string.length }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i)\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i\n n += tabSize - (n % tabSize)\n i = nextTab + 1\n }\n}\n\nvar Delayed = function() {this.id = null};\nDelayed.prototype.set = function (ms, f) {\n clearTimeout(this.id)\n this.id = setTimeout(f, ms)\n};\n\nfunction indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n}\n\n// Number of pixels added to scroller and sizer to hide scrollbar\nvar scrollerGap = 30\n\n// Returned or thrown by various protocols to signal 'I'm not\n// handling this'.\nvar Pass = {toString: function(){return \"CodeMirror.Pass\"}}\n\n// Reused option objects for setSelection & friends\nvar sel_dontScroll = {scroll: false};\nvar sel_mouse = {origin: \"*mouse\"};\nvar sel_move = {origin: \"+move\"};\n// The inverse of countColumn -- find the offset that corresponds to\n// a particular column.\nfunction findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos)\n if (nextTab == -1) { nextTab = string.length }\n var skipped = nextTab - pos\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos\n col += tabSize - (col % tabSize)\n pos = nextTab + 1\n if (col >= goal) { return pos }\n }\n}\n\nvar spaceStrs = [\"\"]\nfunction spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \") }\n return spaceStrs[n]\n}\n\nfunction lst(arr) { return arr[arr.length-1] }\n\nfunction map(array, f) {\n var out = []\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) }\n return out\n}\n\nfunction insertSorted(array, value, score) {\n var pos = 0, priority = score(value)\n while (pos < array.length && score(array[pos]) <= priority) { pos++ }\n array.splice(pos, 0, value)\n}\n\nfunction nothing() {}\n\nfunction createObj(base, props) {\n var inst\n if (Object.create) {\n inst = Object.create(base)\n } else {\n nothing.prototype = base\n inst = new nothing()\n }\n if (props) { copyObj(props, inst) }\n return inst\n}\n\nvar nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/\nfunction isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n}\nfunction isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n}\n\nfunction isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n}\n\n// Extending unicode characters. A series of a non-extending char +\n// any number of extending chars is treated as a single unit as far\n// as editing and measuring is concerned. This is not fully correct,\n// since some scripts/fonts/browsers also treat other configurations\n// of code points as a group.\nvar extendingChars = /[\\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]/\nfunction isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n// Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\nfunction skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir }\n return pos\n}\n\n// Returns the value from the range [`from`; `to`] that satisfies\n// `pred` and is closest to `from`. Assumes that at least `to` satisfies `pred`.\nfunction findFirst(pred, from, to) {\n for (;;) {\n if (Math.abs(from - to) <= 1) { return pred(from) ? from : to }\n var mid = Math.floor((from + to) / 2)\n if (pred(mid)) { to = mid }\n else { from = mid }\n }\n}\n\n// The display handles the DOM integration, both for input reading\n// and content drawing. It holds references to DOM nodes and\n// display-related state.\n\nfunction Display(place, doc, input) {\n var d = this\n this.input = input\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\")\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\")\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\")\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\")\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\")\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\")\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\")\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\")\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\")\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\")\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\")\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\")\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\")\n d.sizerWidth = null\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\")\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\")\n d.lineGutter = null\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\")\n d.scroller.setAttribute(\"tabIndex\", \"-1\")\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\")\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper) }\n else { place(d.wrapper) }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first\n d.reportedViewFrom = d.reportedViewTo = doc.first\n // Information about the rendered lines.\n d.view = []\n d.renderedView = null\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null\n // Empty space (in pixels) above the view\n d.viewOffset = 0\n d.lastWrapHeight = d.lastWrapWidth = 0\n d.updateLineNumbers = null\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0\n d.scrollbarsClipped = false\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null\n d.maxLineLength = 0\n d.maxLineChanged = false\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null\n\n // True when shift is held down.\n d.shift = false\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null\n\n d.activeTouch = null\n\n input.init(d)\n}\n\n// Find the line object corresponding to the given line number.\nfunction getLine(doc, n) {\n n -= doc.first\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize()\n if (n < sz) { chunk = child; break }\n n -= sz\n }\n }\n return chunk.lines[n]\n}\n\n// Get the part of a document between two positions, as an array of\n// strings.\nfunction getBetween(doc, start, end) {\n var out = [], n = start.line\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text\n if (n == end.line) { text = text.slice(0, end.ch) }\n if (n == start.line) { text = text.slice(start.ch) }\n out.push(text)\n ++n\n })\n return out\n}\n// Get the lines between from and to, as array of strings.\nfunction getLines(doc, from, to) {\n var out = []\n doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value\n return out\n}\n\n// Update the height of a line, propagating the height change\n// upwards to parent nodes.\nfunction updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}\n\n// Given a line object, find its line number by walking up through\n// its parent links.\nfunction lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line)\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize()\n }\n }\n return no + cur.first\n}\n\n// Find the line at the given vertical position, using the height\n// information in the document tree.\nfunction lineAtHeight(chunk, h) {\n var n = chunk.first\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height\n if (h < ch) { chunk = child; continue outer }\n h -= ch\n n += child.chunkSize()\n }\n return n\n } while (!chunk.lines)\n var i = 0\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height\n if (h < lh) { break }\n h -= lh\n }\n return n + i\n}\n\nfunction isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\nfunction lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n}\n\n// A Pos instance represents a position within the text.\nfunction Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line\n this.ch = ch\n this.sticky = sticky\n}\n\n// Compare two positions, return 0 if they are the same, a negative\n// number when a is less, and a positive number otherwise.\nfunction cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\nfunction equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\nfunction copyPos(x) {return Pos(x.line, x.ch)}\nfunction maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\nfunction minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n// Most of the external API clips given positions to make sure they\n// actually exist within the document.\nfunction clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\nfunction clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n}\nfunction clipToLen(pos, linelen) {\n var ch = pos.ch\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n}\nfunction clipPosArray(doc, array) {\n var out = []\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) }\n return out\n}\n\n// Optimize some code when these features are not used.\nvar sawReadOnlySpans = false;\nvar sawCollapsedSpans = false;\nfunction seeReadOnlySpans() {\n sawReadOnlySpans = true\n}\n\nfunction seeCollapsedSpans() {\n sawCollapsedSpans = true\n}\n\n// TEXTMARKER SPANS\n\nfunction MarkedSpan(marker, from, to) {\n this.marker = marker\n this.from = from; this.to = to\n}\n\n// Search an array of spans for a span matching the given marker.\nfunction getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.marker == marker) { return span }\n } }\n}\n// Remove a span from an array, returning undefined if no spans are\n// left (we don't store arrays for lines without spans).\nfunction removeMarkedSpan(spans, span) {\n var r\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }\n return r\n}\n// Add a span to a line.\nfunction addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n}\n\n// Used for the algorithm that adjusts markers for a change in the\n// document. These functions cut an array of spans at a given\n// character position, returning an array of remaining chunks (or\n// undefined if nothing remains).\nfunction markedSpansBefore(old, startCh, isInsert) {\n var nw\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh)\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to))\n }\n } }\n return nw\n}\nfunction markedSpansAfter(old, endCh, isInsert) {\n var nw\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh)\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh))\n }\n } }\n return nw\n}\n\n// Given a change object, compute the new set of marker spans that\n// cover the line in which the change took place. Removes spans\n// entirely within the change, reconnects spans belonging to the\n// same marker that appear on both sides of the change, and cuts off\n// spans partially within the change. Returns an array of span\n// arrays with one element for each line in (after) the change.\nfunction stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert)\n var last = markedSpansAfter(oldLast, endCh, isInsert)\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i]\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker)\n if (!found) { span.to = startCh }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1]\n if (span$1.to != null) { span$1.to += offset }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker)\n if (!found$1) {\n span$1.from = offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n } else {\n span$1.from += offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first) }\n if (last && last != first) { last = clearEmptySpans(last) }\n\n var newMarkers = [first]\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers) }\n newMarkers.push(last)\n }\n return newMarkers\n}\n\n// Remove spans that are empty and don't have a clearWhenEmpty\n// option of false.\nfunction clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1) }\n }\n if (!spans.length) { return null }\n return spans\n}\n\n// Used to 'clip' out readOnly ranges when making a change.\nfunction removeReadOnlyRanges(doc, from, to) {\n var markers = null\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark) }\n } }\n })\n if (!markers) { return null }\n var parts = [{from: from, to: to}]\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0)\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j]\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}) }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}) }\n parts.splice.apply(parts, newParts)\n j += newParts.length - 3\n }\n }\n return parts\n}\n\n// Connect or disconnect spans from a line.\nfunction detachMarkedSpans(line) {\n var spans = line.markedSpans\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line) }\n line.markedSpans = null\n}\nfunction attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line) }\n line.markedSpans = spans\n}\n\n// Helpers used when computing which overlapping collapsed span\n// counts as the larger one.\nfunction extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\nfunction extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n// Returns a number indicating which of two overlapping collapsed\n// spans is larger (and thus includes the other). Falls back to\n// comparing ids when the spans cover exactly the same range.\nfunction compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find()\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)\n if (toCmp) { return toCmp }\n return b.id - a.id\n}\n\n// Find out whether a line ends or starts in a collapsed span. If\n// so, return the marker for that span.\nfunction collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker }\n } }\n return found\n}\nfunction collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\nfunction collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n// Test whether there exists a collapsed span that partially\n// overlaps (covers the start or end, but not both) of a new span.\n// Such overlap is not allowed.\nfunction conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo)\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0)\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}\n\n// A visual line is a line as drawn on the screen. Folding, for\n// example, can cause multiple logical lines to appear on the same\n// visual line. This finds the start of the visual line that the\n// given line is part of (usually that is the line itself).\nfunction visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}\n\nfunction visualLineEnd(line) {\n var merged\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line }\n return line\n}\n\n// Returns an array of logical lines that continue the visual line\n// started by the argument, or undefined if there are no such lines.\nfunction visualLineContinued(line) {\n var merged, lines\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line)\n }\n return lines\n}\n\n// Get the line number of the start of the visual line that the\n// given line number is part of.\nfunction visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}\n\n// Get the line number of the start of the next visual line after\n// the given line.\nfunction visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line }\n return lineNo(line) + 1\n}\n\n// Compute whether a line is hidden. Lines count as hidden when they\n// are part of a visual line that starts with another line, or when\n// they are entirely covered by collapsed, non-widget span.\nfunction lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}\nfunction lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true)\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i]\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n}\n\n// Find the height above the given line.\nfunction heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}\n\n// Compute the character length of a line, taking into account\n// collapsed ranges (see markText) that might hide parts, and join\n// other lines onto it.\nfunction lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true)\n cur = found.from.line\n len += found.from.ch - found.to.ch\n }\n cur = line\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true)\n len -= cur.text.length - found$1.from.ch\n cur = found$1.to.line\n len += cur.text.length - found$1.to.ch\n }\n return len\n}\n\n// Find the longest line in the document.\nfunction findMaxLine(cm) {\n var d = cm.display, doc = cm.doc\n d.maxLine = getLine(doc, doc.first)\n d.maxLineLength = lineLength(d.maxLine)\n d.maxLineChanged = true\n doc.iter(function (line) {\n var len = lineLength(line)\n if (len > d.maxLineLength) {\n d.maxLineLength = len\n d.maxLine = line\n }\n })\n}\n\n// BIDI HELPERS\n\nfunction iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\") }\n var found = false\n for (var i = 0; i < order.length; ++i) {\n var part = order[i]\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\")\n found = true\n }\n }\n if (!found) { f(from, to, \"ltr\") }\n}\n\nvar bidiOther = null\nfunction getBidiPartAt(order, ch, sticky) {\n var found\n bidiOther = null\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i]\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i }\n else { bidiOther = i }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i }\n else { bidiOther = i }\n }\n }\n return found != null ? found : bidiOther\n}\n\n// Bidirectional ordering algorithm\n// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n// that this (partially) implements.\n\n// One-char codes used for character types:\n// L (L): Left-to-Right\n// R (R): Right-to-Left\n// r (AL): Right-to-Left Arabic\n// 1 (EN): European Number\n// + (ES): European Number Separator\n// % (ET): European Number Terminator\n// n (AN): Arabic Number\n// , (CS): Common Number Separator\n// m (NSM): Non-Spacing Mark\n// b (BN): Boundary Neutral\n// s (B): Paragraph Separator\n// t (S): Segment Separator\n// w (WS): Whitespace\n// N (ON): Other Neutrals\n\n// Returns null if characters are ordered as they appear\n// (left-to-right), or an array of sections ({from, to, level}\n// objects) in the order in which they occur visually.\nvar bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\"\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\"\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/\n\n function BidiSpan(level, from, to) {\n this.level = level\n this.from = from; this.to = to\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\"\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = []\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))) }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1]\n if (type == \"m\") { types[i$1] = prev }\n else { prev = type }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2]\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\" }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\" } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3]\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\" }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1 }\n prev$1 = type$2\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4]\n if (type$3 == \",\") { types[i$4] = \"N\" }\n else if (type$3 == \"%\") {\n var end = (void 0)\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\"\n for (var j = i$4; j < end; ++j) { types[j] = replace }\n i$4 = end - 1\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5]\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\" }\n else if (isStrong.test(type$4)) { cur$1 = type$4 }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0)\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\"\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\"\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 }\n i$6 = end$1 - 1\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7))\n } else {\n var pos = i$7, at = order.length\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) }\n var nstart = j$2\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2))\n pos = j$2\n } else { ++j$2 }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) }\n }\n }\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length\n order.unshift(new BidiSpan(0, 0, m[0].length))\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length\n order.push(new BidiSpan(0, len - m[0].length, len))\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n})()\n\n// Get the bidi ordering for the given line (and cache it). Returns\n// false for lines that are fully left-to-right, and an array of\n// BidiSpan objects otherwise.\nfunction getOrder(line, direction) {\n var order = line.order\n if (order == null) { order = line.order = bidiOrdering(line.text, direction) }\n return order\n}\n\nfunction moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir)\n return target < 0 || target > line.text.length ? null : target\n}\n\nfunction moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir)\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n}\n\nfunction endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction)\n if (order) {\n var part = dir < 0 ? lst(order) : order[0]\n var moveInStorageOrder = (dir < 0) == (part.level == 1)\n var sticky = moveInStorageOrder ? \"after\" : \"before\"\n var ch\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0) {\n var prep = prepareMeasureForLine(cm, lineObj)\n ch = dir < 0 ? lineObj.text.length - 1 : 0\n var targetTop = measureCharPrepared(cm, prep, ch).top\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch)\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1) }\n } else { ch = dir < 0 ? part.to : part.from }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n}\n\nfunction moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction)\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length\n start.sticky = \"before\"\n } else if (start.ch <= 0) {\n start.ch = 0\n start.sticky = \"after\"\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }\n var prep\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line)\n return wrappedLineExtentChar(cm, line, prep, ch)\n }\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch)\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0)\n var ch = mv(start, moveInStorageOrder ? 1 : -1)\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\"\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); }\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos]\n var moveInStorageOrder = (dir > 0) == (part.level != 1)\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1)\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1)\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n }\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent)\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1)\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh))\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n}\n\n// EVENT HANDLING\n\n// Lightweight event framework. on/off also work on DOM nodes,\n// registering native DOM handlers.\n\nvar noHandlers = []\n\nvar on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false)\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f)\n } else {\n var map = emitter._handlers || (emitter._handlers = {})\n map[type] = (map[type] || noHandlers).concat(f)\n }\n}\n\nfunction getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n}\n\nfunction off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false)\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f)\n } else {\n var map = emitter._handlers, arr = map && map[type]\n if (arr) {\n var index = indexOf(arr, f)\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) }\n }\n }\n}\n\nfunction signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type)\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2)\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) }\n}\n\n// The DOM events that CodeMirror handles can be overridden by\n// registering a (non-DOM) handler on the editor for the event name,\n// and preventDefault-ing the event in that handler.\nfunction signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }\n signal(cm, override || e.type, cm, e)\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}\n\nfunction signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = [])\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]) } }\n}\n\nfunction hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n}\n\n// Add on and off methods to a constructor's prototype, to make\n// registering events on such objects more convenient.\nfunction eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f)}\n ctor.prototype.off = function(type, f) {off(this, type, f)}\n}\n\n// Due to the fact that we still support jurassic IE versions, some\n// compatibility wrappers are needed.\n\nfunction e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault() }\n else { e.returnValue = false }\n}\nfunction e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation() }\n else { e.cancelBubble = true }\n}\nfunction e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n}\nfunction e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}\n\nfunction e_target(e) {return e.target || e.srcElement}\nfunction e_button(e) {\n var b = e.which\n if (b == null) {\n if (e.button & 1) { b = 1 }\n else if (e.button & 2) { b = 3 }\n else if (e.button & 4) { b = 2 }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3 }\n return b\n}\n\n// Detect drag-and-drop\nvar dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div')\n return \"draggable\" in div || \"dragDrop\" in div\n}()\n\nvar zwspSupported\nfunction zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\")\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]))\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\")\n node.setAttribute(\"cm-text\", \"\")\n return node\n}\n\n// Feature-detect IE's crummy client rect reporting for bidi text\nvar badBidiRects\nfunction hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"))\n var r0 = range(txt, 0, 1).getBoundingClientRect()\n var r1 = range(txt, 1, 2).getBoundingClientRect()\n removeChildren(measure)\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n}\n\n// See if \"\".split is the broken IE version, if so, provide an\n// alternative way to split lines.\nvar splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos)\n if (nl == -1) { nl = string.length }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl)\n var rt = line.indexOf(\"\\r\")\n if (rt != -1) {\n result.push(line.slice(0, rt))\n pos += rt + 1\n } else {\n result.push(line)\n pos = nl + 1\n }\n }\n return result\n} : function (string) { return string.split(/\\r\\n?|\\n/); }\n\nvar hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n} : function (te) {\n var range\n try {range = te.ownerDocument.selection.createRange()}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n}\n\nvar hasCopyEvent = (function () {\n var e = elt(\"div\")\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\")\n return typeof e.oncopy == \"function\"\n})()\n\nvar badZoomedRects = null\nfunction hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"))\n var normal = node.getBoundingClientRect()\n var fromRange = range(node, 0, 1).getBoundingClientRect()\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n}\n\nvar modes = {};\nvar mimeModes = {};\n// Extra arguments are stored as the mode's dependencies, which is\n// used by (legacy) mechanisms like loadmode.js to automatically\n// load a mode. (Preferred mechanism is the require/define calls.)\nfunction defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2) }\n modes[name] = mode\n}\n\nfunction defineMIME(mime, spec) {\n mimeModes[mime] = spec\n}\n\n// Given a MIME type, a {name, ...options} config object, or a name\n// string, return a mode config object.\nfunction resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec]\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name]\n if (typeof found == \"string\") { found = {name: found} }\n spec = createObj(found, spec)\n spec.name = found.name\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n}\n\n// Given a mode spec (anything that resolveMode accepts), find and\n// initialize an actual mode object.\nfunction getMode(options, spec) {\n spec = resolveMode(spec)\n var mfactory = modes[spec.name]\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec)\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name]\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop] }\n modeObj[prop] = exts[prop]\n }\n }\n modeObj.name = spec.name\n if (spec.helperType) { modeObj.helperType = spec.helperType }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1] } }\n\n return modeObj\n}\n\n// This can be used to attach properties to mode objects from\n// outside the actual mode definition.\nvar modeExtensions = {}\nfunction extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {})\n copyObj(properties, exts)\n}\n\nfunction copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {}\n for (var n in state) {\n var val = state[n]\n if (val instanceof Array) { val = val.concat([]) }\n nstate[n] = val\n }\n return nstate\n}\n\n// Given a mode and a state (for that mode), find the inner mode and\n// state at the position that the state refers to.\nfunction innerMode(mode, state) {\n var info\n while (mode.innerMode) {\n info = mode.innerMode(state)\n if (!info || info.mode == mode) { break }\n state = info.state\n mode = info.mode\n }\n return info || {mode: mode, state: state}\n}\n\nfunction startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n}\n\n// STRING STREAM\n\n// Fed to the mode parsers, provides helper functions to make\n// parsers more succinct.\n\nvar StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0\n this.string = string\n this.tabSize = tabSize || 8\n this.lastColumnPos = this.lastColumnValue = 0\n this.lineStart = 0\n this.lineOracle = lineOracle\n};\n\nStringStream.prototype.eol = function () {return this.pos >= this.string.length};\nStringStream.prototype.sol = function () {return this.pos == this.lineStart};\nStringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\nStringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n};\nStringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos)\n var ok\n if (typeof match == \"string\") { ok = ch == match }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)) }\n if (ok) {++this.pos; return ch}\n};\nStringStream.prototype.eatWhile = function (match) {\n var start = this.pos\n while (this.eat(match)){}\n return this.pos > start\n};\nStringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos }\n return this.pos > start\n};\nStringStream.prototype.skipToEnd = function () {this.pos = this.string.length};\nStringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos)\n if (found > -1) {this.pos = found; return true}\n};\nStringStream.prototype.backUp = function (n) {this.pos -= n};\nStringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue)\n this.lastColumnPos = this.start\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n};\nStringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n};\nStringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }\n var substr = this.string.substr(this.pos, pattern.length)\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern)\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length }\n return match\n }\n};\nStringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\nStringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n\n try { return inner() }\n finally { this.lineStart -= n }\n};\nStringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle\n return oracle && oracle.lookAhead(n)\n};\n\nvar SavedContext = function(state, lookAhead) {\n this.state = state\n this.lookAhead = lookAhead\n};\n\nvar Context = function(doc, state, line, lookAhead) {\n this.state = state\n this.doc = doc\n this.line = line\n this.maxLookAhead = lookAhead || 0\n};\n\nContext.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n)\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n }\n return line\n};\n\nContext.prototype.nextLine = function () {\n this.line++\n if (this.maxLookAhead > 0) { this.maxLookAhead-- }\n};\n\nContext.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n};\n\nContext.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n};\n\n\n// Compute a style array (an array starting with a mode generation\n// -- for invalidation -- followed by pairs of end positions and\n// style strings), which is used to highlight the tokens on the\n// line.\nfunction highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {}\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd)\n var state = context.state\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0\n context.state = true\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i]\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end) }\n i += 2\n at = Math.min(end, i_end)\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style)\n i = start + 2\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1]\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style\n }\n }\n }, lineClasses)\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n context.state = state\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}\n\nfunction getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line))\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state)\n var result = highlightLine(cm, line, context)\n if (resetState) { context.state = resetState }\n line.stateAfter = context.save(!resetState)\n line.styles = result.styles\n if (result.classes) { line.styleClasses = result.classes }\n else if (line.styleClasses) { line.styleClasses = null }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier) }\n }\n return line.styles\n}\n\nfunction getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise)\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start)\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context)\n var pos = context.line\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null\n context.nextLine()\n })\n if (precise) { doc.modeFrontier = context.line }\n return context\n}\n\n// Lightweight form of highlight -- proceed over this line and\n// update state, but don't save a style array. Used for lines that\n// aren't currently visible.\nfunction processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode\n var stream = new StringStream(text, cm.options.tabSize, context)\n stream.start = stream.pos = startAt || 0\n if (text == \"\") { callBlankLine(mode, context.state) }\n while (!stream.eol()) {\n readToken(mode, stream, context.state)\n stream.start = stream.pos\n }\n}\n\nfunction callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state)\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n}\n\nfunction readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode }\n var style = mode.token(stream, state)\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n}\n\nvar Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos\n this.string = stream.current()\n this.type = type || null\n this.state = state\n};\n\n// Utility for getTokenAt and getLineTokens\nfunction takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style\n pos = clipPos(doc, pos)\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise)\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens\n if (asArray) { tokens = [] }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos\n style = readToken(mode, stream, context.state)\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))) }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}\n\nfunction extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/)\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length)\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\"\n if (output[prop] == null)\n { output[prop] = lineClass[2] }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2] }\n } }\n return type\n}\n\n// Run the given mode's parser over a line, calling f for each token.\nfunction runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }\n var curStart = 0, curStyle = null\n var stream = new StringStream(text, cm.options.tabSize, context), style\n var inner = cm.options.addModeClass && [null]\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses) }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false\n if (forceToEnd) { processLine(cm, text, context, stream.pos) }\n stream.pos = text.length\n style = null\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses)\n }\n if (inner) {\n var mName = inner[0].name\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName) }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000)\n f(curStart, curStyle)\n }\n curStyle = style\n }\n stream.start = stream.pos\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000)\n f(pos, curStyle)\n curStart = pos\n }\n}\n\n// Finds the line to start with when starting a parse. Tries to\n// find a line with a stateAfter, so that it can start with a\n// valid state. If that fails, it returns the line with the\n// smallest indentation, which tends to need the least context to\n// parse correctly.\nfunction findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize)\n if (minline == null || minindent > indented) {\n minline = search - 1\n minindent = indented\n }\n }\n return minline\n}\n\nfunction retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n)\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start)\n}\n\n// LINE DATA STRUCTURE\n\n// Line objects. These hold state related to a line, including\n// highlighting info (the styles array).\nvar Line = function(text, markedSpans, estimateHeight) {\n this.text = text\n attachMarkedSpans(this, markedSpans)\n this.height = estimateHeight ? estimateHeight(this) : 1\n};\n\nLine.prototype.lineNo = function () { return lineNo(this) };\neventMixin(Line)\n\n// Change the content (text, markers) of a line. Automatically\n// invalidates cached information and tries to re-estimate the\n// line's height.\nfunction updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text\n if (line.stateAfter) { line.stateAfter = null }\n if (line.styles) { line.styles = null }\n if (line.order != null) { line.order = null }\n detachMarkedSpans(line)\n attachMarkedSpans(line, markedSpans)\n var estHeight = estimateHeight ? estimateHeight(line) : 1\n if (estHeight != line.height) { updateLineHeight(line, estHeight) }\n}\n\n// Detach a line from the document tree and its markers.\nfunction cleanUpLine(line) {\n line.parent = null\n detachMarkedSpans(line)\n}\n\n// Convert a style as returned by a mode (either null, or a string\n// containing one or more styles) to a CSS style. This is cached,\n// and also looks for line-wide styles.\nvar styleToClassCache = {};\nvar styleToClassCacheWithMode = {};\nfunction interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n}\n\n// Render the DOM representation of the text of a line. Also builds\n// up a 'line map', which points at the DOM nodes that represent\n// specific stretches of text, and is used by the measuring code.\n// The returned object contains the DOM node, this map, and\n// information about line-wide styles that were set by the mode.\nfunction buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}\n\nfunction defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\")\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16)\n token.setAttribute(\"aria-label\", token.title)\n return token\n}\n\n// Build up the DOM representation for a single token, and add it to\n// the line map. Takes care to render special characters separately.\nfunction buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text\n var special = builder.cm.state.specialChars, mustWrap = false\n var content\n if (!special.test(text)) {\n builder.col += text.length\n content = document.createTextNode(displayText)\n builder.map.push(builder.pos, builder.pos + text.length, content)\n if (ie && ie_version < 9) { mustWrap = true }\n builder.pos += text.length\n } else {\n content = document.createDocumentFragment()\n var pos = 0\n while (true) {\n special.lastIndex = pos\n var m = special.exec(text)\n var skipped = m ? m.index - pos : text.length - pos\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped))\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])) }\n else { content.appendChild(txt) }\n builder.map.push(builder.pos, builder.pos + skipped, txt)\n builder.col += skipped\n builder.pos += skipped\n }\n if (!m) { break }\n pos += skipped + 1\n var txt$1 = (void 0)\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"))\n txt$1.setAttribute(\"role\", \"presentation\")\n txt$1.setAttribute(\"cm-text\", \"\\t\")\n builder.col += tabWidth\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"))\n txt$1.setAttribute(\"cm-text\", m[0])\n builder.col += 1\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0])\n txt$1.setAttribute(\"cm-text\", m[0])\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])) }\n else { content.appendChild(txt$1) }\n builder.col += 1\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1)\n builder.pos++\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\"\n if (startStyle) { fullStyle += startStyle }\n if (endStyle) { fullStyle += endStyle }\n var token = elt(\"span\", [content], fullStyle, css)\n if (title) { token.title = title }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content)\n}\n\nfunction splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\"\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i)\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\" }\n result += ch\n spaceBefore = ch == \" \"\n }\n return result\n}\n\n// Work around nonsense dimensions being reported for stretches of\n// right-to-left text.\nfunction buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, title, css) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\"\n var start = builder.pos, end = start + text.length\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0)\n for (var i = 0; i < order.length; i++) {\n part = order[i]\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css)\n startStyle = null\n text = text.slice(part.to - start)\n start = part.to\n }\n }\n}\n\nfunction buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")) }\n widget.setAttribute(\"cm-marker\", marker.id)\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget)\n builder.content.appendChild(widget)\n }\n builder.pos += size\n builder.trailingSpace = false\n}\n\n// Outputs a number of spans to make up a line, taking highlighting\n// and marked text into account.\nfunction insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}\n\n\n// These objects are used to represent the visible (currently drawn)\n// part of the document. A LineView may correspond to multiple\n// logical lines, if those are connected by collapsed ranges.\nfunction LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}\n\n// Create a range of LineView objects for the given lines.\nfunction buildViewArray(cm, from, to) {\n var array = [], nextPos\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)\n nextPos = pos + view.size\n array.push(view)\n }\n return array\n}\n\nvar operationGroup = null\n\nfunction pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op)\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n }\n }\n}\n\nfunction fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null) }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j]\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } }\n }\n } while (i < callbacks.length)\n}\n\nfunction finishOperation(op, endCb) {\n var group = op.ownsGroup\n if (!group) { return }\n\n try { fireCallbacksForOps(group) }\n finally {\n operationGroup = null\n endCb(group)\n }\n}\n\nvar orphanDelayedCallbacks = null\n\n// Often, we want to signal events at a point where we are in the\n// middle of some work, but don't want the handler to start calling\n// other methods on the editor, which might be in an inconsistent\n// state or simply not expect any other events to happen.\n// signalLater looks whether there are any handlers, and schedules\n// them to be executed when the last operation ends, or, if no\n// operation is active, when a timeout fires.\nfunction signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type)\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list\n if (operationGroup) {\n list = operationGroup.delayedCallbacks\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks\n } else {\n list = orphanDelayedCallbacks = []\n setTimeout(fireOrphanDelayed, 0)\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); })\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}\n\nfunction fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks\n orphanDelayedCallbacks = null\n for (var i = 0; i < delayed.length; ++i) { delayed[i]() }\n}\n\n// When an aspect of a line changes, a string is added to\n// lineView.changes. This updates the relevant part of the line's\n// DOM structure.\nfunction updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j]\n if (type == \"text\") { updateLineText(cm, lineView) }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims) }\n else if (type == \"class\") { updateLineClasses(cm, lineView) }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims) }\n }\n lineView.changes = null\n}\n\n// Lines with gutter elements, widgets or a background class need to\n// be wrapped, and have the extra elements added to the wrapper div\nfunction ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\")\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) }\n lineView.node.appendChild(lineView.text)\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 }\n }\n return lineView.node\n}\n\nfunction updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass\n if (cls) { cls += \" CodeMirror-linebackground\" }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView)\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild)\n cm.display.input.setUneditable(lineView.background)\n }\n}\n\n// Wrapper around buildLineContent which will reuse the structure\n// in display.externalMeasured when possible.\nfunction getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}\n\n// Redraw the line's text. Interacts with the background and text\n// classes because the mode may output tokens that influence these\n// classes.\nfunction updateLineText(cm, lineView) {\n var cls = lineView.text.className\n var built = getLineContent(cm, lineView)\n if (lineView.text == lineView.node) { lineView.node = built.pre }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text)\n lineView.text = built.pre\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass\n lineView.textClass = built.textClass\n updateLineClasses(cm, lineView)\n } else if (cls) {\n lineView.text.className = cls\n }\n}\n\nfunction updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView)\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\" }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass\n lineView.text.className = textClass || \"\"\n}\n\nfunction updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter)\n lineView.gutter = null\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground)\n lineView.gutterBackground = null\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView)\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"))\n cm.display.input.setUneditable(lineView.gutterBackground)\n wrap.insertBefore(lineView.gutterBackground, lineView.text)\n }\n var markers = lineView.line.gutterMarkers\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView)\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"))\n cm.display.input.setUneditable(gutterWrap)\n wrap$1.insertBefore(gutterWrap, lineView.text)\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))) }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))) }\n } }\n }\n}\n\nfunction updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node) }\n }\n insertLineWidgets(cm, lineView, dims)\n}\n\n// Build a line's DOM representation from scratch\nfunction buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(cm, lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}\n\n// A lineView may contain multiple logical lines (when merged by\n// collapsed spans). The widgets for all of them need to be drawn.\nfunction insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }\n}\n\nfunction insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView)\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\")\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\") }\n positionLineWidget(widget, node, lineView, dims)\n cm.display.input.setUneditable(node)\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text) }\n else\n { wrap.appendChild(node) }\n signalLater(widget, \"redraw\")\n }\n}\n\nfunction positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n ;(lineView.alignable || (lineView.alignable = [])).push(node)\n var width = dims.wrapperWidth\n node.style.left = dims.fixedPos + \"px\"\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\"\n }\n node.style.width = width + \"px\"\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5\n node.style.position = \"relative\"\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\" }\n }\n}\n\nfunction widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\"\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\" }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\" }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle))\n }\n return widget.height = widget.node.parentNode.offsetHeight\n}\n\n// Return true when the given mouse event happened in a widget\nfunction eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}\n\n// POSITION MEASUREMENT\n\nfunction paddingTop(display) {return display.lineSpace.offsetTop}\nfunction paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\nfunction paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"))\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data }\n return data\n}\n\nfunction scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\nfunction displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n}\nfunction displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n}\n\n// Ensure the lineView.wrapping.heights array is populated. This is\n// an array of bottom offsets for the lines that make up a drawn\n// line. When lineWrapping is on, there might be more than one\n// height.\nfunction ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping\n var curWidth = wrapping && displayWidth(cm)\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = []\n if (wrapping) {\n lineView.measure.width = curWidth\n var rects = lineView.text.firstChild.getClientRects()\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1]\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top) }\n }\n }\n heights.push(rect.bottom - rect.top)\n }\n}\n\n// Find a line map (mapping character offsets to text nodes) and a\n// measurement cache for the given line number. (A line view might\n// contain multiple lines when collapsed ranges are present.)\nfunction mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}\n\n// Render a line into the hidden node display.externalMeasured. Used\n// when measurement is needed for a line that's not in the viewport.\nfunction updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}\n\n// Get a {top, bottom, left, right} box (in line-local coordinates)\n// for a given character.\nfunction measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n}\n\n// Find a line view that corresponds to the given line number.\nfunction findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}\n\n// Measurement can be split in two steps, the set-up work that\n// applies to the whole line, and the measurement of the actual\n// character. Functions like coordsChar, that need to do a lot of\n// measurements in a row, can thus ensure that the set-up work is\n// only done once.\nfunction prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line)\n var view = findViewForLine(cm, lineN)\n if (view && !view.text) {\n view = null\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm))\n cm.curOp.forceUpdate = true\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line) }\n\n var info = mapFromLineView(view, line, lineN)\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}\n\n// Given a prepared measurement object, measures the position of an\n// actual character (or fetches it from the cache).\nfunction measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1 }\n var key = ch + (bias || \"\"), found\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key]\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect() }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect)\n prepared.hasHeights = true\n }\n found = measureCharInner(cm, prepared, ch, bias)\n if (!found.bogus) { prepared.cache[key] = found }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}\n\nvar nullRect = {left: 0, right: 0, top: 0, bottom: 0}\n\nfunction nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i]\n mEnd = map[i + 1]\n if (ch < mStart) {\n start = 0; end = 1\n collapse = \"left\"\n } else if (ch < mEnd) {\n start = ch - mStart\n end = start + 1\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart\n start = end - 1\n if (ch >= mEnd) { collapse = \"right\" }\n }\n if (start != null) {\n node = map[i + 2]\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2]\n collapse = \"left\"\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2]\n collapse = \"right\"\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n}\n\nfunction getUsefulRect(rects, bias) {\n var rect = nullRect\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n}\n\nfunction measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias)\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse\n\n var rect\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect() }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias) }\n if (rect.left || rect.right || start == 0) { break }\n end = start\n start = start - 1\n collapse = \"right\"\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\" }\n var rects\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0] }\n else\n { rect = node.getBoundingClientRect() }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0]\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} }\n else\n { rect = nullRect }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top\n var mid = (rtop + rbot) / 2\n var heights = prepared.view.measure.heights\n var i = 0\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i]\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot}\n if (!rect.left && !rect.right) { result.bogus = true }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot }\n\n return result\n}\n\n// Work around problem with bounding client rects on ranges being\n// returned incorrectly when zoomed on IE10 and below.\nfunction maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI\n var scaleY = screen.logicalYDPI / screen.deviceYDPI\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n}\n\nfunction clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {}\n lineView.measure.heights = null\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {} } }\n }\n}\n\nfunction clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null\n removeChildren(cm.display.lineMeasure)\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]) }\n}\n\nfunction clearCaches(cm) {\n clearLineMeasurementCache(cm)\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true }\n cm.display.lineNumChars = null\n}\n\nfunction pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n}\nfunction pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n}\n\n// Converts a {top, bottom, left, right} box from line-local\n// coordinates into another coordinate system. Context may be one of\n// \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n// or \"page\".\nfunction intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets && lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i])\n rect.top += size; rect.bottom += size\n } } }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\" }\n var yOff = heightAtLine(lineObj)\n if (context == \"local\") { yOff += paddingTop(cm.display) }\n else { yOff -= cm.display.viewOffset }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect()\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY())\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX())\n rect.left += xOff; rect.right += xOff\n }\n rect.top += yOff; rect.bottom += yOff\n return rect\n}\n\n// Coverts a box from \"div\" coords to another coordinate system.\n// Context may be \"window\", \"page\", \"div\", or \"local\"./null.\nfunction fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX()\n top -= pageScrollY()\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect()\n left += localBox.left\n top += localBox.top\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect()\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}\n\nfunction charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line) }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n}\n\n// Returns a box for a given cursor position, which may have an\n// 'other' property containing the position of the secondary cursor\n// on a bidi boundary.\n// A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n// and after `char - 1` in writing order of `char - 1`\n// A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n// and before `char` in writing order of `char`\n// Examples (upper-case letters are RTL, lower-case are LTR):\n// Pos(0, 1, ...)\n// before after\n// ab a|b a|b\n// aB a|B aB|\n// Ab |Ab A|b\n// AB B|A B|A\n// Every position after the last character on a line is considered to stick\n// to the last character on the line.\nfunction cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line)\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight)\n if (right) { m.left = m.right; } else { m.right = m.left }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length\n sticky = \"before\"\n } else if (ch <= 0) {\n ch = 0\n sticky = \"after\"\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = (part.level % 2) != 0\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky)\n var other = bidiOther\n var val = getBidi(ch, partPos, sticky == \"before\")\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\") }\n return val\n}\n\n// Used to cheaply estimate the coordinates for a position. Used for\n// intermediate scroll updates.\nfunction estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}\n\n// Positions returned by coordsChar contain some extra information.\n// xRel is the relative x position of the input coordinates compared\n// to the found position (so xRel > 0 means the coordinates are to\n// the right of the character position, for example). When outside\n// is true, that means the coordinates lie outside the line's\n// vertical range.\nfunction PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky)\n pos.xRel = xRel\n if (outside) { pos.outside = true }\n return pos\n}\n\n// Compute the character position closest to the given coordinates.\n// Input must be lineSpace-local (\"div\" coordinate system).\nfunction coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}\n\nfunction wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n var measure = function (ch) { return intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), \"line\"); }\n var end = lineObj.text.length\n var begin = findFirst(function (ch) { return measure(ch - 1).bottom <= y; }, end, 0)\n end = findFirst(function (ch) { return measure(ch).top > y; }, begin, end)\n return {begin: begin, end: end}\n}\n\nfunction wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n}\n\nfunction coordsCharInner(cm, lineObj, lineNo, x, y) {\n y -= heightAtLine(lineObj)\n var begin = 0, end = lineObj.text.length\n var preparedMeasure = prepareMeasureForLine(cm, lineObj)\n var pos\n var order = getOrder(lineObj, cm.doc.direction)\n if (order) {\n if (cm.options.lineWrapping) {\n ;var assign;\n ((assign = wrappedLineExtent(cm, lineObj, preparedMeasure, y), begin = assign.begin, end = assign.end, assign))\n }\n pos = new Pos(lineNo, Math.floor(begin + (end - begin) / 2))\n var beginLeft = cursorCoords(cm, pos, \"line\", lineObj, preparedMeasure).left\n var dir = beginLeft < x ? 1 : -1\n var prevDiff, diff = beginLeft - x, prevPos\n var steps = Math.ceil((end - begin) / 4)\n outer: do {\n prevDiff = diff\n prevPos = pos\n var i = 0\n for (; i < steps; ++i) {\n var prevPos$1 = pos\n pos = moveVisually(cm, lineObj, pos, dir)\n if (pos == null || pos.ch < begin || end <= (pos.sticky == \"before\" ? pos.ch - 1 : pos.ch)) {\n pos = prevPos$1\n break outer\n }\n }\n diff = cursorCoords(cm, pos, \"line\", lineObj, preparedMeasure).left - x\n if (steps > 1) {\n var diff_change_per_step = Math.abs(diff - prevDiff) / steps\n steps = Math.min(steps, Math.ceil(Math.abs(diff) / diff_change_per_step))\n dir = diff < 0 ? 1 : -1\n }\n } while (diff != 0 && (steps > 1 || ((dir < 0) != (diff < 0) && (Math.abs(diff) <= Math.abs(prevDiff)))))\n if (Math.abs(diff) > Math.abs(prevDiff)) {\n if ((diff < 0) == (prevDiff < 0)) { throw new Error(\"Broke out of infinite loop in coordsCharInner\") }\n pos = prevPos\n }\n } else {\n var ch = findFirst(function (ch) {\n var box = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), \"line\")\n if (box.top > y) {\n // For the cursor stickiness\n end = Math.min(ch, end)\n return true\n }\n else if (box.bottom <= y) { return false }\n else if (box.left > x) { return true }\n else if (box.right < x) { return false }\n else { return (x - box.left < box.right - x) }\n }, begin, end)\n ch = skipExtendingChars(lineObj.text, ch, 1)\n pos = new Pos(lineNo, ch, ch == end ? \"before\" : \"after\")\n }\n var coords = cursorCoords(cm, pos, \"line\", lineObj, preparedMeasure)\n if (y < coords.top || coords.bottom < y) { pos.outside = true }\n pos.xRel = x < coords.left ? -1 : (x > coords.right ? 1 : 0)\n return pos\n}\n\nvar measureText\n// Compute the default text height.\nfunction textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\")\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"))\n measureText.appendChild(elt(\"br\"))\n }\n measureText.appendChild(document.createTextNode(\"x\"))\n }\n removeChildrenAndAdd(display.measure, measureText)\n var height = measureText.offsetHeight / 50\n if (height > 3) { display.cachedTextHeight = height }\n removeChildren(display.measure)\n return height || 1\n}\n\n// Compute the default character width.\nfunction charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\")\n var pre = elt(\"pre\", [anchor])\n removeChildrenAndAdd(display.measure, pre)\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n if (width > 2) { display.cachedCharWidth = width }\n return width || 10\n}\n\n// Do a bulk-read of the DOM positions and sizes needed to draw the\n// view, so that we don't interleave reading and writing to the DOM.\nfunction getDimensions(cm) {\n var d = cm.display, left = {}, width = {}\n var gutterLeft = d.gutters.clientLeft\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft\n width[cm.options.gutters[i]] = n.clientWidth\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n}\n\n// Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n// but using getBoundingClientRect to get a sub-pixel-accurate\n// result.\nfunction compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}\n\n// Returns a function that estimates the height of a line, to use as\n// first approximation until the line becomes visible (and is thus\n// properly measurable).\nfunction estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3)\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}\n\nfunction estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm)\n doc.iter(function (line) {\n var estHeight = est(line)\n if (estHeight != line.height) { updateLineHeight(line, estHeight) }\n })\n}\n\n// Given a mouse event, find the corresponding position. If liberal\n// is false, it checks whether a gutter or scrollbar was clicked,\n// and returns null if it was. forRect is used by rectangular\n// selections, and tries to estimate a character position even for\n// coordinates beyond the right of the text.\nfunction posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect()\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))\n }\n return coords\n}\n\n// Find the view element corresponding to a given line. Return null\n// when the line isn't visible.\nfunction findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom\n if (n < 0) { return null }\n var view = cm.display.view\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size\n if (n < 0) { return i }\n }\n}\n\nfunction updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection())\n}\n\nfunction prepareSelection(cm, primary) {\n var doc = cm.doc, result = {}\n var curFragment = result.cursors = document.createDocumentFragment()\n var selFragment = result.selection = document.createDocumentFragment()\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (primary === false && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i]\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty()\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range.head, curFragment) }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment) }\n }\n return result\n}\n\n// Draws a cursor for the given range\nfunction drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine)\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"))\n cursor.style.left = pos.left + \"px\"\n cursor.style.top = pos.top + \"px\"\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\"\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"))\n otherCursor.style.display = \"\"\n otherCursor.style.left = pos.other.left + \"px\"\n otherCursor.style.top = pos.other.top + \"px\"\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\"\n }\n}\n\n// Draws the given range as a highlighted selection\nfunction drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc\n var fragment = document.createDocumentFragment()\n var padding = paddingH(cm.display), leftSide = padding.left\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0 }\n top = Math.round(top)\n bottom = Math.round(bottom)\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")))\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line)\n var lineLen = lineObj.text.length\n var start, end\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right\n if (from == to) {\n rightPos = leftPos\n left = right = leftPos.left\n } else {\n rightPos = coords(to - 1, \"right\")\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }\n left = leftPos.left\n right = rightPos.right\n }\n if (fromArg == null && from == 0) { left = leftSide }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom)\n left = leftSide\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }\n }\n if (toArg == null && to == lineLen) { right = rightSide }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos }\n if (left < leftSide + 1) { left = leftSide }\n add(left, rightPos.top, right - left, rightPos.bottom)\n })\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to()\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch)\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)\n var singleVLine = visualLine(fromLine) == visualLine(toLine)\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top) }\n }\n\n output.appendChild(fragment)\n}\n\n// Cursor-blinking\nfunction restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display\n clearInterval(display.blinker)\n var on = true\n display.cursorDiv.style.visibility = \"\"\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate) }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\" }\n}\n\nfunction ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) }\n}\n\nfunction delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false\n onBlur(cm)\n } }, 100)\n}\n\nfunction onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e)\n cm.state.focused = true\n addClass(cm.display.wrapper, \"CodeMirror-focused\")\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset()\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730\n }\n cm.display.input.receivedFocus()\n }\n restartBlink(cm)\n}\nfunction onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e)\n cm.state.focused = false\n rmClass(cm.display.wrapper, \"CodeMirror-focused\")\n }\n clearInterval(cm.display.blinker)\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150)\n}\n\n// Read the actual heights of the rendered lines, and update their\n// stored heights to match.\nfunction updateHeightsInViewport(cm) {\n var display = cm.display\n var prevBottom = display.lineDiv.offsetTop\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0)\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight\n height = bot - prevBottom\n prevBottom = bot\n } else {\n var box = cur.node.getBoundingClientRect()\n height = box.bottom - box.top\n }\n var diff = cur.line.height - height\n if (height < 2) { height = textHeight(display) }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height)\n updateWidgetHeight(cur.line)\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]) } }\n }\n }\n}\n\n// Read and store the height of line widgets associated with the\n// given line.\nfunction updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}\n\n// Compute the lines that are visible in a given viewport (defaults\n// the the current scroll position). viewport may contain top,\n// height, and ensure (see op.scrollToPos) properties.\nfunction visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}\n\n// Re-align line numbers and gutter marks to compensate for\n// horizontal scrolling.\nfunction alignHorizontally(cm) {\n var display = cm.display, view = display.view\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\"\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left }\n }\n var align = view[i].alignable\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\" }\n}\n\n// Used to ensure that the line number gutter is still the right\n// size for the current document size. Returns true when an update\n// is needed.\nfunction maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"))\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW\n display.lineGutter.style.width = \"\"\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1\n display.lineNumWidth = display.lineNumInnerWidth + padding\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1\n display.lineGutter.style.width = display.lineNumWidth + \"px\"\n updateGutterSpace(cm)\n return true\n }\n return false\n}\n\n// SCROLLING THINGS INTO VIEW\n\n// If an editor sits on the top or bottom of the window, partially\n// scrolled out of view, this ensures that the cursor is visible.\nfunction maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null\n if (rect.top + box.top < 0) { doScroll = true }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"))\n cm.display.lineSpace.appendChild(scrollNode)\n scrollNode.scrollIntoView(doScroll)\n cm.display.lineSpace.removeChild(scrollNode)\n }\n}\n\n// Scroll a given position into view (immediately), verifying that\n// it actually became visible (as line heights are accurately\n// measured, the position of something may 'drift' during drawing).\nfunction scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0 }\n var rect\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false\n var coords = cursorCoords(cm, pos)\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin}\n var scrollPos = calculateScrollPos(cm, rect)\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop)\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft)\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }\n }\n if (!changed) { break }\n }\n return rect\n}\n\n// Scroll a given set of coordinates into view (immediately).\nfunction scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect)\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop) }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }\n}\n\n// Calculate a new scroll position needed to scroll the given\n// rectangle into view. Returns an object with scrollTop and\n// scrollLeft properties. When these are undefined, the\n// vertical/horizontal position does not need to be adjusted.\nfunction calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display)\n if (rect.top < 0) { rect.top = 0 }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop\n var screen = displayHeight(cm), result = {}\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen }\n var docBottom = cm.doc.height + paddingVert(display)\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen)\n if (newTop != screentop) { result.scrollTop = newTop }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)\n var tooWide = rect.right - rect.left > screenw\n if (tooWide) { rect.right = rect.left + screenw }\n if (rect.left < 10)\n { result.scrollLeft = 0 }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)) }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw }\n return result\n}\n\n// Store a relative adjustment to the scroll position in the current\n// operation (to be applied when the operation finishes).\nfunction addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top\n}\n\n// Make sure that at the end of the operation the current cursor is\n// shown.\nfunction ensureCursorVisible(cm) {\n resolveScrollToPos(cm)\n var cur = cm.getCursor()\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}\n}\n\nfunction scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm) }\n if (x != null) { cm.curOp.scrollLeft = x }\n if (y != null) { cm.curOp.scrollTop = y }\n}\n\nfunction scrollToRange(cm, range) {\n resolveScrollToPos(cm)\n cm.curOp.scrollToPos = range\n}\n\n// When an operation has its scrollToPos property set, and another\n// scroll action is applied before the end of the operation, this\n// 'simulates' scrolling that position into view in a cheap way, so\n// that the effect of intermediate scroll commands is not ignored.\nfunction resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos\n if (range) {\n cm.curOp.scrollToPos = null\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)\n scrollToCoordsRange(cm, from, to, range.margin)\n }\n}\n\nfunction scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n })\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop)\n}\n\n// Sync the scrollable area and scrollbars, ensure the viewport\n// covers the visible area.\nfunction updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}) }\n setScrollTop(cm, val, true)\n if (gecko) { updateDisplaySimple(cm) }\n startWorker(cm, 100)\n}\n\nfunction setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val\n cm.display.scrollbars.setScrollTop(val)\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val }\n}\n\n// Sync scroller and scrollbar, ensure the gutter elements are\n// aligned.\nfunction setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val\n alignHorizontally(cm)\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val }\n cm.display.scrollbars.setScrollLeft(val)\n}\n\n// SCROLLBARS\n\n// Prepare DOM reads needed to update the scrollbars. Done in one\n// shot to minimize update/measure roundtrips.\nfunction measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth\n var docH = Math.round(cm.doc.height + paddingVert(cm.display))\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n}\n\nvar NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\")\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\")\n place(vert); place(horiz)\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\") }\n })\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\") }\n })\n\n this.checkedZeroWidth = false\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\" }\n};\n\nNativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1\n var needsV = measure.scrollHeight > measure.clientHeight + 1\n var sWidth = measure.nativeBarWidth\n\n if (needsV) {\n this.vert.style.display = \"block\"\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\"\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0)\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\"\n } else {\n this.vert.style.display = \"\"\n this.vert.firstChild.style.height = \"0\"\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\"\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\"\n this.horiz.style.left = measure.barLeft + \"px\"\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0)\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\"\n } else {\n this.horiz.style.display = \"\"\n this.horiz.firstChild.style.width = \"0\"\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack() }\n this.checkedZeroWidth = true\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n};\n\nNativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\") }\n};\n\nNativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\") }\n};\n\nNativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\"\n this.horiz.style.height = this.vert.style.width = w\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\"\n this.disableHoriz = new Delayed\n this.disableVert = new Delayed\n};\n\nNativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\"\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect()\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1)\n if (elt != bar) { bar.style.pointerEvents = \"none\" }\n else { delay.set(1000, maybeDisable) }\n }\n delay.set(1000, maybeDisable)\n};\n\nNativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode\n parent.removeChild(this.horiz)\n parent.removeChild(this.vert)\n};\n\nvar NullScrollbars = function () {};\n\nNullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\nNullScrollbars.prototype.setScrollLeft = function () {};\nNullScrollbars.prototype.setScrollTop = function () {};\nNullScrollbars.prototype.clear = function () {};\n\nfunction updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm) }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight\n updateScrollbarsInner(cm, measure)\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm) }\n updateScrollbarsInner(cm, measureForScrollbars(cm))\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight\n }\n}\n\n// Re-synchronize the fake scrollbars with the actual size of the\n// content.\nfunction updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}\n\nvar scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars}\n\nfunction initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear()\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller)\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) }\n })\n node.setAttribute(\"cm-not-content\", \"true\")\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos) }\n else { updateScrollTop(cm, pos) }\n }, cm)\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) }\n}\n\n// Operations are used to wrap a series of changes to the editor\n// state in such a way that each change won't have to update the\n// cursor and display (which would be awkward, slow, and\n// error-prone). Instead, display updates are batched and then all\n// combined and executed at once.\n\nvar nextOpId = 0\n// Start a new operation.\nfunction startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n }\n pushOperation(cm.curOp)\n}\n\n// Finish an operation, updating the display and signalling delayed events\nfunction endOperation(cm) {\n var op = cm.curOp\n finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null }\n endOperations(group)\n })\n}\n\n// The DOM updates done when an operation finishes are batched so\n// that the minimum number of relayouts are required.\nfunction endOperations(group) {\n var ops = group.ops\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]) }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]) }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]) }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]) }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]) }\n}\n\nfunction endOperation_R1(op) {\n var cm = op.cm, display = cm.display\n maybeClipScrollbars(cm)\n if (op.updateMaxLine) { findMaxLine(cm) }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate)\n}\n\nfunction endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update)\n}\n\nfunction endOperation_R2(op) {\n var cm = op.cm, display = cm.display\n if (op.updatedDisplay) { updateHeightsInViewport(cm) }\n\n op.barMeasure = measureForScrollbars(cm)\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3\n cm.display.sizerWidth = op.adjustWidthTo\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth)\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm))\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(op.focus) }\n}\n\nfunction endOperation_W2(op) {\n var cm = op.cm\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\"\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) }\n cm.display.maxLineChanged = false\n }\n\n var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus) }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure) }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure) }\n\n if (op.selectionChanged) { restartBlink(cm) }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing) }\n if (takeFocus) { ensureFocus(op.cm) }\n}\n\nfunction endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll) }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true) }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin)\n maybeScrollWindow(cm, rect)\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\") } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\") } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs) }\n if (op.update)\n { op.update.finish() }\n}\n\n// Run the given function in an operation\nfunction runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm)\n try { return f() }\n finally { endOperation(cm) }\n}\n// Wraps a function in an operation. Returns the wrapped function.\nfunction operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm)\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm) }\n }\n}\n// Used to add methods to editor and doc instances, wrapping them in\n// operations.\nfunction methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this)\n try { return f.apply(this, arguments) }\n finally { endOperation(this) }\n }\n}\nfunction docMethodOp(f) {\n return function() {\n var cm = this.cm\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm)\n try { return f.apply(this, arguments) }\n finally { endOperation(cm) }\n }\n}\n\n// Updates the display.view data structure for a given change to the\n// document. From and to are in pre-change coordinates. Lendiff is\n// the amount of lines added or subtracted by the change. This is\n// used for changes that span multiple lines, or change the way\n// lines are divided into visual lines. regLineChange (below)\n// registers single-line changes.\nfunction regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first }\n if (to == null) { to = cm.doc.first + cm.doc.size }\n if (!lendiff) { lendiff = 0 }\n\n var display = cm.display\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from }\n\n cm.curOp.viewChanged = true\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm) }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm)\n } else {\n display.viewFrom += lendiff\n display.viewTo += lendiff\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm)\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1)\n if (cut) {\n display.view = display.view.slice(cut.index)\n display.viewFrom = cut.lineN\n display.viewTo += lendiff\n } else {\n resetView(cm)\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1)\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index)\n display.viewTo = cut$1.lineN\n } else {\n resetView(cm)\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1)\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1)\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index))\n display.viewTo += lendiff\n } else {\n resetView(cm)\n }\n }\n\n var ext = display.externalMeasured\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null }\n }\n}\n\n// Register a change to a single line. Type must be one of \"text\",\n// \"gutter\", \"class\", \"widget\"\nfunction regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true\n var display = cm.display, ext = cm.display.externalMeasured\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)]\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = [])\n if (indexOf(arr, type) == -1) { arr.push(type) }\n}\n\n// Clear the view.\nfunction resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first\n cm.display.view = []\n cm.display.viewOffset = 0\n}\n\nfunction viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom\n for (var i = 0; i < index; i++)\n { n += view[i].size }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN\n index++\n } else {\n diff = n - oldN\n }\n oldN += diff; newN += diff\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size\n index += dir\n }\n return {index: index, lineN: newN}\n}\n\n// Force the view to cover a given range, adding empty view element\n// or clipping off existing ones as needed.\nfunction adjustView(cm, from, to) {\n var display = cm.display, view = display.view\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to)\n display.viewFrom = from\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)) }\n display.viewFrom = from\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)) }\n }\n display.viewTo = to\n}\n\n// Count the number of lines in the view whose DOM representation is\n// out of date (or nonexistent).\nfunction countDirtyView(cm) {\n var view = cm.display.view, dirty = 0\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i]\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty }\n }\n return dirty\n}\n\n// HIGHLIGHT WORKER\n\nfunction startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)) }\n}\n\nfunction highlightWorker(cm) {\n var doc = cm.doc\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime\n var context = getContextBefore(cm, doc.highlightFrontier)\n var changedLines = []\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null\n var highlighted = highlightLine(cm, line, context, true)\n if (resetState) { context.state = resetState }\n line.styles = highlighted.styles\n var oldCls = line.styleClasses, newCls = highlighted.classes\n if (newCls) { line.styleClasses = newCls }\n else if (oldCls) { line.styleClasses = null }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass)\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] }\n if (ischange) { changedLines.push(context.line) }\n line.stateAfter = context.save()\n context.nextLine()\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context) }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null\n context.nextLine()\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay)\n return true\n }\n })\n doc.highlightFrontier = context.line\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line)\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\") }\n }) }\n}\n\n// DISPLAY DRAWING\n\nvar DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display\n\n this.viewport = viewport\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport)\n this.editorIsHidden = !display.wrapper.offsetWidth\n this.wrapperHeight = display.wrapper.clientHeight\n this.wrapperWidth = display.wrapper.clientWidth\n this.oldDisplayWidth = displayWidth(cm)\n this.force = force\n this.dims = getDimensions(cm)\n this.events = []\n};\n\nDisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments) }\n};\nDisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]) }\n};\n\nfunction maybeClipScrollbars(cm) {\n var display = cm.display\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth\n display.heightForcer.style.height = scrollGap(cm) + \"px\"\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\"\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\"\n display.scrollbarsClipped = true\n }\n}\n\nfunction selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt()\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active}\n if (window.getSelection) {\n var sel = window.getSelection()\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode\n result.anchorOffset = sel.anchorOffset\n result.focusNode = sel.focusNode\n result.focusOffset = sel.focusOffset\n }\n }\n return result\n}\n\nfunction restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus()\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range = document.createRange()\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset)\n range.collapse(false)\n sel.removeAllRanges()\n sel.addRange(range)\n sel.extend(snapshot.focusNode, snapshot.focusOffset)\n }\n}\n\n// Does the actual updating of the line display. Bails out\n// (returning false) when there is nothing to be done and forced is\n// false.\nfunction updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc\n\n if (update.editorIsHidden) {\n resetView(cm)\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm)\n update.dims = getDimensions(cm)\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin)\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from)\n to = visualLineEndNo(cm.doc, to)\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth\n adjustView(cm, from, to)\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\"\n\n var toUpdate = countDirtyView(cm)\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm)\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\" }\n patchDisplay(cm, display.updateLineNumbers, update.dims)\n if (toUpdate > 4) { display.lineDiv.style.display = \"\" }\n display.renderedView = display.view\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot)\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv)\n removeChildren(display.selectionDiv)\n display.gutters.style.height = display.sizer.style.minHeight = 0\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight\n display.lastWrapWidth = update.wrapperWidth\n startWorker(cm, 400)\n }\n\n display.updateLineNumbers = null\n\n return true\n}\n\nfunction postUpdateDisplay(cm, update) {\n var viewport = update.viewport\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport)\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm)\n var barMeasure = measureForScrollbars(cm)\n updateSelection(cm)\n updateScrollbars(cm, barMeasure)\n setDocumentHeight(cm, barMeasure)\n update.force = false\n }\n\n update.signal(cm, \"update\", cm)\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo)\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo\n }\n}\n\nfunction updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport)\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm)\n postUpdateDisplay(cm, update)\n var barMeasure = measureForScrollbars(cm)\n updateSelection(cm)\n updateScrollbars(cm, barMeasure)\n setDocumentHeight(cm, barMeasure)\n update.finish()\n }\n}\n\n// Sync the actual display DOM structure with display.view, removing\n// nodes for lines that are no longer in view, and creating the ones\n// that are not there yet, and updating the ones that are out of\n// date.\nfunction patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers\n var container = display.lineDiv, cur = container.firstChild\n\n function rm(node) {\n var next = node.nextSibling\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\" }\n else\n { node.parentNode.removeChild(node) }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i]\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims)\n container.insertBefore(node, cur)\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur) }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false }\n updateLineForChanges(cm, lineView, lineN, dims)\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber)\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)))\n }\n cur = lineView.node.nextSibling\n }\n lineN += lineView.size\n }\n while (cur) { cur = rm(cur) }\n}\n\nfunction updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth\n cm.display.sizer.style.marginLeft = width + \"px\"\n}\n\nfunction setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\"\n cm.display.heightForcer.style.top = measure.docHeight + \"px\"\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\"\n}\n\n// Rebuild the gutter elements, ensure the margin to the left of the\n// code matches their width.\nfunction updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters\n removeChildren(gutters)\n var i = 0\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i]\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass))\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\"\n }\n }\n gutters.style.display = i ? \"\" : \"none\"\n updateGutterSpace(cm)\n}\n\n// Make sure the gutters options contains the element\n// \"CodeMirror-linenumbers\" when the lineNumbers option is true.\nfunction setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\")\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"])\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0)\n options.gutters.splice(found, 1)\n }\n}\n\nvar wheelSamples = 0;\nvar wheelPixelsPerUnit = null;\n// Fill in a browser-detected starting value on browsers where we\n// know one. These don't have to be accurate -- the result of them\n// being wrong would just be a slight flicker on the first wheel\n// scroll (if it is large enough).\nif (ie) { wheelPixelsPerUnit = -.53 }\nelse if (gecko) { wheelPixelsPerUnit = 15 }\nelse if (chrome) { wheelPixelsPerUnit = -.7 }\nelse if (safari) { wheelPixelsPerUnit = -1/3 }\n\nfunction wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail }\n else if (dy == null) { dy = e.wheelDelta }\n return {x: dx, y: dy}\n}\nfunction wheelEventPixels(e) {\n var delta = wheelEventDelta(e)\n delta.x *= wheelPixelsPerUnit\n delta.y *= wheelPixelsPerUnit\n return delta\n}\n\nfunction onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y\n\n var display = cm.display, scroll = display.scroller\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth\n var canScrollY = scroll.scrollHeight > scroll.clientHeight\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)) }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit))\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e) }\n display.wheelStartX = null // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight\n if (pixels < 0) { top = Math.max(0, top + pixels - 50) }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50) }\n updateDisplaySimple(cm, {top: top, bottom: bot})\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop\n display.wheelDX = dx; display.wheelDY = dy\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX\n var movedY = scroll.scrollTop - display.wheelStartY\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX)\n display.wheelStartX = display.wheelStartY = null\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1)\n ++wheelSamples\n }, 200)\n } else {\n display.wheelDX += dx; display.wheelDY += dy\n }\n }\n}\n\n// Selection objects are immutable. A new one is created every time\n// the selection changes. A selection is one or more non-overlapping\n// (and non-touching) ranges, sorted, and an integer that indicates\n// which one is the primary selection (the one that's scrolled into\n// view, that getCursor returns, etc).\nvar Selection = function(ranges, primIndex) {\n this.ranges = ranges\n this.primIndex = primIndex\n};\n\nSelection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\nSelection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i]\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n};\n\nSelection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = []\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) }\n return new Selection(out, this.primIndex)\n};\n\nSelection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n};\n\nSelection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i]\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n};\n\nvar Range = function(anchor, head) {\n this.anchor = anchor; this.head = head\n};\n\nRange.prototype.from = function () { return minPos(this.anchor, this.head) };\nRange.prototype.to = function () { return maxPos(this.anchor, this.head) };\nRange.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n// Take an unsorted, potentially overlapping set of ranges, and\n// build a selection out of it. 'Consumes' ranges array (modifying\n// it).\nfunction normalizeSelection(ranges, primIndex) {\n var prim = ranges[primIndex]\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); })\n primIndex = indexOf(ranges, prim)\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1]\n if (cmp(prev.to(), cur.from()) >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to())\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head\n if (i <= primIndex) { --primIndex }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to))\n }\n }\n return new Selection(ranges, primIndex)\n}\n\nfunction simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n}\n\n// Compute the position of the end of a change (its 'to' property\n// refers to the pre-change end).\nfunction changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n}\n\n// Adjust a position to refer to the post-change position of the\n// same text, or the end of the change if the change covers it.\nfunction adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }\n return Pos(line, ch)\n}\n\nfunction computeSelAfterChange(doc, change) {\n var out = []\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i]\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)))\n }\n return normalizeSelection(out, doc.sel.primIndex)\n}\n\nfunction offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n}\n\n// Used by replaceSelections to allow moving the selection to the\n// start or around the replaced test. Hint may be \"start\" or \"around\".\nfunction computeReplacedSel(doc, changes, hint) {\n var out = []\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i]\n var from = offsetPos(change.from, oldPrev, newPrev)\n var to = offsetPos(changeEnd(change), oldPrev, newPrev)\n oldPrev = change.to\n newPrev = to\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0\n out[i] = new Range(inv ? to : from, inv ? from : to)\n } else {\n out[i] = new Range(from, from)\n }\n }\n return new Selection(out, doc.sel.primIndex)\n}\n\n// Used to get the editor into a consistent state again when options change.\n\nfunction loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption)\n resetModeState(cm)\n}\n\nfunction resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null }\n if (line.styles) { line.styles = null }\n })\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first\n startWorker(cm, 100)\n cm.state.modeGen++\n if (cm.curOp) { regChange(cm) }\n}\n\n// DOCUMENT DATA STRUCTURE\n\n// By default, updates that start and end at the beginning of a line\n// are treated specially, in order to make the association of line\n// widgets and marker elements with the text behave more intuitive.\nfunction isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n}\n\n// Perform a change on the document data structure.\nfunction updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight)\n signalLater(line, \"change\", line, change)\n }\n function linesFor(start, end) {\n var result = []\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)) }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length))\n doc.remove(text.length, doc.size - text.length)\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1)\n update(lastLine, lastLine.text, lastSpans)\n if (nlines) { doc.remove(from.line, nlines) }\n if (added.length) { doc.insert(from.line, added) }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)\n } else {\n var added$1 = linesFor(1, text.length - 1)\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n doc.insert(from.line + 1, added$1)\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))\n doc.remove(from.line + 1, nlines)\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)\n var added$2 = linesFor(1, text.length - 1)\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }\n doc.insert(from.line + 1, added$2)\n }\n\n signalLater(doc, \"change\", doc, change)\n}\n\n// Call f for all linked documents.\nfunction linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i]\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared)\n propagate(rel.doc, doc, shared)\n } }\n }\n propagate(doc, null, true)\n}\n\n// Attach a document to an editor.\nfunction attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc\n doc.cm = cm\n estimateLineHeights(cm)\n loadMode(cm)\n setDirectionClass(cm)\n if (!cm.options.lineWrapping) { findMaxLine(cm) }\n cm.options.mode = doc.modeOption\n regChange(cm)\n}\n\nfunction setDirectionClass(cm) {\n ;(cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\")\n}\n\nfunction directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm)\n regChange(cm)\n })\n}\n\nfunction History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = []\n this.undoDepth = Infinity\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0\n this.lastOp = this.lastSelOp = null\n this.lastOrigin = this.lastSelOrigin = null\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1\n}\n\n// Create a history change event from an updateDoc-style change\n// object.\nfunction historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)\n return histChange\n}\n\n// Pop all selection events off the end of a history array. Stop at\n// a change event.\nfunction clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array)\n if (last.ranges) { array.pop() }\n else { break }\n }\n}\n\n// Find the top change event in the history. Pop off selection\n// events that are in the way.\nfunction lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done)\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop()\n return lst(hist.done)\n }\n}\n\n// Register a change in the history. Merges changes that are within\n// a single operation, or are close together with an origin that\n// allows merging (starting with \"+\") into a single event.\nfunction addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history\n hist.undone.length = 0\n var time = +new Date, cur\n var last\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes)\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change)\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change))\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done)\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done) }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation}\n hist.done.push(cur)\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift()\n if (!hist.done[0].ranges) { hist.done.shift() }\n }\n }\n hist.done.push(selAfter)\n hist.generation = ++hist.maxGeneration\n hist.lastModTime = hist.lastSelTime = time\n hist.lastOp = hist.lastSelOp = opId\n hist.lastOrigin = hist.lastSelOrigin = change.origin\n\n if (!last) { signal(doc, \"historyAdded\") }\n}\n\nfunction selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0)\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n}\n\n// Called whenever the selection changes, sets the new selection as\n// the pending selection in the history, and pushes the old pending\n// selection into the 'done' array when it was significantly\n// different (in number of selected ranges, emptiness, or time).\nfunction addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel }\n else\n { pushSelectionToHistory(sel, hist.done) }\n\n hist.lastSelTime = +new Date\n hist.lastSelOrigin = origin\n hist.lastSelOp = opId\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone) }\n}\n\nfunction pushSelectionToHistory(sel, dest) {\n var top = lst(dest)\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel) }\n}\n\n// Used to store marked span information in the history.\nfunction attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans }\n ++n\n })\n}\n\n// When un/re-doing restores text containing marked spans, those\n// that have been explicitly cleared should not be restored.\nfunction removeClearedSpans(spans) {\n if (!spans) { return null }\n var out\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }\n else if (out) { out.push(spans[i]) }\n }\n return !out ? spans : out.length ? out : null\n}\n\n// Retrieve and filter the old marked spans stored in a change event.\nfunction getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id]\n if (!found) { return null }\n var nw = []\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])) }\n return nw\n}\n\n// Used for un/re-doing changes from the history. Combines the\n// result of computing the existing spans with the set of spans that\n// existed in the history (so that deleting around a span and then\n// undoing brings back the span).\nfunction mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change)\n var stretched = stretchSpansOverChange(doc, change)\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i]\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j]\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span)\n }\n } else if (stretchCur) {\n old[i] = stretchCur\n }\n }\n return old\n}\n\n// Used both to provide a JSON-safe object in .getHistory, and, when\n// detaching a document, to split the history in two\nfunction copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = []\n for (var i = 0; i < events.length; ++i) {\n var event = events[i]\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event)\n continue\n }\n var changes = event.changes, newChanges = []\n copy.push({changes: newChanges})\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0)\n newChanges.push({from: change.from, to: change.to, text: change.text})\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop]\n delete change[prop]\n }\n } } }\n }\n }\n return copy\n}\n\n// The 'scroll' parameter given to many of these indicated whether\n// the new cursor position should be scrolled into view after\n// modifying the selection.\n\n// If shift is held or the extend flag is set, extends a range to\n// include a given position (and optionally a second position).\n// Otherwise, simply returns the range between the given positions.\n// Used for cursor motion and such.\nfunction extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor\n if (other) {\n var posBefore = cmp(head, anchor) < 0\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head\n head = other\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n}\n\n// Extend the primary selection range, discard the rest.\nfunction extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend) }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options)\n}\n\n// Extend all selections (pos is an array of selections with length\n// equal the number of selections)\nfunction extendSelections(doc, heads, options) {\n var out = []\n var extend = doc.cm && (doc.cm.display.shift || doc.extend)\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend) }\n var newSel = normalizeSelection(out, doc.sel.primIndex)\n setSelection(doc, newSel, options)\n}\n\n// Updates a single range in the selection.\nfunction replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0)\n ranges[i] = range\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)\n}\n\n// Reset the selection to a single range.\nfunction setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options)\n}\n\n// Give beforeSelectionChange handlers a change to influence a\n// selection update.\nfunction filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = []\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)) }\n },\n origin: options && options.origin\n }\n signal(doc, \"beforeSelectionChange\", doc, obj)\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj) }\n if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n}\n\nfunction setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done)\n if (last && last.ranges) {\n done[done.length - 1] = sel\n setSelectionNoUndo(doc, sel, options)\n } else {\n setSelection(doc, sel, options)\n }\n}\n\n// Set a new selection.\nfunction setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options)\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options)\n}\n\nfunction setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options) }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1)\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true))\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm) }\n}\n\nfunction setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true\n signalCursorActivity(doc.cm)\n }\n signalLater(doc, \"cursorActivity\", doc)\n}\n\n// Verify that the selection does not partially select any atomic\n// marked ranges.\nfunction reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false))\n}\n\n// Return a selection that does not partially select any atomic\n// ranges.\nfunction skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i]\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear)\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear)\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i) }\n out[i] = new Range(newAnchor, newHead)\n }\n }\n return out ? normalizeSelection(out, sel.primIndex) : sel\n}\n\nfunction skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line)\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\")\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0)\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1)\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null) }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n}\n\n// Ensure a given position is not inside an atomic range.\nfunction skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true))\n if (!found) {\n doc.cantEdit = true\n return Pos(doc.first, 0)\n }\n return found\n}\n\nfunction movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n}\n\nfunction selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll)\n}\n\n// UPDATING\n\n// Allow \"beforeChange\" event handlers to influence a change\nfunction filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n }\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from) }\n if (to) { obj.to = clipPos(doc, to) }\n if (text) { obj.text = text }\n if (origin !== undefined) { obj.origin = origin }\n } }\n signal(doc, \"beforeChange\", doc, obj)\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj) }\n\n if (obj.canceled) { return null }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n}\n\n// Apply a change to a document, and add it to the document's\n// history, and propagating it to all linked documents.\nfunction makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true)\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to)\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text}) }\n } else {\n makeChangeInner(doc, change)\n }\n}\n\nfunction makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change)\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN)\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change))\n var rebased = []\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change)\n rebased.push(doc.history)\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change))\n })\n}\n\n// Revert a change stored in a document's history.\nfunction makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0\n for (; i < source.length; i++) {\n event = source[i]\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null\n\n for (;;) {\n event = source.pop()\n if (event.ranges) {\n pushSelectionToHistory(event, dest)\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false})\n return\n }\n selAfter = event\n }\n else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = []\n pushSelectionToHistory(selAfter, dest)\n dest.push({changes: antiChanges, generation: hist.generation})\n hist.generation = event.generation || ++hist.maxGeneration\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")\n\n var loop = function ( i ) {\n var change = event.changes[i]\n change.origin = type\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change))\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source)\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change))\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) }\n var rebased = []\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change)\n rebased.push(doc.history)\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change))\n })\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}\n\n// Sub-views need their line numbers shifted when text is added\n// above or below them in the parent document.\nfunction shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex)\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance)\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\") }\n }\n}\n\n// More lower-level change function, handling only a single document\n// (not linked ones).\nfunction makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line))\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line)\n shiftDoc(doc, shift)\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin}\n }\n var last = doc.lastLine()\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin}\n }\n\n change.removed = getBetween(doc, change.from, change.to)\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change) }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) }\n else { updateDoc(doc, change, spans) }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll)\n}\n\n// Handle the interaction of a change to a document with the editor\n// that this document is part of.\nfunction makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to\n\n var recomputeMaxLength = false, checkWidthStart = from.line\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true\n return true\n }\n })\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm) }\n\n updateDoc(doc, change, spans, estimateHeight(cm))\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line)\n if (len > display.maxLineLength) {\n display.maxLine = line\n display.maxLineLength = len\n display.maxLineChanged = true\n recomputeMaxLength = false\n }\n })\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true }\n }\n\n retreatFrontier(doc, from.line)\n startWorker(cm, 400)\n\n var lendiff = change.text.length - (to.line - from.line) - 1\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm) }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\") }\n else\n { regChange(cm, from.line, to.line + 1, lendiff) }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\")\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n }\n if (changeHandler) { signalLater(cm, \"change\", cm, obj) }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) }\n }\n cm.display.selForContextMenu = null\n}\n\nfunction replaceRange(doc, code, from, to, origin) {\n if (!to) { to = from }\n if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp }\n if (typeof code == \"string\") { code = doc.splitLines(code) }\n makeChange(doc, {from: from, to: to, text: code, origin: origin})\n}\n\n// Rebasing/resetting history to deal with externally-sourced changes\n\nfunction rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff\n } else if (from < pos.line) {\n pos.line = from\n pos.ch = 0\n }\n}\n\n// Tries to rebase an array of history events given a change in the\n// document. If the change touches the same lines as the event, the\n// event, and everything 'behind' it, is discarded. If the change is\n// before the event, the event's positions are updated. Uses a\n// copy-on-write scheme for the positions, to avoid having to\n// reallocate them all on every rebase, but also avoid problems with\n// shared position objects being unsafely updated.\nfunction rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff)\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff)\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1]\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch)\n cur.to = Pos(cur.to.line + diff, cur.to.ch)\n } else if (from <= cur.to.line) {\n ok = false\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1)\n i = 0\n }\n }\n}\n\nfunction rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1\n rebaseHistArray(hist.done, from, to, diff)\n rebaseHistArray(hist.undone, from, to, diff)\n}\n\n// Utility for applying a change to a line by handle or number,\n// returning the number and optionally registering the line as\n// changed.\nfunction changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)) }\n else { no = lineNo(handle) }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) }\n return line\n}\n\n// The document is represented as a BTree consisting of leaves, with\n// chunk of lines in them, and branches, with up to ten leaves or\n// other branch nodes below them. The top node is always a branch\n// node, and is the document object itself (meaning it has\n// additional methods and properties).\n//\n// All nodes have parent links. The tree is used both to go from\n// line numbers to line objects, and to go from objects to numbers.\n// It also indexes by height, and is used to convert between height\n// and line object, and to find the total height of the document.\n//\n// See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\nfunction LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines\n this.parent = null\n var height = 0\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1\n height += lines[i].height\n }\n this.height = height\n}\n\nLeafChunk.prototype = {\n chunkSize: function chunkSize() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function removeInner(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i]\n this$1.height -= line.height\n cleanUpLine(line)\n signalLater(line, \"delete\")\n }\n this.lines.splice(at, n)\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function collapse(lines) {\n lines.push.apply(lines, this.lines)\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function insertInner(at, lines, height) {\n var this$1 = this;\n\n this.height += height\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at))\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function iterN(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n}\n\nfunction BranchChunk(children) {\n var this$1 = this;\n\n this.children = children\n var size = 0, height = 0\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i]\n size += ch.chunkSize(); height += ch.height\n ch.parent = this$1\n }\n this.size = size\n this.height = height\n this.parent = null\n}\n\nBranchChunk.prototype = {\n chunkSize: function chunkSize() { return this.size },\n\n removeInner: function removeInner(at, n) {\n var this$1 = this;\n\n this.size -= n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize()\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height\n child.removeInner(at, rm)\n this$1.height -= oldHeight - child.height\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null }\n if ((n -= rm) == 0) { break }\n at = 0\n } else { at -= sz }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = []\n this.collapse(lines)\n this.children = [new LeafChunk(lines)]\n this.children[0].parent = this\n }\n },\n\n collapse: function collapse(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) }\n },\n\n insertInner: function insertInner(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length\n this.height += height\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize()\n if (at <= sz) {\n child.insertInner(at, lines, height)\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25))\n child.height -= leaf.height\n this$1.children.splice(++i, 0, leaf)\n leaf.parent = this$1\n }\n child.lines = child.lines.slice(0, remaining)\n this$1.maybeSpill()\n }\n break\n }\n at -= sz\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function maybeSpill() {\n if (this.children.length <= 10) { return }\n var me = this\n do {\n var spilled = me.children.splice(me.children.length - 5, 5)\n var sibling = new BranchChunk(spilled)\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children)\n copy.parent = me\n me.children = [copy, sibling]\n me = copy\n } else {\n me.size -= sibling.size\n me.height -= sibling.height\n var myIndex = indexOf(me.parent.children, me)\n me.parent.children.splice(myIndex + 1, 0, sibling)\n }\n sibling.parent = me.parent\n } while (me.children.length > 10)\n me.parent.maybeSpill()\n },\n\n iterN: function iterN(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize()\n if (at < sz) {\n var used = Math.min(n, sz - at)\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0\n } else { at -= sz }\n }\n }\n}\n\n// Line widgets are block elements displayed above or below a line.\n\nvar LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt] } } }\n this.doc = doc\n this.node = node\n};\n\nLineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line)\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } }\n if (!ws.length) { line.widgets = null }\n var height = widgetHeight(this)\n updateLineHeight(line, Math.max(0, line.height - height))\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height)\n regLineChange(cm, no, \"widget\")\n })\n signalLater(cm, \"lineWidgetCleared\", cm, this, no)\n }\n};\n\nLineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line\n this.height = null\n var diff = widgetHeight(this) - oldH\n if (!diff) { return }\n updateLineHeight(line, line.height + diff)\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true\n adjustScrollWhenAboveVisible(cm, line, diff)\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line))\n })\n }\n};\neventMixin(LineWidget)\n\nfunction adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff) }\n}\n\nfunction addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options)\n var cm = doc.cm\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = [])\n if (widget.insertAt == null) { widgets.push(widget) }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) }\n widget.line = line\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop\n updateLineHeight(line, line.height + widgetHeight(widget))\n if (aboveVisible) { addToScrollTop(cm, widget.height) }\n cm.curOp.forceUpdate = true\n }\n return true\n })\n signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle))\n return widget\n}\n\n// TEXTMARKERS\n\n// Created with markText and setBookmark methods. A TextMarker is a\n// handle that can be used to clear or find a marked position in the\n// document. Line objects hold arrays (markedSpans) containing\n// {from, to, marker} object pointing to such marker objects, and\n// indicating that such a marker is present on that line. Multiple\n// lines may point to the same marker when it spans across lines.\n// The spans will have null for their from/to properties when the\n// marker continues beyond the start/end of the line. Markers have\n// links back to the lines they currently touch.\n\n// Collapsed markers have unique ids, in order to be able to order\n// them, which is needed for uniquely determining an outer marker\n// when they overlap (they may nest, but not partially overlap).\nvar nextMarkerId = 0\n\nvar TextMarker = function(doc, type) {\n this.lines = []\n this.type = type\n this.doc = doc\n this.id = ++nextMarkerId\n};\n\n// Clear the marker.\nTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp\n if (withOp) { startOperation(cm) }\n if (hasHandler(this, \"clear\")) {\n var found = this.find()\n if (found) { signalLater(this, \"clear\", found.from, found.to) }\n }\n var min = null, max = null\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i]\n var span = getMarkedSpanFor(line.markedSpans, this$1)\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\") }\n else if (cm) {\n if (span.to != null) { max = lineNo(line) }\n if (span.from != null) { min = lineNo(line) }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span)\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)) }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual)\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual\n cm.display.maxLineLength = len\n cm.display.maxLineChanged = true\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) }\n this.lines.length = 0\n this.explicitlyCleared = true\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false\n if (cm) { reCheckSelection(cm.doc) }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max) }\n if (withOp) { endOperation(cm) }\n if (this.parent) { this.parent.clear() }\n};\n\n// Find the position of the marker in the document. Returns a {from,\n// to} object by default. Side can be passed to get a specific side\n// -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n// Pos objects returned contain a line object, rather than a line\n// number (used to prevent looking up the same line twice).\nTextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1 }\n var from, to\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i]\n var span = getMarkedSpanFor(line.markedSpans, this$1)\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from)\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to)\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n};\n\n// Signals that the marker's widget changed, and surrounding layout\n// should be recomputed.\nTextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line)\n var view = findViewForLine(cm, lineN)\n if (view) {\n clearLineMeasurementCacheFor(view)\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true\n }\n cm.curOp.updateMaxLine = true\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height\n widget.height = null\n var dHeight = widgetHeight(widget) - oldHeight\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight) }\n }\n signalLater(cm, \"markerChanged\", cm, this$1)\n })\n};\n\nTextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) }\n }\n this.lines.push(line)\n};\n\nTextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1)\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this)\n }\n};\neventMixin(TextMarker)\n\n// Create a marker, wire it up to the right lines, and\nfunction markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to)\n if (options) { copyObj(options, marker, false) }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\")\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\") }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans()\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN) }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null))\n ++curLine\n })\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) }\n }) }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }) }\n\n if (marker.readOnly) {\n seeReadOnlySpans()\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory() }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId\n marker.atomic = true\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1) }\n else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\") } }\n if (marker.atomic) { reCheckSelection(cm.doc) }\n signalLater(cm, \"markerAdded\", cm, marker)\n }\n return marker\n}\n\n// SHARED TEXTMARKERS\n\n// A shared marker spans multiple linked documents. It is\n// implemented as a meta-marker-object controlling multiple normal\n// markers.\nvar SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers\n this.primary = primary\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1 }\n};\n\nSharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear() }\n signalLater(this, \"clear\")\n};\n\nSharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n};\neventMixin(SharedTextMarker)\n\nfunction markTextShared(doc, from, to, options, type) {\n options = copyObj(options)\n options.shared = false\n var markers = [markText(doc, from, to, options, type)], primary = markers[0]\n var widget = options.widgetNode\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true) }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type))\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers)\n })\n return new SharedTextMarker(markers, primary)\n}\n\nfunction findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n}\n\nfunction copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find()\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to)\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type)\n marker.markers.push(subMark)\n subMark.parent = marker\n }\n }\n}\n\nfunction detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc]\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); })\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j]\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null\n marker.markers.splice(j--, 1)\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n}\n\nvar nextDocId = 0\nvar Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0 }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])])\n this.first = firstLine\n this.scrollTop = this.scrollLeft = 0\n this.cantEdit = false\n this.cleanGeneration = 1\n this.modeFrontier = this.highlightFrontier = firstLine\n var start = Pos(firstLine, 0)\n this.sel = simpleSelection(start)\n this.history = new History(null)\n this.id = ++nextDocId\n this.modeOption = mode\n this.lineSep = lineSep\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\"\n this.extend = false\n\n if (typeof text == \"string\") { text = this.splitLines(text) }\n updateDoc(this, {from: start, to: start, text: text})\n setSelection(this, simpleSelection(start), sel_dontScroll)\n}\n\nDoc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op) }\n else { this.iterN(this.first, this.first + this.size, from) }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height }\n this.insertInner(at - this.first, lines, height)\n },\n remove: function(at, n) { this.removeInner(at - this.first, n) },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size)\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true)\n if (this.cm) { scrollToCoords(this.cm, 0, 0) }\n setSelection(this, simpleSelection(top), sel_dontScroll)\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from)\n to = to ? clipPos(this, to) : from\n replaceRange(this, code, from, to, origin)\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to))\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line) }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos\n if (start == null || start == \"head\") { pos = range.head }\n else if (start == \"anchor\") { pos = range.anchor }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to() }\n else { pos = range.from() }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options)\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options)\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options)\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options)\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f)\n extendSelections(this, clipPosArray(this, heads), options)\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = []\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)) }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) }\n setSelection(this, normalizeSelection(out, primary), options)\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0)\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)))\n setSelection(this, normalizeSelection(ranges, ranges.length - 1), options)\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())\n lines = lines ? lines.concat(sel) : sel\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) }\n parts[i] = sel\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = []\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code }\n this.replaceSelections(dup, collapse, origin || \"+input\")\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i]\n changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin}\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse)\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]) }\n if (newSel) { setSelectionReplaceHistory(this, newSel) }\n else if (this.cm) { ensureCursorVisible(this.cm) }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\")}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\")}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true)}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true)}),\n\n setExtending: function(val) {this.extend = val},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration)},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true)\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration)\n hist.done = copyHistoryArray(histData.done.slice(0), null, true)\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true)\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {})\n markers[gutterID] = value\n if (!value && isEmpty(markers)) { line.gutterMarkers = null }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null }\n return true\n })\n }\n })\n }),\n\n lineInfo: function(line) {\n var n\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line\n line = getLine(this, line)\n if (!line) { return null }\n } else {\n n = lineNo(line)\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\"\n if (!line[prop]) { line[prop] = cls }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\"\n var cur = line[prop]\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null }\n else {\n var found = cur.match(classTest(cls))\n if (!found) { return false }\n var end = found.index + found[0].length\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear() },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents}\n pos = clipPos(this, pos)\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos)\n var markers = [], spans = getLine(this, pos.line).markedSpans\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker) }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to)\n var found = [], lineNo = from.line\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i]\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker) }\n } }\n ++lineNo\n })\n return found\n },\n getAllMarks: function() {\n var markers = []\n this.iter(function (line) {\n var sps = line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker) } } }\n })\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length\n this.iter(function (line) {\n var sz = line.text.length + sepSize\n if (sz > off) { ch = off; return true }\n off -= sz\n ++lineNo\n })\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords)\n var index = coords.ch\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize\n })\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction)\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft\n doc.sel = this.sel\n doc.extend = false\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth\n doc.setHistory(this.getHistory())\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {} }\n var from = this.first, to = this.first + this.size\n if (options.from != null && options.from > from) { from = options.from }\n if (options.to != null && options.to < to) { to = options.to }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction)\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist})\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]\n copySharedMarkers(copy, findSharedMarkers(this))\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i]\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1)\n other.unlinkDoc(this$1)\n detachSharedMarkers(findSharedMarkers(this$1))\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id]\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true)\n other.history = new History(null)\n other.history.done = copyHistoryArray(this.history.done, splitIds)\n other.history.undone = copyHistoryArray(this.history.undone, splitIds)\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f)},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\" }\n if (dir == this.direction) { return }\n this.direction = dir\n this.iter(function (line) { return line.order = null; })\n if (this.cm) { directionChanged(this.cm) }\n })\n})\n\n// Public alias.\nDoc.prototype.eachLine = Doc.prototype.iter\n\n// Kludge to work around strange IE behavior where it'll sometimes\n// re-fire a series of drag-related events right after the drop (#1551)\nvar lastDrop = 0\n\nfunction onDrop(e) {\n var cm = this\n clearDragCursor(cm)\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e)\n if (ie) { lastDrop = +new Date }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader\n reader.onload = operation(cm, function () {\n var content = reader.result\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\" }\n text[i] = content\n if (++read == n) {\n pos = clipPos(cm.doc, pos)\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"}\n makeChange(cm.doc, change)\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)))\n }\n })\n reader.readAsText(file)\n }\n for (var i = 0; i < n; ++i) { loadFile(files[i], i) }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e)\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20)\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\")\n if (text$1) {\n var selected\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections() }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos))\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\") } }\n cm.replaceSelection(text$1, \"around\", \"paste\")\n cm.display.input.focus()\n }\n }\n catch(e){}\n }\n}\n\nfunction onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection())\n e.dataTransfer.effectAllowed = \"copyMove\"\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\")\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"\n if (presto) {\n img.width = img.height = 1\n cm.display.wrapper.appendChild(img)\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop\n }\n e.dataTransfer.setDragImage(img, 0, 0)\n if (presto) { img.parentNode.removeChild(img) }\n }\n}\n\nfunction onDragOver(cm, e) {\n var pos = posFromMouse(cm, e)\n if (!pos) { return }\n var frag = document.createDocumentFragment()\n drawSelectionCursor(cm, pos, frag)\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\")\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv)\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag)\n}\n\nfunction clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor)\n cm.display.dragCursor = null\n }\n}\n\n// These must be handled carefully, because naively registering a\n// handler for each editor will cause the editors to never be\n// garbage collected.\n\nfunction forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\")\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror\n if (cm) { f(cm) }\n }\n}\n\nvar globalsRegistered = false\nfunction ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers()\n globalsRegistered = true\n}\nfunction registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null\n forEachCodeMirror(onResize)\n }, 100) }\n })\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); })\n}\n// Called when the window resizes\nfunction onResize(cm) {\n var d = cm.display\n if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)\n { return }\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null\n d.scrollbarsClipped = false\n cm.setSize()\n}\n\nvar keyNames = {\n 3: \"Enter\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n}\n\n// Number keys\nfor (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) }\n// Alphabetic keys\nfor (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) }\n// Function keys\nfor (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2 }\n\nvar keyMap = {}\n\nkeyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n}\n// Note that the save and find-related commands aren't defined by\n// default. User code or addons can define them. Unknown commands\n// are simply ignored.\nkeyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n fallthrough: \"basic\"\n}\n// Very basic readline/emacs-style bindings, which are standard on Mac.\nkeyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n}\nkeyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n fallthrough: [\"basic\", \"emacsy\"]\n}\nkeyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault\n\n// KEYMAP DISPATCH\n\nfunction normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/)\n name = parts[parts.length - 1]\n var alt, ctrl, shift, cmd\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i]\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true }\n else if (/^a(lt)?$/i.test(mod)) { alt = true }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true }\n else if (/^s(hift)?$/i.test(mod)) { shift = true }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name }\n if (ctrl) { name = \"Ctrl-\" + name }\n if (cmd) { name = \"Cmd-\" + name }\n if (shift) { name = \"Shift-\" + name }\n return name\n}\n\n// This is a kludge to keep keymaps mostly working as raw objects\n// (backwards compatibility) while at the same time support features\n// like normalization and multi-stroke key bindings. It compiles a\n// new normalized keymap, and then updates the old object to reflect\n// this.\nfunction normalizeKeyMap(keymap) {\n var copy = {}\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname]\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName)\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0)\n if (i == keys.length - 1) {\n name = keys.join(\" \")\n val = value\n } else {\n name = keys.slice(0, i + 1).join(\" \")\n val = \"...\"\n }\n var prev = copy[name]\n if (!prev) { copy[name] = val }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname]\n } }\n for (var prop in copy) { keymap[prop] = copy[prop] }\n return keymap\n}\n\nfunction lookupKey(key, map, handle, context) {\n map = getKeyMap(map)\n var found = map.call ? map.call(key, context) : map[key]\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context)\n if (result) { return result }\n }\n }\n}\n\n// Modifier key presses don't count as 'real' key presses for the\n// purpose of keymap fallthrough.\nfunction isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode]\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n}\n\nfunction addModifierNames(name, event, noShift) {\n var base = name\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name }\n return name\n}\n\n// Look up the name of a key as indicated by an event object.\nfunction keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode]\n if (name == null || event.altGraphKey) { return false }\n return addModifierNames(name, event, noShift)\n}\n\nfunction getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n}\n\n// Helper for deleting text near the selection(s), used to implement\n// backspace, delete, and similar functionality.\nfunction deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = []\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i])\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop()\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from\n break\n }\n }\n kill.push(toKill)\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\") }\n ensureCursorVisible(cm)\n })\n}\n\n// Commands are parameter-less actions that can be performed on an\n// editor, mostly used for keybindings.\nvar commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\")\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5\n var pos = cm.coordsChar({left: 0, top: top}, \"div\")\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from()\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize)\n spaces.push(spaceStr(tabSize - col % tabSize))\n }\n cm.replaceSelections(spaces)\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\") }\n else { cm.execCommand(\"insertTab\") }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = []\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1)\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\")\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text\n if (prev) {\n cur = new Pos(cur.line, 1)\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\")\n }\n }\n }\n newSel.push(new Range(cur, cur))\n }\n cm.setSelections(newSel)\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections()\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\") }\n sels = cm.listSelections()\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true) }\n ensureCursorVisible(cm)\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n}\n\n\nfunction lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN)\n var visual = visualLine(line)\n if (visual != line) { lineN = lineNo(visual) }\n return endOfLine(true, cm, visual, lineN, 1)\n}\nfunction lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN)\n var visual = visualLineEnd(line)\n if (visual != line) { lineN = lineNo(visual) }\n return endOfLine(true, cm, line, lineN, -1)\n}\nfunction lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line)\n var line = getLine(cm.doc, start.line)\n var order = getOrder(line, cm.doc.direction)\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/))\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n}\n\n// Run a handler that was bound to a key.\nfunction doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound]\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled()\n var prevShift = cm.display.shift, done = false\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true }\n if (dropShift) { cm.display.shift = false }\n done = bound(cm) != Pass\n } finally {\n cm.display.shift = prevShift\n cm.state.suppressEdits = false\n }\n return done\n}\n\nfunction lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm)\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n}\n\n// Note that, despite the name, this function is also used to check\n// for bound mouse clicks.\n\nvar stopSeq = new Delayed\nfunction dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null\n cm.display.input.reset()\n }\n })\n name = seq + \" \" + name\n }\n var result = lookupKeyForEditor(cm, name, handle)\n\n if (result == \"multi\")\n { cm.state.keySeq = name }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e) }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e)\n restartBlink(cm)\n }\n\n if (seq && !result && /\\'$/.test(name)) {\n e_preventDefault(e)\n return true\n }\n return !!result\n}\n\n// Handle a key from the keydown event.\nfunction handleKeyBinding(cm, e) {\n var name = keyName(e, true)\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n}\n\n// Handle a key from the keypress event\nfunction handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n}\n\nvar lastStoppedKey = null\nfunction onKeyDown(e) {\n var cm = this\n cm.curOp.focus = activeElt()\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false }\n var code = e.keyCode\n cm.display.shift = code == 16 || e.shiftKey\n var handled = handleKeyBinding(cm, e)\n if (presto) {\n lastStoppedKey = handled ? code : null\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\") }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm) }\n}\n\nfunction showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv\n addClass(lineDiv, \"CodeMirror-crosshair\")\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\")\n off(document, \"keyup\", up)\n off(document, \"mouseover\", up)\n }\n }\n on(document, \"keyup\", up)\n on(document, \"mouseover\", up)\n}\n\nfunction onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false }\n signalDOMEvent(this, e)\n}\n\nfunction onKeyPress(e) {\n var cm = this\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode)\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e)\n}\n\nvar DOUBLECLICK_DELAY = 400\n\nvar PastClick = function(time, pos, button) {\n this.time = time\n this.pos = pos\n this.button = button\n};\n\nPastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n};\n\nvar lastClick;\nvar lastDoubleClick;\nfunction clickRepeat(pos, button) {\n var now = +new Date\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button)\n lastClick = null\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button)\n lastDoubleClick = null\n return \"single\"\n }\n}\n\n// A mouse down can be a single click, double click, triple click,\n// start of selection drag, start of text drag, new cursor\n// (ctrl-click), rectangle drag (alt-drag), or xwin\n// middle-click-paste. Or it might be a click on something we should\n// not interfere with, such as a scrollbar or widget.\nfunction onMouseDown(e) {\n var cm = this, display = cm.display\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled()\n display.shift = e.shiftKey\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false\n setTimeout(function () { return display.scroller.draggable = true; }, 100)\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\"\n window.focus()\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e) }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e) }\n else if (e_target(e) == display.scroller) { e_preventDefault(e) }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos) }\n setTimeout(function () { return display.input.focus(); }, 20)\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e) }\n else { delayBlurEvent(cm) }\n }\n}\n\nfunction handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\"\n if (repeat == \"double\") { name = \"Double\" + name }\n else if (repeat == \"triple\") { name = \"Triple\" + name }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound] }\n if (!bound) { return false }\n var done = false\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true }\n done = bound(cm, pos) != Pass\n } finally {\n cm.state.suppressEdits = false\n }\n return done\n })\n}\n\nfunction configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\")\n var value = option ? option(cm, repeat, event) : {}\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\"\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey) }\n return value\n}\n\nfunction leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0) }\n else { cm.curOp.focus = activeElt() }\n\n var behavior = configureMouse(cm, repeat, event)\n\n var sel = cm.doc.sel, contained\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior) }\n else\n { leftButtonSelect(cm, event, pos, behavior) }\n}\n\n// Start a text drag. When it ends, see if any dragging actually\n// happen, and treat as a click if it didn't.\nfunction leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false }\n cm.state.draggingText = false\n off(document, \"mouseup\", dragEnd)\n off(document, \"mousemove\", mouseMove)\n off(display.scroller, \"dragstart\", dragStart)\n off(display.scroller, \"drop\", dragEnd)\n if (!moved) {\n e_preventDefault(e)\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend) }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {document.body.focus(); display.input.focus()}, 20) }\n else\n { display.input.focus() }\n }\n })\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10\n }\n var dragStart = function () { return moved = true; }\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true }\n cm.state.draggingText = dragEnd\n dragEnd.copy = !behavior.moveOnDrag\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop() }\n on(document, \"mouseup\", dragEnd)\n on(document, \"mousemove\", mouseMove)\n on(display.scroller, \"dragstart\", dragStart)\n on(display.scroller, \"drop\", dragEnd)\n\n delayBlurEvent(cm)\n setTimeout(function () { return display.input.focus(); }, 20)\n}\n\nfunction rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos)\n return new Range(result.from, result.to)\n}\n\n// Normal selection, as opposed to text dragging.\nfunction leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc\n e_preventDefault(event)\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start)\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex] }\n else\n { ourRange = new Range(start, start) }\n } else {\n ourRange = doc.sel.primary()\n ourIndex = doc.sel.primIndex\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start) }\n start = posFromMouse(cm, event, true, true)\n ourIndex = -1\n } else {\n var range = rangeForUnit(cm, start, behavior.unit)\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend) }\n else\n { ourRange = range }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0\n setSelection(doc, new Selection([ourRange], 0), sel_mouse)\n startSel = doc.sel\n } else if (ourIndex == -1) {\n ourIndex = ranges.length\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"})\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"})\n startSel = doc.sel\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)\n }\n\n var lastPos = start\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)) }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false})\n cm.scrollIntoView(pos)\n } else {\n var oldRange = ourRange\n var range = rangeForUnit(cm, pos, behavior.unit)\n var anchor = oldRange.anchor, head\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head\n anchor = minPos(oldRange.from(), range.anchor)\n } else {\n head = range.anchor\n anchor = maxPos(oldRange.to(), range.head)\n }\n var ranges$1 = startSel.ranges.slice(0)\n ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect()\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0\n\n function extend(e) {\n var curCount = ++counter\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\")\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt()\n extendTo(cur)\n var visible = visibleLines(display, doc)\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside\n extend(e)\n }), 50) }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false\n counter = Infinity\n e_preventDefault(e)\n display.input.focus()\n off(document, \"mousemove\", move)\n off(document, \"mouseup\", up)\n doc.history.lastSelOrigin = null\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e) }\n else { extend(e) }\n })\n var up = operation(cm, done)\n cm.state.selectingText = up\n on(document, \"mousemove\", move)\n on(document, \"mouseup\", up)\n}\n\n\n// Determines whether an event happened in the gutter, and fires the\n// handlers for the corresponding event.\nfunction gutterEvent(cm, e, type, prevent) {\n var mX, mY\n try { mX = e.clientX; mY = e.clientY }\n catch(e) { return false }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e) }\n\n var display = cm.display\n var lineBox = display.lineDiv.getBoundingClientRect()\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i]\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY)\n var gutter = cm.options.gutters[i]\n signal(cm, type, cm, line, gutter, e)\n return e_defaultPrevented(e)\n }\n }\n}\n\nfunction clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n}\n\n// CONTEXT MENU HANDLING\n\n// To make the context menu work, we need to briefly unhide the\n// textarea (making it as unobtrusive as possible) to let the\n// right-click take effect on it.\nfunction onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e)\n}\n\nfunction contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n}\n\nfunction themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\")\n clearCaches(cm)\n}\n\nvar Init = {toString: function(){return \"CodeMirror.Init\"}}\n\nvar defaults = {}\nvar optionHandlers = {}\n\nfunction defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle }\n }\n\n CodeMirror.defineOption = option\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true)\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val\n loadMode(cm)\n }, true)\n\n option(\"indentUnit\", 2, loadMode, true)\n option(\"indentWithTabs\", false)\n option(\"smartIndent\", true)\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm)\n clearCaches(cm)\n regChange(cm)\n }, true)\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos)\n if (found == -1) { break }\n pos = found + val.length\n newBreaks.push(Pos(lineNo, found))\n }\n lineNo++\n })\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }\n })\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\")\n if (old != Init) { cm.refresh() }\n })\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true)\n option(\"electricChars\", true)\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true)\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true)\n option(\"rtlMoveVisually\", !windows)\n option(\"wholeLineUpdateBefore\", true)\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm)\n guttersChanged(cm)\n }, true)\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val)\n var prev = old != Init && getKeyMap(old)\n if (prev && prev.detach) { prev.detach(cm, next) }\n if (next.attach) { next.attach(cm, prev || null) }\n })\n option(\"extraKeys\", null)\n option(\"configureMouse\", null)\n\n option(\"lineWrapping\", false, wrappingChanged, true)\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options)\n guttersChanged(cm)\n }, true)\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\"\n cm.refresh()\n }, true)\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true)\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm)\n updateScrollbars(cm)\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop)\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft)\n }, true)\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options)\n guttersChanged(cm)\n }, true)\n option(\"firstLineNumber\", 1, guttersChanged, true)\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true)\n option(\"showCursorWhenSelecting\", false, updateSelection, true)\n\n option(\"resetSelectionOnContextMenu\", true)\n option(\"lineWiseCopyCut\", true)\n option(\"pasteLinesPerSelection\", true)\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm)\n cm.display.input.blur()\n }\n cm.display.input.readOnlyChanged(val)\n })\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true)\n option(\"dragDrop\", true, dragDropChanged)\n option(\"allowDropFileTypes\", null)\n\n option(\"cursorBlinkRate\", 530)\n option(\"cursorScrollMargin\", 0)\n option(\"cursorHeight\", 1, updateSelection, true)\n option(\"singleCursorHeightPerLine\", true, updateSelection, true)\n option(\"workTime\", 100)\n option(\"workDelay\", 100)\n option(\"flattenSpans\", true, resetModeState, true)\n option(\"addModeClass\", false, resetModeState, true)\n option(\"pollInterval\", 100)\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; })\n option(\"historyEventDelay\", 1250)\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true)\n option(\"maxHighlightLength\", 10000, resetModeState, true)\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition() }\n })\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; })\n option(\"autofocus\", null)\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true)\n}\n\nfunction guttersChanged(cm) {\n updateGutters(cm)\n regChange(cm)\n alignHorizontally(cm)\n}\n\nfunction dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions\n var toggle = value ? on : off\n toggle(cm.display.scroller, \"dragstart\", funcs.start)\n toggle(cm.display.scroller, \"dragenter\", funcs.enter)\n toggle(cm.display.scroller, \"dragover\", funcs.over)\n toggle(cm.display.scroller, \"dragleave\", funcs.leave)\n toggle(cm.display.scroller, \"drop\", funcs.drop)\n }\n}\n\nfunction wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\")\n cm.display.sizer.style.minWidth = \"\"\n cm.display.sizerWidth = null\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\")\n findMaxLine(cm)\n }\n estimateLineHeights(cm)\n regChange(cm)\n clearCaches(cm)\n setTimeout(function () { return updateScrollbars(cm); }, 100)\n}\n\n// A CodeMirror instance represents an editor. This is the object\n// that user code is usually dealing with.\n\nfunction CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {}\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false)\n setGuttersForLineNumbers(options)\n\n var doc = options.value\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction) }\n this.doc = doc\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this)\n var display = this.display = new Display(place, doc, input)\n display.wrapper.CodeMirror = this\n updateGutters(this)\n themeChanged(this)\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\" }\n initScrollbars(this)\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n }\n\n if (options.autofocus && !mobile) { display.input.focus() }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) }\n\n registerEventHandlers(this)\n ensureGlobalHandlers()\n\n startOperation(this)\n this.curOp.forceUpdate = true\n attachDoc(this, doc)\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20) }\n else\n { onBlur(this) }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init) } }\n maybeUpdateLineNumberWidth(this)\n if (options.finishInit) { options.finishInit(this) }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) }\n endOperation(this)\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\" }\n}\n\n// The default configuration options.\nCodeMirror.defaults = defaults\n// Functions to run when options are changed.\nCodeMirror.optionHandlers = optionHandlers\n\n// Attach the necessary event handlers when initializing the editor\nfunction registerEventHandlers(cm) {\n var d = cm.display\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown))\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e)\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e)\n var word = cm.findWordAt(pos)\n extendSelection(cm.doc, word.anchor, word.head)\n })) }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }) }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0}\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)\n prevTouch = d.activeTouch\n prevTouch.end = +new Date\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0]\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n d.input.ensurePolled()\n clearTimeout(touchFinished)\n var now = +new Date\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null}\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX\n d.activeTouch.top = e.touches[0].pageY\n }\n }\n })\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true }\n })\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos) }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos) }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n cm.setSelection(range.anchor, range.head)\n cm.focus()\n e_preventDefault(e)\n }\n finishTouch()\n })\n on(d.scroller, \"touchcancel\", finishTouch)\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop)\n setScrollLeft(cm, d.scroller.scrollLeft, true)\n signal(cm, \"scroll\", cm)\n }\n })\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); })\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); })\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}\n }\n\n var inp = d.input.getField()\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); })\n on(inp, \"keydown\", operation(cm, onKeyDown))\n on(inp, \"keypress\", operation(cm, onKeyPress))\n on(inp, \"focus\", function (e) { return onFocus(cm, e); })\n on(inp, \"blur\", function (e) { return onBlur(cm, e); })\n}\n\nvar initHooks = []\nCodeMirror.defineInitHook = function (f) { return initHooks.push(f); }\n\n// Indent the given line. The how parameter can be \"smart\",\n// \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n// (typically set to true for forced single-line indents), empty\n// lines are not indented, and places where the mode returns Pass\n// are left alone.\nfunction indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state\n if (how == null) { how = \"add\" }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\" }\n else { state = getContextBefore(cm, n).state }\n }\n\n var tabSize = cm.options.tabSize\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize)\n if (line.stateAfter) { line.stateAfter = null }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0\n how = \"not\"\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text)\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\"\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) }\n else { indentation = 0 }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit\n } else if (typeof how == \"number\") {\n indentation = curSpace + how\n }\n indentation = Math.max(0, indentation)\n\n var indentString = \"\", pos = 0\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\"} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos) }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\")\n line.stateAfter = null\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1]\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length)\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1))\n break\n }\n }\n }\n}\n\n// This will be set to a {lineWise: bool, text: [string]} object, so\n// that, when pasting, we know what kind of selections the copied\n// text was made out of.\nvar lastCopied = null\n\nfunction setLastCopied(newLastCopied) {\n lastCopied = newLastCopied\n}\n\nfunction applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc\n cm.display.shift = false\n if (!sel) { sel = doc.sel }\n\n var paste = cm.state.pasteIncoming || origin == \"paste\"\n var textLines = splitLinesAuto(inserted), multiPaste = null\n // When pasing N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = []\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])) }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; })\n }\n }\n\n var updateInput\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1]\n var from = range.from(), to = range.to()\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted) }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) }\n else if (lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0) }\n }\n updateInput = cm.curOp.updateInput\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\")}\n makeChange(cm.doc, changeEvent)\n signalLater(cm, \"inputRead\", cm, changeEvent)\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted) }\n\n ensureCursorVisible(cm)\n cm.curOp.updateInput = updateInput\n cm.curOp.typing = true\n cm.state.pasteIncoming = cm.state.cutIncoming = false\n}\n\nfunction handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\")\n if (pasted) {\n e.preventDefault()\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }) }\n return true\n }\n}\n\nfunction triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i]\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head)\n var indented = false\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\")\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\") }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line) }\n }\n}\n\nfunction copyableRanges(cm) {\n var text = [], ranges = []\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}\n ranges.push(lineRange)\n text.push(cm.getRange(lineRange.anchor, lineRange.head))\n }\n return {text: text, ranges: ranges}\n}\n\nfunction disableBrowserMagic(field, spellcheck) {\n field.setAttribute(\"autocorrect\", \"off\")\n field.setAttribute(\"autocapitalize\", \"off\")\n field.setAttribute(\"spellcheck\", !!spellcheck)\n}\n\nfunction hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\")\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\")\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\" }\n else { te.setAttribute(\"wrap\", \"off\") }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\" }\n disableBrowserMagic(te)\n return div\n}\n\n// The publicly visible API. Note that methodOp(f) means\n// 'wrap f in an operation, performed on its `this` parameter'.\n\n// This is not the complete set of editor methods. Most of the\n// methods defined on the Doc type are also injected into\n// CodeMirror.prototype, for backwards compatibility and\n// convenience.\n\nfunction addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers\n\n var helpers = CodeMirror.helpers = {}\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus()},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option]\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old) }\n signal(this, \"optionChange\", this, option)\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map))\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1)\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec)\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; })\n this.state.modeGen++\n regChange(this)\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1)\n this$1.state.modeGen++\n regChange(this$1)\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\" }\n else { dir = dir ? \"add\" : \"subtract\" }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (!range.empty()) {\n var from = range.from(), to = range.to()\n var start = Math.max(end, from.line)\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how) }\n var newRanges = this$1.doc.sel.ranges\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) }\n } else if (range.head.line > end) {\n indentLine(this$1, range.head.line, how, true)\n end = range.head.line\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos)\n var styles = getLineStyles(this, getLine(this.doc, pos.line))\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch\n var type\n if (ch == 0) { type = styles[2] }\n else { for (;;) {\n var mid = (before + after) >> 1\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1 }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = []\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos)\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]) }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]]\n if (val) { found.push(val) }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType])\n } else if (help[mode.name]) {\n found.push(help[mode.name])\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1]\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val) }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line)\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary()\n if (start == null) { pos = range.head }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start) }\n else { pos = start ? range.from() : range.to() }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\")\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1\n if (line < this.doc.first) { line = this.doc.first }\n else if (line > last) { line = last; end = true }\n lineObj = getLine(this.doc, line)\n } else {\n lineObj = line\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display\n pos = cursorCoords(this, clipPos(this.doc, pos))\n var top = pos.bottom, left = pos.left\n node.style.position = \"absolute\"\n node.setAttribute(\"cm-ignore-events\", \"true\")\n this.display.input.setUneditable(node)\n display.sizer.appendChild(node)\n if (vert == \"over\") {\n top = pos.top\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth)\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth }\n }\n node.style.top = top + \"px\"\n node.style.left = node.style.right = \"\"\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth\n node.style.right = \"0px\"\n } else {\n if (horiz == \"left\") { left = 0 }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 }\n node.style.left = left + \"px\"\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}) }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text) }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1\n if (amount < 0) { dir = -1; amount = -amount }\n var cur = clipPos(this.doc, from)\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually)\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move)\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\") }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false)\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }) }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn\n if (amount < 0) { dir = -1; amount = -amount }\n var cur = clipPos(this.doc, from)\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\")\n if (x == null) { x = coords.left }\n else { coords.left = x }\n cur = findPosV(this$1, coords, dir, unit)\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = []\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected()\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\")\n if (range.goalColumn != null) { headPos.left = range.goalColumn }\n goals.push(headPos.left)\n var pos = findPosV(this$1, headPos, dir, unit)\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top) }\n return pos\n }, sel_move)\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i] } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text\n var start = pos.ch, end = pos.ch\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\")\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end }\n var startChar = line.charAt(start)\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); }\n while (start > 0 && check(line.charAt(start - 1))) { --start }\n while (end < line.length && check(line.charAt(end))) { ++end }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\") }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\") }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite)\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y) }),\n getScrollInfo: function() {\n var scroller = this.display.scroller\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null}\n if (margin == null) { margin = this.options.cursorScrollMargin }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null}\n } else if (range.from == null) {\n range = {from: range, to: null}\n }\n if (!range.to) { range.to = range.from }\n range.margin = margin || 0\n\n if (range.from.line != null) {\n scrollToRange(this, range)\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin)\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; }\n if (width != null) { this.display.wrapper.style.width = interpret(width) }\n if (height != null) { this.display.wrapper.style.height = interpret(height) }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this) }\n var lineNo = this.display.viewFrom\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo\n })\n this.curOp.forceUpdate = true\n signal(this, \"refresh\", this)\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight\n regChange(this)\n this.curOp.forceUpdate = true\n clearCaches(this)\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop)\n updateGutterSpace(this)\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this) }\n signal(this, \"refresh\", this)\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc\n old.cm = null\n attachDoc(this, doc)\n clearCaches(this)\n this.display.input.reset()\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop)\n this.curOp.forceScroll = true\n signalLater(this, \"swapDoc\", this, old)\n return old\n }),\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n }\n eventMixin(CodeMirror)\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} }\n helpers[type][name] = value\n }\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value)\n helpers[type]._global.push({pred: predicate, val: value})\n }\n}\n\n// Used for horizontal relative motion. Dir is -1 or 1 (left or\n// right), unit can be \"char\", \"column\" (like char, but doesn't\n// cross line boundaries), \"word\" (across next word), or \"group\" (to\n// the start of next group of word or non-word-non-whitespace\n// chars). The visually param controls whether, in right-to-left\n// text, direction 1 means to move towards the next index in the\n// string, or towards the character to the right of the current\n// position. The resulting position will have a hitSide=true\n// property if it reached the end of the document.\nfunction findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos\n var origDir = dir\n var lineObj = getLine(doc, pos.line)\n function findNextLine() {\n var l = pos.line + dir\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky)\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir)\n } else {\n next = moveLogically(lineObj, pos, dir)\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir) }\n else\n { return false }\n } else {\n pos = next\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce()\n } else if (unit == \"column\") {\n moveOnce(true)\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\"\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\")\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\"\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\"\n if (group && !first && !type) { type = \"s\" }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\"}\n break\n }\n\n if (type) { sawType = type }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true)\n if (equalCursorPos(oldPos, result)) { result.hitSide = true }\n return result\n}\n\n// For relative vertical movement. Dir may be -1 or 1. Unit can be\n// \"page\" or \"line\". The resulting position will have a hitSide=true\n// property if it reached the end of the document.\nfunction findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight)\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3)\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3\n }\n var target\n for (;;) {\n target = coordsChar(cm, x, y)\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5\n }\n return target\n}\n\n// CONTENTEDITABLE INPUT STYLE\n\nvar ContentEditableInput = function(cm) {\n this.cm = cm\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null\n this.polling = new Delayed()\n this.composing = null\n this.gracePeriod = false\n this.readDOMTimeout = null\n};\n\nContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm\n var div = input.div = display.lineDiv\n disableBrowserMagic(div, cm.options.spellcheck)\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20) }\n })\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false}\n })\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false} }\n })\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() }\n this$1.composing.done = true\n }\n })\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); })\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon() }\n })\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()})\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\") }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm)\n setLastCopied({lineWise: true, text: ranges.text})\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll)\n cm.replaceSelection(\"\", null, \"cut\")\n })\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData()\n var content = lastCopied.text.join(\"\\n\")\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content)\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault()\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild)\n te.value = lastCopied.text.join(\"\\n\")\n var hadFocus = document.activeElement\n selectInput(te)\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge)\n hadFocus.focus()\n if (hadFocus == div) { input.showPrimarySelection() }\n }, 50)\n }\n on(div, \"copy\", onCopyCut)\n on(div, \"cut\", onCopyCut)\n};\n\nContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false)\n result.focus = this.cm.state.focused\n return result\n};\n\nContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection() }\n this.showMultipleSelections(info)\n};\n\nContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = window.getSelection(), cm = this.cm, prim = cm.doc.sel.primary()\n var from = prim.from(), to = prim.to()\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges()\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset)\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0}\n var end = to.line < cm.display.viewTo && posToDOM(cm, to)\n if (!end) {\n var measure = view[view.length - 1].measure\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}\n }\n\n if (!start || !end) {\n sel.removeAllRanges()\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng\n try { rng = range(start.node, start.offset, end.offset, end.node) }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset)\n if (!rng.collapsed) {\n sel.removeAllRanges()\n sel.addRange(rng)\n }\n } else {\n sel.removeAllRanges()\n sel.addRange(rng)\n }\n if (old && sel.anchorNode == null) { sel.addRange(old) }\n else if (gecko) { this.startGracePeriod() }\n }\n this.rememberSelection()\n};\n\nContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod)\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) }\n }, 20)\n};\n\nContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors)\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection)\n};\n\nContentEditableInput.prototype.rememberSelection = function () {\n var sel = window.getSelection()\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset\n};\n\nContentEditableInput.prototype.selectionInEditor = function () {\n var sel = window.getSelection()\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer\n return contains(this.div, node)\n};\n\nContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true) }\n this.div.focus()\n }\n};\nContentEditableInput.prototype.blur = function () { this.div.blur() };\nContentEditableInput.prototype.getField = function () { return this.div };\n\nContentEditableInput.prototype.supportsTouch = function () { return true };\n\nContentEditableInput.prototype.receivedFocus = function () {\n var input = this\n if (this.selectionInEditor())\n { this.pollSelection() }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection()\n input.polling.set(input.cm.options.pollInterval, poll)\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll)\n};\n\nContentEditableInput.prototype.selectionChanged = function () {\n var sel = window.getSelection()\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n};\n\nContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = window.getSelection(), cm = this.cm\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs})\n this.blur()\n this.focus()\n return\n }\n if (this.composing) { return }\n this.rememberSelection()\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)\n var head = domToPos(cm, sel.focusNode, sel.focusOffset)\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }\n }) }\n};\n\nContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout)\n this.readDOMTimeout = null\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary()\n var from = sel.from(), to = sel.to()\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0) }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line)\n fromNode = display.view[0].node\n } else {\n fromLine = lineNo(display.view[fromIndex].line)\n fromNode = display.view[fromIndex - 1].node.nextSibling\n }\n var toIndex = findViewIndex(cm, to.line)\n var toLine, toNode\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1\n toNode = display.lineDiv.lastChild\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1\n toNode = display.view[toIndex + 1].node.previousSibling\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine))\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length))\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length)\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront }\n var newBot = lst(newText), oldBot = lst(oldText)\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0))\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--\n cutEnd++\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\")\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\")\n\n var chFrom = Pos(fromLine, cutFront)\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0)\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\")\n return true\n }\n};\n\nContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd()\n};\nContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd()\n};\nContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout)\n this.composing = null\n this.updateFromDOM()\n this.div.blur()\n this.div.focus()\n};\nContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null }\n else { return }\n }\n this$1.updateFromDOM()\n }, 80)\n};\n\nContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }) }\n};\n\nContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\"\n};\n\nContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0) { return }\n e.preventDefault()\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) }\n};\n\nContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\")\n};\n\nContentEditableInput.prototype.onContextMenu = function () {};\nContentEditableInput.prototype.resetPosition = function () {};\n\nContentEditableInput.prototype.needsContentAttribute = true\n\nfunction posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line)\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line)\n var info = mapFromLineView(view, line, pos.line)\n\n var order = getOrder(line, cm.doc.direction), side = \"left\"\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch)\n side = partPos % 2 ? \"right\" : \"left\"\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side)\n result.offset = result.collapse == \"right\" ? result.end : result.start\n return result\n}\n\nfunction isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n}\n\nfunction badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\nfunction domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator()\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep\n closing = false\n }\n }\n function addText(str) {\n if (str) {\n close()\n text += str\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\")\n if (cmText != null) {\n addText(cmText || node.textContent.replace(/\\u200b/g, \"\"))\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID))\n if (found.length && (range = found[0].find()))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)) }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p)$/i.test(node.nodeName)\n if (isBlock) { close() }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]) }\n if (isBlock) { closing = true }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue)\n }\n }\n for (;;) {\n walk(from)\n if (from == to) { break }\n from = from.nextSibling\n }\n return text\n}\n\nfunction domToPos(cm, node, offset) {\n var lineNode\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset]\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i]\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n}\n\nfunction locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true\n node = wrapper.childNodes[offset]\n offset = 0\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild\n if (offset) { offset = textNode.nodeValue.length }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode }\n var measure = lineView.measure, maps = measure.maps\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i]\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2]\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i])\n var ch = map[j] + offset\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset)\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0)\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1)\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length }\n }\n}\n\n// TEXTAREA INPUT STYLE\n\nvar TextareaInput = function(cm) {\n this.cm = cm\n // See input.poll and input.reset\n this.prevInput = \"\"\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false\n // Self-resetting timeout for the poller\n this.polling = new Delayed()\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false\n this.composing = null\n};\n\nTextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm\n\n // Wraps and hides input textarea\n var div = this.wrapper = hiddenTextarea()\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var te = this.textarea = div.firstChild\n display.wrapper.insertBefore(div, display.wrapper.firstChild)\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\" }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null }\n input.poll()\n })\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = true\n input.fastPoll()\n })\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()})\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm)\n setLastCopied({lineWise: true, text: ranges.text})\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll)\n } else {\n input.prevInput = \"\"\n te.value = ranges.text.join(\"\\n\")\n selectInput(te)\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = true }\n }\n on(te, \"cut\", prepareCopyCut)\n on(te, \"copy\", prepareCopyCut)\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n cm.state.pasteIncoming = true\n input.focus()\n })\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e) }\n })\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\")\n if (input.composing) { input.composing.range.clear() }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n }\n })\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll()\n input.composing.range.clear()\n input.composing = null\n }\n })\n};\n\nTextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc\n var result = prepareSelection(cm)\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\")\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect()\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top))\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left))\n }\n\n return result\n};\n\nTextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors)\n removeChildrenAndAdd(display.selectionDiv, drawn.selection)\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\"\n this.wrapper.style.left = drawn.teLeft + \"px\"\n }\n};\n\n// Reset the input to correspond to the selection (or to be empty,\n// when not typing and nothing is selected)\nTextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm\n if (cm.somethingSelected()) {\n this.prevInput = \"\"\n var content = cm.getSelection()\n this.textarea.value = content\n if (cm.state.focused) { selectInput(this.textarea) }\n if (ie && ie_version >= 9) { this.hasSelection = content }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\"\n if (ie && ie_version >= 9) { this.hasSelection = null }\n }\n};\n\nTextareaInput.prototype.getField = function () { return this.textarea };\n\nTextareaInput.prototype.supportsTouch = function () { return false };\n\nTextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus() }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n};\n\nTextareaInput.prototype.blur = function () { this.textarea.blur() };\n\nTextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0\n};\n\nTextareaInput.prototype.receivedFocus = function () { this.slowPoll() };\n\n// Poll for input changes, using the normal rate of polling. This\n// runs as long as the editor is focused.\nTextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll()\n if (this$1.cm.state.focused) { this$1.slowPoll() }\n })\n};\n\n// When an event has just come in that is likely to add or change\n// something in the input textarea, we poll faster, to ensure that\n// the change appears on the screen quickly.\nTextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this\n input.pollingFast = true\n function p() {\n var changed = input.poll()\n if (!changed && !missed) {missed = true; input.polling.set(60, p)}\n else {input.pollingFast = false; input.slowPoll()}\n }\n input.polling.set(20, p)\n};\n\n// Read input from the textarea, and update the document to match.\n// When something is selected, it is present in the textarea, and\n// selected (unless it is huge, in which case a placeholder is\n// used). When nothing is selected, the cursor sits after previously\n// seen text (can be empty), which is stored in prevInput (we must\n// not reset the textarea when typing, because that breaks IME).\nTextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset()\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0)\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\" }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length)\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null)\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\" }\n else { this$1.prevInput = text }\n\n if (this$1.composing) {\n this$1.composing.range.clear()\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"})\n }\n })\n return true\n};\n\nTextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false }\n};\n\nTextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null }\n this.fastPoll()\n};\n\nTextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText\n input.wrapper.style.cssText = \"position: absolute\"\n var wrapperBox = input.wrapper.getBoundingClientRect()\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\"\n var oldScrollY\n if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712)\n display.input.focus()\n if (webkit) { window.scrollTo(null, oldScrollY) }\n display.input.reset()\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \" }\n input.contextMenuPending = true\n display.selForContextMenu = cm.doc.sel\n clearTimeout(display.detectingSelectAll)\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected()\n var extval = \"\\u200b\" + (selected ? te.value : \"\")\n te.value = \"\\u21da\" // Used to catch context-menu undo\n te.value = extval\n input.prevInput = selected ? \"\" : \"\\u200b\"\n te.selectionStart = 1; te.selectionEnd = extval.length\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel\n }\n }\n function rehide() {\n input.contextMenuPending = false\n input.wrapper.style.cssText = oldWrapperCSS\n te.style.cssText = oldCSS\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm)\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500)\n } else {\n display.selForContextMenu = null\n display.input.reset()\n }\n }\n display.detectingSelectAll = setTimeout(poll, 200)\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack() }\n if (captureRightClick) {\n e_stop(e)\n var mouseup = function () {\n off(window, \"mouseup\", mouseup)\n setTimeout(rehide, 20)\n }\n on(window, \"mouseup\", mouseup)\n } else {\n setTimeout(rehide, 50)\n }\n};\n\nTextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset() }\n this.textarea.disabled = val == \"nocursor\"\n};\n\nTextareaInput.prototype.setUneditable = function () {};\n\nTextareaInput.prototype.needsContentAttribute = false\n\nfunction fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {}\n options.value = textarea.value\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt()\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body\n }\n\n function save() {textarea.value = cm.getValue()}\n\n var realSubmit\n if (textarea.form) {\n on(textarea.form, \"submit\", save)\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form\n realSubmit = form.submit\n try {\n var wrappedSubmit = form.submit = function () {\n save()\n form.submit = realSubmit\n form.submit()\n form.submit = wrappedSubmit\n }\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save\n cm.getTextArea = function () { return textarea; }\n cm.toTextArea = function () {\n cm.toTextArea = isNaN // Prevent this from being ran twice\n save()\n textarea.parentNode.removeChild(cm.getWrapperElement())\n textarea.style.display = \"\"\n if (textarea.form) {\n off(textarea.form, \"submit\", save)\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit }\n }\n }\n }\n\n textarea.style.display = \"none\"\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options)\n return cm\n}\n\nfunction addLegacyProps(CodeMirror) {\n CodeMirror.off = off\n CodeMirror.on = on\n CodeMirror.wheelEventPixels = wheelEventPixels\n CodeMirror.Doc = Doc\n CodeMirror.splitLines = splitLinesAuto\n CodeMirror.countColumn = countColumn\n CodeMirror.findColumn = findColumn\n CodeMirror.isWordChar = isWordCharBasic\n CodeMirror.Pass = Pass\n CodeMirror.signal = signal\n CodeMirror.Line = Line\n CodeMirror.changeEnd = changeEnd\n CodeMirror.scrollbarModel = scrollbarModel\n CodeMirror.Pos = Pos\n CodeMirror.cmpPos = cmp\n CodeMirror.modes = modes\n CodeMirror.mimeModes = mimeModes\n CodeMirror.resolveMode = resolveMode\n CodeMirror.getMode = getMode\n CodeMirror.modeExtensions = modeExtensions\n CodeMirror.extendMode = extendMode\n CodeMirror.copyState = copyState\n CodeMirror.startState = startState\n CodeMirror.innerMode = innerMode\n CodeMirror.commands = commands\n CodeMirror.keyMap = keyMap\n CodeMirror.keyName = keyName\n CodeMirror.isModifierKey = isModifierKey\n CodeMirror.lookupKey = lookupKey\n CodeMirror.normalizeKeyMap = normalizeKeyMap\n CodeMirror.StringStream = StringStream\n CodeMirror.SharedTextMarker = SharedTextMarker\n CodeMirror.TextMarker = TextMarker\n CodeMirror.LineWidget = LineWidget\n CodeMirror.e_preventDefault = e_preventDefault\n CodeMirror.e_stopPropagation = e_stopPropagation\n CodeMirror.e_stop = e_stop\n CodeMirror.addClass = addClass\n CodeMirror.contains = contains\n CodeMirror.rmClass = rmClass\n CodeMirror.keyNames = keyNames\n}\n\n// EDITOR CONSTRUCTOR\n\ndefineOptions(CodeMirror)\n\naddEditorMethods(CodeMirror)\n\n// Set up methods on CodeMirror's prototype to redirect to the editor's document.\nvar dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \")\nfor (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]) } }\n\neventMixin(Doc)\n\n// INPUT HANDLING\n\nCodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput}\n\n// MODE DEFINITION AND QUERYING\n\n// Extra arguments are stored as the mode's dependencies, which is\n// used by (legacy) mechanisms like loadmode.js to automatically\n// load a mode. (Preferred mechanism is the require/define calls.)\nCodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name }\n defineMode.apply(this, arguments)\n}\n\nCodeMirror.defineMIME = defineMIME\n\n// Minimal default mode.\nCodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); })\nCodeMirror.defineMIME(\"text/plain\", \"null\")\n\n// EXTENSIONS\n\nCodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func\n}\nCodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func\n}\n\nCodeMirror.fromTextArea = fromTextArea\n\naddLegacyProps(CodeMirror)\n\nCodeMirror.version = \"5.28.0\"\n\nreturn CodeMirror;\n\n})));","/*!\n * clipboard.js v1.7.1\n * https://zenorocha.github.io/clipboard.js\n *\n * Licensed MIT © Zeno Rocha\n */\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Clipboard = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this.action = options.action;\n this.container = options.container;\n this.emitter = options.emitter;\n this.target = options.target;\n this.text = options.text;\n this.trigger = options.trigger;\n\n this.selectedText = '';\n }\n }, {\n key: 'initSelection',\n value: function initSelection() {\n if (this.text) {\n this.selectFake();\n } else if (this.target) {\n this.selectTarget();\n }\n }\n }, {\n key: 'selectFake',\n value: function selectFake() {\n var _this = this;\n\n var isRTL = document.documentElement.getAttribute('dir') == 'rtl';\n\n this.removeFake();\n\n this.fakeHandlerCallback = function () {\n return _this.removeFake();\n };\n this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;\n\n this.fakeElem = document.createElement('textarea');\n // Prevent zooming on iOS\n this.fakeElem.style.fontSize = '12pt';\n // Reset box model\n this.fakeElem.style.border = '0';\n this.fakeElem.style.padding = '0';\n this.fakeElem.style.margin = '0';\n // Move element out of screen horizontally\n this.fakeElem.style.position = 'absolute';\n this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';\n // Move element to the same position vertically\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n this.fakeElem.style.top = yPosition + 'px';\n\n this.fakeElem.setAttribute('readonly', '');\n this.fakeElem.value = this.text;\n\n this.container.appendChild(this.fakeElem);\n\n this.selectedText = (0, _select2.default)(this.fakeElem);\n this.copyText();\n }\n }, {\n key: 'removeFake',\n value: function removeFake() {\n if (this.fakeHandler) {\n this.container.removeEventListener('click', this.fakeHandlerCallback);\n this.fakeHandler = null;\n this.fakeHandlerCallback = null;\n }\n\n if (this.fakeElem) {\n this.container.removeChild(this.fakeElem);\n this.fakeElem = null;\n }\n }\n }, {\n key: 'selectTarget',\n value: function selectTarget() {\n this.selectedText = (0, _select2.default)(this.target);\n this.copyText();\n }\n }, {\n key: 'copyText',\n value: function copyText() {\n var succeeded = void 0;\n\n try {\n succeeded = document.execCommand(this.action);\n } catch (err) {\n succeeded = false;\n }\n\n this.handleResult(succeeded);\n }\n }, {\n key: 'handleResult',\n value: function handleResult(succeeded) {\n this.emitter.emit(succeeded ? 'success' : 'error', {\n action: this.action,\n text: this.selectedText,\n trigger: this.trigger,\n clearSelection: this.clearSelection.bind(this)\n });\n }\n }, {\n key: 'clearSelection',\n value: function clearSelection() {\n if (this.trigger) {\n this.trigger.focus();\n }\n\n window.getSelection().removeAllRanges();\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.removeFake();\n }\n }, {\n key: 'action',\n set: function set() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';\n\n this._action = action;\n\n if (this._action !== 'copy' && this._action !== 'cut') {\n throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n }\n },\n get: function get() {\n return this._action;\n }\n }, {\n key: 'target',\n set: function set(target) {\n if (target !== undefined) {\n if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {\n if (this.action === 'copy' && target.hasAttribute('disabled')) {\n throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n }\n\n if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n }\n\n this._target = target;\n } else {\n throw new Error('Invalid \"target\" value, use a valid Element');\n }\n }\n },\n get: function get() {\n return this._target;\n }\n }]);\n\n return ClipboardAction;\n }();\n\n module.exports = ClipboardAction;\n});\n\n},{\"select\":5}],8:[function(require,module,exports){\n(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['module', './clipboard-action', 'tiny-emitter', 'good-listener'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener);\n global.clipboard = mod.exports;\n }\n})(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) {\n 'use strict';\n\n var _clipboardAction2 = _interopRequireDefault(_clipboardAction);\n\n var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);\n\n var _goodListener2 = _interopRequireDefault(_goodListener);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n function _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n\n var Clipboard = function (_Emitter) {\n _inherits(Clipboard, _Emitter);\n\n /**\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n * @param {Object} options\n */\n function Clipboard(trigger, options) {\n _classCallCheck(this, Clipboard);\n\n var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));\n\n _this.resolveOptions(options);\n _this.listenClick(trigger);\n return _this;\n }\n\n /**\n * Defines if attributes would be resolved using internal setter functions\n * or custom functions that were passed in the constructor.\n * @param {Object} options\n */\n\n\n _createClass(Clipboard, [{\n key: 'resolveOptions',\n value: function resolveOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n this.container = _typeof(options.container) === 'object' ? options.container : document.body;\n }\n }, {\n key: 'listenClick',\n value: function listenClick(trigger) {\n var _this2 = this;\n\n this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {\n return _this2.onClick(e);\n });\n }\n }, {\n key: 'onClick',\n value: function onClick(e) {\n var trigger = e.delegateTarget || e.currentTarget;\n\n if (this.clipboardAction) {\n this.clipboardAction = null;\n }\n\n this.clipboardAction = new _clipboardAction2.default({\n action: this.action(trigger),\n target: this.target(trigger),\n text: this.text(trigger),\n container: this.container,\n trigger: trigger,\n emitter: this\n });\n }\n }, {\n key: 'defaultAction',\n value: function defaultAction(trigger) {\n return getAttributeValue('action', trigger);\n }\n }, {\n key: 'defaultTarget',\n value: function defaultTarget(trigger) {\n var selector = getAttributeValue('target', trigger);\n\n if (selector) {\n return document.querySelector(selector);\n }\n }\n }, {\n key: 'defaultText',\n value: function defaultText(trigger) {\n return getAttributeValue('text', trigger);\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.listener.destroy();\n\n if (this.clipboardAction) {\n this.clipboardAction.destroy();\n this.clipboardAction = null;\n }\n }\n }], [{\n key: 'isSupported',\n value: function isSupported() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n\n var actions = typeof action === 'string' ? [action] : action;\n var support = !!document.queryCommandSupported;\n\n actions.forEach(function (action) {\n support = support && !!document.queryCommandSupported(action);\n });\n\n return support;\n }\n }]);\n\n return Clipboard;\n }(_tinyEmitter2.default);\n\n /**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n function getAttributeValue(suffix, element) {\n var attribute = 'data-clipboard-' + suffix;\n\n if (!element.hasAttribute(attribute)) {\n return;\n }\n\n return element.getAttribute(attribute);\n }\n\n module.exports = Clipboard;\n});\n\n},{\"./clipboard-action\":7,\"good-listener\":4,\"tiny-emitter\":6}]},{},[8])(8)\n});","'use strict';\n\nwindow._native = function () {\n\tvar _options = {};\n\tvar _construct = function _construct(e) {\n\t\tvar defaultOptions = {\n\t\t\tcarbonZoneKey: '',\n\t\t\tfallback: '',\n\t\t\tignore: 'false',\n\t\t\tplacement: '',\n\t\t\tprefix: 'native',\n\t\t\ttargetClass: 'native-ad'\n\t\t};\n\n\t\tif (typeof e === 'undefined') return defaultOptions;\n\t\tObject.keys(defaultOptions).forEach(function (key, index) {\n\t\t\tif (typeof e[key] === 'undefined') {\n\t\t\t\te[key] = defaultOptions[key];\n\t\t\t}\n\t\t});\n\t\treturn e;\n\t};\n\n\tvar init = function init(zone, options) {\n\t\t_options = _construct(options);\n\n\t\tvar jsonUrl = 'https://srv.buysellads.com/ads/' + zone + '.json?callback=_native_go';\n\t\tif (_options['placement'] !== '') {\n\t\t\tjsonUrl += '&segment=placement:' + _options['placement'];\n\t\t}\n\t\tif (_options['ignore'] === 'true') {\n\t\t\tjsonUrl += '&ignore=yes';\n\t\t}\n\n\t\tvar srv = document.createElement('script');\n\t\tsrv.src = jsonUrl;\n\t\tdocument.getElementsByTagName('head')[0].appendChild(srv);\n\t};\n\n\tvar carbon = function carbon(e) {\n\t\tvar srv = document.createElement('script');\n\t\tsrv.src = '//cdn.carbonads.com/carbon.js?serve=' + e['carbonZoneKey'] + '&placement=' + e['placement'];\n\t\tsrv.id = '_carbonads_js';\n\n\t\treturn srv;\n\t};\n\n\tvar sanitize = function sanitize(ads) {\n\t\treturn ads.filter(function (ad) {\n\t\t\treturn Object.keys(ad).length > 0;\n\t\t}).filter(function (ad) {\n\t\t\treturn ad.hasOwnProperty('statlink');\n\t\t});\n\t};\n\n\tvar pixel = function pixel(p, timestamp) {\n\t\tvar c = '';\n\t\tif (p) {\n\t\t\tp.split('||').forEach(function (pixel, index) {\n\t\t\t\tc += '';\n\t\t\t});\n\t\t}\n\t\treturn c;\n\t};\n\n\tvar options = function options() {\n\t\treturn _options;\n\t};\n\n\treturn {\n\t\tcarbon: carbon,\n\t\tinit: init,\n\t\toptions: options,\n\t\tpixel: pixel,\n\t\tsanitize: sanitize\n\t};\n}({});\n\nwindow._native_go = function (json) {\n\tvar options = _native.options();\n\tvar ads = _native.sanitize(json['ads']);\n\tvar selectedClass = document.querySelectorAll('.' + options['targetClass']);\n\n\tif (ads.length < 1) {\n\t\tselectedClass.forEach(function (className, index) {\n\t\t\tvar selectedTarget = document.getElementsByClassName(options['targetClass'])[index];\n\n\t\t\tif (options['fallback'] !== '' || options['carbonZoneKey'] !== '') selectedTarget.setAttribute('data-state', 'visible');\n\t\t\tselectedTarget.innerHTML = options['fallback'];\n\t\t\tif (options['carbonZoneKey'] !== '') selectedTarget.appendChild(_native.carbon(options));\n\t\t});\n\n\t\t// End at this line if no ads are found, avoiding unnecessary steps\n\t\treturn;\n\t}\n\n\tselectedClass.forEach(function (className, index) {\n\t\tvar selectedTarget = document.getElementsByClassName(options['targetClass'])[index];\n\t\tvar adElement = selectedTarget.innerHTML||\"\";\n\t\tvar prefix = options['prefix'];\n\t\tvar ad = ads[index];\n\n\t\tif (ad && className) {\n\t\t\tvar adInnerHtml = adElement.replace(new RegExp('#' + prefix + '_bg_color#', 'g'), ad['backgroundColor']).replace(new RegExp('#' + prefix + '_bg_color_hover#', 'g'), ad['backgroundHoverColor']).replace(new RegExp('#' + prefix + '_company#', 'g'), ad['company']).replace(new RegExp('#' + prefix + '_cta#', 'g'), ad['callToAction']).replace(new RegExp('#' + prefix + '_cta_bg_color#', 'g'), ad['ctaBackgroundColor']).replace(new RegExp('#' + prefix + '_cta_bg_color_hover#', 'g'), ad['ctaBackgroundHoverColor']).replace(new RegExp('#' + prefix + '_cta_color#', 'g'), ad['ctaTextColor']).replace(new RegExp('#' + prefix + '_cta_color_hover#', 'g'), ad['ctaTextColorHover']).replace(new RegExp('#' + prefix + '_desc#', 'g'), ad['description']).replace(new RegExp('#' + prefix + '_index#', 'g'), prefix + '-' + ad['i']).replace(new RegExp('#' + prefix + '_img#', 'g'), ad['image']).replace(new RegExp('#' + prefix + '_small_img#', 'g'), ad['smallImage']).replace(new RegExp('#' + prefix + '_link#', 'g'), ad['statlink']).replace(new RegExp('#' + prefix + '_logo#', 'g'), ad['logo']).replace(new RegExp('#' + prefix + '_color#', 'g'), ad['textColor']).replace(new RegExp('#' + prefix + '_color_hover#', 'g'), ad['textColorHover']).replace(new RegExp('#' + prefix + '_title#', 'g'), ad['title']);\n\t\t\tselectedTarget.innerHTML = adInnerHtml + _native.pixel(ad['pixel'], ad['timestamp']);\n\t\t\tselectedTarget.setAttribute('data-state', 'visible');\n\t\t} else {\n\t\t\tselectedTarget.innerHTML = \"\";\n\t\t}\n\t});\n};","/*\n* Event\n* Visit http://createjs.com/ for documentation, updates and examples.\n*\n* Copyright (c) 2010 gskinner.com, inc.\n*\n* Permission is hereby granted, free of charge, to any person\n* obtaining a copy of this software and associated documentation\n* files (the \"Software\"), to deal in the Software without\n* restriction, including without limitation the rights to use,\n* copy, modify, merge, publish, distribute, sublicense, and/or sell\n* copies of the Software, and to permit persons to whom the\n* Software is furnished to do so, subject to the following\n* conditions:\n*\n* The above copyright notice and this permission notice shall be\n* included in all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n* OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n/**\n * A collection of Classes that are shared across all the CreateJS libraries. The classes are included in the minified\n * files of each library and are available on the createjs namespace directly.\n *\n *

    Example

    \n *\n * myObject.addEventListener(\"change\", createjs.proxy(myMethod, scope));\n *\n * @module CreateJS\n * @main CreateJS\n */\n\n\n/**\n * Contains properties and methods shared by all events for use with\n * {{#crossLink \"EventDispatcher\"}}{{/crossLink}}.\n * \n * Note that Event objects are often reused, so you should never\n * rely on an event object's state outside of the call stack it was received in.\n * @class Event\n * @param {String} type The event type.\n * @param {Boolean} bubbles Indicates whether the event will bubble through the display list.\n * @param {Boolean} cancelable Indicates whether the default behaviour of this event can be cancelled.\n * @constructor\n **/\nexport default class Event {\n\t\t\n\t\n\tconstructor(type, bubbles, cancelable) {\n\t// public properties:\n\t\t/**\n\t\t * The type of event.\n\t\t * @property type\n\t\t * @type String\n\t\t **/\n\t\tthis.type = type;\n\t\n\t\t/**\n\t\t * The object that generated an event.\n\t\t * @property target\n\t\t * @type Object\n\t\t * @default null\n\t\t * @readonly\n\t\t*/\n\t\tthis.target = null;\n\t\n\t\t/**\n\t\t * The current target that a bubbling event is being dispatched from. For non-bubbling events, this will\n\t\t * always be the same as target. For example, if childObj.parent = parentObj, and a bubbling event\n\t\t * is generated from childObj, then a listener on parentObj would receive the event with\n\t\t * target=childObj (the original target) and currentTarget=parentObj (where the listener was added).\n\t\t * @property currentTarget\n\t\t * @type Object\n\t\t * @default null\n\t\t * @readonly\n\t\t*/\n\t\tthis.currentTarget = null;\n\t\n\t\t/**\n\t\t * For bubbling events, this indicates the current event phase:
      \n\t\t * \t
    1. capture phase: starting from the top parent to the target
    2. \n\t\t * \t
    3. at target phase: currently being dispatched from the target
    4. \n\t\t * \t
    5. bubbling phase: from the target to the top parent
    6. \n\t\t *
    \n\t\t * @property eventPhase\n\t\t * @type Number\n\t\t * @default 0\n\t\t * @readonly\n\t\t*/\n\t\tthis.eventPhase = 0;\n\t\n\t\t/**\n\t\t * Indicates whether the event will bubble through the display list.\n\t\t * @property bubbles\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.bubbles = !!bubbles;\n\t\n\t\t/**\n\t\t * Indicates whether the default behaviour of this event can be cancelled via\n\t\t * {{#crossLink \"Event/preventDefault\"}}{{/crossLink}}. This is set via the Event constructor.\n\t\t * @property cancelable\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.cancelable = !!cancelable;\n\t\n\t\t/**\n\t\t * The epoch time at which this event was created.\n\t\t * @property timeStamp\n\t\t * @type Number\n\t\t * @default 0\n\t\t * @readonly\n\t\t*/\n\t\tthis.timeStamp = (new Date()).getTime();\n\t\n\t\t/**\n\t\t * Indicates if {{#crossLink \"Event/preventDefault\"}}{{/crossLink}} has been called\n\t\t * on this event.\n\t\t * @property defaultPrevented\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.defaultPrevented = false;\n\t\n\t\t/**\n\t\t * Indicates if {{#crossLink \"Event/stopPropagation\"}}{{/crossLink}} or\n\t\t * {{#crossLink \"Event/stopImmediatePropagation\"}}{{/crossLink}} has been called on this event.\n\t\t * @property propagationStopped\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.propagationStopped = false;\n\t\n\t\t/**\n\t\t * Indicates if {{#crossLink \"Event/stopImmediatePropagation\"}}{{/crossLink}} has been called\n\t\t * on this event.\n\t\t * @property immediatePropagationStopped\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.immediatePropagationStopped = false;\n\t\t\n\t\t/**\n\t\t * Indicates if {{#crossLink \"Event/remove\"}}{{/crossLink}} has been called on this event.\n\t\t * @property removed\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.removed = false;\n\t}\n\n// public methods:\n\t/**\n\t * Sets {{#crossLink \"Event/defaultPrevented\"}}{{/crossLink}} to true if the event is cancelable.\n\t * Mirrors the DOM level 2 event standard. In general, cancelable events that have `preventDefault()` called will\n\t * cancel the default behaviour associated with the event.\n\t * @method preventDefault\n\t **/\n\tpreventDefault() {\n\t\tthis.defaultPrevented = this.cancelable&&true;\n\t};\n\n\t/**\n\t * Sets {{#crossLink \"Event/propagationStopped\"}}{{/crossLink}} to true.\n\t * Mirrors the DOM event standard.\n\t * @method stopPropagation\n\t **/\n\tstopPropagation() {\n\t\tthis.propagationStopped = true;\n\t};\n\n\t/**\n\t * Sets {{#crossLink \"Event/propagationStopped\"}}{{/crossLink}} and\n\t * {{#crossLink \"Event/immediatePropagationStopped\"}}{{/crossLink}} to true.\n\t * Mirrors the DOM event standard.\n\t * @method stopImmediatePropagation\n\t **/\n\tstopImmediatePropagation() {\n\t\tthis.immediatePropagationStopped = this.propagationStopped = true;\n\t};\n\t\n\t/**\n\t * Causes the active listener to be removed via removeEventListener();\n\t * \n\t * \t\tmyBtn.addEventListener(\"click\", function(evt) {\n\t * \t\t\t// do stuff...\n\t * \t\t\tevt.remove(); // removes this listener.\n\t * \t\t});\n\t * \n\t * @method remove\n\t **/\n\tremove() {\n\t\tthis.removed = true;\n\t};\n\t\n\t/**\n\t * Returns a clone of the Event instance.\n\t * @method clone\n\t * @return {Event} a clone of the Event instance.\n\t **/\n\tclone() {\n\t\treturn new Event(this.type, this.bubbles, this.cancelable);\n\t};\n\t\n\t/**\n\t * Provides a chainable shortcut method for setting a number of properties on the instance.\n\t *\n\t * @method set\n\t * @param {Object} props A generic object containing properties to copy to the instance.\n\t * @return {Event} Returns the instance the method is called on (useful for chaining calls.)\n\t * @chainable\n\t*/\n\tset(props) {\n\t\tfor (let n in props) { this[n] = props[n]; }\n\t\treturn this;\n\t};\n\n\t/**\n\t * Returns a string representation of this object.\n\t * @method toString\n\t * @return {String} a string representation of the instance.\n\t **/\n\ttoString() {\n\t\treturn \"[Event (type=\"+this.type+\")]\";\n\t};\n}\n","/*\n* EventDispatcher\n* Visit http://createjs.com/ for documentation, updates and examples.\n*\n* Copyright (c) 2010 gskinner.com, inc.\n*\n* Permission is hereby granted, free of charge, to any person\n* obtaining a copy of this software and associated documentation\n* files (the \"Software\"), to deal in the Software without\n* restriction, including without limitation the rights to use,\n* copy, modify, merge, publish, distribute, sublicense, and/or sell\n* copies of the Software, and to permit persons to whom the\n* Software is furnished to do so, subject to the following\n* conditions:\n*\n* The above copyright notice and this permission notice shall be\n* included in all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n* OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n\n\n// constructor:\n/**\n* EventDispatcher provides methods for managing queues of event listeners and dispatching events.\n*\n* You can either extend EventDispatcher or mix its methods into an existing prototype or instance by using the\n* EventDispatcher {{#crossLink \"EventDispatcher/initialize\"}}{{/crossLink}} method.\n* \n* Together with the CreateJS Event class, EventDispatcher provides an extended event model that is based on the\n* DOM Level 2 event model, including addEventListener, removeEventListener, and dispatchEvent. It supports\n* bubbling / capture, preventDefault, stopPropagation, stopImmediatePropagation, and handleEvent.\n* \n* EventDispatcher also exposes a {{#crossLink \"EventDispatcher/on\"}}{{/crossLink}} method, which makes it easier\n* to create scoped listeners, listeners that only run once, and listeners with associated arbitrary data. The \n* {{#crossLink \"EventDispatcher/off\"}}{{/crossLink}} method is merely an alias to\n* {{#crossLink \"EventDispatcher/removeEventListener\"}}{{/crossLink}}.\n* \n* Another addition to the DOM Level 2 model is the {{#crossLink \"EventDispatcher/removeAllEventListeners\"}}{{/crossLink}}\n* method, which can be used to listeners for all events, or listeners for a specific event. The Event object also \n* includes a {{#crossLink \"Event/remove\"}}{{/crossLink}} method which removes the active listener.\n*\n*

    Example

    \n* Add EventDispatcher capabilities to the \"MyClass\" class.\n*\n* EventDispatcher.initialize(MyClass.prototype);\n*\n* Add an event (see {{#crossLink \"EventDispatcher/addEventListener\"}}{{/crossLink}}).\n*\n* instance.addEventListener(\"eventName\", handlerMethod);\n* function handlerMethod(event) {\n* console.log(event.target + \" Was Clicked\");\n* }\n*\n* Maintaining proper scope
    \n* Scope (ie. \"this\") can be be a challenge with events. Using the {{#crossLink \"EventDispatcher/on\"}}{{/crossLink}}\n* method to subscribe to events simplifies this.\n*\n* instance.addEventListener(\"click\", function(event) {\n* console.log(instance == this); // false, scope is ambiguous.\n* });\n* \n* instance.on(\"click\", function(event) {\n* console.log(instance == this); // true, \"on\" uses dispatcher scope by default.\n* });\n* \n* If you want to use addEventListener instead, you may want to use function.bind() or a similar proxy to manage\n* scope.\n*\n* Browser support\n* The event model in CreateJS can be used separately from the suite in any project, however the inheritance model\n* requires modern browsers (IE9+).\n* \n*\n* @class EventDispatcher\n* @constructor\n**/\nimport Event from \"./Event.js\";\n\nexport default class EventDispatcher {\n\t\n\tconstructor() {\n\t// private properties:\n\t\t/**\n\t\t * @protected\n\t\t * @property _listeners\n\t\t * @type Object\n\t\t **/\n\t\tthis._listeners = null;\n\t\t\n\t\t/**\n\t\t * @protected\n\t\t * @property _captureListeners\n\t\t * @type Object\n\t\t **/\n\t\tthis._captureListeners = null;\n\t\t\n\t\t\n\t\t/**\n\t\t * A shortcut to the removeEventListener method, with the same parameters and return value. This is a companion to the\n\t\t * .on method.\n\t\t * \n\t\t * IMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener. See \n\t\t * {{#crossLink \"EventDispatcher/on\"}}{{/crossLink}} for an example.\n\t\t *\n\t\t * @method off\n\t\t * @param {String} type The string type of the event.\n\t\t * @param {Function | Object} listener The listener function or object.\n\t\t * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.\n\t\t **/\n\t\t this.off = this.removeEventListener;\n\t}\n\t\n\t\n// static public methods:\n\t/**\n\t * Static initializer to mix EventDispatcher methods into a target object or prototype.\n\t * \n\t * \t\tEventDispatcher.initialize(MyClass.prototype); // add to the prototype of the class\n\t * \t\tEventDispatcher.initialize(myObject); // add to a specific instance\n\t * \n\t * @method initialize\n\t * @static\n\t * @param {Object} target The target object to inject EventDispatcher methods into. This can be an instance or a\n\t * prototype.\n\t **/\n\tstatic EventDispatcher(target) {\n\t\ttarget.addEventListener = p.addEventListener;\n\t\ttarget.on = p.on;\n\t\ttarget.removeEventListener = target.off = p.removeEventListener;\n\t\ttarget.removeAllEventListeners = p.removeAllEventListeners;\n\t\ttarget.hasEventListener = p.hasEventListener;\n\t\ttarget.dispatchEvent = p.dispatchEvent;\n\t\ttarget._dispatchEvent = p._dispatchEvent;\n\t\ttarget.willTrigger = p.willTrigger;\n\t};\n\t\n\n// public methods:\n\t/**\n\t * Adds the specified event listener. Note that adding multiple listeners to the same function will result in\n\t * multiple callbacks getting fired.\n\t *\n\t *

    Example

    \n\t *\n\t * displayObject.addEventListener(\"click\", handleClick);\n\t * function handleClick(event) {\n\t * // Click happened.\n\t * }\n\t *\n\t * @method addEventListener\n\t * @param {String} type The string type of the event.\n\t * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when\n\t * the event is dispatched.\n\t * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.\n\t * @return {Function | Object} Returns the listener for chaining or assignment.\n\t **/\n\taddEventListener(type, listener, useCapture) {\n\t\tlet listeners;\n\t\tif (useCapture) {\n\t\t\tlisteners = this._captureListeners = this._captureListeners||{};\n\t\t} else {\n\t\t\tlisteners = this._listeners = this._listeners||{};\n\t\t}\n\t\tlet arr = listeners[type];\n\t\tif (arr) { this.removeEventListener(type, listener, useCapture); }\n\t\tarr = listeners[type]; // remove may have deleted the array\n\t\tif (!arr) { listeners[type] = [listener]; }\n\t\telse { arr.push(listener); }\n\t\treturn listener;\n\t};\n\t\n\t/**\n\t * A shortcut method for using addEventListener that makes it easier to specify an execution scope, have a listener\n\t * only run once, associate arbitrary data with the listener, and remove the listener.\n\t * \n\t * This method works by creating an anonymous wrapper function and subscribing it with addEventListener.\n\t * The wrapper function is returned for use with `removeEventListener` (or `off`).\n\t * \n\t * IMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener, or use\n\t * {{#crossLink \"Event/remove\"}}{{/crossLink}}. Likewise, each time you call `on` a NEW wrapper function is subscribed, so multiple calls\n\t * to `on` with the same params will create multiple listeners.\n\t * \n\t *

    Example

    \n\t * \n\t * \t\tvar listener = myBtn.on(\"click\", handleClick, null, false, {count:3});\n\t * \t\tfunction handleClick(evt, data) {\n\t * \t\t\tdata.count -= 1;\n\t * \t\t\tconsole.log(this == myBtn); // true - scope defaults to the dispatcher\n\t * \t\t\tif (data.count == 0) {\n\t * \t\t\t\talert(\"clicked 3 times!\");\n\t * \t\t\t\tmyBtn.off(\"click\", listener);\n\t * \t\t\t\t// alternately: evt.remove();\n\t * \t\t\t}\n\t * \t\t}\n\t * \n\t * @method on\n\t * @param {String} type The string type of the event.\n\t * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when\n\t * the event is dispatched.\n\t * @param {Object} [scope] The scope to execute the listener in. Defaults to the dispatcher/currentTarget for function listeners, and to the listener itself for object listeners (ie. using handleEvent).\n\t * @param {Boolean} [once=false] If true, the listener will remove itself after the first time it is triggered.\n\t * @param {*} [data] Arbitrary data that will be included as the second parameter when the listener is called.\n\t * @param {Boolean} [useCapture=false] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.\n\t * @return {Function} Returns the anonymous function that was created and assigned as the listener. This is needed to remove the listener later using .removeEventListener.\n\t **/\n\ton(type, listener, scope, once, data, useCapture) {\n\t\tif (listener.handleEvent) {\n\t\t\tscope = scope||listener;\n\t\t\tlistener = listener.handleEvent;\n\t\t}\n\t\tscope = scope||this;\n\t\treturn this.addEventListener(type, function(evt) {\n\t\t\t\tlistener.call(scope, evt, data);\n\t\t\t\tonce&&evt.remove();\n\t\t\t}, useCapture);\n\t};\n\n\t/**\n\t * Removes the specified event listener.\n\t *\n\t * Important Note: that you must pass the exact function reference used when the event was added. If a proxy\n\t * function, or function closure is used as the callback, the proxy/closure reference must be used - a new proxy or\n\t * closure will not work.\n\t *\n\t *

    Example

    \n\t *\n\t * displayObject.removeEventListener(\"click\", handleClick);\n\t *\n\t * @method removeEventListener\n\t * @param {String} type The string type of the event.\n\t * @param {Function | Object} listener The listener function or object.\n\t * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.\n\t **/\n\tremoveEventListener(type, listener, useCapture) {\n\t\tlet listeners = useCapture ? this._captureListeners : this._listeners;\n\t\tif (!listeners) { return; }\n\t\tlet arr = listeners[type];\n\t\tif (!arr) { return; }\n\t\tfor (let i=0,l=arr.length; iExample\n\t *\n\t * // Remove all listeners\n\t * displayObject.removeAllEventListeners();\n\t *\n\t * // Remove all click listeners\n\t * displayObject.removeAllEventListeners(\"click\");\n\t *\n\t * @method removeAllEventListeners\n\t * @param {String} [type] The string type of the event. If omitted, all listeners for all types will be removed.\n\t **/\n\tremoveAllEventListeners(type) {\n\t\tif (!type) { this._listeners = this._captureListeners = null; }\n\t\telse {\n\t\t\tif (this._listeners) { delete(this._listeners[type]); }\n\t\t\tif (this._captureListeners) { delete(this._captureListeners[type]); }\n\t\t}\n\t};\n\n\t/**\n\t * Dispatches the specified event to all listeners.\n\t *\n\t *

    Example

    \n\t *\n\t * // Use a string event\n\t * this.dispatchEvent(\"complete\");\n\t *\n\t * // Use an Event instance\n\t * var event = new Event(\"progress\");\n\t * this.dispatchEvent(event);\n\t *\n\t * @method dispatchEvent\n\t * @param {Object | String | Event} eventObj An object with a \"type\" property, or a string type.\n\t * While a generic object will work, it is recommended to use a CreateJS Event instance. If a string is used,\n\t * dispatchEvent will construct an Event instance if necessary with the specified type. This latter approach can\n\t * be used to avoid event object instantiation for non-bubbling events that may not have any listeners.\n\t * @param {Boolean} [bubbles] Specifies the `bubbles` value when a string was passed to eventObj.\n\t * @param {Boolean} [cancelable] Specifies the `cancelable` value when a string was passed to eventObj.\n\t * @return {Boolean} Returns false if `preventDefault()` was called on a cancelable event, true otherwise.\n\t **/\n\tdispatchEvent(eventObj, bubbles, cancelable) {\n\t\tif (typeof eventObj == \"string\") {\n\t\t\t// skip everything if there's no listeners and it doesn't bubble:\n\t\t\tlet listeners = this._listeners;\n\t\t\tif (!bubbles && (!listeners || !listeners[eventObj])) { return true; }\n\t\t\teventObj = new Event(eventObj, bubbles, cancelable);\n\t\t} else if (eventObj.target && eventObj.clone) {\n\t\t\t// redispatching an active event object, so clone it:\n\t\t\teventObj = eventObj.clone();\n\t\t}\n\t\t\n\t\t// TODO: it would be nice to eliminate this. Maybe in favour of evtObj instanceof Event? Or !!evtObj.createEvent\n\t\ttry { eventObj.target = this; } catch (e) {} // try/catch allows redispatching of native events\n\n\t\tif (!eventObj.bubbles || !this.parent) {\n\t\t\tthis._dispatchEvent(eventObj, 2);\n\t\t} else {\n\t\t\tlet top=this, list=[top];\n\t\t\twhile (top.parent) { list.push(top = top.parent); }\n\t\t\tlet i, l=list.length;\n\n\t\t\t// capture & atTarget\n\t\t\tfor (i=l-1; i>=0 && !eventObj.propagationStopped; i--) {\n\t\t\t\tlist[i]._dispatchEvent(eventObj, 1+(i==0));\n\t\t\t}\n\t\t\t// bubbling\n\t\t\tfor (i=1; i.\n*/\n\nlet DOMUtils = {}, $ = DOMUtils;\nexport default DOMUtils;\n\t\n$.query = function(query, element = document.body) {\n\treturn (query[0] === \">\") ? $._childQuery(query, element, $.query) : element.querySelector(query);\n};\n\n$.queryAll = function(query, element = document.body) {\n\treturn (query[0] === \">\") ? $._childQuery(query, element, $.queryAll) : element.querySelectorAll(query);\n};\n\n$.removeClass = function(element, className) {\n\tif ($._runOnNodeList($.removeClass, element, className)) { return element; }\n\tif (className instanceof RegExp) {\n\t\tlet arr = (element.getAttribute(\"class\")||\"\").split(\" \"), re = className;\n\t\telement.setAttribute(\"class\", arr.filter((s)=> !re.test(s)).join(\" \"));\n\t} else {\n\t\tlet list = element.classList;\n\t\tlist.remove.apply(list, className.split(\" \"));\n\t}\n\treturn element;\n};\n\n$.addClass = function(element, className) {\n\tif ($._runOnNodeList($.addClass, element, className)) { return element; }\n\t\n\t$.removeClass(element, className);\n\n\tlet names = className.split(\" \");\n\tfor (let i = 0; i < names.length; i++) {\n\t\telement.classList.add(names[i]);\n\t}\n\treturn element;\n};\n\n$.toggleClass = function(element, className, value) {\n\tif ($._runOnNodeList($.toggleClass, element, className, value)) { return element; }\n\tlet curValue = $.hasClass(element, className);\n\tif (value == null) { value = !curValue; }\n\telse if (value === curValue) { return; }\n\tif (value) { $.addClass(element, className); }\n\telse { $.removeClass(element, className); }\n};\n\n$.hasClass = function(element, className) {\n\treturn !!(element.getAttribute(\"class\")||\"\").match(new RegExp(\"\\\\b\\\\s?\" + className + \"\\\\b\", \"g\"));\n};\n\n$.swapClass = function(element, oldClass, newClass) {\n\t$.removeClass(element, oldClass);\n\t$.addClass(element, newClass);\n\treturn element;\n};\n\n$.remove = function(element) {\n\tif ($._runOnNodeList($.remove, element)) { return element; }\n\t\n\tif (element.remove) {\n\t\telement.remove();\n\t} else if (element.parentNode) {\n\t\telement.parentNode.removeChild(element);\n\t}\n\treturn element;\n};\n\n$.on = function(element, event, listener) {\n\tif ($._runOnNodeList($.on, element, event, listener)) { return element; }\n\telement.addEventListener(event, listener);\n}\n\n$.off = function(element, event, listener) {\n\tif ($._runOnNodeList($.off, element, event, listener)) { return element; }\n\telement.removeEventListener(event, listener);\n}\n\n/*\n Remove all children from an element.\n When using .innerHTML = \"\"; IE fails when adding new dom elements via appendChild();\n */\n$.empty = function(element) {\n\tif ($._runOnNodeList($.empty, element)) { return element; }\n\t\n\twhile (element.firstChild) {\n\t\telement.removeChild(element.firstChild);\n\t}\n\treturn element;\n};\n\n$.create = function(type, className, content, parent) {\n\tlet element = document.createElement(type || \"div\");\n\tif (className) { element.className = className; }\n\tif (content) {\n\t\tif (content instanceof HTMLElement) { element.appendChild(content); }\n\t\telse { element.innerHTML = content; }\n\t}\n\tif (parent) { parent.appendChild(element); }\n\treturn element;\n};\n\n$.getEl = function(query, scope) {\n\tif (query instanceof HTMLElement || !query) { return query; }\n\treturn $.query(query, scope);\n};\n\n$.togglePanel = function(element, openEl, closedEl, open) {\n\tlet el1 = $.getEl(openEl, element), el2 = $.getEl(closedEl, element), tmp, isOpen = !$.hasClass(element, \"closed\");\n\tif (open === undefined) { open = !isOpen; }\n\telse { open = !!open; }\n\tif (open === isOpen) { return; }\n\tif (open) {\n\t\t$.removeClass(element, \"closed\");\n\t\ttmp = el2;\n\t\tel2 = el1;\n\t\tel1 = tmp;\n\t}\n\telse { $.addClass(element, \"closed\"); }\n\n\tel1 && (el1.style.display = \"none\");\n\tif (el2) {\n\t\tlet f = function(evt) {\n\t\t\tif (evt.target !== element) { return; }\n\t\t\tel2.style.display = \"flex\";\n\t\t\telement.removeEventListener(\"transitionend\", f);\n\t\t};\n\t\telement.addEventListener(\"transitionend\", f);\n\t}\n};\n\n$.transition = function(target, className, then) {\n\tlet f = (evt) => {\n\t\tif (evt.target !== target) { return; }\n\t\ttarget.removeEventListener(\"transition\", f);\n\t\tthen();\n\t};\n\ttarget.addEventListener(\"transitionend\", f);\n\t$.addClass(target, className);\n};\n\n$.template = function(strings, ...keys) {\n\treturn (o) => {\n\t\tlet result = strings[0];\n\t\tfor (let i=0, l=keys.length; i.\n*/\n\nlet Utils = {};\nexport default Utils;\n\nUtils.prepMenuContent = function(content, idMap) {\n\tif (!idMap.__next_id) { idMap.__next_id = 1; }\n\tlet kids = content.kids;\n\tfor (let i = 0, l = kids.length; i < l; i++) {\n\t\tlet o = kids[i];\n\t\t// current list implementation requires everything to have an id:\n\t\tif (!o.id) { o.id = \"__id_\"+(idMap.__next_id++); }\n\t\tidMap[o.id] = o;\n\t\to.parent = content;\n\t\tif (o.kids) { Utils.prepMenuContent(o, idMap); }\n\t}\n\treturn content;\n};\n\nUtils.find = function(arr, f) {\n\tfor (let i=0, l=arr.length; i 0 && str.length > length;\n\tif (b) { str = str.substr(0, length-1); }\n\tif (htmlSafe) { str = Utils.htmlSafe(str); }\n\treturn !b ? str : str + (tag&&\"<\"+tag+\">\") + \"\\u2026\" + (tag&&\"\");\n};\n\nUtils.unescSubstStr = function(str) {\n\tif (!str) { return \"\"; }\n\treturn str.replace(Utils.SUBST_ESC_RE, (a, b, c)=> Utils.SUBST_ESC_CHARS[b] || String.fromCharCode(parseInt(c, 16)) );\n};\n\n\nUtils.getRegExp = function(str) {\n\t// returns a JS RegExp object.\n\tlet match = str.match(/^\\/(.+)\\/([a-z]+)?$/), regex=null;\n\ttry {\n\t\tregex = match ? new RegExp(match[1], match[2] || \"\") : new RegExp(str, \"g\");\n\t} catch(e) { }\n\treturn regex;\n};\n\nUtils.decomposeRegEx = function(str, delim=\"/\") {\n\tlet re = new RegExp(\"^\"+delim+\"(.*)\"+delim+\"([igmsuUxy]*)$\");\n\tlet match = re.exec(str);\n\tif (match) {\n\t\treturn {source: match[1], flags: match[2]};\n\t} else {\n\t\treturn {source: str, flags: \"g\"};\n\t}\n};\n\nUtils.isMac = function () {\n\treturn !!(navigator.userAgent.match(/Mac\\sOS/i))\n};\n\nUtils.getCtrlKey = function () {\n\treturn Utils.isMac() ? \"cmd\" : \"ctrl\";\n};\n\nUtils.now = function() {\n\treturn window.performance ? performance.now() : Date.now();\n};\n\nUtils.getUrlParams = function() {\n\tlet match, re = /([^&=]+)=?([^&]*)/g, params = {};\n\tlet url = window.location.search.substr(1).replace(/\\+/g, \" \");\n\twhile (match = re.exec(url)) { params[decodeURIComponent(match[1])] = decodeURIComponent(match[2]); }\n\treturn params;\n};\n\nlet deferIds = {};\nUtils.defer = function (f, id, t=1) {\n\tclearTimeout(deferIds[id]);\n\tif (f === null) {\n\t\tdelete(deferIds[id]);\n\t\treturn;\n\t}\n\tdeferIds[id] = setTimeout(()=>{\n\t\tdelete deferIds[id];\n\t\tf();\n\t}, t)\n};\n\nUtils.getHashCode = function(s) {\n\tlet hash = 0, l = s.length, i;\n\tfor (i = 0; i < l; i++ ) {\n\t\thash = ((hash << 5) - hash) + s.charCodeAt(i) | 0;\n\t}\n\treturn hash;\n};\n\nUtils.getPatternURL = function(pattern) {\n\tlet a = Utils.isLocal ? \"?id=\" : \"/\";\n\tlet url = window.location.origin, id=pattern&&pattern.id||\"\";\n\treturn url+a+id;\n}\n\nUtils.isLocal = (window.location.hostname === \"localhost\");\n\nUtils.getPatternURLStr = function(pattern) {\n\tif (!pattern || !pattern.id) { return null; }\n\tlet a = Utils.isLocal ? \"?id=\" : \"/\";\n\tlet url = window.location.host, id=pattern.id;\n\treturn url+a+id;\n}\n\nUtils.getForkName = function(name) {\n\tlet res = / ?\\(fork ?(\\d*)\\)$/.exec(name);\n\tif (res) {\n\t\tlet num = (res[1]||1)*1 + 1;\n\t\treturn name.substr(0, res.index) + \" (fork \"+num+\")\";\n\t}\n\treturn name + \" (fork)\";\n}\n\nUtils.SUBST_ESC_CHARS = {\n\t// this is just the list supported in Replace. Others: b, f, \", etc.\n\tn: \"\\n\",\n\tr: \"\\r\",\n\tt: \"\\t\",\n\t\"\\\\\": \"\\\\\"\n};\n\nUtils.SUBST_ESC_RE = /\\\\([nrt\\\\]|u([A-Z0-9]{4}))/ig;","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\n\nexport default class Tooltip {\n\t\n\tconstructor(el, transition=false) {\n\t\tthis.el = $.remove(el);\n\t\tthis.transition = transition;\n\t\tthis.contentEl = $.query(\".content\", el);\n\t\tthis.tipEl = $.query(\".tip\", el);\n\t\tthis.hideF = (evt)=> Date.now()>this._showT && this.handleBodyClick(evt);\n\t\tthis.curId = null;\n\t}\n\t\n\ttoggle(id, content, x, y, autohide, th) {\n\t\tif (id === this.curId) { return this.hide(id); }\n\t\tthis.show(id, content, x, y, autohide, th);\n\t}\n\t\n\ttoggleOn(id, content, el, autohide, th) {\n\t\tif (id === this.curId) { return this.hide(id); }\n\t\tthis.showOn(id, content, el, autohide, th);\n\t\tthis.toggleEl = el;\n\t\t$.addClass(el, \"selected\");\n\t}\n\t\n\thide(id) {\n\t\tif (id && this.curId !== id) { return; }\n\t\tlet el = this.el, elStyle = el.style;\n\t\t$.empty($.query(\".content\", $.remove(el)));\n\t\t$.removeClass(el, \"flipped\");\n\t\tdocument.body.removeEventListener(\"mousedown\", this.hideF);\n\t\t\n\t\tif (this.toggleEl) {\n\t\t\t$.removeClass(this.toggleEl, \"selected\");\n\t\t\tthis.toggleEl = null;\n\t\t}\n\t\t\n\t\t// reset position and width so that content wrapping resolves properly:\n\t\telStyle.left = elStyle.top = \"0\";\n\t\telStyle.width = \"\";\n\t\tif (this.transition) {\n\t\t\telStyle.opacity = 0;\n\t\t\telStyle.marginTop = \"-0.25em\";\n\t\t}\n\t\tthis.curId = null;\n\t}\n\n\tshow(id, content, x, y, autohide = false, th = 0) {\n\t\tthis.hide();\n\t\tif (!content) { return; }\n\n\t\tlet el = this.el, elStyle = el.style, contentEl = this.contentEl, body = document.body, pad = 8;\n\t\tif (content instanceof HTMLElement) { contentEl.appendChild(content); }\n\t\telse { contentEl.innerHTML = content; }\n\n\t\tif (autohide) {\n\t\t\tthis._showT = Date.now()+30; // ignore double clicks and events in the current stack.\n\t\t\tbody.addEventListener(\"mousedown\", this.hideF);\n\t\t}\n\n\t\tbody.appendChild(el);\n\n\t\tlet wh = window.innerHeight, ww = window.innerWidth;\n\t\tlet rect = el.getBoundingClientRect(), w = rect.right - rect.left, h = rect.bottom - rect.top, off = 0;\n\t\tif (y + h > wh - pad) {\n\t\t\t$.addClass(el, \"flipped\");\n\t\t\ty -= th;\n\t\t}\n\t\tif (x - w / 2 < pad) { off = pad - x + w / 2; }\n\t\telse if (x + w / 2 > ww - pad) { off = ww - pad - x - w / 2; }\n\t\tthis.tipEl.style.marginRight = Math.max(-w / 2 + 10, Math.min(w / 2 - 10, off)) * 2 + \"px\";\n\t\telStyle.width = Math.ceil(w/2)*2 + \"px\";\n\t\telStyle.top = Math.round(y) + \"px\";\n\t\telStyle.left = Math.round(x + off) + \"px\";\n\t\tif (this.transition) {\n\t\t\telStyle.opacity = 1;\n\t\t\telStyle.marginTop = 0;\n\t\t}\n\t\t\n\t\tthis.curId = id;\n\t}\n\t\n\tshowOn(id, content, el, autohide, th=0) {\n\t\tlet rect = el.getBoundingClientRect();\n\t\tlet x = Math.round((rect.left+rect.right)/2);\n\t\tlet y = rect.bottom+th;\n\t\tlet h = rect.bottom-rect.top;\n\t\tthis.show(id, content, x, y, autohide, h);\n\t}\n\n\thandleBodyClick(evt) {\n\t\tlet id = this.curId;\n\t\tif (this.el.contains(evt.target) || (this.toggleEl && this.toggleEl.contains(evt.target))) { return; }\n\t\tthis.hide(id);\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"../utils/Utils\";\nimport app from \"../app\";\n\nexport default class Server {\n\n// regex:\n\tstatic solve(req) {\n\t\treturn Server._getRequest(\"regex/solve\", {data: JSON.stringify(req)});\n\t}\n\n\tstatic version(flavor) {\n\t\treturn Server._getRequest(\"regex/version\", {flavor:flavor});\n\t}\n\n// patterns:\n\tstatic communitySearch(str) {\n\t\treturn Server._getRequest(\"patterns/search\", {query:str||\"\", startIndex:0, limit:100}, (data) => { this._processPatternList(data); });\n\t}\n\n\tstatic load(id) {\n\t\treturn Server._getRequest(\"patterns/load\", {patternId:id}, (data) => this._processPattern(data));\n\t}\n\n\tstatic save(pattern, fork, community) {\n\t\t// clone and prep the pattern object:\n\t\tlet o = this._prepPattern(pattern, fork, community);\n\t\treturn Server._getRequest(\"patterns/save\", o, (data) => this._processPattern(data));\n\t}\n\n\tstatic rate(id, rating) {\n\t\treturn Server._getRequest(\"patterns/rate\", {patternId:id, userRating:rating}, (data) => data.rating = Number(data.rating));\n\t}\n\n\tstatic delete(id) {\n\t\treturn Server._getRequest(\"patterns/delete\", {patternId:id});\n\t}\n\n\tstatic favorite(id, value) {\n\t\treturn Server._getRequest(\"patterns/favorite\", {patternId:id, favorite:!!value});\n\t}\n\n\tstatic private(id, value) {\n\t\treturn Server.setAccess(id, value ? \"private\" : \"protected\");\n\t}\n\n\tstatic setAccess(id, value) {\n\t\treturn Server._getRequest(\"patterns/setAccess\", {patternId:id, access:value});\n\t}\n\n\tstatic multiFavorite(ids) {\n\t\treturn Server._getRequest(\"patterns/multiFavorite\", {patternIds:JSON.stringify(ids)});\n\t}\n\n// account:\n\tstatic login(service) {\n\t\twindow.location = Server.url + \"?action=account/login&type=\"+service;\n\t}\n\n\tstatic logout() {\n\t\treturn Server._getRequest(\"account/logout\", {});\n\t}\n\n\tstatic verify() {\n\t\treturn Server._getRequest(\"account/verify\", {});\n\t}\n\n\tstatic patterns() {\n\t\treturn Server._getRequest(\"account/patterns\", {}, (data) => {\n\t\t\tthis._processPatternList(data);\n\t\t\tdata.results.sort((a, b) => {\n\t\t\t\treturn (b.favorite - a.favorite) || (b.dateAdded - a.dateAdded) || 1-2*(a.id > b.id);\n\t\t\t})\n\t\t});\n\t}\n\n// helpers:\n\tstatic _processPatternList(data) {\n\t\tdata.results.forEach(this._processPattern);\n\t}\n\n\tstatic _processPattern(o) {\n\t\t// parse values:\n\t\to.rating = Number(o.rating);\n\t\to.userRating = Number(o.userRating);\n\t\to.flavor = o.flavor || \"js\";\n\t\to.mode = o.mode || \"text\";\n\t\to.text = o.text || null;\n\t\tif (o.tool && o.tool.id) { o.tool.id = o.tool.id.toLowerCase(); }\n\t}\n\n\tstatic _prepPattern(o, fork, community) {\n\t\to = Utils.clone(o);\n\t\tif (fork) {\n\t\t\to.parentId = o.id;\n\t\t\tdelete(o.id);\n\t\t\tif (!community) { o.name = Utils.getForkName(o.name); }\n\t\t}\n\t\t// clear null values:\n\t\tif (!o.id) { delete(o.id); }\n\t\tif (!o.parentId) { delete(o.parentId); }\n\t\tdelete(o.userId); // this gets added by the server\n\t\to.tool = o.tool && JSON.stringify(o.tool);\n\t\to.tests = o.tests && JSON.stringify(o.tests);\n\t\treturn o;\n\t}\n\n// private methods:\n\tstatic _getRequest(action, data={}, postprocess) {\n\t\tlet req = new XMLHttpRequest(), p = new ServerPromise(req, postprocess), params = [];\n\t\treq.open(\"POST\", Server.url);\n\t\treq.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\", true);\n\t\treq.timeout = 30*1000;\n\t\tdata.action = action;\n\n\t\tif (Server.isLocal && Server.useBeta) { data.userId = 111; }\n\t\tfor (let n in data) { params.push(n + \"=\" + encodeURIComponent(data[n])); }\n\t\tif (Server.isLocal) { console.log(data); }\n\t\treq.send(params.join(\"&\"));\n\t\treturn p;\n\t}\n}\n\nclass ServerPromise {\n\tconstructor(req, postprocess) {\n\t\tthis._req = req;\n\t\tthis._postprocess = postprocess;\n\t\treq.addEventListener(\"load\", ()=>this._load());\n\t\treq.addEventListener(\"timeout\", (evt)=>this._error(\"servercomm\"));\n\t\treq.addEventListener(\"error\", (evt)=>this._error(\"servercomm\"));\n\t}\n\n\tthen(f, cf, ff) {\n\t\tthis._loadF = f;\n\t\tif (cf) { this.catch(cf); }\n\t\tif (this._data) { f(this._data); }\n\t\tif (ff) { this.finally(ff); }\n\t\treturn this;\n\t}\n\n\tcatch(f) {\n\t\tthis._errorF = f;\n\t\tif (this._err) { f(this._err); }\n\t\treturn this;\n\t}\n\n\tfinally(f) {\n\t\tthis._finallyF = f;\n\t\tif (this._complete) { f(); }\n\t\treturn this;\n\t}\n\n\tabort() {\n\t\tif (this._complete) { return; }\n\t\tthis._complete = true;\n\t\tthis._req.abort();\n\t\tthis._finallyF && this._finallyF();\n\t\tthis._loadF = this._errorF = this._finallyF = null; // just to make sure.\n\t}\n\n\t_load() {\n\t\tlet json;\n\t\tthis._complete = true;\n\t\tif (Server.isLocal) { console.log(this._req.response || this._req.responseText); }\n\t\ttry { json = JSON.parse(this._req.response || this._req.responseText); }\n\t\tcatch (e) { return this._error(e); }\n\t\tif (!json.success) { return this._error(json.data); }\n\t\tthis._postprocess && this._postprocess(json.data);\n\t\tthis._data = json.data;\n\t\tthis._loadF && this._loadF(this._data);\n\t\tthis._finallyF && this._finallyF();\n\t}\n\n\t_error(e) {\n\t\tthis._err = (e.data && e.data.error) || e.message || e.detail || e.type || String(e);\n\t\tthis._errorF && this._errorF(this._err);\n\t\tthis._finallyF && this._finallyF();\n\t}\n}\n\nServer.isLocal = Utils.isLocal;\nServer.useBeta = Server.isLocal || (window.location.hostname === \"beta.regexr.com\");\nServer.host = \"https://\" + (Server.useBeta ? \"beta.\" : \"\") + \"regexr.com\"\nServer.url = Server.host + \"/server/api.php\";\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n/*\nUtilities for working with CodeMirror.\n*/\n\nimport Utils from \"../utils/Utils\";\nimport $ from \"../utils/DOMUtils\";\n\nlet CMUtils = {};\nexport default CMUtils;\n\nCMUtils.create = function (target, opts={}, width=\"100%\", height=\"100%\") {\n\tlet keys = {}, ctrlKey = Utils.getCtrlKey();\n\t//keys[ctrlKey + \"-Z\"] = keys[ctrlKey + \"-Y\"] = keys[\"Shift-\" + ctrlKey + \"-Z\"] = () => false; // block CM handling\n\n\tlet o = Utils.copy({\n\t\tlineNumbers: false,\n\t\ttabSize: 3,\n\t\tindentWithTabs: true,\n\t\textraKeys: keys,\n\t\tspecialChars: /[ \\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/,\n\t\tspecialCharPlaceholder: (ch) => $.create(\"span\", ch === \" \" ? \"cm-space\" : \"cm-special\", \" \") // needs to be a space so wrapping works\n\t}, opts);\n\t\n\tlet cm = CodeMirror(target, o);\n\tcm.setSize(width, height);\n\t\n\t\n\tif (cm.getOption(\"maxLength\")) {\n\t\tcm.on(\"beforeChange\", CMUtils.enforceMaxLength);\n\t}\n\tif (cm.getOption(\"singleLine\")) {\n\t\tcm.on(\"beforeChange\", CMUtils.enforceSingleLine);\n\t}\n\t\n\treturn cm;\n};\n\nCMUtils.getCharIndexAt = function (cm, winX, winY) {\n\tlet pos = cm.coordsChar({left: winX, top: winY}, \"page\");\n\t// test current and prev character, since CM seems to use the center of each character for coordsChar:\n\tfor (let i = 0; i <= 1; i++) {\n\t\tlet rect = cm.charCoords(pos, \"page\");\n\t\tif (winX >= rect.left && winX <= rect.right && winY >= rect.top && winY <= rect.bottom) {\n\t\t\treturn cm.indexFromPos(pos);\n\t\t}\n\t\tif (pos.ch-- <= 0) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn null;\n};\n/*\n// unused?\nCMUtils.getEOLPos = function (cm, pos) {\n\tif (!isNaN(pos)) {\n\t\tpos = cm.posFromIndex(pos);\n\t}\n\tlet rect = cm.charCoords(pos, \"local\"), w = cm.getScrollInfo().width;\n\treturn cm.coordsChar({left: w - 1, top: rect.top}, \"local\");\n};\n*/\nCMUtils.getCharRect = function (cm, index) {\n\tif (index == null) { return null; }\n\tlet pos = cm.posFromIndex(index), rect = cm.charCoords(pos);\n\trect.x = rect.left;\n\trect.y = rect.top;\n\trect.width = rect.right - rect.left;\n\trect.height = rect.bottom - rect.top;\n\treturn rect;\n};\n\n\nCMUtils.enforceMaxLength = function (cm, change) {\n\tlet maxLength = cm.getOption(\"maxLength\");\n\tif (maxLength && change.update) {\n\t\tlet str = change.text.join(\"\\n\");\n\t\tlet delta = str.length - (cm.indexFromPos(change.to) - cm.indexFromPos(change.from));\n\t\tif (delta <= 0) { return true; \n\t\t}\n\t\tdelta = cm.getValue().length + delta - maxLength;\n\t\tif (delta > 0) {\n\t\t\tstr = str.substr(0, str.length - delta);\n\t\t\tchange.update(change.from, change.to, str.split(\"\\n\"));\n\t\t}\n\t}\n\treturn true;\n};\n\nCMUtils.enforceSingleLine = function (cm, change) {\n\tif (change.update) {\n\t\tlet str = change.text.join(\"\").replace(/(\\n|\\r)/g, \"\");\n\t\tchange.update(change.from, change.to, [str]);\n\t}\n\treturn true;\n};\n\nCMUtils.selectAll = function(cm) {\n\tcm.focus();\n\tcm.setSelection({ch:0,line:0},{ch:0, line:cm.lineCount()});\n}\n\nCMUtils.calcRangePos = function(cm, i, l=0, o={}) {\n\tlet doc = cm.getDoc();\n\to.startPos = doc.posFromIndex(i);\n\to.endPos = doc.posFromIndex(i+l);\n\treturn o;\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nlet Track = {};\nexport default Track;\n\nTrack.GA_ID = \"UA-3579542-6\";\n\nTrack.page = function(path) {\n\tgtag(\"config\", Track.GA_ID, {\"page_path\": \"/\"+path});\n};\n\n// https://developers.google.com/analytics/devguides/collection/gtagjs/events\nTrack.event = function(name, category, label) {\n\tlet o = {};\n\tif (category) { o.event_category = category; }\n\tif (label) { o.event_label = label; }\n\tgtag(\"event\", name, o);\n}\n\n\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nexport default class List extends EventDispatcher {\n\tconstructor(el, opts) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis.multi = opts.multi;\n\t\tthis.template = opts.template;\n\t\tthis.data = opts.data;\n\t\tif (opts.selected) { this.selected = opts.selected; }\n\t}\n\t\n\tset data(data) {\n\t\t$.empty(this.el);\n\t\tthis._data = data;\n\t\tif (!data || !data.length) { return; }\n\t\tfor (let i=0, l=data.length; i$.addClass($.query(\"[data-id='\"+id+\"']\",this.el), \"selected\"));\n\t\t\n\t\tif (!this.multi) { this.scrollTo(ids[0]); }\n\t}\n\t\n\tget selected() {\n\t\tlet els = $.queryAll(\"li.selected\", this.el);\n\t\tif (!els[0]) { return null; }\n\t\tif (!this.multi) { return els[0].dataset.id; }\n\t\tlet ids = [];\n\t\tfor (let i=0, l=els.length; i o.id === id);\n\t}\n\t\n\tget selectedItem() {\n\t\tlet el = this.selectedEl;\n\t\treturn el && el.item;\n\t}\n\n\tget selectedEl() {\n\t\treturn $.query(\"li.selected\", this.el);\n\t}\n\t\n\trefresh() {\n\t\tlet sel = this.selected;\n\t\tthis.data = this._data;\n\t\tthis.selected = sel;\n\t}\n\n\taddItem(o, selected=null) {\n\t\tlet label, id, sel;\n\t\tlet f=(evt) => this.handleClick(evt), template=this.template;\n\t\tif (typeof o === \"string\") {\n\t\t\tid = o;\n\t\t\tlabel = template ? template(o) : o;\n\t\t} else {\n\t\t\tif (o.hide) { return; }\n\t\t\tid = o.id || o.label;\n\t\t\tlabel = template ? template(o) : o.label;\n\t\t\tif (selected === null) { sel = o.selected; }\n\t\t}\n\t\tlet item = $.create(\"li\", sel ? \"selected\" : null, label, this.el);\n\t\titem.dataset.id = id;\n\t\titem.item = o;\n\t\titem.addEventListener(\"click\", f);\n\t\titem.addEventListener(\"dblclick\", f);\n\n\t\tif (selected) {\n\t\t\tthis.selected = o.id;\n\t\t}\n\t}\n\n\tremoveItem(id) {\n\t\tlet el = $.query(\"[data-id='\"+id+\"']\",this.el);\n\t\tel && el.remove();\n\t}\n\n\thandleClick(evt) {\n\t\tlet id = evt.currentTarget.dataset.id, old = this.selected;\n\t\tif (!this.getEl(id)) { return; }\n\t\tif (evt.type === \"dblclick\") {\n\t\t\tif (id != null) { this.dispatchEvent(\"dblclick\"); }\n\t\t\treturn;\n\t\t} else if (this.multi) {\n\t\t\t$.toggleClass(evt.currentTarget, \"selected\");\n\t\t} else if (old === id) {\n\t\t\tif (id != null) { this.dispatchEvent(\"selclick\"); }\n\t\t\treturn;\n\t\t} else {\n\t\t\tthis.selected = id;\n\t\t}\n\t\tif (!this.dispatchEvent(\"change\", false, true)) { this.selected = old; }\n\t}\n\t\n\tscrollTo(id=this.selected) {\n\t\tlet el = this.getEl(id);\n\t\tif (!el) { return; }\n\t\t//el.scrollIntoView(); // this is too jumpy, but would handle horizontal.\n\n\t\tlet scrollEl = this.scrollEl || this.el;\n\t\tlet top = el.offsetTop - scrollEl.offsetTop;\n\t\tif (top + el.offsetHeight > scrollEl.scrollTop+scrollEl.offsetHeight) {\n\t\t\tscrollEl.scrollTop = top+el.offsetHeight-scrollEl.offsetHeight+10;\n\t\t} else if (top < scrollEl.scrollTop) {\n\t\t\tscrollEl.scrollTop = top-10;\n\t\t}\n\t}\n\n\tgetEl(id) {\n\t\treturn $.query(\"[data-id='\"+id+\"']\", this.el);\n\t}\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"./utils/Utils.js\";\n\nexport default class ExpressionLexer {\n\tconstructor() {\n\t\tthis.profile = null;\n\t}\n\t\n\tset profile(profile) {\n\t\tthis._profile = profile;\n\t\tthis.string = this.token = this.errors = this.captureGroups = this.namedGroups = null;\n\t}\n\t\n\tparse(str) {\n\t\tif (!this._profile) { return null; }\n\t\tif (str === this.string) { return this.token; }\n\t\n\t\tthis.token = null;\n\t\tthis._modes = {};\n\t\tthis.string = str;\n\t\tthis.errors = [];\n\t\tlet capgroups = this.captureGroups = [];\n\t\tlet namedgroups = this.namedGroups = {};\n\t\tlet brgroups = this.branchResetGroups = [];\n\t\tlet groups = [], refs = [], i = 0, l = str.length;\n\t\tlet o, c, token, charset = null;\n\t\t// previous is the previous token, prv is the previous \"active\" token (!ignore)\n\t\tlet prev = null, prv = null\n\t\tlet profile = this._profile, unquantifiable = profile.unquantifiable;\n\t\tlet charTypes = profile.charTypes;\n\t\tlet closeIndex = str.lastIndexOf(\"/\");\n\t\t\n\t\tfor (let i=closeIndex+1; i= closeIndex) {\n\t\t\t\tthis.parseFlag(str, token);\n\t\t\t} else if (c === \"(\" && !charset) {\n\t\t\t\tthis.parseParen(str, token);\n\t\t\t\tif (token.close === null) {\n\t\t\t\t\ttoken.depth = groups.length;\n\t\t\t\t\tgroups.push(token);\n\t\t\t\t}\n\t\t\t\tif (token.capture) { this.addCaptureGroup(token, groups); }\n\t\t\t} else if (c === \")\" && !charset) {\n\t\t\t\ttoken.type = \"groupclose\";\n\t\t\t\tif (groups.length) {\n\t\t\t\t\to = token.open = groups.pop();\n\t\t\t\t\to.close = token;\n\t\t\t\t\tif (o.type === \"branchreset\") {\n\t\t\t\t\t\tbrgroups.pop();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttoken.error = {id: \"groupclose\"};\n\t\t\t\t}\n\t\t\t} else if (c === \"[\") {\n\t\t\t\tcharset = this.parseSquareBracket(str, token, charset);\n\t\t\t} else if (c === \"]\" && charset) {\n\t\t\t\ttoken.type = \"setclose\";\n\t\t\t\ttoken.open = charset;\n\t\t\t\tcharset.close = token;\n\t\t\t\tcharset = null;\n\t\t\t} else if (c === \"+\" && prv && prv.clss === \"quant\" && profile.tokens.possessive) {\n\t\t\t\ttoken.type = \"possessive\";\n\t\t\t\ttoken.related = [prv];\n\t\t\t} else if ((c === \"+\" || c === \"*\") && !charset) {\n\t\t\t\ttoken.type = charTypes[c];\n\t\t\t\ttoken.clss = \"quant\";\n\t\t\t\ttoken.min = (c === \"+\" ? 1 : 0);\n\t\t\t\ttoken.max = -1;\n\t\t\t} else if (c === \"{\" && !charset && str.substr(i).search(/^{\\d+,?\\d*}/) !== -1) {\n\t\t\t\tthis.parseQuant(str, token);\n\t\t\t} else if (c === \"\\\\\") {\n\t\t\t\tthis.parseBackSlash(str, token, charset, closeIndex);\n\t\t\t} else if (c === \"?\" && !charset) {\n\t\t\t\tif (!prv || prv.clss !== \"quant\") {\n\t\t\t\t\ttoken.type = charTypes[c];\n\t\t\t\t\ttoken.clss = \"quant\";\n\t\t\t\t\ttoken.min = 0;\n\t\t\t\t\ttoken.max = 1;\n\t\t\t\t} else {\n\t\t\t\t\ttoken.type = \"lazy\";\n\t\t\t\t\ttoken.related = [prv];\n\t\t\t\t}\n\t\t\t} else if (c === \"-\" && charset && prv.code !== undefined && prv.prv && prv.prv.type !== \"range\") {\n\t\t\t\t// this may be the start of a range, but we'll need to validate after the next token.\n\t\t\t\ttoken.type = \"range\";\n\t\t\t} else {\n\t\t\t\tthis.parseChar(str, token, charset);\n\t\t\t\tif (!charset && this._modes.x && /\\s/.test(c)) {\n\t\t\t\t\ttoken.ignore = true;\n\t\t\t\t\ttoken.type = \"ignorews\";\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// post process token:\n\t\t\t// quantifier:\n\t\t\tif (token.clss === \"quant\") {\n\t\t\t\tif (!prv || prv.close !== undefined || unquantifiable[prv.type] || (prv.open && unquantifiable[prv.open.type])) {\n\t\t\t\t\ttoken.error = {id: \"quanttarg\"};\n\t\t\t\t} else {\n\t\t\t\t\ttoken.related = [prv.open || prv];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// reference:\n\t\t\tif (token.group === true) {\n\t\t\t\trefs.push(token);\n\t\t\t}\n\n\t\t\t// conditional:\n\t\t\tlet curGroup = groups.length ? groups[groups.length-1] : null;\n\t\t\tif (curGroup && (curGroup.type === \"conditional\" || curGroup.type === \"conditionalgroup\") && token.type === \"alt\") {\n\t\t\t\tif (!curGroup.alt) { curGroup.alt = token; }\n\t\t\t\telse { token.error = {id: \"extraelse\"}; }\n\t\t\t\ttoken.related = [curGroup];\n\t\t\t\ttoken.type = \"conditionalelse\";\n\t\t\t\ttoken.clss = \"special\";\n\t\t\t} else if (curGroup && curGroup.type === \"branchreset\") {\n\t\t\t\t// reset group\n\t\t\t\tcurGroup.curGroupNum = curGroup.inGroupNum;\n\t\t\t}\n\n\t\t\t// range:\n\t\t\tif (prv && prv.type === \"range\" && prv.l === 1) {\n\t\t\t\tthis.validateRange(str, token);\n\t\t\t}\n\t\t\t\n\t\t\t// js warnings:\n\t\t\t// TODO: this isn't ideal, but I'm hesitant to write a more robust solution for a couple of edge cases.\n\t\t\tif (profile.id === \"js\") { this.addJSWarnings(token); }\n\n\t\t\t// general:\n\t\t\tif (token.open && !token.clss) {\n\t\t\t\ttoken.clss = token.open.clss;\n\t\t\t}\n\t\t\tif (token.error) {\n\t\t\t\tthis.addError(token);\n\t\t\t}\n\t\t\ti += token.l;\n\t\t\tprev = token;\n\t\t\tif (!token.ignore) { prv = token; }\n\t\t}\n\t\n\t\t// post processing:\n\t\twhile (groups.length) {\n\t\t\tthis.addError(groups.pop(), {id: \"groupopen\"});\n\t\t}\n\t\tthis.matchRefs(refs, capgroups, namedgroups);\n\t\tif (charset) {\n\t\t\tthis.addError(charset, {id: \"setopen\"});\n\t\t}\n\t\n\t\treturn this.token;\n\t}\n\n\taddError(token, error=token.error) {\n\t\ttoken.error = error;\n\t\tthis.errors.push(token);\n\t}\n\n\taddJSWarnings(token) {\n\t\tif (token.error) { return; }\n\t\tif ((token.type === \"neglookbehind\" || token.type === \"poslookbehind\") ||\n\t\t\t(token.type === \"sticky\" || token.type === \"unicode\" || token.type == \"dotall\") ||\n\t\t\t(token.type === \"unicodecat\" || token.type === \"unicodescript\") ||\n\t\t\t(token.type === \"namedgroup\")\n\t\t\t) {\n\t\t\t\ttoken.error = {id: \"jsfuture\", warning:true};\n\t\t}\n\t}\n\n\taddCaptureGroup(token, groups) {\n\t\t// it would be nice to make branch reset groups actually highlight all of the groups that share the same number\n\t\t// that would require switching to arrays of groups for each group num - requires rearchitecture throughout the app.\n\t\tlet capgroups = this.captureGroups, brgroups = this.branchResetGroups, namedgroups = this.namedGroups;\n\t\tlet curGroup = groups.length ? groups[groups.length-1] : null;\n\t\tif (brgroups.length) {\n\t\t\tlet brgroup = brgroups[brgroups.length-1];\n\t\t\ttoken.num = ++brgroup.curGroupNum;\n\t\t} else {\n\t\t\ttoken.num = capgroups.length+1;\n\t\t}\n\t\tif (!capgroups[token.num-1]) { capgroups.push(token); }\n\t\tif (token.name && !token.error) {\n\t\t\tif (/\\d/.test(token.name[0])) { token.error = {id: \"badname\"}; }\n\t\t\telse if (namedgroups[token.name]) {\n\t\t\t\ttoken.error = {id: \"dupname\"};\n\t\t\t\ttoken.related = [namedgroups[token.name]];\n\t\t\t} else { namedgroups[token.name] = token; }\n\t\t}\n\t}\n\t\n\tgetRef(token, str) {\n\t\ttoken.clss = \"ref\";\n\t\ttoken.group = true;\n\t\ttoken.relIndex = this.captureGroups.length;\n\t\ttoken.name = str;\n\t}\n\t\n\tmatchRefs(refs, indexes, names) {\n\t\twhile (refs.length) {\n\t\t\tlet token = refs.pop(), name=token.name, group = names[name];\n\t\n\t\t\tif (!group && !isNaN(name)) {\n\t\t\t\tlet sign = name[0], index = parseInt(name) + ((sign === \"+\" || sign === \"-\") ? token.relIndex : 0);\n\t\t\t\tif (sign === \"-\") { index++; }\n\t\t\t\tgroup = indexes[index-1];\n\t\t\t}\n\t\t\tif (group) {\n\t\t\t\ttoken.group = group;\n\t\t\t\ttoken.related = [group];\n\t\t\t\ttoken.dir = (token.i < group.i) ? 1 : (!group.close || token.i < group.close.i) ? 0 : -1;\n\t\t\t} else {\n\t\t\t\tdelete token.group;\n\t\t\t\tdelete token.relIndex;\n\t\t\t\tthis.refToOctal(token);\n\t\t\t\tif (token.error) { this.errors.push(token.error); }\n\t\t\t}\n\t\t}\n\t};\n\t\n\trefToOctal(token) {\n\t\t// PCRE: \\# unmatched, \\0 \\00 \\## = octal\n\t\t// JS: \\# \\0 \\00 \\## = octal\n\t\t// PCRE matches \\8 \\9 to \"8\" \"9\"\n\t\t// JS: without the u flag \\8 \\9 match \"8\" \"9\" in IE, FF & Chrome, and \"\\8\" \"\\9\" in Safari. We support the former.\n\t\t// JS: with the u flag, Chrome & FF throw an esc error, Safari does not.\n\t\t\n\t\t// TODO: handle \\0 for PCRE? Would need more testing.\n\t\t// TODO: this doesn't handle two digit refs with 8/9 in them. Ex. \\18 - not even sure what this is interpreted as.\n\t\tlet name = token.name, profile = this._profile;\n\t\tif (token.type !== \"numref\") {\n\t\t\t// not a simple \\4 style reference, so can't decompose into an octal.\n\t\t\ttoken.error = {id: \"unmatchedref\"};\n\t\t} else if (/^[0-7]{2}$/.test(name) || (profile.config.reftooctalalways && /^[0-7]$/.test(name))) { // octal\n\t\t\tlet next = token.next, char = String.fromCharCode(next.code);\n\t\t\tif (next.type === \"char\" && char >= \"0\" && char <= \"7\" && parseInt(name+char, 8) <= 255) {\n\t\t\t\tname += char;\n\t\t\t\tthis.mergeNext(token);\n\t\t\t}\n\t\t\ttoken.code = parseInt(name,8);\n\t\t\ttoken.clss = \"esc\";\n\t\t\ttoken.type = \"escoctal\";\n\t\t\tdelete token.name;\n\t\t} else if (name === \"8\" || name === \"9\") {\n\t\t\tthis.parseEscChar(token, name);\n\t\t\tdelete token.name;\n\t\t} else {\n\t\t\ttoken.error = {id: \"unmatchedref\"};\n\t\t}\n\t};\n\t\n\tmergeNext(token) {\n\t\tlet next = token.next;\n\t\ttoken.next = next.next;\n\t\ttoken.next.prev = token;\n\t\ttoken.l++;\n\t};\n\t\n\tparseFlag(str, token) {\n\t\t// note that this doesn't deal with misformed patterns or incorrect flags.\n\t\tlet i = token.i, c = str[i];\n\t\tif (str[i] === \"/\") {\n\t\t\ttoken.type = (i === 0) ? \"open\" : \"close\";\n\t\t\tif (i !== 0) {\n\t\t\t\ttoken.related = [this.token];\n\t\t\t\tthis.token.related = [token];\n\t\t\t}\n\t\t} else {\n\t\t\ttoken.type = this._profile.flags[c];\n\t\t}\n\t\t//token.clear = true;\n\t};\n\t\n\tparseChar(str, token, charset) {\n\t\tlet c = str[token.i];\n\t\ttoken.type = (!charset && this._profile.charTypes[c]) || \"char\";\n\t\tif (!charset && c === \"/\") {\n\t\t\ttoken.error = {id: \"fwdslash\"};\n\t\t}\n\t\tif (token.type === \"char\") {\n\t\t\ttoken.code = c.charCodeAt(0);\n\t\t} else if (ExpressionLexer.ANCHOR_TYPES[token.type]) {\n\t\t\ttoken.clss = \"anchor\";\n\t\t} else if (token.type === \"dot\") {\n\t\t\ttoken.clss = \"charclass\";\n\t\t}\n\t\treturn token;\n\t};\n\t\n\tparseSquareBracket(str, token, charset) {\n\t\tlet match;\n\t\tif (this._profile.tokens.posixcharclass && (match = str.substr(token.i).match(/^\\[(:|\\.)([^\\]]*?)\\1]/))) {\n\t\t\t// posixcharclass: [:alpha:]\n\t\t\t// posixcollseq: [.ch.]\n\t\t\t// currently neither flavor supports posixcollseq, but PCRE does flag as an error:\n\t\t\t// TODO: the expression above currently does not catch [.\\].]\n\t\t\ttoken.l = match[0].length;\n\t\t\ttoken.value = match[2];\n\t\t\ttoken.clss = \"charclass\";\n\t\t\tif (match[1] === \":\") {\n\t\t\t\ttoken.type = \"posixcharclass\";\n\t\t\t\tif (!this._profile.posixCharClasses[match[2]]) { token.error = {id: \"posixcharclassbad\"}; }\n\t\t\t\telse if (!charset) { token.error = {id: \"posixcharclassnoset\"}; }\n\t\t\t} else {\n\t\t\t\ttoken.type = \"posixcollseq\";\n\t\t\t\t// TODO: can this be generalized? Right now, no, because we assign ids that aren't in the profile.\n\t\t\t\ttoken.error = {id: \"notsupported\"};\n\t\t\t}\n\t\t} else if (!charset) {\n\t\t\t// set [a-z] [aeiou]\n\t\t\t// setnot [^a-z]\n\t\t\ttoken.type = token.clss = \"set\";\n\t\t\tif (str[token.i + 1] === \"^\") {\n\t\t\t\ttoken.l++;\n\t\t\t\ttoken.type += \"not\";\n\t\t\t}\n\t\t\tcharset = token;\n\t\t} else {\n\t\t\t// [[] (square bracket inside a set)\n\t\t\tthis.parseChar(str, token, charset);\n\t\t}\n\t\treturn charset;\n\t};\n\t\n\tparseParen(str, token) {\n\t\t/*\n\t\tcore:\n\t.\t\tgroup:\n\t.\t\tlookahead: ?= ?!\n\t.\t\tnoncap: ?:\n\t\tPCRE:\n\t.\t\tlookbehind: ?<= ? ?'name' ?\n\t.\t\tnamedref: ?P=name\t\tAlso: \\g'name' \\k'name' etc\n\t.\t\tcomment: ?#\n\t.\t\tatomic: ?>\n\t.\t\trecursion: ?0 ?R\t\tAlso: \\g<0>\n\t.\t\tdefine: ?(DEFINE)\n\t.\t\tsubroutine: ?1 ?-1 ?&name ?P>name\n\t\t\tconditionalgroup: ?(1)a|b ?(-1)a|b ?(name)a|b\n\t\t\tconditional: ?(?=if)then|else\n\t\t\tmode: ?c-i\n\t\t\tbranchreset: ?|\n\t\t*/\n\t\n\t\ttoken.clss = token.type = \"group\";\n\t\tif (str[token.i+1] !== \"?\") {\n\t\t\ttoken.close = null; // indicates that it needs a close token.\n\t\t\ttoken.capture = true;\n\t\t\treturn token;\n\t\t}\n\t\n\t\tlet sub = str.substr(token.i+2), match, s=sub[0];\n\t\n\t\tif (s === \":\") {\n\t\t\t// (?:foo)\n\t\t\ttoken.type = \"noncapgroup\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.l = 3;\n\t\t} else if (s === \">\") {\n\t\t\t// (?>foo)\n\t\t\ttoken.type = \"atomic\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.l = 3;\n\t\t} else if (s === \"|\") {\n\t\t\t// (?|(a)|(b))\n\t\t\ttoken.type = \"branchreset\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.l = 3;\n\t\t\ttoken.inGroupNum = token.curGroupNum = this.captureGroups.length;\n\t\t\tthis.branchResetGroups.push(token);\n\t\t} else if (s === \"#\" && (match = sub.match(/[^)]*\\)/))) {\n\t\t\t// (?#foo)\n\t\t\ttoken.clss = token.type = \"comment\";\n\t\t\ttoken.ignore = true;\n\t\t\ttoken.l = 2+match[0].length;\n\t\t} else if (/^(R|0)\\)/.test(sub)) {\n\t\t\t// (?R) (?0)\n\t\t\ttoken.clss = \"ref\";\n\t\t\ttoken.type = \"recursion\";\n\t\t\ttoken.l = 4;\n\t\t} else if (match = sub.match(/^P=(\\w+)\\)/i)) {\n\t\t\t// (?P=name)\n\t\t\ttoken.type = \"namedref\";\n\t\t\tthis.getRef(token, match[1]);\n\t\t\ttoken.l = match[0].length+2;\n\t\t} else if (/^\\(DEFINE\\)/.test(sub)) {\n\t\t\t// (?(DEFINE)foo)\n\t\t\ttoken.type = \"define\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.l = 10;\n\t\t} else if (match = sub.match(/^/)) ||\n\t\t\t(this._profile.config.namedgroupalt && ((match = sub.match(/^'(\\w+)'/)) || (match = sub.match(/^P<(\\w+)>/))))\n\t\t\t) {\n\t\t\t// (?foo) (?'name'foo) (?Pfoo)\n\t\t\ttoken.type = \"namedgroup\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.name = match[1];\n\t\t\ttoken.capture = true;\n\t\t\ttoken.l = match[0].length + 2;\n\t\t} else if ((match = sub.match(/^([-+]?\\d\\d?)\\)/)) || (match = sub.match(/^(?:&|P>)(\\w+)\\)/))) {\n\t\t\t// (?1) (?-1) (?&name) (?P>name)\n\t\t\ttoken.type = (isNaN(match[1]) ? \"named\" : \"num\") + \"subroutine\";\n\t\t\tthis.getRef(token, match[1]);\n\t\t\ttoken.l = match[0].length + 2;\n\t\t} else if ((match = sub.match(/^\\(([-+]?\\d\\d?)\\)/)) || (match = sub.match(/^\\((\\w+)\\)/))) {\n\t\t\t// (?(1)a|b) (?(-1)a|b) (?(name)a|b)\n\t\t\tthis.getRef(token, match[1]);\n\t\t\ttoken.clss = \"special\";\n\t\t\ttoken.type = \"conditionalgroup\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.l = match[0].length + 2;\n\t\t} else if (/^\\(\\?255). In theory it should allow 4?\n\t\t\tif (isNaN(val) || val > 255 || /[^\\da-f]/i.test(match[1])) { token.error = {id: \"esccharbad\"}; }\n\t\t\telse { token.code = val; }\n\t\t} else if (match = sub.match(/^x([\\da-fA-F]{0,2})/)) {\n\t\t\t// hex ascii: \\xFF\n\t\t\ttoken.type = \"eschexadecimal\";\n\t\t\ttoken.l += match[0].length;\n\t\t\ttoken.code = parseInt(match[1]||0, 16);\n\t\t} else if (match = sub.match(/^c([a-zA-Z])?/)) {\n\t\t\t// control char: \\cA \\cz\n\t\t\t// also handles: \\c\n\t\t\t// not supported in JS strings\n\t\t\ttoken.type = \"esccontrolchar\";\n\t\t\tif (match[1]) {\n\t\t\t\ttoken.code = match[1].toUpperCase().charCodeAt(0) - 64; // A=65\n\t\t\t\ttoken.l += 2;\n\t\t\t} else if (profile.config.ctrlcodeerr) {\n\t\t\t\ttoken.l++;\n\t\t\t\ttoken.error = {id: \"esccharbad\"};\n\t\t\t} else {\n\t\t\t\treturn this.parseChar(str, token, charset); // this builds the \"/\" token\n\t\t\t}\n\t\t} else if (match = sub.match(/^[0-7]{1,3}/)) {\n\t\t\t// octal ascii: \\011\n\t\t\ttoken.type = \"escoctal\";\n\t\t\tsub = match[0];\n\t\t\tif (parseInt(sub, 8) > 255) {\n\t\t\t\tsub = sub.substr(0, 2);\n\t\t\t}\n\t\t\ttoken.l += sub.length;\n\t\t\ttoken.code = parseInt(sub, 8);\n\t\t} else if (profile.tokens.escoctalo && (match = sub.match(/^o\\{(.*?)}/i))) {\n\t\t\t// \\o{377}\n\t\t\ttoken.type = \"escoctal\";\n\t\t\ttoken.l += match[0].length;\n\t\t\tval = parseInt(match[1], 8);\n\t\t\tif (isNaN(val) || val > 255 || /[^0-7]/.test(match[1])) { token.error = {id: \"esccharbad\"}; }\n\t\t\telse { token.code = val; }\n\t\t} else {\n\t\t\t// single char\n\t\t\tif (token.type = profile.escCharTypes[c]) {\n\t\t\t\ttoken.l++;\n\t\t\t\ttoken.clss = ExpressionLexer.ANCHOR_TYPES[token.type] ? \"anchor\" : \"charclass\";\n\t\t\t\treturn token;\n\t\t\t}\n\t\t\t\n\t\t\ttoken.code = profile.escCharCodes[c];\n\t\t\tif (token.code === undefined || token.code === false) {\n\t\t\t\t// unrecognized.\n\t\t\t\treturn this.parseEscChar(token, c);\n\t\t\t}\n\t\t\t\n\t\t\t// update SubstLexer if this changes:\n\t\t\ttoken.l++;\n\t\t\ttoken.type = \"esc_\"+token.code;\n\t\t}\n\t\ttoken.clss = \"esc\";\n\t\treturn token;\n\t};\n\t\n\tparseEscChar(token, c) {\n\t\t// unrecognized escchar: \\u \\a \\8, etc\n\t\t// JS: allowed except if u flag set, Safari still allows \\8 \\9\n\t\t// PCRE: allows \\8 \\9 but not others // TODO: support?\n\t\tlet profile = this._profile;\n\t\ttoken.l=2;\n\t\tif (!profile.badEscChars[c] && (profile.tokens.escchar && !this._modes.u) || profile.escChars[c]) {\n\t\t\ttoken.type = \"escchar\";\n\t\t\ttoken.code = c.charCodeAt(0);\n\t\t\ttoken.clss = \"esc\";\n\t\t} else {\n\t\t\ttoken.error = {id: \"esccharbad\"};\n\t\t}\n\t}\n\t\n\tparseRef(token, sub) {\n\t\t// namedref: \\k \\k'name' \\k{name} \\g{name}\n\t\t// namedsubroutine: \\g \\g'name'\n\t\t// numref: \\g1 \\g+2 \\g{2}\n\t\t// numsubroutine: \\g<-1> \\g'1'\n\t\t// recursion: \\g<0> \\g'0'\n\t\tlet c=sub[0], s=\"\", match;\n\t\tif (match = sub.match(/^[gk](?:'\\w*'|<\\w*>|{\\w*})/)) {\n\t\t\ts = match[0].substr(2, match[0].length - 3);\n\t\t\tif (c === \"k\" && !isNaN(s)) { s = \"\"; } // TODO: specific error for numeric \\k?\n\t\t} else if (match = sub.match(/^g(?:({[-+]?\\d+}|<[-+]?\\d+>|'[-+]?\\d+')|([-+]?\\d+))/)) {\n\t\t\ts = match[2] !== undefined ? match[2] : match[1].substr(1, match[1].length-2);\n\t\t}\n\t\tlet isRef = c === \"k\" || !(sub[1] === \"'\" || sub[1] === \"<\");\n\t\tif (!isRef && s == 0) {\n\t\t\ttoken.type = \"recursion\";\n\t\t\ttoken.clss = \"ref\";\n\t\t} else {\n\t\t\t// namedref, extnumref, namedsubroutine, numsubroutine\n\t\t\ttoken.type = (isNaN(s) ? \"named\" : (isRef?\"ext\":\"\")+\"num\") + (isRef ? \"ref\" : \"subroutine\");\n\t\t\tthis.getRef(token, s);\n\t\t}\n\t\ttoken.l += match ? match[0].length : 1;\n\t};\n\t\n\tparseUnicode(token, sub) {\n\t\t// unicodescript: \\p{Cherokee}\n\t\t// unicodecat: \\p{Ll} \\pL\n\t\t// not: \\P{Ll} \\p{^Lu}\n\t\tlet match = sub.match(/p\\{\\^?([^}]*)}/i), val = match && match[1], not = sub[0] === \"P\";\n\t\tif (!match && (match = sub.match(/[pP]([LMZSNPC])/))) { val = match[1]; }\n\t\telse { not = not !== (sub[2] === \"^\"); }\n\t\ttoken.l += match ? match[0].length : 1;\n\t\ttoken.type = \"unicodecat\";\n\t\tif (this._profile.unicodeScripts[val]) {\n\t\t\ttoken.type = \"unicodescript\";\n\t\t} else if (!this._profile.unicodeCategories[val]) {\n\t\t\tval = null;\n\t\t}\n\t\tif (not) { token.type = \"not\"+token.type; }\n\t\tif ((!this._profile.config.unicodenegated && sub[2] === \"^\") || !val) {\n\t\t\ttoken.error = {id: \"unicodebad\"}\n\t\t}\n\t\ttoken.value = val;\n\t\ttoken.clss = \"charclass\"\n\t\treturn token;\n\t};\n\t\n\tparseMode(token, sub) {\n\t\t// (?i-x)\n\t\t// supported modes in PCRE: i-caseinsens, x-freespacing, s-dotall, m-multiline, U-switchlazy, [J-samename]\n\t\tlet match = sub.match(/^[-a-z]+\\)/i);\n\t\tif (!match) { return; }\n\t\tlet supModes = this._profile.modes;\n\t\tlet modes = Utils.copy({}, this._modes), bad=false, not=false, s=match[0], c;\n\t\ttoken.on = token.off = \"\";\n\n\t\tfor (let i=0, l=s.length-1; i token.max) {\n\t\t\ttoken.error = {id: \"quantrev\"};\n\t\t}\n\t\treturn token;\n\t};\n\t\n\tvalidateRange(str, end) {\n\t\t// char range: [a-z] [\\11-\\n]\n\t\tlet next = end, token = end.prv, prv = token.prv;\n\t\tif (prv.code === undefined || next.code === undefined) {\n\t\t\t// not a range, rewrite as a char:\n\t\t\tthis.parseChar(str, token);\n\t\t} else {\n\t\t\ttoken.clss = \"set\";\n\t\t\tif (prv.code > next.code) {\n\t\t\t\t// this gets added here because parse has already moved to the next token:\n\t\t\t\tthis.errors.push(token.error = {id: \"rangerev\"});\n\t\t\t}\n\t\t\t// preserve as separate tokens, but treat as one in the UI:\n\t\t\tnext.proxy = prv.proxy = token;\n\t\t\ttoken.set = [prv, token, next];\n\t\t}\n\t};\n\n}\n\nExpressionLexer.ANCHOR_TYPES = {\n\t\"bof\": true,\n\t\"eof\": true,\n\t\"bos\": true,\n\t\"eos\": true,\n\t\"abseos\": true,\n\t\"wordboundary\": true,\n\t\"notwordboundary\": true,\n\t\"prevmatchend\": true\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n\nimport EventDispatcher from \"../events/EventDispatcher\";\nimport CMUtils from \"../utils/CMUtils\";\n\nexport default class ExpressionHighlighter extends EventDispatcher {\n\tconstructor(cm) {\n\t\tsuper();\n\t\tthis.cm = cm;\n\t\tthis._activeMarks = [];\n\t\tthis._hoverMarks = [];\n\t\tthis._hoverToken = null;\n\t}\n\t\n\tclear() {\n\t\tthis.cm.operation(() => {\n\t\t\tlet marks = this._activeMarks;\n\t\t\tfor (var i = 0, l = marks.length; i < l; i++) {\n\t\t\t\tmarks[i].clear();\n\t\t\t}\n\t\t\tmarks.length = 0;\n\t\t});\n\t}\n\t\n\tdraw(token) {\n\t\tlet cm = this.cm, pre = ExpressionHighlighter.CSS_PREFIX;\n\t\n\t\tthis.clear();\n\t\tcm.operation(() => {\n\t\t\t\n\t\t\tlet groupClasses = ExpressionHighlighter.GROUP_CLASS_BY_TYPE;\n\t\t\tlet doc = cm.getDoc(), endToken, marks = this._activeMarks;\n\t\n\t\t\twhile (token) {\n\t\t\t\tif (token.clear) {\n\t\t\t\t\ttoken = token.next;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttoken = this._calcTokenPos(token);\n\t\n\t\t\t\tvar className = pre + (token.clss || token.type);\n\t\t\t\tif (token.error) {\n\t\t\t\t\tclassName += \" \" + pre + (token.error.warning ? \"warning\" : \"error\");\n\t\t\t\t}\n\t\n\t\t\t\tif (className) {\n\t\t\t\t\tmarks.push(doc.markText(token.startPos, token.endPos, {className: className}));\n\t\t\t\t}\n\t\n\t\t\t\tif (token.close) {\n\t\t\t\t\tendToken = this._calcTokenPos(token.close);\n\t\t\t\t\tclassName = groupClasses[token.clss || token.type];\n\t\t\t\t\tif (className) {\n\t\t\t\t\t\tclassName = className.replace(\"%depth%\", token.depth);\n\t\t\t\t\t\tmarks.push(doc.markText(token.startPos, endToken.endPos, {className: className}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttoken = token.next;\n\t\t\t}\n\t\t});\n\t}\n\t\n\tset hoverToken(token) {\n\t\tif (token === this._hoverToken) { return; }\n\t\tif (token && token.set && token.set.indexOf(this._hoverToken) !== -1) { return; }\n\t\twhile (this._hoverMarks.length) { this._hoverMarks.pop().clear(); }\n\t\t\n\t\tthis._hoverToken = token;\n\t\tif (token) {\n\t\t\tif (token.open) {\n\t\t\t\tthis._drawSelect(token.open);\n\t\t\t} else {\n\t\t\t\tthis._drawSelect(token);\n\t\t\t}\n\t\t\tif (token.related) {\n\t\t\t\tfor (let i = 0, l=token.related.length; i < l; i++) {\n\t\t\t\t\tthis._drawSelect(token.related[i], ExpressionHighlighter.CSS_PREFIX + \"related\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.dispatchEvent(\"hover\");\n\t};\n\t\n\tget hoverToken() {\n\t\treturn this._hoverToken;\n\t}\n\t\n\t\n// private methods:\n\t_drawSelect(token, style = ExpressionHighlighter.CSS_PREFIX+\"selected\") {\n\t\tlet doc = this.cm.getDoc(), endToken = token.close || token;\n\t\tif (token.set) {\n\t\t\tendToken = token.set[token.set.length - 1];\n\t\t\ttoken = token.set[0];\n\t\t}\n\t\t\n\t\tthis._calcTokenPos(endToken);\n\t\tthis._calcTokenPos(token);\n\t\tthis._hoverMarks.push(doc.markText(token.startPos, endToken.endPos, {\n\t\t\tclassName: style,\n\t\t\tstartStyle: style + \"-left\",\n\t\t\tendStyle: style + \"-right\"\n\t\t}));\n\t};\n\n\t_calcTokenPos(token) {\n\t\tif (token.startPos || token == null) {\n\t\t\treturn token;\n\t\t}\n\t\tCMUtils.calcRangePos(this.cm, token.i, token.l, token);\n\t\treturn token;\n\t};\n\t\n};\n\nExpressionHighlighter.CSS_PREFIX = \"exp-\";\n\nExpressionHighlighter.GROUP_CLASS_BY_TYPE = {\n\tset: ExpressionHighlighter.CSS_PREFIX+\"group-set\",\n\tsetnot: ExpressionHighlighter.CSS_PREFIX+\"group-set\",\n\tgroup: ExpressionHighlighter.CSS_PREFIX+\"group-%depth%\",\n\tlookaround: ExpressionHighlighter.CSS_PREFIX+\"group-%depth%\"\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport CMUtils from \"../utils/CMUtils\";\n\nimport app from \"../app\";\n\nexport default class ExpressionHover {\n\tconstructor (editor, highlighter) {\n\t\tthis.editor = editor;\n\t\tthis.highlighter = highlighter;\n\t\tthis.isMouseDown = false;\n\t\tthis.token = null;\n\t\t\n\t\tlet o = editor.display.lineDiv;\n\t\to.addEventListener(\"mousemove\", (evt)=> this._handleMouseMove(evt));\n\t\to.addEventListener(\"mouseout\", (evt)=> this._handleMouseOut(evt));\n\t\to.addEventListener(\"mousedown\", (evt)=> this._handleMouseDown(evt));\n\t\t\n\t}\n\n\t\n// private methods:\n\t_handleMouseMove(evt) {\n\t\tif (this.isMouseDown) { return; }\n\t\t\n\t\tlet index, editor = this.editor, token = this.token, target = null;\n\t\t\n\t\tif (evt && token && (index = CMUtils.getCharIndexAt(editor, evt.clientX, evt.clientY + window.pageYOffset)) != null) {\n\t\t\twhile (token) {\n\t\t\t\tif (index >= token.i && index < token.i+token.l) {\n\t\t\t\t\ttarget = token;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttoken = token.next;\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (target) {\n\t\t\tif (target.open) { target = target.open; }\n\t\t\telse if (target.proxy) { target = target.proxy; }\n\t\t\telse { break; }\n\t\t}\n\t\n\t\tthis.highlighter.hoverToken = target;\n\t\tlet rect = (index != null) && CMUtils.getCharRect(editor, index);\n\t\tif (rect) { rect.right = rect.left = evt.clientX; }\n\t\tapp.tooltip.hover.show(\"ExpressionHover\", app.reference.tipForToken(target), evt.clientX, rect.bottom, true, 0);\n\t}\n\t\n\t_handleMouseOut(evt) {\n\t\tthis.highlighter.hoverToken = null;\n\t\tapp.tooltip.hover.hide(\"ExpressionHover\");\n\t}\n\t\n\t_handleMouseDown(evt) {\n\t\t// TODO: Should this also be in TextHover?\n\t\tif (evt.which !== 1 && evt.button !== 1) { return; }\n\t\t\n\t\tthis.isMouseDown = true;\n\t\tlet f, t = window.addEventListener ? window : document;\n\t\tt.addEventListener(\"mouseup\", f = () => {\n\t\t\tt.removeEventListener(\"mouseup\", f);\n\t\t\tthis.isMouseDown = false;\n\t\t});\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n/*\nThe core profile essentially defines every feature we support, and is then pared down by other profiles. All values should be y (true).\n\nIt also acts in part as pseudo documentation for all of the \"type\" values.\n */\nlet y=true, n=false;\n\nlet core = {\n\tid: \"core\",\n\t\n\tflags: {\n\t\t\"g\": \"global\", // note that this is not a real flag in some flavors, but a different method call\n\t\t\"i\": \"caseinsensitive\",\n\t\t\"m\": \"multiline\",\n\t\t\"s\": \"dotall\",\n\t\t\"u\": \"unicode\",\n\t\t\"y\": \"sticky\",\n\t\t\"x\": \"extended\",\n\t\t\"U\": \"ungreedy\"\n\t},\n\t\n\t// reserved characters that need to be escaped:\n\tescChars: \"+*?^$\\\\.[]{}()|/\".split(\"\").reduce((o, c) => { o[c] = y; return o}, {}),\n\n\t// escape chars that are specifically not supported by the flavor:\n\tbadEscChars: n,\n\t\n\tescCharCodes: {\n\t\t\"0\": 0, // null\n\t\t\"a\": 7, // bell\n\t\t\"t\": 9, // tab\n\t\t\"n\": 10, // lf\n\t\t\"v\": 11, // vertical tab\n\t\t\"f\": 12, // form feed\n\t\t\"r\": 13, // cr\n\t\t\"e\": 27 // escape\n\t},\n\t\n\tescCharTypes: {\n\t\t\"A\": \"bos\",\n\t\t\"b\": \"wordboundary\",\n\t\t\"B\": \"notwordboundary\",\n\t\t\"d\": \"digit\",\n\t\t\"D\": \"notdigit\",\n\t\t\"G\": \"prevmatchend\",\n\t\t\"h\": \"hwhitespace\",\n\t\t\"H\": \"nothwhitespace\",\n\t\t\"K\": \"keepout\",\n\t\t\"N\": \"notlinebreak\",\n\t\t\"R\": \"linebreak\",\n\t\t\"s\": \"whitespace\",\n\t\t\"S\": \"notwhitespace\",\n\t\t\"v\": \"vwhitespace\",\n\t\t\"V\": \"notvwhitespace\",\n\t\t\"w\": \"word\",\n\t\t\"W\": \"notword\",\n\t\t\"X\": \"unicodegrapheme\",\n\t\t\"Z\": \"eos\",\n\t\t\"z\": \"abseos\"\n\t},\n\t\n\tcharTypes: {\n\t\t\".\": \"dot\",\n\t\t\"|\": \"alt\",\n\t\t\"$\": \"eof\",\n\t\t\"^\": \"bof\",\n\t\t\"?\": \"opt\", // also: \"lazy\"\n\t\t\"+\": \"plus\", // also: \"possessive\"\n\t\t\"*\": \"star\"\n\t},\n\t\n\tunquantifiable: {\n\t\t// all group/set open tokens are unquantifiable by default (ie. tokens with a .close value)\n\t\t\"quant\": y,\n\t\t\"plus\": y,\n\t\t\"star\": y,\n\t\t\"opt\": y,\n\t\t\"lazy\": y,\n\t\t\"possessive\": y,\n\t\t\"eof\": y,\n\t\t\"bof\": y,\n\t\t\"eos\": y,\n\t\t\"abseos\": y,\n\t\t\"alt\": y,\n\t\t\"open\": y,\n\t\t\"mode\": y,\n\t\t\"comment\":y, // TODO: this should actually be ignored by quantifiers.\n\t\t\"condition\": y\n\t},\n\t\n\tunicodeScripts: {\n\t\t// from: http://www.pcre.org/original/doc/html/pcrepattern.html\n\t\t\"Arabic\": y,\n\t\t\"Armenian\": y,\n\t\t\"Avestan\": y,\n\t\t\"Balinese\": y,\n\t\t\"Bamum\": y,\n\t\t\"Bassa_Vah\": y,\n\t\t\"Batak\": y,\n\t\t\"Bengali\": y,\n\t\t\"Bopomofo\": y,\n\t\t\"Brahmi\": y,\n\t\t\"Braille\": y,\n\t\t\"Buginese\": y,\n\t\t\"Buhid\": y,\n\t\t\"Canadian_Aboriginal\": y,\n\t\t\"Carian\": y,\n\t\t\"Caucasian_Albanian\": y,\n\t\t\"Chakma\": y,\n\t\t\"Cham\": y,\n\t\t\"Cherokee\": y,\n\t\t\"Common\": y,\n\t\t\"Coptic\": y,\n\t\t\"Cuneiform\": y,\n\t\t\"Cypriot\": y,\n\t\t\"Cyrillic\": y,\n\t\t\"Deseret\": y,\n\t\t\"Devanagari\": y,\n\t\t\"Duployan\": y,\n\t\t\"Egyptian_Hieroglyphs\": y,\n\t\t\"Elbasan\": y,\n\t\t\"Ethiopic\": y,\n\t\t\"Georgian\": y,\n\t\t\"Glagolitic\": y,\n\t\t\"Gothic\": y,\n\t\t\"Grantha\": y,\n\t\t\"Greek\": y,\n\t\t\"Gujarati\": y,\n\t\t\"Gurmukhi\": y,\n\t\t\"Han\": y,\n\t\t\"Hangul\": y,\n\t\t\"Hanunoo\": y,\n\t\t\"Hebrew\": y,\n\t\t\"Hiragana\": y,\n\t\t\"Imperial_Aramaic\": y,\n\t\t\"Inherited\": y,\n\t\t\"Inscriptional_Pahlavi\": y,\n\t\t\"Inscriptional_Parthian\": y,\n\t\t\"Javanese\": y,\n\t\t\"Kaithi\": y,\n\t\t\"Kannada\": y,\n\t\t\"Katakana\": y,\n\t\t\"Kayah_Li\": y,\n\t\t\"Kharoshthi\": y,\n\t\t\"Khmer\": y,\n\t\t\"Khojki\": y,\n\t\t\"Khudawadi\": y,\n\t\t\"Lao\": y,\n\t\t\"Latin\": y,\n\t\t\"Lepcha\": y,\n\t\t\"Limbu\": y,\n\t\t\"Linear_A\": y,\n\t\t\"Linear_B\": y,\n\t\t\"Lisu\": y,\n\t\t\"Lycian\": y,\n\t\t\"Lydian\": y,\n\t\t\"Mahajani\": y,\n\t\t\"Malayalam\": y,\n\t\t\"Mandaic\": y,\n\t\t\"Manichaean\": y,\n\t\t\"Meetei_Mayek\": y,\n\t\t\"Mende_Kikakui\": y,\n\t\t\"Meroitic_Cursive\": y,\n\t\t\"Meroitic_Hieroglyphs\": y,\n\t\t\"Miao\": y,\n\t\t\"Modi\": y,\n\t\t\"Mongolian\": y,\n\t\t\"Mro\": y,\n\t\t\"Myanmar\": y,\n\t\t\"Nabataean\": y,\n\t\t\"New_Tai_Lue\": y,\n\t\t\"Nko\": y,\n\t\t\"Ogham\": y,\n\t\t\"Ol_Chiki\": y,\n\t\t\"Old_Italic\": y,\n\t\t\"Old_North_Arabian\": y,\n\t\t\"Old_Permic\": y,\n\t\t\"Old_Persian\": y,\n\t\t\"Old_South_Arabian\": y,\n\t\t\"Old_Turkic\": y,\n\t\t\"Oriya\": y,\n\t\t\"Osmanya\": y,\n\t\t\"Pahawh_Hmong\": y,\n\t\t\"Palmyrene\": y,\n\t\t\"Pau_Cin_Hau\": y,\n\t\t\"Phags_Pa\": y,\n\t\t\"Phoenician\": y,\n\t\t\"Psalter_Pahlavi\": y,\n\t\t\"Rejang\": y,\n\t\t\"Runic\": y,\n\t\t\"Samaritan\": y,\n\t\t\"Saurashtra\": y,\n\t\t\"Sharada\": y,\n\t\t\"Shavian\": y,\n\t\t\"Siddham\": y,\n\t\t\"Sinhala\": y,\n\t\t\"Sora_Sompeng\": y,\n\t\t\"Sundanese\": y,\n\t\t\"Syloti_Nagri\": y,\n\t\t\"Syriac\": y,\n\t\t\"Tagalog\": y,\n\t\t\"Tagbanwa\": y,\n\t\t\"Tai_Le\": y,\n\t\t\"Tai_Tham\": y,\n\t\t\"Tai_Viet\": y,\n\t\t\"Takri\": y,\n\t\t\"Tamil\": y,\n\t\t\"Telugu\": y,\n\t\t\"Thaana\": y,\n\t\t\"Thai\": y,\n\t\t\"Tibetan\": y,\n\t\t\"Tifinagh\": y,\n\t\t\"Tirhuta\": y,\n\t\t\"Ugaritic\": y,\n\t\t\"Vai\": y,\n\t\t\"Warang_Citi\": y,\n\t\t\"Yi\": y\n\t},\n\t\n\tunicodeCategories: {\n\t\t// from: http://www.pcre.org/original/doc/html/pcrepattern.html\n\t\t\"C\": y, // Other\n\t\t\"Cc\": y, // Control\n\t\t\"Cf\": y, // Format\n\t\t\"Cn\": y, // Unassigned\n\t\t\"Co\": y, // Private use\n\t\t\"Cs\": y, // Surrogate\n\t\t\"L\": y, // Letter\n\t\t\"L&\": y, // Any letter \n\t\t\"Ll\": y, // Lower case letter\n\t\t\"Lm\": y, // Modifier letter\n\t\t\"Lo\": y, // Other letter\n\t\t\"Lt\": y, // Title case letter\n\t\t\"Lu\": y, // Upper case letter\n\t\t\"M\": y, // Mark\n\t\t\"Mc\": y, // Spacing mark\n\t\t\"Me\": y, // Enclosing mark\n\t\t\"Mn\": y, // Non-spacing mark\n\t\t\"N\": y, // Number\n\t\t\"Nd\": y, // Decimal number\n\t\t\"Nl\": y, // Letter number\n\t\t\"No\": y, // Other number\n\t\t\"P\": y, // Punctuation\n\t\t\"Pc\": y, // Connector punctuation\n\t\t\"Pd\": y, // Dash punctuation\n\t\t\"Pe\": y, // Close punctuation\n\t\t\"Pf\": y, // Final punctuation\n\t\t\"Pi\": y, // Initial punctuation\n\t\t\"Po\": y, // Other punctuation\n\t\t\"Ps\": y, // Open punctuation\n\t\t\"S\": y, // Symbol\n\t\t\"Sc\": y, // Currency symbol\n\t\t\"Sk\": y, // Modifier symbol\n\t\t\"Sm\": y, // Mathematical symbol\n\t\t\"So\": y, // Other symbol\n\t\t\"Z\": y, // Separator\n\t\t\"Zl\": y, // Line separator\n\t\t\"Zp\": y, // Paragraph separator\n\t\t\"Zs\": y // Space separator\n\t},\n\t\n\tposixCharClasses: {\n\t\t// from: http://www.pcre.org/original/doc/html/pcrepattern.html\n\t\t\"alnum\": y, // letters and digits\n\t\t\"alpha\": y, // letters\n\t\t\"ascii\": y, // character codes 0 - 127\n\t\t\"blank\": y, // space or tab only\n\t\t\"cntrl\": y, // control characters\n\t\t\"digit\": y, // decimal digits (same as \\d)\n\t\t\"graph\": y, // printing characters, excluding space\n\t\t\"lower\": y, // lower case letters\n\t\t\"print\": y, // printing characters, including space\n\t\t\"punct\": y, // printing characters, excluding letters and digits and space\n\t\t\"space\": y, // white space (the same as \\s from PCRE 8.34)\n\t\t\"upper\": y, // upper case letters\n\t\t\"word\": y, // \"word\" characters (same as \\w)\n\t\t\"xdigit\": y // hexadecimal digits\n\t},\n\t\n\tmodes: {\n\t\t\"i\": \"caseinsensitive\",\n\t\t\"s\": \"dotall\",\n\t\t\"m\": \"multiline\",\n\t\t\"x\": \"freespacing\",\n\t\t\"J\": \"samename\",\n\t\t\"U\": \"switchlazy\"\n\t},\n\t\n\ttokens: {\n\t\t// note that not all of these are actively used in the lexer, but are included for completeness.\n\t\t\"open\": y, // opening /\n\t\t\"close\": y, // closing /\n\t\t\"char\": y, // abc\n\t\t\n\t\t// classes:\n\t\t// also in escCharTypes and charTypes\n\t\t\"set\": y, // [a-z]\n\t\t\"setnot\": y, // [^a-z]\n\t\t\"setclose\": y, // ]\n\t\t\"range\": y, // [a-z]\n\t\t\"unicodecat\": y, // \\p{Ll} \\P{^Ll} \\pL\n\t\t\"notunicodecat\": y, // \\P{Ll} \\p{^Ll} \\PL\n\t\t\"unicodescript\": y, // \\p{Cherokee} \\P{^Cherokee}\n\t\t\"notunicodescript\": y, // \\P{Cherokee} \\p{^Cherokee}\n\t\t\"posixcharclass\": y, // [[:alpha:]]\n\t\t// not in supported flavors:\t\"posixcollseq\": y, // [[.foo.]] // this is recognized by the lexer, currently returns \"notsupported\" error\n\t\t// not in supported flavors:\t\"unicodeblock\": y, // \\p{InThai} \\p{IsThai} and NOT \\P\n\t\t// not in supported flavors:\t\"subtract\": y, // [base-[subtract]]\n\t\t// not in supported flavors:\t\"intersect\": y, // [base&&[intersect]]\n\t\t\n\t\t// esc:\n\t\t// also in escCharCodes and escCharTypes\n\t\t\"escoctal\": y, // \\11\n\t\t\"escunicodeu\": y, // \\uFFFF\n\t\t\"escunicodeub\": y, // \\u{00A9}\n\t\t\"escunicodexb\": y, // \\x{00A9}\n\t\t\"escsequence\": y, // \\Q...\\E\n\t\t\"eschexadecimal\": y, // \\xFF\n\t\t\"esccontrolchar\": y, // \\cA\n\t\t\"escoctalo\": y, // \\o{377} // resolved to escoctal in lexer, no docs required\n\t\t\"escchar\": y, // \\m (unrecognized escapes) // no reference documentation required\n\t\t\n\t\t// group:\n\t\t\"group\": y, // (foo)\n\t\t\"groupclose\": y, // )\n\t\t\"noncapgroup\": y, // (?:foo)\n\t\t\"namedgroup\": y, // (?Pfoo) (?foo) (?'name'foo)\n\t\t\"atomic\": y, // (?>foo|bar)\n\t\t\"define\": y, // (?(DEFINE)foo)\n\t\t\"branchreset\": y, // (?|(a)|(b))\n\t\t\n\t\t// lookaround:\n\t\t\"poslookbehind\" : y, // (?<=foo)\n\t\t\"neglookbehind\": y, // (? \\k'name' \\k{name} (?P=name) \\g{name}\n\t\t\"numref\": y, // \\1\n\t\t\"extnumref\": y, // \\g{-1} \\g{+1} \\g{1} \\g1 \\g-1\n\t\t\"recursion\": y, // (?R) (?0) \\g<0> \\g'0'\n\t\t\"numsubroutine\": y, // \\g<1> \\g'-1' (?1) (?-1)\n\t\t\"namedsubroutine\": y, // \\g \\g'name' (?&name) (?P>name)\n\t\t\n\t\t// quantifiers:\n\t\t// also in specialChars\n\t\t\"quant\": y, // {1,2}\n\t\t\"possessive\": y, // ++\n\t\t\"lazy\": y, // ?\n\t\t\n\t\t// special:\n\t\t\"conditional\": y, // (?(?=if)then|else)\n\t\t\"condition\": y, // (?=if) any lookaround\n\t\t\"conditionalelse\": y, // |\n\t\t\"conditionalgroup\": y, // (?(1)a|b) (?(-1)a|b) (?(name)a|b)\n\t\t\"mode\": y, // (?i-x) see modes above\n\t\t\"comment\": y, // (?#comment)\n\n\t\t// meta:\n\t\t\"matchanyset\": y // [\\s\\S]\n\t},\n\t\n\tsubstTokens: {\n\t\t// named references aren't supported in JS or PCRE / PHP\n\t\t\"subst_$esc\": y, // $$\n\t\t\"subst_$&match\": y, // $&\n\t\t\"subst_$before\": y, // $`\n\t\t\"subst_$after\": y, // $'\n\t\t\"subst_$group\": y, // $1 $99 // resolved to subst_group in lexer, no docs required\n\t\t\"subst_$bgroup\": y, // ${1} ${99} // resolved to subst_group in lexer, no docs required\n\t\t\"subst_bsgroup\": y, // \\1 \\99 // resolved to subst_group in lexer, no docs required\n\t\t\"subst_group\": y, // $1 \\1 \\{1} // combined in docs, not used by lexer\n\t\t\"subst_0match\": y, // $0 \\0 \\{0}\n\t\t\n\t\t// this isn't a feature of the engine, but of RegExr:\n\t\t\"subst_esc\": y // \\n \\r \\u1234\n\t},\n\t\n\tconfig: {\n\t\t\"forwardref\": y, // \\1(a)\n\t\t\"nestedref\": y, // (\\1a|b)+\n\t\t\"ctrlcodeerr\": y, // does \\c error? (vs decompose)\n\t\t\"reftooctalalways\": y, // does a single digit reference \\1 become an octal? (vs remain an unmatched ref)\n\t\t\"substdecomposeref\": y, // will a subst reference decompose? (ex. \\3 becomes \"\\\" & \"3\" if < 3 groups)\n\t\t\"looseesc\": y, // should unrecognized escape sequences match the character (ex. \\u could match \"u\") // disabled when `u` flag is set\n\t\t\"unicodenegated\": y, // \\p{^etc}\"\n\t\t\"namedgroupalt\": y, // if false, only support (?foo)\n\t},\n\t\n\tdocs: {\n\t\t// for example:\n\t\t//possessive: {desc: \"+This will be appended to the existing entry.\" },\n\t\t//namedgroup: {tip: \"This will overwrite the existing entry.\" }\n\t}\n};\n\nexport default core;\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n/*\nThe PCRE profile is almost a straight copy of the core profile.\n*/\nlet y=true, n=false;\n\nlet pcre = {\n\tid: \"pcre\",\n\tlabel: \"PCRE\",\n\tbrowser: false,\n\t\n\tflags: {\n\t\t\"u\": n,\n\t\t\"y\": n\n\t},\n\t\n\tbadEscChars: \"uUlLN\".split(\"\").reduce((o, c) => { o[c] = y; return o}, {}),\n\n\tescCharCodes: {\n\t\t\"v\": n // vertical tab // PCRE support \\v as vertical whitespace\n\t},\n\t\n\ttokens: {\n\t\t\"escunicodeu\": n, // \\uFFFF\n\t\t\"escunicodeub\": n, // \\u{00A9}\n\t\t// octalo PCRE 8.34+\n\t},\n\t\n\tsubstTokens: {\n\t\t\"subst_$esc\": n, // $$\n\t\t\"subst_$&match\": n, // $&\n\t\t\"subst_$before\": n, // $`\n\t\t\"subst_$after\": n // $'\n\t},\n\t\n\tconfig: {\n\t\t\"reftooctalalways\": n, // does a single digit reference \\1 become an octal? (vs remain an unmatched ref)\n\t\t\"substdecomposeref\": n, // will a subst reference decompose? (ex. \\3 becomes \"\\\" & \"3\" if < 3 groups)\n\t\t\"looseesc\": n // should unrecognized escape sequences match the character (ex. \\u could match \"u\") // disabled when `u` flag is set\n\t},\n\t\n\tdocs: {\n\t\t\"escoctal\":{ext:\"+

    The syntax \\\\o{FFF} is also supported.

    \"},\n\t\t\"numref\":{\n\t\t\text:\"

    There are multiple syntaxes for this feature: \\\\1 \\\\g1 \\\\g{1}.

    \"+\n\t\t\t\t\"

    The latter syntaxes support relative values preceded by + or -. For example \\\\g-1 would match the group preceding the reference.

    \"\n\t\t},\n\t\t\"lazy\": { ext:\"+

    This behaviour is reversed by the ungreedy (U) flag/modifier.

    \" }\n\t}\n};\n\nexport default pcre;","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n/*\nThe javascript profile disables a large number of features.\n\nNote that JS warnings are currently added in addJSWarnings in the ExpresssionLexer.\n*/\n\nlet y=true, n=false;\nfunction test(expr, flag) { try { return new RegExp(expr, flag) && undefined; } catch (e) { return n; } }\nfunction testFlag(flag) { return test(\".\", flag); }\nlet unicodeFlag = testFlag(\"u\");\nlet stickyFlag = testFlag(\"y\");\nlet dotallFlag = testFlag(\"s\");\nlet lookbehind = test(\"(?<=A)\");\nlet namedgroup = test(\"(?B)\");\nlet unicodecat = test(\"\\\\p{Ll}\", \"u\"); // disabled when `u` flag is not set\n\n\nlet javascript = {\n\tid: \"js\",\n\tlabel: \"JavaScript\",\n\tbrowser: true,\n\t\n\tflags: {\n\t\t\"s\": dotallFlag, // warning\n\t\t\"x\": n,\n\t\t\"u\": unicodeFlag, // warning\n\t\t\"y\": stickyFlag, // warning\n\t\t\"U\": n\n\t},\n\n\tescCharCodes: {\n\t\t\"a\": n, // bell\n\t\t\"e\": n // escape\n\t},\n\n\tescCharTypes: {\n\t\t\"A\": n, // bos\n\t\t\"G\": n, // prevmatchend\n\t\t\"h\": n, // hwhitespace\n\t\t\"H\": n, // nothwhitespace\n\t\t\"K\": n, // keepout\n\t\t\"N\": n, // notlinebreak\n\t\t\"R\": n, // newline\n\t\t\"v\": n, // vwhitespace\n\t\t\"V\": n, // notvwhitespace\n\t\t\"X\": n, // unicodegrapheme\n\t\t\"Z\": n, // eos\n\t\t\"z\": n // abseos\n\t},\n\n\tunicodeScripts: unicodecat,\n\n\tunicodeCategories: unicodecat,\n\n\tposixCharClasses: n,\n\n\tmodes: n,\n\n\ttokens: {\n\t\t// classes:\n\t\t// also in escCharSpecials and specialChars\n\t\t\"unicodecat\": unicodecat, // \\p{Ll} \\P{^Ll} \\pL\n\t\t\"notunicodecat\": unicodecat, // \\P{Ll} \\p{^Ll} \\PL\n\t\t\"unicodescript\": unicodecat, // \\p{Cherokee} \\P{^Cherokee}\n\t\t\"notunicodescript\": unicodecat, // \\P{Cherokee} \\p{^Cherokee}\n\t\t\"posixcharclass\": n, // [[:alpha:]]\n\n\t\t// esc:\n\t\t// also in escCharCodes and escCharSpecials\n\t\t\"escunicodeub\": unicodeFlag, // \\u{00A9}\n\t\t\"escunicodexb\": n, // \\x{00A9}\n\t\t\"escsequence\": n, // \\Q...\\E\n\t\t\"escoctalo\": n, // \\o{377}\n\n\t\t// group:\n\t\t\"namedgroup\": namedgroup, // (?Pfoo) (?foo) (?'name'foo)\n\t\t\"atomic\": n, // (?>foo|bar)\n\t\t\"define\": n, // (?(DEFINE)foo)\n\t\t\"branchreset\": n, // (?|(a)|(b))\n\n\t\t// lookaround:\n\t\t\"poslookbehind\": lookbehind, // (?<=foo) // warning\n\t\t\"neglookbehind\": lookbehind, // (? \\k'name' \\k{name} (?P=name) \\g{name}\n\t\t\"extnumref\": n, // \\g{-1} \\g{+1} \\g{1} \\g1 \\g-1\n\t\t\"recursion\": n, // (?R) (?0) \\g<0> \\g'0'\n\t\t\"numsubroutine\": n, // \\g<1> \\g'-1' (?1) (?-1)\n\t\t\"namedsubroutine\": n, // \\g \\g'name' (?&name) (?P>name)\n\n\t\t// quantifiers:\n\t\t// also in specialChars\n\t\t\"possessive\": n,\n\n\t\t// special:\n\t\t\"conditional\": n, // (?(?=if)then|else)\n\t\t\"conditionalif\": n, // (?=if) any lookaround\n\t\t\"conditionalelse\": n, // |\n\t\t\"conditionalgroup\": n, // (?(1)a|b) (?(-1)a|b) (?(name)a|b)\n\t\t\"mode\": n, // (?i-x) see modes above\n\t\t\"comment\": n // (?#comment)\n\t},\n\n\tconfig: {\n\t\t\"forwardref\": n, // \\1(a)\n\t\t\"nestedref\": n, // (\\1a|b)+\n\t\t\"ctrlcodeerr\": n, // does \\c error, or decompose?\n\t\t\"unicodenegated\": n, // \\p{^etc}\n\t\t\"namedgroupalt\": n, // if false, only support (?foo)\n\t},\n\t\n\tsubstTokens: {\n\t\t\"subst_0match\": n, // $0 \\0 \\{0}\n\t\t\"subst_$bgroup\": n, // ${1} ${99}\n\t\t\"subst_bsgroup\": n // \\1 \\99\n\t},\n\t\n\tdocs: {\n\t\t\"subst_group\": {ext:\"\"}, // remove other syntaxes.\n\t\t\"namedgroup\": {ext:\"\"}, // remove other syntaxes.\n\t\t\"unicodecat\": {\n\t\t\text: \"

    Requires the u flag.

    \"+\n\t\t\t\"

    For a list of values, see this MDN page.

    \"\n\t\t},\n\t\t// notunicodecat, unicodescript, notunicodescript are copied from unicodecat below.\n\t}\n};\n\njavascript.docs.notunicodecat = javascript.docs.unicodescript = javascript.docs.notunicodescript = javascript.docs.unicodecat;\n\nexport default javascript;\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport core from \"./core\";\nimport pcre from \"./pcre\";\nimport js from \"./javascript\";\n\nlet profiles = {core};\nexport default profiles;\n\nprofiles.pcre = merge(core, pcre);\nprofiles.js = merge(core, js);\n\nfunction merge(p1, p2) {\n\t// merges p1 into p2, essentially just a simple deep copy without array support.\n\tfor (let n in p1) {\n\t\tif (p2[n] === false) { continue; }\n\t\telse if (typeof p1[n] === \"object\") { p2[n] = merge(p1[n], p2[n] || {}); }\n\t\telse if (p2[n] === undefined) { p2[n] = p1[n]; }\n\t}\n\treturn p2;\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport CMUtils from \"../utils/CMUtils\";\nimport Utils from \"../utils/Utils\";\nimport Track from \"../utils/Track\";\n\nimport List from \"../controls/List\";\nimport ExpressionLexer from \"../ExpressionLexer\";\nimport ExpressionHighlighter from \"./ExpressionHighlighter\";\nimport ExpressionHover from \"./ExpressionHover\";\nimport profiles from \"../profiles/profiles\";\nimport EventDispatcher from \"../events/EventDispatcher\"\n\nimport app from \"../app\";\n\nexport default class Expression extends EventDispatcher {\n\tconstructor (el) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis.delim = \"/\";\n\t\tthis.lexer = new ExpressionLexer();\n\t\t\n\t\tthis._initUI(el);\n\t\tapp.flavor.on(\"change\", ()=> this._onFlavorChange());\n\t\tthis._onFlavorChange();\n\t}\n\t\n\tset value(expression) {\n\t\tlet regex = Utils.decomposeRegEx(expression || Expression.DEFAULT_EXPRESSION, this.delim);\n\t\tthis.pattern = regex.source;\n\t\tthis.flags = regex.flags;\n\t}\n\t\n\tget value() {\n\t\treturn this.editor.getValue();\n\t}\n\t\n\tset pattern(pattern) {\n\t\tlet index = this.editor.getValue().lastIndexOf(this.delim);\n\t\tthis.editor.replaceRange(pattern, {line: 0, ch: 1}, {line: 0, ch: index});\n\t\tthis._deferUpdate();\n\t}\n\t\n\tget pattern() {\n\t\treturn Utils.decomposeRegEx(this.editor.getValue(), this.delim).source;\n\t}\n\t\n\tset flags(flags) {\n\t\tflags = app.flavor.validateFlagsStr(flags);\n\t\tlet str = this.editor.getValue(), index = str.lastIndexOf(this.delim);\n\t\tthis.editor.replaceRange(flags, {line: 0, ch: index + 1}, {line: 0, ch: str.length }); // this doesn't work if readOnly is false.\n\t}\n\t\n\tget flags() {\n\t\treturn Utils.decomposeRegEx(this.editor.getValue(), this.delim).flags;\n\t}\n\t\n\tget token() {\n\t\treturn this.lexer.token;\n\t}\n\t\n\tshowFlags() {\n\t\tthis.flagsList.selected = this.flags.split(\"\");\n\t\tapp.tooltip.toggle.toggleOn(\"flags\", this.flagsEl, this.flagsBtn, true, -2);\n\t}\n\n\ttoggleFlag(s) {\n\t\tlet flags = this.flags, i = flags.indexOf(s);\n\t\tthis.flags = i>=0 ? flags.replace(s, \"\") : flags+s;\n\t}\n\t\n\tshowFlavors() {\n\t\tapp.tooltip.toggle.toggleOn(\"flavor\", this.flavorEl, this.flavorBtn, true, -2)\n\t}\n\t\n\tinsert(str) {\n\t\tthis.editor.replaceSelection(str, \"end\");\n\t}\n\n\tselectAll() {\n\t\tCMUtils.selectAll(this.editor);\n\t}\n\t\n// private methods:\n\t_initUI(el) {\n\t\tthis.editorEl = $.query(\"> .editor\", el);\n\t\tlet editor = this.editor = CMUtils.create(this.editorEl, {\n\t\t\tautofocus: true,\n\t\t\tmaxLength: 2500,\n\t\t\tsingleLine: true\n\t\t}, \"100%\", \"100%\");\n\t\t\n\t\teditor.on(\"mousedown\", (cm, evt)=> this._onEditorMouseDown(cm, evt));\n\t\teditor.on(\"change\", (cm, evt)=> this._onEditorChange(cm, evt));\n\t\teditor.on(\"keydown\", (cm, evt)=> this._onEditorKeyDown(cm, evt));\n\t\t// hacky method to disable overwrite mode on expressions to avoid overwriting flags:\n\t\teditor.toggleOverwrite = ()=>{};\n\t\t\n\t\tthis.errorEl = $.query(\".icon.alert\", this.editorEl);\n\t\tthis.errorEl.addEventListener(\"mouseenter\", (evt)=>this._onMouseError(evt));\n\t\tthis.errorEl.addEventListener(\"mouseleave\", (evt)=>this._onMouseError(evt));\n\t\t\n\t\tthis.highlighter = new ExpressionHighlighter(editor);\n\t\tthis.hover = new ExpressionHover(editor, this.highlighter);\n\t\t\n\t\tthis._setInitialExpression();\n\t\tthis._initTooltips(el);\n\t\tthis.value = Expression.DEFAULT_EXPRESSION;\n\t}\n\t\n\t_setInitialExpression() {\n\t\tlet editor = this.editor;\n\t\teditor.setValue(\"/./g\");\n\t\t\n\t\t// leading /\n\t\teditor.getDoc().markText({line: 0, ch: 0}, {\n\t\t\tline: 0,\n\t\t\tch: 1\n\t\t}, {\n\t\t\tclassName: \"exp-decorator\",\n\t\t\treadOnly: true,\n\t\t\tatomic: true,\n\t\t\tinclusiveLeft: true\n\t\t});\n\t\t\n\t\t// trailing /g\n\t\teditor.getDoc().markText({line: 0, ch: 2}, {\n\t\t\tline: 0,\n\t\t\tch: 4\n\t\t}, {\n\t\t\tclassName: \"exp-decorator\",\n\t\t\treadOnly: false,\n\t\t\tatomic: true,\n\t\t\tinclusiveRight: true\n\t\t});\n\t\tthis._deferUpdate();\n\t}\n\t\n\t_deferUpdate() {\n\t\tUtils.defer(()=>this._update(), \"Expression._update\");\n\t}\n\t\n\t_update() {\n\t\tlet expr = this.editor.getValue();\n\t\tthis.lexer.profile = app.flavor.profile;\n\t\tlet token = this.lexer.parse(expr);\n\t\t$.toggleClass(this.editorEl, \"error\", !!this.lexer.errors.length);\n\t\tthis.hover.token = token;\n\t\tthis.highlighter.draw(token);\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\t\n\t_initTooltips(el) {\n\t\tconst template = $.template` ${\"label\"}`;\n\t\tlet flavorData = app.flavor.profiles.map((o)=>({id:o.id, label:o.label+\" (\"+(o.browser?\"Browser\":\"Server\")+\")\"}));\n\t\t\n\t\tthis.flavorBtn = $.query(\"section.expression .button.flavor\", el);\n\t\tthis.flavorEl = $.query(\"#library #tooltip-flavor\");\n\t\tthis.flavorList = new List($.query(\"ul.list\", this.flavorEl), {data:flavorData, template});\n\t\tthis.flavorList.on(\"change\", ()=>this._onFlavorListChange());\n\t\tthis.flavorBtn.addEventListener(\"click\", (evt) => this.showFlavors());\n\t\t$.query(\".icon.help\", this.flavorEl).addEventListener(\"click\", ()=> app.sidebar.goto(\"engine\"));\n\t\t\n\t\tthis.flagsBtn = $.query(\"section.expression .button.flags\", el);\n\t\tthis.flagsEl = $.query(\"#library #tooltip-flags\");\n\t\tthis.flagsList = new List($.query(\"ul.list\", this.flagsEl), {data:[], multi:true, template});\n\t\tthis.flagsList.on(\"change\", ()=> this._onFlagListChange());\n\t\tthis.flagsBtn.addEventListener(\"click\", (evt) => this.showFlags());\n\t\t$.query(\".icon.help\", this.flagsEl).addEventListener(\"click\", ()=> app.sidebar.goto(\"flags\"));\n\t}\n\n// event handlers:\n\t_onFlavorListChange() {\n\t\tapp.tooltip.toggle.hide(\"flavor\");\n\t\tapp.flavor.value = this.flavorList.selected;\n\t\tTrack.page(\"flavor/\"+this.flavorList.selected);\n\t}\n\t\n\t_onFlagListChange() {\n\t\tlet sel = this.flagsList.selected;\n\t\tthis.flags = sel ? sel.join(\"\") : \"\";\n\t\tTrack.event(\"set_flags\", \"engagement\", this.flags);\n\t}\n\t\n\t_onFlavorChange() {\n\t\tlet flavor = app.flavor, profile = flavor.profile;\n\t\tthis.flavorList.selected = profile.id;\n\t\t$.query(\"> .label\", this.flavorBtn).innerText = profile.label;\n\t\t\n\t\tlet supported = Expression.FLAGS.split(\"\").filter((n)=>!!profile.flags[n]);\n\t\tlet labels = Expression.FLAG_LABELS;\n\t\tthis.flagsList.data = supported.map((n)=>({id:n, label:labels[n]}));\n\t\tthis.flags = this.flags.split(\"\").filter((n)=>!!profile.flags[n]).join(\"\");\n\t}\n\t\n\t_onEditorMouseDown(cm, evt) {\n\t\t// offset by half a character to make accidental clicks less likely:\n\t\tlet index = CMUtils.getCharIndexAt(cm, evt.clientX - cm.defaultCharWidth() * 0.6, evt.clientY);\n\t\tif (index >= cm.getValue().lastIndexOf(this.delim)) {\n\t\t\tthis.showFlags();\n\t\t}\n\t}\n\t\t\n\t\n\t_onEditorChange(cm, evt) {\n\t\t// catches pasting full expressions in.\n\t\t// TODO: will need to be updated to work with other delimeters\n\t\tthis._deferUpdate();\n\t\tlet str = evt.text[0];\n\t\tif (str.length < 3 || !str.match(/^\\/.+[^\\\\]\\/[a-z]*$/ig) || evt.from.ch !== 1 || evt.to.ch != 1 + evt.removed[0].length) {\n\t\t\t// not pasting a full expression.\n\t\t\treturn;\n\t\t}\n\t\tthis.value = str;\n\t}\n\t\n\t_onEditorKeyDown(cm, evt) {\n\t\t// Ctrl or Command + D by default, will delete the expression and the flags field, Re: https://github.com/gskinner/regexr/issues/74\n\t\t// So we just manually reset to nothing here.\n\t\tif ((evt.ctrlKey || evt.metaKey) && evt.keyCode == 68) {\n\t\t\tevt.preventDefault();\n\t\t\tthis.pattern = \"\";\n\t\t}\n\t}\n\t\n\t_onMouseError(evt) {\n\t\tlet tt = app.tooltip.hover, errs = this.lexer.errors;\n\t\tif (evt.type === \"mouseleave\") { return tt.hide(\"error\"); }\n\t\tif (errs.length === 0) { return; }\n\t\tlet err = errs.length === 1 && errs[0].error;\n\t\tlet str = err ? app.reference.getError(err, errs[0]) : \"Problems in the Expression are underlined in red. Roll over them for details.\";\n\t\tlet label = err && err.warning ? \"WARNING\" : \"PARSE ERROR\";\n\t\ttt.showOn(\"error\", \"\"+label+\": \"+str, this.errorEl);\n\t}\n\t\n}\n\nExpression.DEFAULT_EXPRESSION = \"/([A-Z])\\\\w+/g\";\n\nExpression.FLAGS = \"gimsuxyU\"; // for flag order\nExpression.FLAG_LABELS = {\n\t\"g\": \"global\",\n\t\"i\": \"case insensitive\",\n\t\"m\": \"multiline\",\n\t\"s\": \"single line (dotall)\",\n\t\"u\": \"unicode\",\n\t\"x\": \"extended\",\n\t\"y\": \"sticky\",\n\t\"U\": \"Ungreedy\"\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nlet UID = {\n\t_next: 0,\n\tget id() { return Date.now() + \"_\" + this._next++; },\n\tassign(list, force=false) {\n\t\tlist.forEach((o) => o.id = o.id == null || force ? this.id : o.id );\n\t}\n};\nexport default UID;\n\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"../utils/Utils\";\n\nexport default class TextHighlighter {\n\tconstructor(editor, canvas, fill = \"#6CF\", stroke=\"#888\") {\n\t\tthis.lineSpacing = 2;\n\t\tthis.capWidth = 4;\n\t\tthis.lastBottom = -1;\n\t\tthis.lastRight = -1;\n\t\tthis.editor = editor;\n\t\tthis.canvas = canvas;\n\t\tthis.fill = fill;\n\t\tthis.stroke = stroke;\n\t}\n\t\n\tset matches(val) {\n\t\tthis._matches = val;\n\t\tthis._deferUpdate();\n\t}\n\t\n\tset hoverMatch(val) {\n\t\tthis._hoverMatch = val;\n\t\tthis._deferUpdate();\n\t}\n\t\n\tset selectedMatch(val) {\n\t\tthis._selectedMatch = val;\n\t\tthis._deferUpdate();\n\t}\n\n\tredraw() {\n\t\tthis._update();\n\t}\n\t\n\t_deferUpdate() {\n\t\tUtils.defer(()=>this._update(), \"TextHighlighter._update\");\n\t}\n\t\n\t_update() {\n\t\tthis.clear();\n\t\tlet matches = this._matches, hoverMatch = this._hoverMatch, selectedMatch = this._selectedMatch;\n\t\tif (!matches || !matches.length) { return; }\n\t\t\n\t\n\t\tlet cm = this.editor, doc = cm.getDoc()\n\t\tlet ctx = this.canvas.getContext(\"2d\");\n\t\tctx.fillStyle = this.fill;\n\t\tctx.strokeStyle = this.stroke;\n\t\tctx.lineWidth = 2;\n\t\n\t\t// find the range of the visible text:\n\t\tlet scroll = cm.getScrollInfo();\n\t\tlet top = cm.indexFromPos(cm.coordsChar({\n\t\t\tleft: 0,\n\t\t\ttop: scroll.top\n\t\t}, \"local\"));\n\t\tlet bottom = cm.indexFromPos(cm.coordsChar({\n\t\t\tleft: scroll.clientWidth,\n\t\t\ttop: scroll.top + scroll.clientHeight\n\t\t}, \"local\"));\n\t\n\t\tfor (let i = 0, l = matches.length; i < l; i++) {\n\t\t\tlet match = matches[i], start = match.i, end = match.i+match.l-1;\n\t\t\t\n\t\t\tif (start > bottom) { break; } // all done.\n\t\t\tif (end < top || end < start) { continue; } // not visible, so don't mark.\n\t\t\tlet startPos = match.startPos || (match.startPos = doc.posFromIndex(start));\n\t\t\tlet endPos = match.endPos || (match.endPos = doc.posFromIndex(end));\n\t\t\tlet emphasis = match === hoverMatch || match === selectedMatch;\n\t\n\t\t\tlet startRect = cm.charCoords(startPos, \"local\"), endRect = cm.charCoords(endPos, \"local\");\n\t\n\t\t\tif (startRect.bottom === endRect.bottom) {\n\t\t\t\tthis.drawHighlight(ctx, startRect.left, startRect.top, endRect.right, endRect.bottom, scroll.top, false, false, emphasis);\n\t\t\t} else {\n\t\t\t\tlet lw = cm.getScrollInfo().width, lh = cm.defaultTextHeight();\n\t\t\t\t// render first line:\n\t\t\t\tthis.drawHighlight(ctx, startRect.left, startRect.top, lw - 2, startRect.bottom, scroll.top, false, true, emphasis); // startRect.top+lh\n\t\t\t\t// render lines in between:\n\t\t\t\tlet y = startRect.top;\n\t\t\t\twhile ((y += lh) < endRect.top - 1) { // the -1 is due to fractional issues on FF\n\t\t\t\t\tthis.drawHighlight(ctx, 0, y, lw - 2, y + startRect.bottom - startRect.top, scroll.top, true, true, emphasis); // lh\n\t\t\t\t}\n\t\t\t\t// render last line:\n\t\t\t\tthis.drawHighlight(ctx, 0, endRect.top, endRect.right, endRect.bottom, scroll.top, true, false, emphasis);\n\t\t\t\t// CMUtils.getEOLPos(this.sourceCM, startPos);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tdrawHighlight(ctx, left, top, right, bottom, scrollY, startCap, endCap, emphasis) {\n\t\tlet capW = this.capWidth;\n\t\n\t\tif (right < 0 || left + 1 >= right) { return; } // weird bug in CodeMirror occasionally returns negative values\n\t\tleft = left + 0.5 | 0;\n\t\tright = right + 0.5 | 0;\n\t\ttop = (top + 0.5 | 0) + this.lineSpacing;\n\t\tbottom = bottom + 0.5 | 0;\n\t\n\t\tif (top + 1 > this.lastBottom) {\n\t\t\tthis.lastBottom = bottom;\n\t\t}\n\t\telse if (left < this.lastRight) {\n\t\t\tleft = this.lastRight;\n\t\t}\n\t\tthis.lastRight = right;\n\t\t\n\t\tlet a = ctx.globalAlpha;\n\t\tif (startCap) {\n\t\t\tctx.globalAlpha = a * 0.5;\n\t\t\tctx.fillRect(left + 1 | 0, top - scrollY, capW + 1, bottom - top);\n\t\t\tleft += capW;\n\t\t}\n\t\tif (endCap) {\n\t\t\tctx.globalAlpha = a * 0.5;\n\t\t\tctx.fillRect(right - capW - 1 | 0, top - scrollY, capW + 1, bottom - top);\n\t\t\tright -= capW;\n\t\t}\n\t\tctx.globalAlpha = a;\n\t\tctx.fillRect(left + 1, top - scrollY, right - left - 1, bottom - top);\n\n\t\tif (emphasis) {\n\t\t\tctx.strokeRect(left + 1, top - scrollY, right - left - 1, bottom - top);\n\t\t}\n\t}\n\t\n\tclear() {\n\t\tthis.canvas.width = this.canvas.width;\n\t\tthis.lastBottom = -1;\n\t}\n}\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport CMUtils from \"../utils/CMUtils\";\nimport $ from \"../utils/DOMUtils\";\n\nimport app from \"../app\";\n\nexport default class TextHover {\n\tconstructor (editor, highlighter) {\n\t\tthis.editor = editor;\n\t\tthis.highlighter = highlighter;\n\t\tthis._matches = this._x = null;\n\t\t\n\t\tlet o = editor.display.lineDiv;\n\t\to.addEventListener(\"mousemove\", (evt)=> this._handleMouseMove(evt));\n\t\to.addEventListener(\"mouseout\", (evt)=> this._handleMouseOut(evt));\n\t}\n\n\tset matches(val) {\n\t\tthis._matches = val;\n\t\tthis._update();\n\t}\n\n// private methods:\n\t_handleMouseMove(evt) {\n\t\tthis._x = evt.clientX;\n\t\tthis._y = evt.clientY + window.pageYOffset;\n\t\tthis._update();\n\t}\n\t\n\t_handleMouseOut(evt) {\n\t\tthis._x = null;\n\t\tthis._update();\n\t}\n\n\t_update() {\n\t\tif (this._x === null) {\n\t\t\tthis.highlighter.hoverMatch = null;\n\t\t\tapp.tooltip.hover.hide(\"TextHover\");\n\t\t\treturn;\n\t\t}\n\t\tlet index, cm = this.editor, match, matches = this._matches, x = this._x, y = this._y;\n\t\t\n\t\tif (matches && matches.length && (index = CMUtils.getCharIndexAt(cm, x, y)) != null) {\n\t\t\tmatch = this.highlighter.hoverMatch = app.text.getMatchAt(index);\n\t\t}\n\t\tlet rect = (index != null) && CMUtils.getCharRect(cm, index);\n\t\tif (rect) { rect.right = rect.left = x; }\n\t\tlet tip = app.reference.tipForMatch(match, cm.getValue());\n\t\tif (tip) {\n\t\t\tlet div = $.create(\"div\", \"texthover\", tip);\n\t\t\tapp.tooltip.hover.show(\"TextHover\", div, x, rect.bottom, true, 0);\n\t\t}\n\t\t\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n/*\nTODO:\nAdd analytics.\nSave / load - don't forget to assign IDs on load.\nServer solve.\nIssue with CM not updating in Text when loading pattern in Test mode.\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils\";\nimport UID from \"../utils/UID\";\nimport CMUtils from \"../utils/CMUtils\";\nimport TextHighlighter from \"./TextHighlighter\";\nimport TextHover from \"./TextHover\";\nimport EventDispatcher from \"../events/EventDispatcher\";\nimport List from \"../controls/List\";\nimport Track from \"../utils/Track\";\n\nimport app from \"../app\";\n\nexport default class Text extends EventDispatcher {\n\tconstructor (el) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis._initUI(el);\n\t\tthis._initTestUI(el);\n\t\tapp.on(\"result\", () => this._setResult(app.result));\n\t\tapp.theme.on(\"change\", () => this._handleThemeChange());\n\t}\n\t\n\tset value(val) {\n\t\tthis.editor.setValue(val || this.defaultText);\n\t}\n\t\n\tget value() {\n\t\treturn this.editor.getValue();\n\t}\n\n\tset tests(val) {\n\t\tif (!(val instanceof Array)) {\n\t\t\tval = [];\n\t\t\t$.removeClass(this.testsEl, \"tests-added\");\n\t\t}\n\t\tthis._tests = this.testList.data = val;\n\t\tthis._testMatches = null;\n\t\tthis._reselectTest();\n\t}\n\n\tget tests() {\n\t\treturn this._tests;\n\t}\n\n\tset mode(val) {\n\t\tif (val === this.mode) { return; }\n\t\tthis.modeList.selected = val || \"text\";\n\t\tthis._handleModeChange();\n\t}\n\n\tget mode() {\n\t\treturn this.modeList.selected;\n\t}\n\t\n\tget selectedMatch() {\n\t\tlet cm = this.editor;\n\t\treturn this.getMatchAt(cm.indexFromPos(cm.getCursor()), true);\n\t}\n\t\n\tgetMatchValue(match) {\n\t\t// this also works for groups.\n\t\treturn match ? this.value.substr(match.i, match.l) : null;\n\t}\n\t\n\tgetMatchAt(index, inclusive) {\n\t\t// also used by TextHover\n\t\tlet match, offset=(inclusive ? -1 : 0), matches=this._result && this._result.matches;\n\t\tif (!matches) { return null; }\n\t\tfor (let i = 0, l = matches.length; i < l; i++) {\n\t\t\tmatch = matches[i];\n\t\t\tif (match.l+match.i-1 < index + offset) { continue; }\n\t\t\tif (match.i > index) { break; }\n\t\t\treturn match;\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetEmptyTest() {\n\t\treturn {\n\t\t\tid: UID.id,\n\t\t\tname: \"\",\n\t\t\ttext: \"Enter your test text here.\",\n\t\t\ttype: \"any\"\n\t\t}\n\t}\n\t\n// private methods:\n\t_initUI(el) {\n\t\tthis.resultEl = $.query(\"> header .result\", el);\n\t\tthis.resultEl.addEventListener(\"mouseenter\", (evt)=>this._mouseResult(evt));\n\t\tthis.resultEl.addEventListener(\"mouseleave\", (evt)=>this._mouseResult(evt));\n\n\t\tthis.modeListEl = $.query(\"> header .modelist\", el);\n\t\tlet data = [\"Text\", \"Tests\"].map((val) => ({label:val, id:val.toLowerCase()}));\n\t\tthis.modeList = new List(this.modeListEl, {data});\n\t\tthis.modeList.on(\"change\", ()=> this._handleModeChange());\n\t\tthis.modeList.selected = \"text\";\n\t\t\n\t\tlet textEl = $.query(\".editor > .pad\", el);\n\t\tthis.defaultText = $.query(\"textarea\", textEl).value;\n\t\tlet editor = this.editor = CMUtils.create($.empty(textEl), {lineWrapping: true}, \"100%\", \"100%\");\n\t\teditor.setValue(this.defaultText);\n\t\t\n\t\teditor.on(\"change\", ()=> this._change());\n\t\teditor.on(\"scroll\", ()=> this._update());\n\t\teditor.on(\"cursorActivity\", () => this._updateSelected());\n\t\t\n\t\tlet detector = $.create(\"iframe\", \"resizedetector\", null, textEl), win = detector.contentWindow;\n\t\tlet canvas = this.canvas = $.create(\"canvas\", \"highlights\", null, textEl);\n\t\ttextEl.appendChild(editor.display.wrapper); // move the editor on top of the iframe & canvas.\n\n\t\twin.onresize = ()=> {\n\t\t\tlet w = win.innerWidth|0, h = win.innerHeight|0;\n\t\t\tthis._startResize();\n\t\t\tUtils.defer(() => this._handleResize(w, h), \"text_resize\", 250);\n\t\t};\n\t\twin.onresize();\n\t\t\n\t\tthis.highlighter = new TextHighlighter(editor, canvas, $.getCSSValue(\"match\", \"color\"), $.getCSSValue(\"selected-stroke\", \"color\"));\n\t\tthis.hover = new TextHover(editor, this.highlighter);\n\t}\n\n\t_handleThemeChange() {\n\t\tthis.highlighter.fill = $.getCSSValue(\"match\", \"color\");\n\t\tthis.highlighter.stroke = $.getCSSValue(\"selected-stroke\", \"color\");\n\t\tthis.highlighter.redraw();\n\t}\n\n\t_handleModeChange(evt) {\n\t\tthis.dispatchEvent(\"modechange\");\n\t\tif (this.mode === \"text\") { this.editor.refresh(); }\n\t\telse { $.addClass(this.el, \"tests-viewed\"); }\n\n\t\tTrack.page(\"mode/\"+this.mode);\n\t}\n\t\n\t_setResult(val) {\n\t\tthis._result = val;\n\t\tthis._testMatches = null;\n\n\t\tif (this.mode !== val.mode) { return; }\n\t\tif (val.mode === \"tests\") {\n\t\t\tthis._updateTests();\n\t\t} else { // mode === \"text\"\n\t\t\tthis._updateEmptyCount();\n\t\t\tthis._updateResult();\n\t\t\tthis._updateSelected();\n\t\t\tthis._deferUpdate();\n\t\t}\n\t}\n\t\n\t_deferUpdate() {\n\t\tUtils.defer(()=>this._update(), \"Text._update\");\n\t}\n\t\n\t_update() {\n\t\tlet result = this._result, matches = result && result.matches;\n\t\tif (result && result.mode === \"tests\") {\n\t\t\tthis._updateTests();\n\t\t} else { // mode === \"text\"\n\t\t\tthis.hover.matches = this.highlighter.matches = matches;\n\t\t}\n\t}\n\t\n\t_updateResult() {\n\t\tlet result = this._result, matches=result&&result.matches, l=matches&&matches.length, text;\n\t\t\n\t\tif (l && result && !result.error) {\n\t\t\ttext = l + \" match\" + (l>1?\"es\":\"\") + (this._emptyCount?\"*\":\"\");\n\t\t} else if (!result || !result.error) {\n\t\t\ttext = \"No match\";\n\t\t}\n\t\tthis._showResult(text);\n\t}\n\n\t_showResult(text, clss) {\n\t\tlet result = this._result, el = this.resultEl;\n\t\t$.removeClass(el, \"error warning matches pass fail\");\n\n\t\tif (result && result.error) {\n\t\t\tif (!text) { text = result.error.warning ? \"WARNING\" : \"ERROR\"; }\n\t\t\t$.addClass(el, \"error\");\n\t\t\tif (result.error.warning) { $.addClass(el, \"warning\"); }\n\t\t}\n\n\t\tif (clss) { $.addClass(el, clss); }\n\t\tel.innerHTML = text;\n\t\tif (result.time != null) { el.innerHTML += \" (\"+parseFloat(result.time).toFixed(1)+\"ms)\"; }\n\t}\n\t\n\t_updateSelected() {\n\t\tlet match = this.selectedMatch;\n\t\tif (this.highlighter.selectedMatch === match) { return; }\n\t\tthis.highlighter.selectedMatch = match;\n\t\tthis.dispatchEvent(\"select\");\n\t}\n\t\n\t_change() {\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\n\t_startResize() {\n\t\tlet canvas = this.canvas, style=canvas.style;\n\t\tstyle.visibility = \"hidden\";\n\t\tstyle.opacity = 0;\n\t\t// keeps it from causing scrollbars:\n\t\tcanvas.width = canvas.height = 1;\n\t}\n\t\n\t_mouseResult(evt) {\n\t\tlet tt = app.tooltip.hover, res=this._result, err = res&&res.error, str=\"\";\n\t\tif (evt.type === \"mouseleave\") { return tt.hide(\"result\"); }\n\t\tif (err && !err.warning) {\n\t\t\tstr = \"EXEC ERROR: \" + this._errorText(err);\n\t\t} else {\n\t\t\tif (err && err.warning) {\n\t\t\t\tstr = \"WARNING: \"+ this._errorText(err) + \"
    \";\n\t\t\t}\n\t\t\tlet l = this._tests.length;\n\t\t\tif (this.mode === \"tests\") {\n\t\t\t\tif (this._tests.length === 0) {\n\t\t\t\t\tstr += \"Use the 'Add Test' button to create a new test.\";\n\t\t\t\t} else if (this._testFails) {\n\t\t\t\t\tstr += this._testFails+\" out of \"+l+\" tests failed.\";\n\t\t\t\t} else {\n\t\t\t\t\tstr += \"All \"+l+\" tests passed.\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr += (l||\"No\")+\" match\"+(l>1?\"es\":\"\")+\" found in \"+this.value.length+\" characters\";\n\t\t\t\tstr += this._emptyCount ? \", including \"+this._emptyCount+\" empty matches (* not displayed).\" : \".\";\n\t\t\t\tlet cm = this.editor, sel = cm.listSelections()[0], pos = sel.head;\n\t\t\t\tlet i0 = cm.indexFromPos(pos), i1=cm.indexFromPos(sel.anchor), range=Math.abs(i0-i1);\n\t\t\t\tstr += \"
    Insertion point: line \"+pos.line+\", col \"+pos.ch+\", index \"+i0;\n\t\t\t\tstr += (range>0 ? \" (\"+range+\" character\"+(range===1?\"\":\"s\")+\" selected)\" : \"\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\ttt.showOn(\"result\", str, this.resultEl, false, -2);\n\t}\n\n\t_updateEmptyCount() {\n\t\tlet result = this._result, matches = result && result.matches;\n\t\tthis._emptyCount = matches ? matches.reduce((v,o)=>v+(o.l?0:1),0) : 0;\n\t}\n\n\t_errorText(err) {\n\t\treturn err.message || app.reference.getError(err);\n\t}\n\t\n\t_handleResize(w, h) {\n\t\tlet canvas = this.canvas, style=canvas.style;\n\t\tstyle.visibility = style.opacity = \"\";\n\t\tcanvas.width = w;\n\t\tcanvas.height = h;\n\t\tthis.editor.refresh();\n\t\tthis._deferUpdate();\n\t}\n\n// Test mode:\n\t_initTestUI(el) {\n\t\tconst types = [\n\t\t\t{id:\"all\", label:\"Match Full\"},\n\t\t\t{id:\"any\", label:\"Match Any\"},\n\t\t\t// {id:\"start\", label:\"Match Start\"},\n\t\t\t{id:\"none\", label:\"Match None\"},\n\t\t];\n\t\tthis.typeLabels = types.reduce((o, t) => { o[t.id] = t.label; return o; }, {});\n\n\t\tthis.testsEl = $.query(\".tests\", el);\n\t\tthis.testItemEl = $.query(\"#library > #tests_item\");\n\t\tthis.testListEl = $.query(\".list\", this.testsEl);\n\t\tthis.testList = new List(this.testListEl, {template:(o) => this._testItemTemplate(o)});\n\t\tthis.testList.scrollEl = this.testsEl;\n\n\t\tthis.testList.on(\"change\", (evt) => this._handleTestChange(evt));\n\n\t\t$.on($.queryAll(\".button.add\", el), \"click\", ()=>this._addTest());\n\n\t\tconst template = $.template` ${\"label\"}`;\n\t\tthis.typesEl = $.query(\"#library #tooltip-testtypes\");\n\t\tthis.typesList = new List($.query(\"ul.list\", this.typesEl), {data:types, template});\n\t\tthis.typesList.on(\"change\", ()=> this._handleTypesChange());\n\n\t\tthis.tests = null;\n\t}\n\n\t_updateTests() {\n\t\tlet result = this._result;\n\t\tif (result.error) { return this._showResult(); }\n\n\t\tlet data = this._tests, l=data.length;\n\t\tif (!data || !l) { return this._showResult(\"No tests.\"); }\n\t\t\n\t\tlet matches = result.matches.reduce((o, t) => { o[t.id] = t; return o; }, {}), fails=0;\n\t\tfor (let i=0; i this._showTypes(typeBtn, o));\n\n\t\tlet delBtn = $.query(\"header .delete\", el);\n\t\tdelBtn.addEventListener(\"click\", (evt) => this._deleteTest(o));\n\n\t\tlet nameFld = $.query(\"header .name\", el);\n\t\tnameFld.addEventListener(\"input\", () => this._handleTestNameChange(nameFld, o));\n\n\t\tthis._updateTestHeader(o, el, false);\n\n\t\treturn el;\n\t}\n\n\t_updateTestHeader(o, el, edit) {\n\t\tlet nameFld = $.query(\"header .name\", el);\n\t\tnameFld.value = o.name||\"\";\n\t\tnameFld.placeholder = o.text && !edit ? o.text.substr(0, 100) : \"Untitled Test\";\n\n\t\tlet typeLbl = $.query(\"header .button.type .label\", el);\n\t\ttypeLbl.innerText = this.typeLabels[o.type];\n\t}\n\n\t_addTest() {\n\t\tconst o = this.getEmptyTest();\n\t\tthis._tests.push(o);\n\t\tthis.testList.addItem(o, true);\n\t\tthis._handleTestChange();\n\t\tthis.testEditor.execCommand(\"selectAll\");\n\t\t$.addClass(this.testsEl, \"tests-added\");\n\t\tthis._change();\n\t}\n\n\t_reselectTest() {\n\t\tif (this._selTest) {\n\t\t\tthis.testList.selected = this._selTest.id;\n\t\t}\n\t\tif (!this._selTest || this.testList.selected == null) {\n\t\t\tthis.testList.selectedIndex = 0;\n\t\t}\n\t\tthis._selTest = null;\n\t\tthis._handleTestChange();\n\t}\n\n\t_handleTestChange() {\n\t\tlet el, o;\n\t\tif (this._selTest) {\n\t\t\to = this._selTest;\n\t\t\tel = this.testList.getEl(o.id);\n\t\t\tthis._updateTestHeader(o, el, false);\n\t\t}\n\n\t\tel = this.testList.selectedEl;\n\t\to = this._selTest = this.testList.selectedItem;\n\n\t\tif (!o) { return; }\n\n\t\tthis._getTestEditor($.query(\"article .editor .pad\", el), o);\n\t\tthis._updateTestHeader(o, el, true);\n\t\tthis._updateSelTest();\n\t\tthis.testEditor.focus();\n\t\tthis.testEditor.setCursor(this.testEditor.lineCount(), 0);\n\t}\n\n\t_handleTestNameChange(fld, o) {\n\t\to.name = fld.value;\n\t\tthis._change();\n\t}\n\n\t_handleTypesChange() {\n\t\tlet el = this.testList.selectedEl, o = this.testList.selectedItem;\n\t\to.type = this.typesList.selectedItem.id;\n\t\tapp.tooltip.toggle.hide(\"testtypes\");\n\t\tthis._updateTestHeader(o, el, true);\n\t\tthis._change();\n\t}\n\n\t_handleTestTextChange(change) {\n\t\tthis._selTest.text = this.testEditor.getValue();\n\t\tif (change.origin !== \"setValue\") { this._change(); }\n\t}\n\n\t_showTypes(el, o) {\n\t\tthis.typesList.selected = o.type;\n\t\tapp.tooltip.toggle.toggleOn(\"testtypes\", this.typesEl, el, true, -2);\n\t}\n\n\t_deleteTest(o) {\n\t\tlet data = this._tests;\n\t\tlet i = data.indexOf(o);\n\t\tdata.splice(i, 1);\n\t\tthis._selTest = null;\n\t\tthis.testList.removeItem(o.id);\n\t\tif (data.length) { this.testList.selected = data[Math.min(i, data.length-1)].id; }\n\t\tthis._updateTests();\n\t\tthis._handleTestChange();\n\t\tthis._change();\n\t}\n\n\t_getTestEditor(el, o) {\n\t\tlet cm = this.testEditor;\n\t\tif (!cm) {\n\t\t\tcm = this.testEditor = CMUtils.create($.empty(el), {lineWrapping: true}, \"100%\", \"100%\");\n\t\t\tcm.on(\"change\", (a, b) => this._handleTestTextChange(b));\n\t\t} else {\n\t\t\tel.appendChild(cm.getWrapperElement());\n\t\t}\n\t\tcm.setValue(o.text);\n\t}\n}\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../../utils/DOMUtils\";\nimport Utils from \"../../utils/Utils.js\";\n\nimport ExpressionHighlighter from \"../ExpressionHighlighter\";\n\nimport app from \"../../app\";\n\nexport default class Explain {\n\t\n\tconstructor(el) {\n\t\tthis.el = el;\n\t\t$.addClass(el, \"explain\");\n\t\tthis._update();\n\t\t\n\t\tthis._bound_handleEvent = (evt) => this._handleEvent(evt);\n\t\tapp.expression.addEventListener(\"change\", this._bound_handleEvent);\n\t\tapp.expression.highlighter.addEventListener(\"hover\", this._bound_handleEvent);\n\t}\n\t\n\t\n\tcleanup() {\n\t\t$.empty(this.el);\n\t\t$.removeClass(this.el, \"explain\");\n\t\tapp.expression.removeEventListener(\"change\", this._bound_handleEvent);\n\t\tapp.expression.highlighter.removeEventListener(\"hover\", this._bound_handleEvent);\n\t}\n\t\n// private methods:\n\t_update() {\n\t\tlet el = $.empty(this.el), token = app.expression.token, expr = app.expression.value;\n\t\tthis._divs = [];\n\t\tif (!token || token.next.type === \"close\") {\n\t\t\tel.innerHTML = \"Enter an Expression above and it will be explained here.\";\n\t\t\treturn;\n\t\t}\n\t\tel.innerHTML = \"Roll-over elements below to highlight in the Expression above. Click to open in Reference.\";\n\t\twhile ((token = token.next) && (token.type !== \"close\")) {\n\t\t\t\n\t\t\tif (token.proxy || (token.open && token.open.proxy)) { continue; }\n\t\t\t\n\t\t\tlet groupClasses = ExpressionHighlighter.GROUP_CLASS_BY_TYPE, pre = ExpressionHighlighter.CSS_PREFIX;\n\t\t\tlet i = token.i, end = token.i+token.l, content=expr.substring(i, end).replace(\"<\", \"<\");\n\t\t\tif (token.set) {\n\t\t\t\tlet set0=token.set[0], set2=token.set[2];\n\t\t\t\tcontent = \"\"+expr.substring(set0.i, set0.i+set0.l)+\"\";\n\t\t\t\tcontent += expr.substring(i, end);\n\t\t\t\tcontent += \"\"+expr.substring(set2.i, set2.i+set2.l)+\"\";\n\t\t\t}\n\t\t\t\n\t\t\tlet className = pre + (token.clss || token.type);\n\t\t\tcontent = \"\"+content+\" \";\n\t\t\tif (!token.open) { content += app.reference.tipForToken(token); }\n\t\t\telse { content += \" \"; }\n\t\t\tlet div = $.create(\"div\", null, content, el);\n\t\t\t\n\t\t\tif (token.close) {\n\t\t\t\tclassName = groupClasses[token.clss || token.type];\n\t\t\t\tif (className) {\n\t\t\t\t\tclassName = className.replace(\"%depth%\", Math.min(4,token.depth));\n\t\t\t\t\t$.addClass(div, className);\n\t\t\t\t}\n\t\t\t\tif (token.depth > 3) {\n\t\t\t\t\tdiv.innerHTML = \"So... you wanted to see what would happen if you just kept nesting groups, eh? Well, this is it.\"+\n\t\t\t\t\t\t\" I was going to reward your curiosity with a RegEx joke, but a quick search on google reveals that not even\"+\n\t\t\t\t\t\t\" the collective wisdom of the internet can make regular expressions funny. Well, except the whole 'now you've got two problems'\"+\n\t\t\t\t\t\t\" shtick, but you've probably heard that one already. Wasn't really worth the effort, was it?\";\n\t\t\t\t\ttoken = token.close.prv;\n\t\t\t\t\tthis._divs.push(div);\n\t\t\t\t\tel = div;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tel = div;\n\t\t\t}\n\t\t\t\n\t\t\tdiv.token = token;\n\t\n\t\t\tif (token.open) {\n\t\t\t\t$.addClass(div, \"close\");\n\t\t\t\tdiv.proxy = el;\n\t\t\t\tel = el.parentNode;\n\t\t\t}\n\t\n\t\t\tif (token.error) {\n\t\t\t\t$.addClass(div, \"error\");\n\t\t\t\tif (token.error.warning) { $.addClass(div, \"warning\"); }\n\t\t\t}\n\t\n\t\t\tif (!token.open) {\n\t\t\t\tdiv.addEventListener(\"mouseover\", this._handleMouseEvent);\n\t\t\t\tdiv.addEventListener(\"mouseout\", this._handleMouseEvent);\n\t\t\t\tdiv.addEventListener(\"click\", this._handleMouseEvent);\n\t\t\t}\n\t\t\t\n\t\t\tif (token.clss === \"quant\" || token.type === \"lazy\" || token.type === \"possessive\") {\n\t\t\t\tthis._insertApplied(div);\n\t\t\t} else {\n\t\t\t\tthis._divs.push(div);\n\t\t\t}\n\t\t}\n\t}\n\n\t_insertApplied(div) {\n\t\tlet divs = this._divs, prv = div.token.prv, d, i=divs.length;\n\t\twhile ((d = divs[--i]) && d.token !== prv) {} // search backwards for efficiency\n\t\td = d.proxy||d;\n\t\tdivs.splice(i, 0, div);\n\t\td.insertAdjacentElement(\"afterend\", div);\n\t\t$.addClass(div, \"applied\");\n\t}\n\n\t_handleHoverChange() {\n\t\tlet token = app.expression.highlighter.hoverToken;\n\t\t$.removeClass($.queryAll(\"div.selected\", this.el), \"selected\");\n\t\t$.removeClass($.queryAll(\"div.related\", this.el), \"related\");\n\t\tif (!token) { return; }\n\t\t\n\t\tlet div = this._findDiv(token);\n\t\t$.addClass(div, \"selected\");\n\t\tif (token.related) {\n\t\t\tfor (let i = 0, l=token.related.length; i < l; i++) {\n\t\t\t\t$.addClass(this._findDiv(token.related[i]), \"related\");\n\t\t\t}\n\t\t}\n\t}\n\t\n\t_findDiv(token) {\n\t\treturn Utils.find(this._divs, (div) => div.token === token);\n\t}\n\n\t_handleMouseEvent(evt) {\n\t\tlet type = evt.type, token = evt.currentTarget.token;\n\t\tif (type == \"click\") { app.sidebar.showToken(token); }\n\t\telse { app.expression.highlighter.hoverToken = type === \"mouseout\" ? null : token; }\n\t\tevt.stopPropagation();\n\t}\n\t\n\t_handleEvent(evt) {\n\t\tif (evt.type === \"change\") { this._update(); }\n\t\telse if (evt.type === \"hover\") { this._handleHoverChange(); }\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../../utils/DOMUtils\";\nimport Utils from \"../../utils/Utils\";\n\nimport app from \"../../app\";\n\nexport default class Details {\n\t\n\tconstructor(el) {\n\t\tthis.el = el;\n\t\t$.addClass(el, \"details\");\n\t\tthis._update();\n\t\t\n\t\tthis._bound_handleEvent = (evt) => this._handleEvent(evt);\n\t\tapp.addEventListener(\"result\", this._bound_handleEvent);\n\t\tapp.text.addEventListener(\"select\", this._bound_handleEvent);\n\t}\n\t\n\t\n\tcleanup() {\n\t\t$.empty(this.el);\n\t\t$.removeClass(this.el, \"details\");\n\t\tapp.removeEventListener(\"result\", this._bound_handleEvent);\n\t\tapp.text.removeEventListener(\"select\", this._bound_handleEvent);\n\t\tUtils.defer(null, \"Details._update\");\n\t}\n\t\n// private methods:\n\t_update() {\n\t\t$.empty(this.el);\n\t\t$.create(\"div\", \"desc\", \"Click a match above to display match & group details. Mouse over a Group row to highlight it in the Expression.\", this.el);\n\t\tthis._addMatch(app.text.selectedMatch, app.text.value);\n\t}\n\t\n\t_addMatch(match, textVal) {\n\t\tif (!match) { return; }\n\t\tlet groups = match.groups, l=groups&&groups.length, ext=l&&(groups[0].i != null), matchVal=this._getMatchVal(match, textVal), extStr=\"\", me = match.i+match.l;\n\t\tlet groupTokens = app.expression.lexer.captureGroups;\n\t\t\n\t\tlet tableEl = $.create(\"table\", null, null, this.el);\n\t\tlet matchEl = $.create(\"tr\", \"match\", \"Match \"+match.num+\"\"+this._getRangeStr(match)+\"\", tableEl);\n\t\t\n\t\tif (l) {\n\t\t\tlet inGroups = [], lastIndex = match.i;\n\t\t\tfor (let i = 0; i <= l; i++) {\n\t\t\t\tlet group = groups[i], index = group ? group.i : me, num = i + 1, token = groupTokens[i];\n\t\t\t\tif (ext) {\n\t\t\t\t\tfor (let j = inGroups.length - 1; j >= 0; j--) {\n\t\t\t\t\t\tlet inGroup = inGroups[j], ge = inGroup.i + inGroup.l;\n\t\t\t\t\t\tif (ge > index) { break; }\n\t\t\t\t\t\tinGroups.pop();\n\t\t\t\t\t\textStr += Utils.htmlSafe(textVal.substring(lastIndex, ge)) + \"\";\n\t\t\t\t\t\tlastIndex = ge;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!group) { break; }\n\t\t\t\tif (group.l) {\n\t\t\t\t\textStr += Utils.htmlSafe(textVal.substring(lastIndex, index)) + \"\";\n\t\t\t\t\tinGroups.push(group);\n\t\t\t\t\tlastIndex = index;\n\t\t\t\t}\n\t\t\t\tlet val = \"\" + this._getMatchVal(group, textVal) + \"\";\n\t\t\t\tlet label = token.name ? \"'\"+token.name+\"'\" : (\"Group \" + num);\n\t\t\t\tlet tr = $.create(\"tr\", \"group\", \"\" + label + \"\" + this._getRangeStr(group) + \"\" + val + \"\", tableEl);\n\t\t\t\t\n\t\t\t\ttr.token = token;\n\t\t\t\ttr.addEventListener(\"mouseover\", this._handleMouseEvent);\n\t\t\t\ttr.addEventListener(\"mouseout\", this._handleMouseEvent);\n\t\t\t}\n\t\t\tif (ext) { extStr += Utils.htmlSafe(textVal.substring(lastIndex, me)); }\n\t\t} else {\n\t\t\t$.create(\"tr\", \"nogroup\", \"No groups.\", tableEl);\n\t\t}\n\t\t\n\t\t$.query(\"td:last-child\", matchEl).innerHTML = extStr || matchVal;\n\t}\n\t\n\t_getMatchVal(match, str) {\n\t\tlet val = match.s || (match.i === undefined ? \"\" : str.substr(match.i, match.l));\n\t\treturn val ? Utils.htmlSafe(val) : \"<empty>\";\n\t}\n\t\n\t_getRangeStr(match) {\n\t\t// we could check for match.l>0 to catch empty matches, but having a weird range might be more accurate.\n\t\treturn match.i != null ? match.i + \"-\" + (match.i+match.l-1) : \"n/a\";\n\t}\n\n\t_handleEvent(evt) {\n\t\tUtils.defer(()=>this._update(), \"Details._update\");\n\t}\n\t\n\t_handleMouseEvent(evt) {\n\t\tlet type = evt.type, token = evt.currentTarget.token;\n\t\tapp.expression.highlighter.hoverToken = type === \"mouseout\" ? null : token;\n\t\tif (type === \"mouseover\") { $.addClass($.query(\"span.num-\"+token.num, this.el), \"hover\"); }\n\t\telse { $.removeClass($.query(\"span.hover\", this.el), \"hover\"); }\n\t\tevt.stopPropagation();\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../../utils/DOMUtils\";\nimport Utils from \"../../utils/Utils\";\nimport app from \"../../app\";\n\nexport default class Replace {\n\tconstructor(el, cm) {\n\t\tthis.el = el;\n\t\tthis.editor = cm;\n\t\t\n\t\tthis._bound_handleEvent = (evt) => this._handleEvent(evt);\n\t\tapp.addEventListener(\"result\", this._bound_handleEvent);\n\t\t\n\t\tthis._initUI();\n\t\tthis._update();\n\t}\n\t\n\tcleanup() {\n\t\t$.empty(this.el);\n\t\tthis.output.value = \"\";\n\t\t$.removeClass(this.el, \"details\");\n\t\tapp.removeEventListener(\"result\", this._bound_handleEvent);\n\t\tUtils.defer(null, \"Replace._update\");\n\t}\n\t\n// private methods:\n\t_initUI() {\n\t\tthis.output = $.create(\"textarea\", null, null, this.el);\n\t\tthis.output.readOnly = true;\n\t}\n\t\n\t_update() {\n\t\tlet o = app.result && app.result.tool, result = o&&o.result;\n\t\tthis.output.value = result || \"no result\";\n\t}\n\n\t_handleEvent(evt) {\n\t\tUtils.defer(()=>this._update(), \"Replace._update\");\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"./utils/Utils\";\n\nimport app from \"./app\";\n\nexport default class SubstLexer {\n\tconstructor() {\n\t\tthis.profile = null;\n\t}\n\t\n\tset profile(profile) {\n\t\tthis._profile = profile;\n\t\tthis.string = this.token = this.errors = null;\n\t}\n\t\n\tparse(str) {\n\t\tif (!this._profile) { return null; }\n\t\t\n\t\tthis.token = null;\n\t\tthis.string = str;\n\t\tthis.errors = [];\n\t\t\n\t\t// TODO: should this be passed in from Tools?\n\t\tlet capGroups = app.expression.lexer.captureGroups;\n\t\t\n\t\tlet prev=null, token, c;\n\t\tfor (let i=0, l=str.length; i= 10 && capGroups[(num = (num/10|0))-1]) { l = numStr.length-1; }\n\t\tif (l) {\n\t\t\ttoken.l += l;\n\t\t\t// we don't assign the original type, because the docs combine them all into one id:\n\t\t\ttoken.type = num > 0 ? \"subst_group\" : \"subst_0match\";\n\t\t\ttoken.clss = \"subst\";\n\t\t\tif (num > 0) { token.group = capGroups[num-1]; }\n\t\t}\n\t}\n}\n\nSubstLexer.$_TYPES = {\n\t\"$\": \"subst_$esc\",\n\t\"&\": \"subst_$&match\",\n\t\"`\": \"subst_$before\",\n\t\"'\": \"subst_$after\",\n\t\"0\": \"subst_0match\"\n};\n\nSubstLexer.SUBST_ESC_RE = new RegExp(\"^\"+Utils.SUBST_ESC_RE.source,\"i\");\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport CMUtils from \"../utils/CMUtils\";\nimport Utils from \"../utils/Utils\";\nimport Track from \"../utils/Track\";\n\nimport List from \"../controls/List\";\nimport ExpressionHighlighter from \"./ExpressionHighlighter\";\nimport ExpressionHover from \"./ExpressionHover\";\nimport Explain from \"./tools/Explain\";\nimport Details from \"./tools/Details\";\nimport Replace from \"./tools/Replace\";\n\nimport SubstLexer from \"../SubstLexer\";\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport app from \"../app\";\n\nexport default class Tools extends EventDispatcher {\n\tconstructor (el) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis._initUI();\n\t\tthis.value = null;\n\t}\n\t\n\tset value(o) {\n\t\tif (!o) {\n\t\t\tthis.show(\"explain\");\n\t\t\tthis._toolValues = Utils.copy({}, Tools.DEFAULT_VALUES);\n\t\t} else {\n\t\t\tthis.show(o.id);\n\t\t\tif (o.input != null) { this.editor.setValue(o.input); }\n\t\t}\n\t}\n\t\n\tget value() {\n\t\treturn {\n\t\t\tid: this._toolId,\n\t\t\tinput: this.input\n\t\t};\n\t}\n\t\n\tget input() {\n\t\treturn this.hasInput ? this.editor.getValue() : null;\n\t}\n\t\n\tget hasInput() {\n\t\tlet id = this._toolId;\n\t\treturn (id === \"replace\" || id === \"list\");\n\t}\n\t\n\tshow(id) {\n\t\tif (!id || id === this._toolId) { return; }\n\n\t\tthis.toolList.selected = this._toolId = id;\n\t\tlet input = (id === \"replace\" || id === \"list\");\n\t\t\n\t\tif (this._tool) { this._tool.cleanup(); }\n\t\t\n\t\t$.toggleClass($.query(\"> article\", this.el), \"showinput\", input);\n\t\tif (input) {\n\t\t\tthis.editor.setValue(this._toolValues[id]);\n\t\t\tthis.editor.refresh();\n\t\t\tthis.editor.focus();\n\t\t}\n\t\t\n\t\tif (id === \"explain\") { this._tool = new Explain(this.contentEl); }\n\t\telse if (id === \"details\") { this._tool = new Details(this.contentEl); }\n\t\telse if (id === \"replace\" || id === \"list\") { this._tool = new Replace(this.resultEl, this.editor); }\n\t\t\n\t\tthis._toolId = id;\n\t\tthis._updateHighlights();\n\t}\n\t\n\t_initUI() {\n\t\tlet el = this.el;\n\t\tthis.headerEl = $.query(\"header\", this.el);\n\t\tthis.headerEl.addEventListener(\"click\", (evt) => this._handleHeaderClick(evt));\n\t\t\n\t\tthis.contentEl = $.query(\"> article > .content\", el);\n\t\tthis.resultEl = $.query(\"> article > .inputtool > .result\", el);\n\t\t\n\t\tthis.toolListEl = $.query(\".toollist\", this.headerEl);\n\t\tlet data = [\"Replace\", \"List\", \"Details\", \"Explain\"].map((val) => ({label:val, id:val.toLowerCase()}));\n\t\tthis.toolList = new List(this.toolListEl, {data});\n\t\tthis.toolList.on(\"change\", ()=> this._handleListChange());\n\t\t\n\t\tlet editor = this.editor = CMUtils.create($.query(\".inputtool .editor\", el), {\n\t\t\tmaxLength: 2500,\n\t\t\tsingleLine: true\n\t\t}, \"100%\", \"100%\");\n\n\t\t$.query(\".help.icon\", el).addEventListener(\"click\", () => app.sidebar.goto(this._toolId));\n\t\t\n\t\t// TODO: evaluate this living here or in Replace:\n\t\teditor.on(\"change\", ()=> this._handleEditorChange());\n\t\t\n\t\tapp.flavor.on(\"change\", () => this._updateHighlights());\n\t\tapp.expression.on(\"change\", () => this._updateHighlights());\n\t\t\n\t\tthis.lexer = new SubstLexer();\n\t\tthis.highlighter = new ExpressionHighlighter(editor);\n\t\tthis.hover = new ExpressionHover(editor, this.highlighter);\n\t}\n\t\n\t_handleEditorChange() {\n\t\tthis._updateHighlights();\n\t\tthis._toolValues[this._toolId] = this.editor.getValue();\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\t\n\t_updateHighlights() {\n\t\tif (!this.hasInput) { return; } // only for Replace & List\n\t\tthis.lexer.profile = app.flavor.profile;\n\t\tlet token = this.lexer.parse(this.editor.getValue());\n\t\tthis.highlighter.draw(token);\n\t\tthis.hover.token = token;\n\t}\n\t\n\t_handleListChange() {\n\t\tthis.show(this.toolList.selected);\n\t\tTrack.page(\"tool/\"+this.toolList.selected);\n\t}\n\t\n\t_handleHeaderClick(evt) {\n\t\tif ($.hasClass(this.el, \"closed\") || !this.toolListEl.contains(evt.target)) {\n\t\t\t$.togglePanel(this.el, 'article');\n\t\t}\n\t}\n}\nTools.DEFAULT_VALUES = {\n\treplace: \"<< $& >>\",\n\tlist: \"$&\\\\n\"\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nlet home = {};\nexport default home;\n\nhome.id = \"home\";\nhome.label = \"Menu\";\nhome.desc = \"[from HTML]\";\nhome.kids = [\n\n\n\t{\n\tlabel: \"Pattern Settings\",\n\tid: \"share\",\n\tel: \"#share_main\",\n\tlist: false,\n\tkids: [\n\t\t{\n\t\tlabel: \"Save to my Favorites\",\n\t\tid: \"share_favorites\",\n\t\tel:\"#share_favorites\"\n\t\t},\n\t\t{\n\t\tlabel: \"Share with the Community\",\n\t\tid: \"share_community\",\n\t\tel:\"#share_community\"\n\t\t}\n\t]\n\t},\n\n\t{\n\tlabel: \"My Patterns\",\n\tid:\"favorites\",\n\tdesc: \"The list above will display any patterns that you create or favorite.\"+\n\t\t\"

    To edit a pattern you created, click its URL or double-click it in the list to load it, then open Save / Share to edit and save.

    \",\n\tsearch: true,\n\tkids: []\n\t},\n\n\t{\n\tlabel: \"Cheatsheet\",\n\tid:\"cheatsheet\",\n\tel: \"#cheatsheet\"\n\t},\n\n\t{ // injected from Reference\n\tid:\"reference\"\n\t},\n\n\t{\n\tlabel: \"Community Patterns\",\n\tid: \"community\",\n\tdesc: \"Welcome to Community Patterns, a searchable database of patterns submitted by users like you.\"+\n\t\t\"

    After selecting a pattern, click its URL or double-click it in the list to load the full pattern. Or use the right arrow icon to load just the expression or text.

    \"+\n\t\t\"

    Help make the Community better by rating patterns, and submitting your own via Search & Share in the menu.

    \",\n\tsearch: true,\n\tkids: []\n\t},\n\n\t{\n\tlabel: \"Help\",\n\tid: \"help\",\n\tdesc: \"Help for the RegExr application. See the RegEx Reference for help with Regular Expressions.\",\n\tkids: [\n\n\t\t{\n\t\tlabel:\"About\",\n\t\tdesc:\"RegExr v<%= build_version %> (<%= build_date %>).\"+\n\t\t\t\"

    Created by Grant Skinner and the gskinner team, using the CreateJS & CodeMirror libraries.

    \"+\n\t\t\t\"

    You can provide feedback or log bugs on GitHub.

    \"\n\t\t},\n\t\t{\n\t\tlabel:\"Getting started\",\n\t\tdesc:\"RegExr provides real-time visual results, syntax highlighting, tooltips, and undo/redo ({{getCtrlKey()}}-Z / Y) so it's easy and fun to explore Regular Expressions.\"+\n\t\t\t\"

    Browse through the RegEx Reference and test different tokens to see what they do, then check out Community Patterns to see examples.

    \"+\n\t\t\t\"

    You can also Save your patterns for later reference, or to share with others. Sign In to ensure you don't lose your patterns.

    \"+\n\t\t\t\"

    Modify your pattern's details, share it with the Community, or make it private, or delete it in Pattern Settings

    \",\n\t\tkids: [\n\t\t\t{\n\t\t\tlabel:\"Expression panel\",\n\t\t\tdesc:\"This is where you enter a regular expression to test. The results in the Text and Tools panel will update as you type.\"+\n\t\t\t\t\"Roll over the expression for information on each token.\"+\n\t\t\t\t\"

    The buttons to the right allow you to switch RegEx engines, or edit the expression flags.

    \"\n\t\t\t},\n\t\t\t{\n\t\t\tlabel:\"Text panel\",\n\t\t\tdesc:\"This is where you enter text to test your expression against. Drag & drop a text file to load its contents.\"+\n\t\t\t\t\"

    Matches will be highlighted as you type. Roll over a match for information on the match and its capture groups. The match count and execution time are shown in the title bar.

    \"+\n\t\t\t\t\"

    Lighter colored caps at the start or end of a line indicate the match continues between lines.

    \"\n\t\t\t},\n\t\t\t{\n\t\t\tlabel:\"Tests panel\",\n\t\t\tdesc:\"This allows you to create a suite of tests that you can use to validate your Expression in real time.\"+\n\t\t\t\t\"

    A test can check if the pattern matches anything, matches everything, or matches nothing in the test text.

    \"+\n\t\t\t\t\"

    Access this panel with the toggle at the top of the Text panel. When you save, both your Text and Tests will be saved.

    \"\n\t\t\t},\n\t\t\t{\n\t\t\tlabel:\"Tools panel\",\n\t\t\tdesc:\"Click the Tools title bar below the Text panel to show or hide the Tools panel.\"+\n\t\t\t\t\"

    Tools provide different ways of working with or exploring your results.

    \",\n\t\t\tkids: [\n\t\t\t\t{\n\t\t\t\tlabel:\"Replace\",\n\t\t\t\tid: \"replace\",\n\t\t\t\tdesc:\"The Replace tool replaces matches with a specified string or pattern.\"+\n\t\t\t\t\t\"

    Matches in the Text panel are replaced by the substitution string & displayed as you type.

    \"+\n\t\t\t\t\t\"

    Substitution tokens and escaped characters are supported, such as \\\\n, \\\\t & \\\\u0009.

    \"+\n\t\t\t\t\t\"

    Roll over tokens for information, and check out the RegEx Reference for more information.

    \"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\tlabel:\"List\",\n\t\t\t\tid: \"list\",\n\t\t\t\tdesc:\"The List tool lists all found matches.\"+\n\t\t\t\t\t\"

    You can specify either a simple delimiter (ex. , or \\\\n), or use substitution tokens to generate more advanced reports. For example, $1\\\\n would list all group 1 results (in the JavaScript engine).

    \"+\n\t\t\t\t\t\"

    Escaped characters are supported, such as \\\\n, \\\\t & \\\\u0009.

    \"+\n\t\t\t\t\t\"

    Roll over tokens for information.

    \"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\tlabel:\"Details\",\n\t\t\t\tid: \"details\",\n\t\t\t\tdesc:\"The Details tool displays the full text of a match and its capture groups.\"+\n\t\t\t\t\t\"

    Click on a highlighted match in the Text panel to display the details for that match.

    \"+\n\t\t\t\t\t\"

    Roll over a group row to highlight that group in your Expression.

    \"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\tlabel:\"Explain\",\n\t\t\t\tid: \"explain\",\n\t\t\t\tdesc:\"The Explain tool displays a detailed breakdown of the Expression.\"+\n\t\t\t\t\t\"

    Mouse over the explanation to highlight the related tokens in the Expression panel and vice versa.

    \"+\n\t\t\t\t\t\"

    Click an item in the explanation to show more info in the RegEx Reference.

    \"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\tlabel:\"Menu\",\n\t\t\tdesc:\"The Menu (this panel) includes Help, a full RegEx Reference, a Cheatsheet, and Pattern Settings features.\"+\n\t\t\t\t\"

    Double-click a selected item in the RegEx Reference to insert it into your Expression. Click the arrow beside an example to load it.

    \"+\n\t\t\t\t\"

    The menu also includes searchable Community Patterns, and patterns you've created or favorited in My Patterns.

    \"\n\t\t\t}\n\t\t]\n\t\t},\n\t\t{\n\t\tlabel:\"Signing in\",\n\t\tid: \"signin\",\n\t\tdesc:\"Before you sign in, RegExr creates a temporary account which relies on a browser cookie. This means you can't access your patterns on other computers, and that you could lose your patterns if your cookies are deleted or expire.\"+\n\t\t\t\"

    Signing in creates a permanent account, so you can access your patterns anywhere, anytime.

    \"+\n\t\t\t\"

    Your existing patterns & favorites will automatically be assigned to the new account.

    \"+\n\t\t\t\"

    We don't use your info for anything other than signing you into your RegExr account.

    \"\n\t\t},\n\t\t{\n\t\tid: \"engine\",\n\t\tlabel:\"RegEx engines\",\n\t\tdesc:\"While the core feature set of regular expressions is fairly consistent, different implementations (ex. Perl vs Java) may have different features or behaviours.\"+\n\t\t\t \"

    RegExr currently supports JavaScript RegExp executed in your browser and PCRE via PHP.

    \"+\n\t\t\t \"

    You can switch engines using the dropdown in Expression.

    \",\n\t\tkids: [\n\t\t\t{\n\t\t\tlabel:\"JavaScript\",\n\t\t\tdesc:\"Your browser's JavaScript engine is used to execute RegEx in an asynchronous worker using RegExp.exec().\"+\n\t\t\t\t\"

    Note that while implementations are mostly consistent, there are small variations between browsers. Here is a short list of known differences:

      \"+\n\t\t\t\t\"
    • Older browsers don't support the u or y flags
    • \"+\n\t\t\t\t\"
    • Differences in handling of certain ambiguous escapes: \\\\8 \\\\9
    • \"+\n\t\t\t\t\"
    • Chrome handles \\\\x & \\\\u escapes slightly differently than other browsers
    • \"+\n\t\t\t\t\"
    • Chrome supports lookbehind, but it isn't yet in the JS spec
    • \"+\n\t\t\t\t\"
    • Safari ignores leading zeros in octal escapes (ex. \\\\00020)
    • \"+\n\t\t\t\t\"

    \"\n\t\t\t},\n\t\t\t{\n\t\t\tlabel:\"PCRE (PHP)\",\n\t\t\tdesc:\"PHP {{getPHPVersion()}} and PCRE {{getPCREVersion()}} are used to execute your pattern on our server.\"\n\t\t\t}\n\t\t]\n\t\t},\n\t\t{\n\t\tlabel:\"Query string support\",\n\t\tdesc:\"In addition to the built in Save mechanism which creates a shareable link, RegExr also supports the ability to pre-populate a pattern via the query string.\"+\n\t\t\t\"

    The following query string params are recognized:

      \"+\n\t\t\t\"
    • engine - the RegEx engine to use (js or pcre)
    • \"+\n\t\t\t\"
    • expression - populates the Expression area. It is recommended to pass a full expression with flags (/.*/ig) not just the pattern (.*)
    • \"+\n\t\t\t\"
    • text - populates the Text area
    • \"+\n\t\t\t\"
    • tool - sets the tool (replace, list, details, or explain)
    • \"+\n\t\t\t\"
    • input - populates the tool input field
    • \"+\n\t\t\t\"

    \"+\n\t\t\t\"Ex. regexr.com/?expression=/./g&text=test\"\n\t\t}\n\t]\n\t}\n];\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils\";\nimport app from \"../app\";\n\nexport default class LinkRow {\n\tconstructor(el) {\n\t\tthis.el = el;\n\t\tthis._initUI();\n\t\tthis.url = null;\n\t}\n\t\n\tset pattern(val) {\n\t\tlet url = Utils.getPatternURLStr(val)\n\t\tthis._pattern = val;\n\t\t$.query(\".url\", this.el).innerText = url || \"\";\n\t\t$.toggleClass(this.el, \"disabled\", !url);\n\t\t$.toggleClass(this.el, \"active\", !!url);\n\t}\n\n\tshowMessage(message) {\n\t\t// for some reason this displays one line too low if it's synchronous:\n\t\tsetTimeout(()=>app.tooltip.toggle.showOn(\"linkrow\", message, $.query(\".copy.icon\", this.el), true, 0), 1);\n\t}\n\n\t_initUI() {\n\t\tthis.el.onclick = (evt) => this._onClick(evt);\n\n\t\tlet fld=$.query(\".url\", this.el), copyBtn = $.query(\".copy\", this.el);\n\t\tlet clipboard = new Clipboard(copyBtn, { target: () => fld });\n\t\tclipboard.on(\"success\", () => app.tooltip.toggle.toggleOn(\"copy\", \"Copied to clipboard.\", copyBtn, true, 3));\n\t\tclipboard.on(\"error\", (e) => app.tooltip.toggle.toggleOn(\"copy\", Utils.getCtrlKey()+\"-C to copy.\", copyBtn, true, 3)); // TODO: cmd/ctrl\n\t}\n\n\t_onClick(evt) {\n\t\tif ($.query(\".copy\", this.el).contains(evt.target)) { return; }\n\t\tif (evt.which === 2 || evt.metaKey || evt.ctrlKey) {\n\t\t\twindow.open(Utils.getPatternURL(this._pattern));\n\t\t} else {\n\t\t\tapp.load(this._pattern);\n\t\t}\n\t}\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils.js\";\n\nimport app from \"../app\";\n\nexport default class Example {\n\tconstructor (title, ex) {\n\t\tthis.el = $.create(\"div\", \"example\");\n\t\tthis.title = title;\n\t\tthis.example = ex;\n\t}\n\t\n\tset example(ex) {\n\t\tif (ex === this._example) { return; }\n\t\tthis._example = ex;\n\t\t\n\t\tlet str = \"\", txt, exp, regex;\n\t\tif (ex) {\n\t\t\texp = ex[0];\n\t\t\ttxt = ex[1];\n\t\t\tregex = Utils.getRegExp(exp, \"g\");\n\t\t\tif (this.title) { str += \"

    \" + this.title + \"


    \"; }\n\t\t\tstr += \"Load expression\" + Utils.htmlSafe(exp) + \"\";\n\t\t\tif (txt && regex) {\n\t\t\t\tlet over=Math.max(0, txt.length-160), s=txt;\n\t\t\t\tif (over) { s = Utils.htmlSafe(s.substr(0,159)); }\n\t\t\t\tif (regex) { s = s.replace(regex, \"$&\"); }\n\t\t\t\t// TODO: this won't match on html elements:\n\t\t\t\tstr += \"
    Load text\" + s + (over?\"\\u2026\" : \"\") + \"\";\n\t\t\t}\n\t\t}\n\t\tthis.el.innerHTML = str;\n\t\tif (exp) {\n\t\t\t$.query(\"code.expression > .load\", this.el).addEventListener(\"click\", ()=> {\n\t\t\t\t// TODO: this will need to be updated when we support other delimiters:\n\t\t\t\tapp.expression.value = exp[0] === \"/\" ? exp : \"/\"+exp+\"/g\";\n\t\t\t});\n\t\t\t\n\t\t}\n\t\tif (txt) { $.query(\"code.text > .load\", this.el).addEventListener(\"click\", ()=> app.text.value = txt); }\n\t}\n\t\n\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport LinkRow from \"../controls/LinkRow\";\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils\";\nimport Example from \"./Example\";\nimport Server from \"../net/Server\";\n\nimport app from \"../app\";\n\n// also used for My Patterns.\nexport default class CommunityContent {\n\tconstructor (el) {\n\t\tthis.el = el;\n\t\tthis.example = new Example();\n\t\tel.appendChild(this.example.el);\n\t\t$.query(\".icon.thumbup\", el).addEventListener(\"click\", ()=>this._rate(1));\n\t\t$.query(\".icon.thumbdown\", el).addEventListener(\"click\", ()=>this._rate(-1));\n\t\t$.query(\".icon.favorites\", el).addEventListener(\"click\", ()=>this._favorite());\n\t\tthis.linkRow = new LinkRow($.query(\".row.link\", el))\n\t\t$.query(\".icon.share\", el).addEventListener(\"click\", ()=>this._share());\n\t}\n\t\n\tset item(o) {\n\t\tlet el = this.el;\n\t\tthis._pattern = o;\n\t\t$.query(\".author\", el).innerText = o.author ? \"by \"+o.author : \"\";\n\t\t$.query(\".name.label\", el).innerText = o.name;\n\t\t$.query(\".desc\", el).innerText = o.description || \"No description available.\";\n\t\tthis._updateRating();\n\t\tthis._updateFavorite();\n\t\tthis.example.example = [o.expression, o.text];\n\n\t\tthis.linkRow.pattern = o;\n\t}\n\t\n// private methods:\n\t_updateRating() {\n\t\tlet o = this._pattern, el = this.el;\n\t\t$.query(\".rating\", el).innerText = o.rating.toFixed(1);\n\t\t$.removeClass($.query(\".icon.rate.selected\", el), \"selected\");\n\t\tif (o.userRating === 1) { $.addClass($.query(\".icon.thumbup\", el), \"selected\"); }\n\t\telse if (o.userRating === -1) { $.addClass($.query(\".icon.thumbdown\", el), \"selected\"); }\n\t}\n\n\t_updateFavorite() {\n\t\tlet o = this._pattern, el = this.el;\n\t\t$.toggleClass($.query(\".icon.favorites\", el), \"selected\", !!o.favorite);\n\t}\n\n\t_rate(val) {\n\t\tlet o = this._pattern;\n\t\to.userRating = (val === o.userRating) ? 0 : val;\n\t\tthis._updateRating();\n\t\t\n\t\tServer.rate(o.id, o.userRating).then((data) => this._handleRate(data));\n\t}\n\n\t_share() {\n\t\tapp.load(this._pattern);\n\t\tapp.share.show();\n\t}\n\n\t_handleRate(data) {\n\t\tif (data.id === this._pattern.id) {\n\t\t\tthis._pattern.rating = data.rating;\n\t\t\tthis._updateRating();\n\t\t}\n\t}\n\n\t_favorite() {\n\t\tlet o = this._pattern;\n\t\tServer.favorite(o.id, !o.favorite).then((data) => this._handleFavorite(data));\n\t}\n\n\t_handleFavorite(data) {\n\t\tif (data.id === this._pattern.id) {\n\t\t\tthis._pattern.favorite = data.favorite;\n\t\t\tthis._updateFavorite();\n\t\t}\n\t}\n\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport app from \"../app\";\n\nexport default class Status {\n\tconstructor(el) {\n\t\tif (!el) { el = document.createElement(\"div\"); }\n\t\tthis.el = el;\n\t\t$.addClass(el, \"status\");\n\n\t\tel.addEventListener(\"mouseover\", () => this._showTooltip());\n\t\tel.addEventListener(\"mouseout\", () => this._hideTooltip());\n\t}\n\n\tdistract() {\n\t\tthis.el.innerHTML = '';\n\t\tthis._show();\n\t\treturn this;\n\t}\n\n\thide(t=0) {\n\t\tthis._clearTimeout();\n\t\tif (t) {\n\t\t\tthis._timeoutId = setTimeout(()=>this._hide(), t*1000);\n\t\t} else { this._hide(); }\n\t\treturn this;\n\t}\n\n\tsuccess() {\n\t\tthis.el.innerHTML = '';\n\t\tthis._show();\n\t\treturn this;\n\t}\n\n\terror(msg) {\n\t\tlet el = this.el;\n\t\tel.innerHTML = '';\n\t\tthis._show();\n\t\tthis._ttMsg = msg;\n\t\treturn this;\n\t}\n\n\t_showTooltip() {\n\t\tif (!this._ttMsg) { return; }\n\t\tapp.tooltip.hover.showOn(\"status\", this._ttMsg, this.el, true, 0);\n\t}\n\n\t_hideTooltip() {\n\t\tapp.tooltip.hover.hide(\"status\");\n\t}\n\n\t_show() {\n\t\tthis.el.style.display = null;\n\t\tthis._ttMsg = null;\n\t\tthis._hideTooltip();\n\t\tthis._clearTimeout();\n\t}\n\n\t_hide() {\n\t\tthis.el.style.display = \"none\";\n\t\tthis._hideTooltip();\n\t\tthis._clearTimeout();\n\t}\n\n\t_clearTimeout() {\n\t\tif (this._timeoutId == null) { return; }\n\t\tclearTimeout(this._timeoutId);\n\t\tthis._timeoutId = null;\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport $ from \"../utils/DOMUtils\"\nimport Track from \"../utils/Track\"\n\nimport List from \"../controls/List\";\nimport Server from \"../net/Server\";\n\nimport app from \"../app\";\n\nexport default class Account extends EventDispatcher {\n\tconstructor () {\n\t\tsuper();\n\t\tthis._value = {};\n\t\tthis._initUI();\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\tset value(val={}) {\n\t\tthis._value = val;\n\t\tthis._updateUI();\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\n\tget userId() { return this._value.userId; }\n\tget author() { return this._value.author || this._value.username || \"\"; }\n\tget username() { return this._value.username || \"\"; }\n\tget authenticated() { return !!this._value.username; } // this._value.authenticated;\n\tget type() { return this._value.type; }\n\n\tshowTooltip() {\n\t\tapp.tooltip.toggle.toggleOn(\"signin\", this.tooltipEl, this.signinBtn, true, 20);\n\t}\n\n// private methods:\n\t_initUI() {\n\t\tlet template = (o) => ''+o;\n\t\tthis.signinBtn = $.query(\".header .signin\");\n\t\tthis.tooltipEl = $.query(\"#library > #tooltip-signin\");\n\t\tthis.signinEl = $.query(\".signin\", this.tooltipEl);\n\t\tthis.signoutEl = $.query(\".signout\", this.tooltipEl);\n\t\t$.query(\".signoutbtn\", this.signoutEl).addEventListener(\"click\", (evt) => this._doSignout());\n\t\tthis.signinBtn.addEventListener(\"click\", (evt) => this.showTooltip());\n\t\t$.query(\".icon.help\", this.signinEl).addEventListener(\"click\", ()=> app.sidebar.goto(\"signin\"));\n\t\tthis.signinList = new List($.query(\"ul.list\", this.signinEl), {data:[\"GitHub\", \"Google\"], template});\n\t\tthis.signinList.on(\"change\", ()=>this._signinListChange());\n\t}\n\n\t_updateUI() {\n\t\tlet auth = this.authenticated;\n\t\t$.toggleClass(this.tooltipEl, \"authenticated\", auth);\n\t\t$.query(\".label\", this.signinBtn).innerText = auth ? \"Sign Out\" : \"Sign In\";\n\t\tif (auth) {\n\t\t\t$.query(\".username\", this.signoutEl).innerText = this.username;\n\t\t\t$.query(\".type\", this.signoutEl).innerText = this.type;\n\t\t}\n\t}\n\n\t_doSignout() {\n\t\t$.addClass(this.tooltipEl, \"wait\");\n\t\tServer.logout().then((data) => { this._handleSignout(data); }).finally(()=>this._cleanSignout());\n\t}\n\n\t_handleSignout(data) {\n\t\tthis.value = data;\n\t}\n\n\t_cleanSignout(err) {\n\t\t$.removeClass(this.tooltipEl, \"wait\");\n\t}\n\n\t_signinListChange() {\n\t\tlet service = this.signinList.selected.toLowerCase();\n\t\t$.addClass(this.tooltipEl, \"wait\");\n\t\tTrack.event(\"login\", \"access\", service);\n\t\tsetTimeout(() => Server.login(service), 100);\n\t}\n}\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils\";\nimport app from \"../app\";\n\nimport LinkRow from \"../controls/LinkRow\";\nimport Status from \"../controls/Status\";\nimport Account from \"./Account\";\nimport Server from \"../net/Server\";\n\nexport default class Share extends EventDispatcher {\n\tconstructor (el) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis._pattern = false;\n\t\tthis._initUI();\n\t\tapp.on(\"change\", () => this._handleAppChange());\n\t\tapp.on(\"load\", () => this._handleAppLoad());\n\t\tapp.account.on(\"change\", () => this._handleAccountChange());\n\t}\n\n// public methods:\n\tget value() {\n\t\treturn {\n\t\t\tid: this._pattern ? this._pattern.id : null,\n\t\t\tname: this.name,\n\t\t\tauthor: this.author,\n\t\t\tdescription: this.description,\n\t\t\tkeywords: this.keywords\n\t\t}\n\t}\n\n\tset pattern(o) {\n\t\tthis._pattern = o;\n\t\tthis.name = o.name;\n\t\tthis.description = o.description;\n\t\tthis.keywords = o.keywords;\n\n\t\tthis._updateUI();\n\t\tthis._pushHistory(o);\n\t}\n\n\tget name() { return this.nameFld.value; }\n\tset name(val) {\n\t\tthis.nameFld.value = val||\"\";\n\t\tthis.hNameFld.innerText = val||\"Untitled Pattern\";\n\t}\n\n\tget author() { return this.authorFld.value; }\n\tset author(val) { this.authorFld.value = val||\"\"; }\n\n\tget description() { return this.descriptionFld.value; }\n\tset description(val) { this.descriptionFld.value = val||\"\"; }\n\n\tget keywords() { return this.keywordsFld.value; }\n\tset keywords(val) { this.keywordsFld.value = val||\"\"; }\n\n\tshow() {\n\t\tapp.sidebar.goto(\"share\");\n\t}\n\n// private methods:\n\t_initUI() {\n\t\tlet el = this.el;\n\t\tlet mainEl = this.mainEl = $.query(\"> #share_main\", el);\n\t\tlet comEl = this.communityEl = $.query(\"> #share_community\", el);\n\n\t\t// set up header:\n\t\tlet hEl = $.query(\".header\");\n\t\tthis.hNewBtn = $.query(\".new\", hEl);\n\t\tthis.hForkBtn = $.query(\".fork\", hEl);\n\t\tthis.hSaveBtn = $.query(\".save\", hEl);\n\t\tthis.hNameFld = $.query(\".name\", hEl);\n\t\t$.query(\".settings\", hEl).addEventListener(\"click\", () => this.show());\n\t\t$.query(\".savekey\", this.hSaveBtn).innerText = \"(\"+Utils.getCtrlKey()+\"-s)\";\n\t\tthis.hSaveBtn.addEventListener(\"click\", () => this._doSave());\n\t\tthis.hNewBtn.addEventListener(\"click\", () => this._doNew());\n\n\t\tthis._defaultName = this.hNameFld.innerText;\n\n\t\t// set up main:\n\t\tthis._privateRow = $.query(\".row.private\", this.mainEl);\n\t\tthis._privateRow.addEventListener(\"click\", ()=> this._doPrivate());\n\t\tthis._privateStatus = new Status($.query(\".status\", this._privateRow));\n\t\tthis._favoritesRow = $.query(\".row.favorites\", this.mainEl);\n\t\tthis._favoritesRow.addEventListener(\"click\", ()=> this._doFavorite());\n\t\tthis._favoritesStatus = new Status($.query(\".status\", this._favoritesRow));\n\t\tthis._communityRow = $.query(\".row.community\", this.mainEl);\n\t\tthis._communityRow.addEventListener(\"click\", ()=> this._showCommunity());\n\t\tthis._deleteRow = $.query(\".row.delete\", this.mainEl);\n\t\tthis._deleteRow.addEventListener(\"click\", ()=> this._doDelete());\n\t\tthis._deleteStatus = new Status($.query(\".status\", this._deleteRow));\n\t\t$.query(\".row.signin a\", this.mainEl).addEventListener(\"click\", ()=> this._doSignin());\n\n\t\t// set up link row:\n\t\tthis._linkRow = new LinkRow($.query(\".link.row\", mainEl));\n\n\t\t// set up save buttons:\n\t\tlet saveEl = this.saveEl = $.query(\"> .save\", mainEl);\n\t\tthis.saveBtn = $.query(\".button.save\", saveEl);\n\t\tthis.forkBtn = $.query(\".button.fork\", saveEl);\n\t\tthis.saveBtn.addEventListener(\"click\", ()=> this._doSave());\n\t\tthis.forkBtn.addEventListener(\"click\", ()=> this._doSave(true));\n\t\tthis.saveStatus = new Status($.query(\".status\", saveEl));\n\t\tthis.saveMessage = $.query(\".message\", saveEl);\n\n\t\t// set up input fields:\n\t\tlet infoEl = this.infoEl = $.query(\"> .info\", mainEl);\n\t\tthis.nameFld = $.query(\".name\", infoEl);\n\t\tthis.authorFld = $.query(\".author\", infoEl);\n\t\tthis.descriptionFld = $.query(\".description\", infoEl);\n\t\tthis.keywordsFld = $.query(\".keywords\", infoEl);\n\n\t\t// listen for changes:\n\t\tthis.nameFld.addEventListener(\"input\", () => this._handleChange());\n\t\tthis.authorFld.addEventListener(\"input\", () => this._handleChange());\n\t\tthis.descriptionFld.addEventListener(\"input\", () => this._handleChange());\n\t\tthis.keywordsFld.addEventListener(\"input\", () => this._handleChange());\n\t\t\n\t\t/// set up community:\n\t\tlet comInputsEl = $.query(\".inputs\", comEl)\n\t\t$.query(\".button.cancel\", comEl).addEventListener(\"click\", ()=> app.sidebar.goto(\"share\"));\n\t\t$.query(\".button.share\", comEl).addEventListener(\"click\", ()=> this._doComSave());\n\t\tthis.comSaveStatus = new Status($.query(\".status\", comEl));\n\t\tthis._comNameFld = $.query(\".name\", comInputsEl);\n\t\tthis._comAuthorFld = $.query(\".author\", comInputsEl);\n\t\tthis._comDescriptionFld = $.query(\".description\", comInputsEl);\n\t\tthis._comKeywordsFld = $.query(\".keywords\", comInputsEl);\n\n\t\t// set up cmd-s listener:\n\t\twindow.document.addEventListener(\"keydown\", (evt) => this._handleKey(evt) );\n\t}\n\n\t_updateUI() {\n\t\tlet o = this._pattern, text;\n\t\tlet isChanged = this._isChanged(), isNew = this._isNew(), isOwned = this._isOwned();\n\t\t\n\t\t$.toggleClass([this.forkBtn, this.hForkBtn], \"disabled\", !this._canFork());\n\t\t$.toggleClass(this.saveBtn, \"disabled\", !this._canSave());\n\n\t\t$.toggleClass(this.hSaveBtn, \"disabled\", !this._canSave() && isOwned);\n\t\t$.query(\".action\",this.hSaveBtn).innerText = isOwned ? \"Save\" : \"Fork\";\n\t\t\n\t\tif (!isOwned) { text = \"This pattern was created by '\"+(o.author||\"[anonymous]\")+\"'.\"; }\n\t\telse if (!isChanged) { text = \"No unsaved changes.\" }\n\t\telse if (isNew) { text = \"Save will create a shareable public link.\"; }\n\t\telse { text = \"Save will update the current link.\"; }\n\n\t\tif (!isOwned && !isChanged) { text += \" Fork to create your own copy.\"; }\n\t\telse if (!isNew) { text += \" Fork will create a new copy\" + (isChanged ? \" with your changes.\" : \".\"); }\n\t\t\n\t\tthis._setSaveText(text);\n\n\t\tthis._linkRow.pattern = this._pattern.id && this._pattern;\n\n\t\t$.toggleClass(this._privateRow, \"disabled\", isNew || !isOwned);\n\t\t$.toggleClass(this._favoritesRow, \"disabled\", isNew || !isOwned);\n\t\t$.toggleClass(this._communityRow, \"disabled\", isNew || !isOwned);\n\t\t$.toggleClass(this._deleteRow, \"disabled\", isNew || !isOwned);\n\n\t\t$.toggleClass(this._privateRow, \"active\", o.access === \"private\");\n\t\t$.toggleClass(this._favoritesRow, \"active\", !!o.favorite);\n\t}\n\t\n\t_isNew() {\n\t\treturn !this._pattern.id;\n\t}\n\n\t_isOwned() {\n\t\tlet o = this._pattern;\n\t\treturn this._isNew() || (o.userId === app.account.userId);\n\t}\n\n\t_isChanged() {\n\t\treturn app.unsaved;\n\t}\n\n\t_canSave() {\n\t\treturn this._isChanged() && this._isOwned();\n\t}\n\n\t_canFork() {\n\t\treturn !this._isNew();\n\t}\n\n\t_pushHistory(pattern) {\n\t\tlet history = window.history, url = Utils.getPatternURL(pattern);\n\t\tlet title = \"RegExr: \"+ (pattern.name || \"Learn, Build, & Test RegEx\");\n\t\t\n\t\tif (history.state && (pattern.id === history.state.id)) {\n\t\t\thistory.replaceState(pattern, title, url);\n\t\t} else {\n\t\t\thistory.pushState(pattern, title, url);\n\t\t}\n\t\twindow.document.title = title;\n\t}\n\n\t_handleKey(evt) {\n\t\tlet mac = Utils.isMac();\n\t\tif (evt.key === \"s\" && ((mac && evt.metaKey) || (!mac && evt.ctrlKey))) {\n\t\t\tthis._doSave(false);\n\t\t\tevt.preventDefault();\n\t\t}\n\t}\n\n\t_doSave(fork) {\n\t\t// if we can't save for some reason, then show the panel.\n\t\tif (!fork && !this._canSave()) {\n\t\t\tapp.sidebar.goto(\"share\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (fork && !this._canFork()) { return; }\n\n\t\tlet o = app.state;\n\t\t$.addClass($.query(\".buttons\", this.saveEl), \"wait\");\n\t\tthis.saveStatus.distract();\n\t\tServer.save(o, fork)\n\t\t\t.then((data) => this._handleSave(data))\n\t\t\t.catch((err) => this._handleSaveErr(err));\n\t}\n\n\t_handleSave(data) {\n\t\tlet isNew = (this._pattern.id == null), isFork = !isNew && (data.id !== this._pattern.id);\n\t\t$.removeClass($.query(\".buttons\", this.saveEl), \"wait\");\n\t\tthis.saveStatus.hide();\n\n\t\tapp.state = data;\n\n\t\tif (isFork || isNew) {\n\t\t\tthis.show();\n\t\t\tif (isFork || !this.name) {\n\t\t\t\tthis.nameFld.focus();\n\t\t\t\tthis.nameFld.select();\n\t\t\t}\n\t\t\tthis._linkRow.showMessage(\"Saved. New share link created. Click to copy to clipboard.\");\n\t\t}\n\t}\n\t\n\t_handleSaveErr(err) {\n\t\t$.removeClass($.query(\".buttons\", this.saveEl), \"wait\");\n\t\tthis.saveStatus.error(this._getErrMsg(err));\n\t}\n\t\n\t_doNew() {\n\t\tapp.newDoc();\n\t}\n\n\t_doPrivate() {\n\t\tlet o = this._pattern;\n\t\tthis._privateStatus.distract();\n\t\tServer.private(o.id, o.access !== \"private\")\n\t\t\t.then((data) => this._handlePrivate(data))\n\t\t\t.catch((err) => this._handleErr(err, this._privateStatus));\n\t}\n\n\t_handlePrivate(data) {\n\t\tif (data.id === this._pattern.id) {\n\t\t\tthis._pattern.access = data.access;\n\t\t\tthis._privateStatus.hide();\n\t\t\tthis._updateUI();\n\t\t}\n\t}\n\t\n\t_doFavorite() {\n\t\tlet o = this._pattern;\n\t\tthis._favoritesStatus.distract();\n\t\tServer.favorite(o.id, !o.favorite)\n\t\t\t.then((data) => this._handleFavorite(data))\n\t\t\t.catch((err) => this._handleErr(err, this._favoritesStatus));\n\t}\n\t\n\t_handleFavorite(data) {\n\t\tif (data.id === this._pattern.id) {\n\t\t\tthis._pattern.favorite = data.favorite;\n\t\t\tthis._favoritesStatus.hide();\n\t\t\tthis._updateUI();\n\t\t}\n\t}\n\n\t_doDelete() {\n\t\tlet o = this._pattern;\n\t\tif (!confirm(\"Are you sure you want to permanently delete this pattern?\")) { return; }\n\t\tthis._deleteStatus.distract();\n\t\tServer.delete(o.id)\n\t\t\t.then((data) => this._handleDelete(data))\n\t\t\t.catch((err) => this._handleErr(err, this._deleteStatus));\n\t}\n\n\t_handleDelete(data) {\n\t\tthis._deleteStatus.hide();\n\t\tapp.state = {\n\t\t\tflavor: app.flavor.value\n\t\t}\n\t\tsetTimeout(()=>app.tooltip.toggle.showOn(\"delete\", \"Pattern was permanently deleted.\", this._deleteRow, true, 0), 1);\n\t}\n\n\t_handleErr(err, status) {\n\t\tstatus.error(this._getErrMsg(err)).hide(6);\n\t}\n\n\t_showCommunity() {\n\t\tapp.sidebar.goto(\"share_community\");\n\t\tthis._comNameFld.value = this.name;\n\t\tthis._comAuthorFld.value = this.author;\n\t\tthis._comDescriptionFld.value = this.description;\n\t\tthis._comKeywordsFld.value = this.keywords;\n\t}\n\n\t_doComSave() {\n\t\tif (!this._comNameFld.value) {\n\t\t\tthis._comNameFld.focus();\n\t\t\treturn;\n\t\t}\n\t\tlet o = app.state;\n\t\tthis.name = o.name = this._comNameFld.value;\n\t\tthis.author = o.author = this._comAuthorFld.value;\n\t\tthis.description = o.description = this._comDescriptionFld.value;\n\t\tthis.keywords = o.keywords = this._comKeywordsFld.value;\n\t\to.access = \"public\";\n\t\t$.addClass($.query(\".buttons\", this.communityEl), \"wait\");\n\t\tthis.comSaveStatus.distract();\n\t\tServer.save(o, true, true)\n\t\t\t.then((data) => this._handleComSave(data))\n\t\t\t.catch((err) => this._handleComSaveErr(err));\n\t}\n\n\t_handleComSave(data) {\n\t\t$.removeClass($.query(\".buttons\", this.communityEl), \"wait\");\n\t\tthis.comSaveStatus.hide();\n\t\tthis.show();\n\t}\n\n\t_handleComSaveErr(err) {\n\t\t$.removeClass($.query(\".buttons\", this.communityEl), \"wait\");\n\t\tthis.comSaveStatus.error(this._getErrMsg(err));\n\t}\n\n\t_handleChange() {\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\n\t_handleAppChange() {\n\t\tthis._updateUI();\n\t}\n\n\t_handleAccountChange() {\n\t\tlet acc = app.account, rowEl = $.query(\".signin.row\", this.mainEl);\n\t\tif (!this.authorFld.value) { this.authorFld.value = acc.author || acc.username; }\n\t\t$.toggleClass(rowEl, \"authenticated\", acc.authenticated);\n\t\t$.query(\".username\", rowEl).innerText = acc.username;\n\t}\n\n\t_handleAppLoad() {\n\t\t$.toggleClass($.query(\".save .actions\", this.mainEl), \"disabled\");\n\t}\n\n\t_doSignin() {\n\t\tapp.account.showTooltip();\n\t}\n\n\t_setSaveText(str) {\n\t\tthis.saveMessage.innerText = str;\n\t}\n\n\t_getErrMsg(err) {\n\t\treturn \"ERROR: \"+app.reference.getError(\"servercomm\");\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils\";\n\nimport List from \"../controls/List\";\nimport content from \"../docs/sidebar_content\";\nimport Track from \"../utils/Track\";\nimport Server from \"../net/Server\";\nimport Community from \"./Community\";\nimport Example from \"./Example\";\nimport Share from \"./Share\";\n\nimport app from \"../app\";\n\nexport default class Sidebar {\n\tconstructor (el) {\n\t\tthis.el = el;\n\t\tthis.itemEl = null;\n\t\tthis.openReq = null;\n\t\tthis._initUI(el);\n\t\tthis._content = this._prepContent(content);\n\t\tthis.minList.data = [{id: \"menu\", label:\"Menu\"}].concat(content.kids);\n\t\tapp.flavor.on(\"change\", ()=>this._onFlavorChange());\n\t\tlet id = app.prefs.read(\"side\");\n\t\tif (!id || !this._idMap[id] || id === \"share\") { id = \"home\"; }\n\t\tthis.goto(id);\n\t\tif (app.isNarrow) { setTimeout(() => this.minimize(true, false), 1500); }\n\t}\n\n\tminimize(val=true, track=true) {\n\t\tif (val === this._minimized) { return; }\n\t\tif (val && track) { Track.event(\"minimize_menu\", \"engagement\"); }\n\t\t$.togglePanel(this.el, '.full', '.min', !val);\n\t\tthis._minimized = val;\n\t\tthis._updateUI();\n\t}\n\t\n\tgoto(id) {\n\t\tthis.show(this._idMap[id]);\n\t}\n\t\n\tshowToken(token) {\n\t\tthis.goto(app.reference.idForToken(token));\n\t}\n\t\n\tshow(item) {\n\t\tif (!item) { return; }\n\t\tif (item.hide) { return this.show(item.parent); }\n\t\tif (!item || item.id === \"menu\") { return; } // expand button on the min menu\n\t\tthis.minimize(false);\n\t\tif (item.id) {\n\t\t\tif (item.id === \"home\" || (item.parent && item.parent.id === \"home\") || this._isInReference(item)) {\n\t\t\t\tapp.prefs.write(\"side\", item.id);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!item.el && !item.kids) {\n\t\t\tif (this.searchMode || !item.parent || item.parent === this.curItem) {\n\t\t\t\t// in a search, community / favorites, of selecting a leaf child from a list.\n\t\t\t\tthis.selItem = item;\n\t\t\t\tthis.menuList.selected = item.id;\n\t\t\t\treturn this._showContent(item);\n\t\t\t} else if (item.parent !== this.curItem) {\n\t\t\t\t// trying to jump to a leaf child without previously showing parent.\n\t\t\t\tthis.show(item.parent);\n\t\t\t\treturn this.show(item);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis._resetFull();\n\t\t\n\t\tthis.curItem = item;\n\t\t$.query(\"h1\", this.titleEl).innerText = item.label;\n\t\t$.query(\"svg.back.icon use\", this.titleEl).setAttribute(\"xlink:href\", \"#\"+(item.parent ? \"arrowleft\" : \"menu\"));\n\t\tif (item.el) {\n\t\t\tthis._showEl($.query(\"#library \"+item.el));\n\t\t} else {\n\t\t\tthis._showContent(item);\n\t\t}\n\t\t\n\t\tif (item.kids && item.list !== false) {\n\t\t\t$.removeClass(this.fullEl, \"no-list\");\n\t\t\tthis.menuList.data = item.kids || item.parent.kids;\n\t\t}\n\t\tif (item.search) { $.removeClass(this.fullEl, \"no-search\"); }\n\t\t\n\t\t// special handling:\n\t\tif (item.id === \"community\") {\n\t\t\tthis.menuList.template = this.communityListTemplate;\n\t\t\tthis._onSearchSubmit();\n\t\t} else if (item.id === \"favorites\") {\n\t\t\tthis.menuList.template = this.communityListTemplate;\n\t\t\tthis._loadFavorites();\n\t\t}\n\t}\n\t\n\tback() {\n\t\tif (this.curItem.parent) { this.show(this.curItem.parent); }\n\t\telse { this.minimize(true); }\n\t}\n\t\n\tmenuListTemplate(o) {\n\t\treturn (o.parent && o.parent.id === \"home\" ? '' : \"\") + \n\t\t\t ''+ (o.label||o.id) +\"\" + \n\t\t\t (o.token ? ''+ o.token.replace(\"<\", \"<\") + '' : \"\") +\n\t\t\t (o.kids || o.el ? '' : \"\");\n\t}\n\t\n\tcommunityListTemplate(o) {\n\t\treturn ''+ Utils.htmlSafe(o.name) +\"\" +\n\t\t\t '' +\n\t\t\t (o.favorite ? '' : '') +\n\t\t\t ''+o.rating.toFixed(1)+'';\n\t}\n\t\n// private methods:\n\t_initUI(el) {\n\t\t// set up full width content:\n\t\tthis.fullEl = $.query(\"> .full\", el);\n\t\t\n\t\t// title bar:\n\t\tthis.titleEl = $.query(\"> header\", this.fullEl);\n\t\t$.query(\"> .close.icon\", this.titleEl).addEventListener(\"click\", () => this.minimize(true));\n\t\t$.query(\"> .backrow\", this.titleEl).addEventListener(\"click\", () => this.back());\n\t\t\n\t\t// search:\n\t\tthis.searchEl = $.query(\"> .search\", this.fullEl);\n\t\tthis.searchFld = $.query(\"> .search > input\", this.fullEl);\n\t\tthis.searchFld.addEventListener(\"input\", ()=>this._onSearchChange());\n\t\tthis.searchFld.addEventListener(\"keyup\", (evt)=>(evt.keyCode === 13)&&this._onSearchSubmit());\n\t\tlet searchBtn = $.query(\"> svg.icon.search\", this.searchEl);\n\t\tsearchBtn.addEventListener(\"click\", ()=>this._onSearchSubmit());\n\t\t\n\t\t// list & content:\n\t\tthis.listEl = $.query(\"> .list\", this.fullEl);\n\t\tthis.menuList = new List(this.listEl, {data:content.kids, template:this.menuListTemplate});\n\t\tthis.menuList.on(\"change\", () => {\n\t\t\tconst lastId = this.curItem.id;\n\t\t\tthis.show(this.menuList.selectedItem);\n\t\t\tif (lastId !== this.curItem.id) {\n\t\t\t\tTrack.page(\"sidebar/\"+this.curItem.id);\n\t\t\t}\n\t\t});\n\t\tthis.menuList.on(\"dblclick\", ()=> this._onDblClick(this.menuList.selectedItem));\n\t\tthis.contentEl = $.query(\"> .content\", this.fullEl);\n\t\t\n\t\t// set up minimized sidebar:\n\t\tthis.minEl = $.query(\"> .min\", el);\n\t\tthis.minEl.addEventListener(\"click\", () => this.minimize(false));\n\t\t\n\t\tlet template = $.template``;\n\t\tthis.minList = new List($.query(\"> .list\", this.minEl), {template});\n\t\tthis.minList.on(\"change\", (evt)=> { this.show(this.minList.selectedItem); evt.preventDefault(); Track.page(\"sidebar/\"+this.curItem.id); });\n\n\t\t// set up special content:\n\t\tthis.community = new Community($.query(\"#library > #community\"));\n\t\tthis.share = new Share($.query(\"#library > #share\"));\n\t\tthis._prepCheatsheet(); // TODO: switch to a Cheatsheet class.\n\n\t\t$.query(\".doc > .blocker\").addEventListener(\"mousedown\", (evt) => {\n\t\t\tthis.minimize(true);\n\t\t})\n\t}\n\n\t_updateUI() {\n\t\t// TODO: this is cheating a bit:\n\t\tlet doc = $.query(\".doc\");\n\t\t$.toggleClass(doc, \"fadeback\", !this._minimized);\n\t}\n\n\t_resetFull() {\n\t\tif (this.itemEl) {\n\t\t\t$.query(\"#library\").appendChild(this.itemEl);\n\t\t\tthis.itemEl = null;\n\t\t}\n\t\tthis._abortReq();\n\t\t$.addClass(this.fullEl, \"no-search no-list\");\n\t\tthis.searchFld.value = \"\";\n\t\tthis.searchMode = false;\n\t\tthis.menuList.template = this.menuListTemplate;\n\t\t$.removeClass(this.searchEl, \"wait\");\n\t}\n\t\n\t_showContent(o) {\n\t\tif ((this.curItem.id === \"community\" || this.curItem.id === \"favorites\") && o !== this.curItem) {\n\t\t\tthis._showEl(this.community.el);\n\t\t\tthis.community.item = o;\n\t\t} else {\n\t\t\tlet ref = app.reference;\n\t\t\tthis.contentEl.innerHTML = this._isInReference(o) ? ref.getContent(o.id) : ref.fillTags((o.desc || \"\") + (o.ext || \"\"), o, ref);\n\t\t\tif (o.example) { this.contentEl.appendChild(new Example(\"Example\", o.example).el); }\n\t\t}\n\t}\n\n\t_isInReference(o) {\n\t\treturn this._isIn(o, \"reference\");\n\t}\n\t\n\t_isIn(o, id) {\n\t\tdo { if (o.id === id) { return true; } } while (o = o.parent);\n\t\treturn false;\n\t}\n\t\n\t_onDblClick(o) {\n\t\tif (o.token) {\n\t\t\tlet expr = app.expression;\n\t\t\tif (o.parent.id === \"flags\") { expr.toggleFlag(o.token); }\n\t\t\telse { expr.insert(o.token); }\n\t\t} else if (this.curItem.id === \"community\" || this.curItem.id === \"favorites\") {\n\t\t\tapp.load(o);\n\t\t}\n\t}\n\t\n\t_showEl(el) {\n\t\tif (this.itemEl === el) { return; }\n\t\tthis.itemEl = el;\n\t\t$.empty(this.contentEl).appendChild(el);\n\t}\n\n\t_prepContent(content) {\n\t\t// inject reference:\n\t\tlet i = Utils.findIndex(content.kids, (o)=>o.id===\"reference\");\n\t\tcontent.kids.splice(i, 1, app.reference.content);\n\t\t// grab home content from HTML:\n\t\tcontent.desc = this.contentEl.innerHTML;\n\t\t// build idMap:\n\t\tthis._idMap = {home:content};\n\t\treturn Utils.prepMenuContent(content, this._idMap);\n\t}\n\t\n\t_prepCheatsheet() {\n\t\tlet els = $.queryAll(\"#cheatsheet *[data-id]\");\n\t\tlet f = (evt)=>this.goto(evt.target.dataset.id);\n\t\tfor (let i=0, l=els.length; iapp.expression.insert(evt.target.innerText);\n\t\tfor (let i=0, l=els.length; i o.hide = !rank(o, search));\n\t\tthis.menuList.data = data;\n\t}\n\t\n\t_onFlavorChange() {\n\t\tlet item = this.selItem || this.curItem;\n\t\tif (!this._isInReference(item)) { return; }\n\t\tthis.selItem = this.curItem = null;\n\t\tthis.show(item);\n\t}\n\t\n\t_onSearchSubmit() {\n\t\tthis._abortReq();\n\t\tlet val = this.searchFld.value;\n\t\tif (this.curItem.id === \"community\") {\n\t\t\tif (val) { Track.event(\"search\", \"engagement\", {search_term:val, target:\"community\"}); }\n\t\t\t$.addClass(this.searchEl, \"wait\");\n\t\t\tthis._showListMsg();\n\t\t\tthis.openReq = Server.communitySearch(val)\n\t\t\t\t.then((data)=>this._showServerResults(data))\n\t\t\t\t.catch((msg)=>this._showListMsg(msg))\n\t\t\t\t.finally(()=>this._reqCleanup());\n\t\t}\n\t\tthis.searchFld.select();\n\t}\n\t\n\t_loadFavorites() {\n\t\tthis._abortReq();\n\t\tlet val = this.searchFld.value;\n\t\tthis.openReq = Server.patterns()\n\t\t\t.then((data)=>this._showServerResults(data))\n\t\t\t.catch((msg)=>this._showListMsg(msg))\n\t\t\t.finally(()=>this._reqCleanup());\n\t\tthis._showListMsg();\n\t}\n\n\t_showListMsg(msg=\"Loading...\") {\n\t\tthis.listEl.innerHTML = \"
  • \"+msg+\"
  • \";\n\t}\n\t\n\t_abortReq() {\n\t\tif (this.openReq) { this.openReq.abort(); }\n\t\tthis.openReq = null;\n\t}\n\t\n\t_showServerResults(data) {\n\t\tthis.menuList.data = data.results;\n\t\tif (data.results.length === 0) {\n\t\t\tthis._showListMsg(this.curItem.id === \"community\" ? \"No matches.\" : \"No patterns created or favorited.\");\n\t\t}\n\t}\n\t\n\t_reqCleanup(msg) {\n\t\t$.removeClass(this.searchEl, \"wait\");\n\t}\n\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport $ from \"../utils/DOMUtils\"\nimport app from \"../app\";\n\nexport default class Theme extends EventDispatcher {\n\tconstructor (el) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis.urlTemplate = \"./assets/themes/%name%.css\";\n\t\tthis.targetNode = this._node = null;\n\t\tthis._dark = false;\n\t\tthis._initUI();\n\t\tthis.dark = !!app.prefs.read(\"dark\");\n\t}\n\n\tset dark(val) {\n\t\tval = !!val;\n\t\tif (this._dark === val) { return; }\n\t\tthis._dark = val;\n\t\tthis._load(val ? \"dark\" : null);\n\t\t$.toggleClass(this.themeBtn, \"selected\", val);\n\t\tapp.prefs.write(\"dark\", val);\n\t}\n\t\n\tget dark() {\n\t\treturn this._dark;\n\t}\n\n\t_initUI() {\n\t\tthis.themeBtn = $.query(\".header .button.theme\", this.el);\n\t\tthis.themeBtn.addEventListener(\"click\", (evt) => this._toggleTheme());\n\t}\n\n\t_load(id) {\n\t\tif (id === this._id) { return; }\n\t\tthis._id = id;\n\t\tif (this._node) { this._node.remove(); }\n\t\tif (!id) { this._change(); return; }\n\t\tlet tmpl = this.urlTemplate, n = $.create(\"link\");\n\t\tn.addEventListener(\"load\", () => this._change());\n\t\tn.rel = \"stylesheet\";\n\t\tn.type = \"text/css\";\n\t\tn.href = tmpl ? tmpl.replace(/%name%/g, id) : id;\n\t\tthis._node = (this.targetNode || document.head).appendChild(n);\n\t}\n\n\t_change() {\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\n\t_toggleTheme() {\n\t\tthis.dark = !this.dark;\n\t}\n\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"../utils/Utils.js\";\n\nexport default class Reference {\n\t\n\tconstructor(content, flavor, config) {\n\t\tthis._config = config;\n\t\tthis._flavor = flavor;\n\t\tthis._flavor.on(\"change\", ()=> this._flavorChange());\n\t\t\n\t\tthis._injectEscChars(content);\n\t\t\n\t\tthis._idMap = {reference:content};\n\t\tthis._content = Utils.prepMenuContent(content, this._idMap);\n\t\tthis._misc = Utils.prepMenuContent(content.misc, this._idMap);\n\t\tthis._flavorChange();\n\t}\n\t\n\tget content() {\n\t\treturn this._content;\n\t}\n\t\n\tsearch(searchStr) {\n\t\tfunction srch(kids, results) {\n\t\t\tfor (let i=0, l=kids.length; ib.__searchPoints - a.__searchPoints);\n\t}\n\t\n\tidForToken(token) {\n\t\tlet errId = token.error && token.error.id;\n\t\tif (this._idMap[errId]) { return errId; }\n\t\tif (this._idMap[token.type]) { return token.type; }\n\t\tif (this._idMap[token.clss]) { return token.clss; }\n\t\treturn errId || token.type || token.clss;\n\t}\n\t\n// methods used in fillTags:\n\tgetChar(token) {\n\t\tlet chr = Reference.NONPRINTING_CHARS[token.code];\n\t\treturn chr ? chr : \"\\\"\" + String.fromCharCode(token.code) + \"\\\"\";\n\t}\n\t\n\tgetQuant(token) {\n\t\tlet min = token.min, max = token.max;\n\t\treturn min === max ? min : max === -1 ? min + \" or more\" : \"between \" + min + \" and \" + max;\n\t}\n\t\n\tgetUniCat(token) {\n\t\treturn Reference.UNICODE_CATEGORIES[token.value] || \"[Unrecognized]\";\n\t}\n\n\tgetModes(token) {\n\t\tlet str = (token.on ? \" Enable \\\"\"+token.on+\"\\\".\" : \"\")\n\t\tif (token.off) { str += \" Disable \\\"\"+token.off+\"\\\".\"; }\n\t\treturn str;\n\t}\n\n\tgetInsensitive(token) {\n\t\tif (token.code) {\n\t\t\tlet chr = String.fromCharCode(token.code);\n\t\t\tif (chr.toLowerCase() === chr.toUpperCase()) { return \"\"; }\n\t\t}\n\t\treturn token.modes ? `Case ${token.modes.i ? \"in\" : \"\"}sensitive.` : \"\";\n\t}\n\n\tgetDotAll(token) {\n\t\treturn (token.modes.s ? \"including\" : \"except\") + \" line breaks\";\n\t}\n\n\tgetLabel(token) {\n\t\tlet node = this.getNodeForToken(token);\n\t\treturn node ? node.label || node.id || \"\" : token.type;\n\t}\n\n\tgetDesc(token) {\n\t\treturn this.getVal(this.getNodeForToken(token), \"desc\");\n\t}\n\n\tgetLazy(token) {\n\t\treturn token.modes.U ? \"greedy\" : \"lazy\";\n\t}\n\n\tgetLazyFew(token) {\n\t\treturn token.modes.U ? \"many\" : \"few\";\n\t}\n\n\tgetPHPVersion() {\n\t\treturn this._config.PHPVersion;\n\t}\n\n\tgetPCREVersion() {\n\t\treturn this._config.PCREVersion;\n\t}\n\n\tgetCtrlKey() {\n\t\treturn Utils.getCtrlKey();\n\t}\n\n\tgetEscChars() {\n\t\tlet o = this._flavor.profile.escChars, str=\"\";\n\t\tfor (let n in o) { str += n; }\n\t\treturn str;\n\t}\n\n\t/*\n\tSearches for tags in the string in the format:\n\t`{{prop.prop}}` or `{{method(prop.prop)}}`\n\t\n\tThe first format will inject the specified property of the data object.\n\tFor example, `{{a.b}}` would inject the value of `data.a.b`.\n\t\n\tThe second will inject the results of calling the specified function on the functs object with a property of the data object as it's parameter (or the data object itself if empty).\n\tFor example, `{{myMethod(a.b)}}` would inject the return value of `functs.myMethod(data.a.b)`.\n\t\n\tCurrently only supports a single param.\n\t */\n\tfillTags(str, data, functs, maxLength=20, htmlSafe=true) {\n\t\tlet match;\n\t\twhile (match = str.match(/{{~?[\\w.()]+}}/)) {\n\t\t\tlet val, f, safe=false;\n\t\t\tval = match[0].substring(2, match[0].length - 2);\n\t\t\tif (val[0] === \"~\") {\n\t\t\t\tval = val.substr(1);\n\t\t\t\tsafe = true;\n\t\t\t}\n\t\t\tlet match2 = val.match(/\\([\\w.]*\\)/);\n\t\t\tif (match2) {\n\t\t\t\tf = val.substr(0, match2.index);\n\t\t\t\tval = match2[0].substring(1, match2[0].length - 1);\n\t\t\t} else {\n\t\t\t\tf = null;\n\t\t\t}\n\t\t\tlet o = data, arr = val.split(\".\");\n\t\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\t\tlet prop = arr[i];\n\t\t\t\tif (prop && o) { o = o[prop]; }\n\t\t\t}\n\t\t\tval = o;\n\t\t\tif (f) {\n\t\t\t\tif (functs[f]) { val = functs[f](val); }\n\t\t\t\telse { val = \" [\"+f+\"] \"; }\n\t\t\t}\n\t\t\tif (!safe && (maxLength || htmlSafe)) { val = Utils.shorten(val, maxLength, htmlSafe, \"i\"); }\n\t\t\tstr = str.replace(match[0], val);\n\t\t}\n\t\treturn str;\n\t}\n\t\n\t// returns doc props from the profile or reference as appropriate (ex. tip, desc, ext)\n\tgetVal(node, prop) {\n\t\tif (!node) { return \"\"; }\n\t\tlet pDocs = this._flavor.getDocs(node.id), pRef = (pDocs && pDocs[prop]);\n\t\tif (pRef != null && pRef[0] !== \"+\") { return pRef; }\n\t\tlet ref=(node&&node[prop])||\"\";\n\t\treturn pRef != null ? ref+pRef.substr(1) : ref;\n\t}\n\t\n\tgetNodeForToken(token) {\n\t\tlet id=this.idForToken(token), clss = token.clss;\n\t\t\n\t\t// Special cases:\n\t\tif (clss === \"quant\") { id = clss; }\n\t\tif (clss === \"esc\" && token.type !== \"escsequence\") { id = \"escchar\"; }\n\n\t\treturn this.getNode(id);\n\t}\n\n\tgetNode(id) {\n\t\tlet map=this._idMap, node = map[id]\n\t\twhile (node&&node.proxy) { node = map[node.proxy]; }\n\t\treturn node;\n\t}\n\t\n\tgetError(error, token) {\n\t\tlet errId = error && error.id;\n\t\tlet str = this._content.errors[errId] || \"no docs for error='\" + errId + \"'\";\n\t\tif (token) { str = this.fillTags(str, token, this, 20); }\n\t\treturn str;\n\t}\n\t\n\ttipForToken(token) {\n\t\tif (!token) { return null; }\n\n\t\tlet node = this.getNodeForToken(token), label, tip;\n\n\t\tif (token.error && !token.error.warning) {\n\t\t\tlabel = \"ERROR: \";\n\t\t\ttip = this.getError(token.error, token);\n\t\t} else {\n\t\t\tlabel = node ? node.label || node.id || \"\" : token.type;\n\t\t\ttip = this.getVal(node, \"tip\") || this.getVal(node, \"desc\");\n\t\t\ttip = this.fillTags(tip, token, this, 20);\n\t\t\tif (token.type === \"group\") { label += \" #\" + token.num; }\n\t\t\tlabel = \"\" + label[0].toUpperCase() + label.substr(1) + \". \";\n\n\t\t\tif (token.error) {\n\t\t\t\ttip += \"WARNING: \" + this.getError(token.error, token) + \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn tip ? label + tip : \"no docs for id='\" + this.idForToken(token) + \"'\";\n\t}\n\t\n\tgetContent(id) {\n\t\tlet node = this.getNode(id);\n\t\treturn this.fillTags(this.getVal(node, \"desc\") + this.getVal(node, \"ext\"), node, this);\n\t}\n\t\n\t// TODO: this isn't necessarily the most ideal place for this method (has nothing to do with Reference). Maybe move into Text?\n\ttipForMatch(match, text) {\n\t\tif (!match) { return null; }\n\t\tlet more = match.l > 150;\n\t\tlet str = \"match: \" + Utils.shorten(text.substr(match.i, match.l), 150, true, \"i\") +\n\t\t\t\t \"
    range: \" + match.i + \"-\" + (match.i+match.l-1)+ \"\";\n\t\t\n\t\tlet groups = match.groups, l = groups && groups.length;\n\t\tfor (let i = 0; i < l; i++) {\n\t\t\tif (i > 3 && l > 5) {\n\t\t\t\tmore = false;\n\t\t\t\tstr += \"
    see Details for \"+(l-i)+\" more\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet group = groups[i], s;\n\t\t\ts = (group.i !== undefined) ? text.substr(group.i, group.l) : group.s;\n\t\t\tmore = more || (s && s.length > 50);\n\t\t\tstr += (i > 0) ? \"
    \" : \"
    \";\n\t\t\tstr += \"group #\" + (i+1) + \": \" + Utils.shorten(s, 50, true, \"i\");\n\t\t}\n\t\tif (more) { str += \"
    see Details for full matches\" }\n\t\treturn str;\n\t};\n\t\n// private methods:\n\t_flavorChange() {\n\t\tthis._updateHide(this.content);\n\t}\n\t\n\t_updateHide(o, list) {\n\t\t// the list param is for debugging, it is populated with the ids of all nodes that were hidden.\n\t\t// parent nodes aren't hidden unless all their children are.\n\t\tlet kids = o.kids, hide=true;\n\t\tif (kids) {\n\t\t\tfor (let i = 0, l = kids.length; i < l; i++) {\n\t\t\t\thide = this._updateHide(kids[i], list) && hide;\n\t\t\t}\n\t\t} else {\n\t\t\thide = (o.show === false) || (o.show !== true && o.id && !this._flavor.isTokenSupported(o.id));\n\t\t}\n\t\tif (list && hide) { list.push(o.id); }\n\t\treturn (o.hide = hide);\n\t}\n\n\t_injectEscChars(content) {\n\t\tlet kids=Utils.find(content.kids, (o)=>o.id===\"escchars\").kids;\n\t\tlet template = Utils.find(content.misc.kids, (o)=>o.id===\"escchar\").tip;\n\t\t// \\x07 - bell, \\x1b - esc\n\t\tlet chars = \"\\t\\n\\v\\f\\r\\0\\x07\\x1b\", tokens = \"tnvfr0ae\"; // .\\\\+*?^$[]{}()|/\n\t\tfor (let i=0, l=chars.length; i.\n*/\n\n// this is just raw content for the Reference.\n// right now all examples are executed in-browser, so they need to be compatible. Maybe swap to XRegExp at some point.\n// TODO: rewrite to use multiline template literals?\n\nlet reference_content = {}, o = reference_content;\nexport default reference_content; \n\no.label = \"RegEx Reference\";\no.id = \"reference\";\no.search = true,\no.desc = `Information on all of the tokens available to create regular expressions.\n\t

    Double-click an item in the list to insert it into your Expression.

    \n\t

    Click the arrow beside an example to load it.

    `;\n\no.kids = [\n\t{\n\tlabel: \"Character classes\",\n\tid: \"charclasses\",\n\tdesc: \"Character classes match a character from a specific set. There are a number of predefined character classes and you can also define your own sets.\",\n\tkids: [\n\t\t\n\t\t{\n\t\tid:\"set\",\n\t\tlabel: \"character set\",\n\t\tdesc:\"Match any character in the set.\",\n\t\texample:[\"[aeiou]\",\"glib jocks vex dwarves!\"],\n\t\ttoken:\"[ABC]\"\n\t\t},\n\t\t{\n\t\tid:\"setnot\",\n\t\tlabel: \"negated set\",\n\t\tdesc:\"Match any character that is not in the set.\",\n\t\texample:[\"[^aeiou]\",\"glib jocks vex dwarves!\"],\n\t\ttoken:\"[^ABC]\"\n\t\t},\n\t\t{\n\t\tid:\"range\",\n\t\ttip:\"Matches a character in the range {{getChar(prev)}} to {{getChar(next)}} (char code {{prev.code}} to {{next.code}}). {{getInsensitive()}}\",\n\t\texample:[\"[g-s]\",\"abcdefghijklmnopqrstuvwxyz\"],\n\t\tdesc: \"Matches a character having a character code between the two specified characters inclusive.\",\n\t\ttoken:\"[A-Z]\"\n\t\t},\n\t\t{\n\t\tid:\"posixcharclass\",\n\t\ttip:\"Matches any character in the '{{value}}' POSIX class.\",\n\t\tlabel:\"POSIX class\",\n\t\tdesc:\"Matches any character in the specified POSIX class. Must be in a character set. For example, [[:alnum:]$] will match alphanumeric characters and $.\",\n\t\text:\"

    For a list of classes, see the PCRE spec.

    \",\n\t\ttoken:\"[:alnum:]\"\n\t\t},\n\t\t{\n\t\tid:\"dot\",\n\t\ttip:\"Matches any character {{getDotAll()}}.\",\n\t\tdesc:\"Matches any character except linebreaks.\",\n\t\text:\" Equivalent to [^\\\\n\\\\r].\",\n\t\texample:[\".\", \"glib jocks vex dwarves!\"],\n\t\ttoken:\".\"\n\t\t},\n\t\t{\n\t\tid:\"matchanyset\",\n\t\tlabel:\"match any\",\n\t\tdesc:\"A character set that can be used to match any character, including line breaks, without the dotall flag (s).\"+\n\t\t\t\"

    An alternative is [^], but it is not supported in all browsers.

    \",\n\t\texample:[\"[\\\\s\\\\S]\", \"glib jocks vex dwarves!\"],\n\t\ttoken:\"[\\\\s\\\\S]\"\n\t\t},\n\t\t{\n\t\tid:\"unicodegrapheme\",\n\t\tlabel:\"unicode grapheme\",\n\t\tdesc:\"Matches any single unicode grapheme (ie. character).\",\n\t\text:\" This includes line breaks (regardless of the dotall mode) and graphemes encoded as multiple code points.\",\n\t\ttoken:\"\\\\X\"\n\t\t},\n\t\t{\n\t\tid:\"word\",\n\t\tdesc:\"Matches any word character (alphanumeric & underscore).\",\n\t\text:\" Only matches low-ascii characters (no accented or non-roman characters). Equivalent to [A-Za-z0-9_]\",\n\t\texample:[\"\\\\w\",\"bonjour, mon fr\\u00E8re\"],\n\t\ttoken:\"\\\\w\"\n\t\t},\n\t\t{\n\t\tid:\"notword\",\n\t\tlabel: \"not word\",\n\t\tdesc:\"Matches any character that is not a word character (alphanumeric & underscore).\",\n\t\text:\" Equivalent to [^A-Za-z0-9_]\",\n\t\texample:[\"\\\\W\",\"bonjour, mon fr\\u00E8re\"],\n\t\ttoken:\"\\\\W\"\n\t\t},\n\t\t{\n\t\tid:\"digit\",\n\t\tdesc:\"Matches any digit character (0-9).\",\n\t\text:\" Equivalent to [0-9].\",\n\t\texample:[\"\\\\d\",\"+1-(444)-555-1234\"],\n\t\ttoken:\"\\\\d\"\n\t\t},\n\t\t{\n\t\tid:\"notdigit\",\n\t\tlabel: \"not digit\",\n\t\tdesc:\"Matches any character that is not a digit character (0-9).\",\n\t\text:\" Equivalent to [^0-9].\",\n\t\texample:[\"\\\\D\",\"+1-(444)-555-1234\"],\n\t\ttoken:\"\\\\D\"\n\t\t},\n\t\t{\n\t\tid:\"whitespace\",\n\t\tdesc:\"Matches any whitespace character (spaces, tabs, line breaks).\",\n\t\texample:[\"\\\\s\", \"glib jocks vex dwarves!\"],\n\t\ttoken:\"\\\\s\"\n\t\t},\n\t\t{\n\t\tid:\"notwhitespace\",\n\t\tlabel: \"not whitespace\",\n\t\tdesc:\"Matches any character that is not a whitespace character (spaces, tabs, line breaks).\",\n\t\texample:[\"\\\\S\", \"glib jocks vex dwarves!\"],\n\t\ttoken:\"\\\\S\"\n\t\t},\n\t\t{\n\t\tid:\"hwhitespace\",\n\t\tlabel:\"horizontal whitespace\",\n\t\tdesc:\"Matches any horizontal whitespace character (spaces, tabs).\",\n\t\ttoken:\"\\\\h\"\n\t\t},\n\t\t{\n\t\tid:\"nothwhitespace\",\n\t\tlabel: \"not horizontal whitespace\",\n\t\tdesc:\"Matches any character that is not a horizontal whitespace character (spaces, tabs).\",\n\t\ttoken:\"\\\\H\"\n\t\t},\n\t\t{\n\t\tid:\"vwhitespace\",\n\t\tlabel:\"vertical whitespace\",\n\t\tdesc:\"Matches any vertical whitespace character (line breaks).\",\n\t\ttoken:\"\\\\v\"\n\t\t},\n\t\t{\n\t\tid:\"notvwhitespace\",\n\t\tlabel: \"not vertical whitespace\",\n\t\tdesc:\"Matches any character that is not a vertical whitespace character (line breaks).\",\n\t\ttoken:\"\\\\V\"\n\t\t},\n\t\t{\n\t\tid:\"linebreak\",\n\t\tlabel:\"line break\",\n\t\tdesc:\"Matches any line break character, including the CRLF pair, and CR / LF individually.\",\n\t\ttoken:\"\\\\R\"\n\t\t},\n\t\t{\n\t\tid:\"notlinebreak\",\n\t\tlabel:\"not line break\",\n\t\tdesc:\"Matches any character that is not a line break.\",\n\t\text:\" Similar to dot (.) but is unaffected by the dotall flag (s).\",\n\t\ttoken:\"\\\\N\"\n\t\t},\n\t\t{\n\t\tid:\"unicodecat\",\n\t\ttip:\"Matches any character in the '{{getUniCat()}}' unicode category.\",\n\t\tlabel:\"unicode category\",\n\t\tdesc:\"Matches a character in the specified unicode category. For example, \\\\p{Ll} will match any lowercase letter.\",\n\t\text:\"

    For a list of categories, see the PCRE spec.

    \"+\n\t\t\t\"

    There are multiple syntaxes for this feature:

    \\\\p{L} \\\\pL

    \",\n\t\ttoken:\"\\\\p{L}\"\n\t\t},\n\t\t{\n\t\tid:\"notunicodecat\",\n\t\ttip:\"Matches any character that is not in the '{{getUniCat()}}' unicode category.\",\n\t\tlabel:\"not unicode category\",\n\t\tdesc:\"Matches any character that is not in the specified unicode category.\",\n\t\text:\"

    For a list of categories, see the PCRE spec.

    \"+\n\t\t\t\"

    There are multiple syntaxes for this feature:

    \\\\P{L} \\\\p{^L} \\\\PL

    \",\n\t\ttoken:\"\\\\P{L}\"\n\t\t},\n\t\t{\n\t\tid:\"unicodescript\",\n\t\ttip:\"Matches any character in the '{{value}}' unicode script.\",\n\t\tlabel:\"unicode script\",\n\t\tdesc:\"Matches any character in the specified unicode script. For example, \\\\p{Arabic} will match characters in the Arabic script.\",\n\t\text:\"

    For a list of scripts, see the PCRE spec.

    \",\n\t\ttoken:\"\\\\p{Han}\"\n\t\t},\n\t\t{\n\t\tid:\"notunicodescript\",\n\t\ttip:\"Matches any character that is not in the '{{value}}' unicode script.\",\n\t\tlabel:\"not unicode script\",\n\t\tdesc:\"Matches any character that is not in the specified unicode script.\",\n\t\text:\"

    For a list of scripts, see the PCRE spec.

    \"+\n\t\t\t\"

    There are multiple syntaxes for this feature:

    \\\\P{Han} \\\\p{^Han}\",\n\t\ttoken:\"\\\\P{Han}\"\n\t\t}\n\t]\n\t},\n\n\t{\n\tlabel:\"Anchors\",\n\tid:\"anchors\",\n\tdesc:\"Anchors are unique in that they match a position within a string, not a character.\",\n\tkids:[\n\t\t{\n\t\tid:\"bos\",\n\t\tlabel:\"beginning of string\",\n\t\tdesc:\"Matches the beginning of the string.\",\n\t\text:\" Unlike ^, this is unaffected by the multiline flag (m). This matches a position, not a character.\",\n\t\ttoken:\"\\\\A\"\n\t\t},\n\t\t{\n\t\tid:\"eos\",\n\t\tlabel:\"end of string\",\n\t\tdesc:\"Matches the end of the string.\",\n\t\text:\" Unlike $, this is unaffected by the multiline flag (m). This matches a position, not a character.\",\n\t\ttoken:\"\\\\Z\"\n\t\t},\n\t\t{\n\t\tid:\"abseos\",\n\t\tlabel:\"strict end of string\",\n\t\tdesc:\"Matches the end of the string. Unlike $ or \\\\Z, it does not allow for a trailing newline.\",\n\t\text:\" This is unaffected by the multiline flag (m). This matches a position, not a character.\",\n\t\ttoken:\"\\\\z\"\n\t\t},\n\t\t{\n\t\tid:\"bof\",\n\t\tlabel:\"beginning\",\n\t\tdesc:\"Matches the beginning of the string, or the beginning of a line if the multiline flag (m) is enabled.\",\n\t\text:\" This matches a position, not a character.\",\n\t\texample:[\"^\\\\w+\",\"she sells seashells\"],\n\t\ttoken:\"^\"\n\t\t},\n\t\t{\n\t\tid:\"eof\",\n\t\tlabel:\"end\",\n\t\tdesc:\"Matches the end of the string, or the end of a line if the multiline flag (m) is enabled.\",\n\t\text:\" This matches a position, not a character.\",\n\t\texample:[\"\\\\w+$\",\"she sells seashells\"],\n\t\ttoken:\"$\"\n\t\t},\n\t\t{\n\t\tid:\"wordboundary\",\n\t\tlabel:\"word boundary\",\n\t\tdesc:\"Matches a word boundary position between a word character and non-word character or position (start / end of string).\",\n\t\text:\" See the word character class (\\w) for more info.\",\n\t\texample:[\"s\\\\b\",\"she sells seashells\"],\n\t\ttoken:\"\\\\b\"\n\t\t},\n\t\t{\n\t\tid:\"notwordboundary\",\n\t\tlabel: \"not word boundary\",\n\t\tdesc:\"Matches any position that is not a word boundary.\",\n\t\text:\" This matches a position, not a character.\",\n\t\texample:[\"s\\\\B\",\"she sells seashells\"],\n\t\ttoken:\"\\\\B\"\n\t\t},\n\t\t{\n\t\tid:\"prevmatchend\",\n\t\tlabel: \"previous match end\",\n\t\tdesc:\"Matches the end position of the previous match.\",\n\t\text:\" This matches a position, not a character.\",\n\t\ttoken:\"\\\\G\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tlabel: \"Escaped characters\",\n\tid:\"escchars\",\n\tdesc: \"Escape sequences can be used to insert reserved, special, and unicode characters. All escaped characters begin with the \\\\ character.\",\n\tkids: [\n\t\t{\n\t\tid:\"reservedchar\",\n\t\tlabel:\"reserved characters\",\n\t\tdesc:\"The following character have special meaning, and should be preceded by a \\\\ (backslash) to represent a literal character:\"+\n\t\t\t\"

    {{getEscChars()}}

    \"+\n\t\t\t\"

    Within a character set, only \\\\, -, and ] need to be escaped.

    \",\n\t\texample:[\"\\\\+\",\"1 + 1 = 2\"],\n\t\ttoken:\"\\\\+\",\n\t\tshow:true\n\t\t},\n\t\t{\n\t\tid:\"escoctal\",\n\t\tlabel:\"octal escape\",\n\t\tdesc:\"Octal escaped character in the form \\\\000.\",\n\t\text:\" Value must be less than 255 (\\\\377).\", // PCRE profile adds to ext.\n\t\texample:[\"\\\\251\",\"RegExr is \\u00A92014\"],\n\t\ttoken:\"\\\\000\"\n\t\t},\n\t\t{\n\t\tid:\"eschexadecimal\",\n\t\tlabel:\"hexadecimal escape\",\n\t\tdesc:\"Hexadecimal escaped character in the form \\\\xFF.\",\n\t\texample:[\"\\\\xA9\",\"RegExr is \\u00A92014\"],\n\t\ttoken:\"\\\\xFF\"\n\t\t},\n\t\t{\n\t\tid:\"escunicodeu\",\n\t\tlabel:\"unicode escape\",\n\t\tdesc:\"Unicode escaped character in the form \\\\uFFFF\",\n\t\texample:[\"\\\\u00A9\",\"RegExr is \\u00A92014\"],\n\t\ttoken:\"\\\\uFFFF\"\n\t\t},\n\t\t{\n\t\tid:\"escunicodeub\",\n\t\tlabel:\"extended unicode escape\",\n\t\tdesc:\"Unicode escaped character in the form \\\\u{FFFF}.\",\n\t\text:\" Supports a full range of unicode point escapes with any number of hex digits.

    Requires the unicode flag (u).

    \",\n\t\ttoken:\"\\\\u{FFFF}\"\n\t\t},\n\t\t{\n\t\tid:\"escunicodexb\",\n\t\tlabel:\"unicode escape\",\n\t\tdesc:\"Unicode escaped character in the form \\\\x{FF}.\",\n\t\ttoken:\"\\\\x{FF}\"\n\t\t},\n\t\t{\n\t\tid:\"esccontrolchar\",\n\t\tlabel:\"control character escape\",\n\t\tdesc:\"Escaped control character in the form \\\\cZ.\",\n\t\text:\" This can range from \\\\cA (SOH, char code 1) to \\\\cZ (SUB, char code 26).

    Example:

    \\\\cI matches TAB (char code 9).\",\n\t\ttoken:\"\\\\cI\"\n\t\t},\n\t\t{\n\t\tid:\"escsequence\",\n\t\tlabel:\"escape sequence\",\n\t\ttip: \"Matches the literal string '{{value}}'.\",\n\t\tdesc:\"All characters between the \\\\Q and the \\\\E are interpreted as a literal string. If \\\\E is omitted, it continues to the end of the expression.\",\n\t\text:\" For example, the expression /\\\\Q(?.)\\\\E/ will match the string (?.).\",\n\t\ttoken:\"\\\\Q...\\\\E\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tlabel: \"Groups & References\",\n\tid:\"groups\",\n\tdesc: \"Groups allow you to combine a sequence of tokens to operate on them together. Capture groups can be referenced by a backreference and accessed separately in the results.\",\n\tkids: [\n\t\t{\n\t\tid:\"group\",\n\t\tlabel: \"capturing group\",\n\t\tdesc: \"Groups multiple tokens together and creates a capture group for extracting a substring or using a backreference.\",\n\t\texample:[\"(ha)+\",\"hahaha haa hah!\"],\n\t\ttoken:\"(ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"namedgroup\",\n\t\tlabel: \"named capturing group\",\n\t\ttip:\"Creates a capturing group named '{{name}}'.\",\n\t\tdesc:\"Creates a capturing group that can be referenced via the specified name.\",\n\t\text:\"

    There are multiple syntaxes for this feature:

    (?'name'ABC) (?P<name>ABC) (?<name>ABC)

    \",\n\t\ttoken:\"(?ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"namedref\",\n\t\tlabel:\"named reference\",\n\t\ttip:\"Matches the results of the capture group named '{{group.name}}'.\",\n\t\tdesc:\"Matches the results of a named capture group.\",\n\t\text:\"

    There are multiple syntaxes for this feature:

    \\\\k'name' \\\\k<name> \\\\k{name} \\\\g{name} (?P=name)

    \",\n\t\ttoken:\"\\\\k'name'\"\n\t\t},\n\t\t{\n\t\tid:\"numref\",\n\t\tlabel:\"numeric reference\",\n\t\ttip:\"Matches the results of capture group #{{group.num}}.\",\n\t\tdesc:\"Matches the results of a capture group. For example \\\\1 matches the results of the first capture group & \\\\3 matches the third.\",\n\t\t// PCRE adds relative and alternate syntaxes in ext\n\t\texample:[\"(\\\\w)a\\\\1\",\"hah dad bad dab gag gab\"],\n\t\ttoken:\"\\\\1\"\n\t\t},\n\t\t{\n\t\tid:\"branchreset\",\n\t\tlabel: \"branch reset group\",\n\t\tdesc:\"Define alternative groups that share the same group numbers.\",\n\t\text: \"

    For example, in (?|(a)|(b)) both groups (a and b) would be counted as group #1.\",\n\t\ttoken:\"(?|(a)|(b))\"\n\t\t},\n\t\t{\n\t\tid:\"noncapgroup\",\n\t\tlabel: \"non-capturing group\",\n\t\tdesc:\"Groups multiple tokens together without creating a capture group.\",\n\t\texample:[\"(?:ha)+\",\"hahaha haa hah!\"],\n\t\ttoken:\"(?:ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"atomic\",\n\t\tlabel:\"atomic group\",\n\t\tdesc:\"Non-capturing group that discards backtracking positions once matched.\",\n\t\text:\"

    For example, /(?>ab|a)b/ will match abb but not ab because once the ab option has matched, the atomic group prevents backtracking to retry with the a option.

    \",\n\t\ttoken:\"(?>ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"define\",\n\t\tdesc:\"Used to define named groups for use as subroutines without including them in the match.\",\n\t\text:\"

    For example, /A(?(DEFINE)(?'foo'Z))B\\\\g'foo'/ will match ABZ, because the define group is ignored in the match except to define the foo subroutine that is referenced later with \\\\g'foo'.

    \",\n\t\ttoken:\"(?(DEFINE)(?'foo'ABC))\"\n\t\t},\n\t\t{\n\t\tid:\"numsubroutine\",\n\t\tlabel:\"numeric subroutine\",\n\t\ttip:\"Matches the expression in capture group #{{group.num}}.\",\n\t\tdesc:\"Matches the expression in a capture group. Compare this to a reference, that matches the result.\"+\n\t\t\t\" For example /(a|b)\\\\g'1'/ can match ab, because the expression a|b is evaluated again.\",\n\t\text:\"

    There are multiple syntaxes for this feature: \\\\g<1> \\\\g'1' (?1).

    \"+\n\t\t\t\"

    Relative values preceded by + or - are also supported. For example \\\\g<-1> would match the group preceding the reference.

    \",\n\t\ttoken:\"\\\\g'1'\"\n\t\t},\n\t\t{\n\t\tid:\"namedsubroutine\",\n\t\tlabel:\"named subroutine\",\n\t\ttip:\"Matches the expression in the capture group named '{{group.name}}'.\",\n\t\tdesc:\"Matches the expression in a capture group. Compare this to a reference, that matches the result.\",\n\t\text:\"

    There are multiple syntaxes for this feature: \\\\g<name> \\\\g'name' (?&name) (?P>name).

    \",\n\t\ttoken:\"\\\\g'name'\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tlabel: \"Lookaround\",\n\tid:\"lookaround\",\n\tdesc: \"Lookaround lets you match a group before (lookbehind) or after (lookahead) your main pattern without including it in the result.\"+\n\t\t\"

    Negative lookarounds specify a group that can NOT match before or after the pattern.

    \",\n\tkids: [\n\t\t{\n\t\tid:\"poslookahead\",\n\t\tlabel: \"positive lookahead\",\n\t\tdesc:\"Matches a group after the main expression without including it in the result.\",\n\t\texample:[\"\\\\d(?=px)\",\"1pt 2px 3em 4px\"],\n\t\ttoken:\"(?=ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"neglookahead\",\n\t\tlabel: \"negative lookahead\",\n\t\tdesc:\"Specifies a group that can not match after the main expression (if it matches, the result is discarded).\",\n\t\texample:[\"\\\\d(?!px)\",\"1pt 2px 3em 4px\"],\n\t\ttoken:\"(?!ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"poslookbehind\",\n\t\tlabel: \"positive lookbehind\",\n\t\tdesc:\"Matches a group before the main expression without including it in the result.\",\n\t\ttoken:\"(?<=ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"neglookbehind\",\n\t\tlabel: \"negative lookbehind\",\n\t\tdesc:\"Specifies a group that can not match before the main expression (if it matches, the result is discarded).\",\n\t\ttoken:\"(?/o\\\\Kbar/ will match bar within the string foobar\",\n\t\ttoken:\"\\\\K\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tlabel: \"Quantifiers & Alternation\",\n\tid:\"quants\",\n\tdesc: \"Quantifiers indicate that the preceding token must be matched a certain number of times. By default, quantifiers are greedy, and will match as many characters as possible.\"+\n\t\t\"
    Alternation acts like a boolean OR, matching one sequence or another.\",\n\tkids: [\n\t\t{\n\t\tid:\"plus\",\n\t\tdesc:\"Matches 1 or more of the preceding token.\",\n\t\texample:[\"b\\\\w+\",\"b be bee beer beers\"],\n\t\ttoken:\"+\"\n\t\t},\n\t\t{\n\t\tid:\"star\",\n\t\tdesc:\"Matches 0 or more of the preceding token.\",\n\t\texample:[\"b\\\\w*\",\"b be bee beer beers\"],\n\t\ttoken:\"*\"\n\t\t},\n\t\t{\n\t\tid:\"quant\",\n\t\tlabel:\"quantifier\",\n\t\ttip:\"Match {{getQuant()}} of the preceding token.\",\n\t\tdesc:\"Matches the specified quantity of the previous token. \"+\n\t\t\t\"{1,3} will match 1 to 3. \"+\n\t\t\t\"{3} will match exactly 3. \"+\n\t\t\t\"{3,} will match 3 or more. \",\n\t\texample:[\"b\\\\w{2,3}\",\"b be bee beer beers\"],\n\t\ttoken:\"{1,3}\"\n\t\t},\n\t\t{\n\t\tid:\"opt\",\n\t\tlabel:\"optional\",\n\t\tdesc:\"Matches 0 or 1 of the preceding token, effectively making it optional.\",\n\t\texample: [\"colou?r\", \"color colour\"],\n\t\ttoken:\"?\"\n\t\t},\n\t\t{\n\t\tid:\"lazy\",\n\t\ttip:\"Makes the preceding quantifier {{getLazy()}}, causing it to match as {{getLazyFew()}} characters as possible.\",\n\t\tdesc:\"Makes the preceding quantifier lazy, causing it to match as few characters as possible.\",\n\t\text:\" By default, quantifiers are greedy, and will match as many characters as possible.\",\n\t\texample:[\"b\\\\w+?\",\"b be bee beer beers\"],\n\t\ttoken:\"?\"\n\t\t},\n\t\t{\n\t\tid:\"possessive\",\n\t\tdesc:\"Makes the preceding quantifier possessive. It will match as many characters as possible, and will not release them to match subsequent tokens.\",\n\t\text:\"

    For example /.*a/ would match aaa, but /.*+a/ would not, because the repeating dot would match and not release the last character to match a.

    \",\n\t\ttoken:\"+\"\n\t\t},\n\t\t{\n\t\tid:\"alt\",\n\t\tlabel:\"alternation\",\n\t\tdesc:\"Acts like a boolean OR. Matches the expression before or after the |.\",\n\t\text:\"

    It can operate within a group, or on a whole expression. The patterns will be tested in order.

    \",\n\t\texample:[\"b(a|e|i)d\",\"bad bud bod bed bid\"],\n\t\ttoken:\"|\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tlabel: \"Special\",\n\tid:\"other\",\n\tdesc: \"Tokens that don't quite fit anywhere else.\",\n\tkids: [\n\t\t{\n\t\tid:\"comment\",\n\t\tdesc:\"Allows you to insert a comment into your expression that is ignored when finding a match.\",\n\t\ttoken:\"(?#foo)\"\n\t\t},\n\t\t{\n\t\tid:\"conditional\",\n\t\tdesc:\"Conditionally matches one of two options based on whether a lookaround is matched.\",\n\t\text:\"

    For example, /(?(?=a)ab|..)/ will match ab and zx but not ax, because if the first character matches the condition a then it evaluates the pattern ab.

    \"+\n\t\t\t\"

    Any lookaround can be used as the condition. A lookahead will start the subsequent match at the start of the condition, a lookbehind will start it after.

    \",\n\t\ttoken:\"(?(?=A)B|C)\"\n\t\t},\n\t\t{\n\t\tid:\"conditionalgroup\",\n\t\tlabel:\"group conditional\",\n\t\tdesc:\"Conditionally matches one of two options based on whether group '{{name}}' matched.\",\n\t\text:\"

    For example, /(z)?(?(1)a|b)/ will match za because the first capture group matches z successfully, which causes the conditional to match the first option a.

    \"+\n\t\t\t\"

    The same pattern will also match b on its own, because group 1 doesn't match, so it instead tries to match the second option b.

    \"+\n\t\t\t\"

    You can reference a group by name, number, or relative position (ex. -1).

    \",\n\t\ttoken:\"(?(1)B|C)\"\n\t\t},\n\t\t{\n\t\tid:\"recursion\",\n\t\tdesc:\"Attempts to match the full expression again at the current position.\",\n\t\text:\"

    For example, /a(?R)?b/ will match any number of a followed by the same number of z: the full text of az or aaaazzzz, but not azzz.

    \"+\n\t\t\t\"

    There are multiple syntaxes for this feature:

    (?R) (?0) \\\\g<0> \\\\g'0'

    \",\n\t\ttoken:\"(?R)\"\n\t\t},\n\t\t{\n\t\tid:\"mode\",\n\t\tlabel:\"mode modifier\",\n\t\ttip:\"{{~getDesc()}}{{~getModes()}}\",\n\t\tdesc:\"Enables or disables modes for the remainder of the expression.\",\n\t\text:\"Matching modes generally map to expression flags. For example (?i) would enable case insensitivity for the remainder of the expression.\"+\n\t\t\t\"

    Multiple modifiers can be specified, and any modifiers that follow - are disabled. For example (?im-s) would enable case insensitivity & multiline modes, and disable dotall.

    \"+\n\t\t\t\"

    Supported modifiers are: i - case insensitive, s - dotall, m - multiline, x - free spacing, J - allow duplicate names, U - ungreedy.

    \",\n\t\ttoken:\"(?i)\"\n\t\t}\n\t]\n\t},\n\n\t{\n\tlabel: \"Substitution\",\n\tdesc: \"These tokens are used in a substitution string to insert different parts of the match.\",\n\ttarget: \"subst\",\n\tid:\"subst\",\n\tkids: [\n\t\t{\n\t\tid:\"subst_$&match\",\n\t\tlabel: \"match\",\n\t\tdesc:\"Inserts the matched text.\",\n\t\ttoken:\"$&\"\n\t\t},\n\t\t{\n\t\tid:\"subst_0match\",\n\t\tlabel: \"match\",\n\t\tdesc:\"Inserts the matched text.\",\n\t\text:\"

    There are multiple syntaxes for this feature:

    $0 \\\\0 \\\\{0}

    \",\n\t\ttoken:\"$0\"\n\t\t},\n\t\t{\n\t\tid:\"subst_group\",\n\t\tlabel: \"capture group\",\n\t\ttip:\"Inserts the results of capture group #{{group.num}}.\",\n\t\tdesc:\"Inserts the results of the specified capture group. For example, $3 would insert the third capture group.\",\n\t\t// NOTE: javascript profile overrides this:\n\t\text:\"

    There are multiple syntaxes for this feature:

    $1 \\\\1 \\\\{1}

    \",\n\t\ttoken:\"$1\"\n\t\t},\n\t\t{\n\t\tid:\"subst_$before\",\n\t\tlabel: \"before match\",\n\t\tdesc:\"Inserts the portion of the source string that precedes the match.\",\n\t\ttoken:\"$`\"\n\t\t},\n\t\t{\n\t\tid:\"subst_$after\",\n\t\tlabel: \"after match\",\n\t\tdesc:\"Inserts the portion of the source string that follows the match.\",\n\t\ttoken:\"$'\"\n\t\t},\n\t\t{\n\t\tid:\"subst_$esc\",\n\t\tlabel: \"escaped $\",\n\t\tdesc:\"Inserts a dollar sign character ($).\",\n\t\ttoken:\"$$\"\n\t\t},\n\t\t{\n\t\tid: \"subst_esc\",\n\t\tlabel: \"escaped characters\",\n\t\ttoken: \"\\\\n\",\n\t\tdesc: \"For convenience, these escaped characters are supported in the Replace string in RegExr: \\\\n, \\\\r, \\\\t, \\\\\\\\, and unicode escapes \\\\uFFFF. This may vary in your deploy environment.\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tid:\"flags\",\n\tlabel:\"Flags\",\n\ttooltip:\"Expression flags change how the expression is interpreted. Click to edit.\",\n\tdesc:\"Expression flags change how the expression is interpreted. Flags follow the closing forward slash of the expression (ex. /.+/igm ).\",\n\ttarget:\"flags\",\n\tkids: [\n\t\t{\n\t\tid:\"caseinsensitive\",\n\t\tlabel: \"ignore case\",\n\t\tdesc:\"Makes the whole expression case-insensitive.\",\n\t\text:\" For example, /aBc/i would match AbC.\",\n\t\ttoken:\"i\"\n\t\t},\n\t\t{\n\t\tid:\"global\",\n\t\tlabel: \"global search\",\n\t\ttip: \"Retain the index of the last match, allowing iterative searches.\",\n\t\tdesc:\"Retain the index of the last match, allowing subsequent searches to start from the end of the previous match.\"+\n\t\t\t\"

    Without the global flag, subsequent searches will return the same match.


    \"+\n\t\t\t\"RegExr only searches for a single match when the global flag is disabled to avoid infinite match errors.\",\n\t\ttoken:\"g\"\n\t\t},\n\t\t{\n\t\tid:\"multiline\",\n\t\ttip:\"Beginning/end anchors (^/$) will match the start/end of a line.\",\n\t\tdesc:\"When the multiline flag is enabled, beginning and end anchors (^ and $) will match the start and end of a line, instead of the start and end of the whole string.\"+\n\t\t\t\"

    Note that patterns such as /^[\\\\s\\\\S]+$/m may return matches that span multiple lines because the anchors will match the start/end of any line.

    \",\n\t\ttoken:\"m\"\n\t\t},\n\t\t{\n\t\tid:\"unicode\",\n\t\ttip:\"Enables \\\\x{FFFFF} unicode escapes.\",\n\t\tdesc:\"When the unicode flag is enabled, you can use extended unicode escapes in the form \\\\x{FFFFF}.\"+\n\t\t\t\"

    It also makes other escapes stricter, causing unrecognized escapes (ex. \\\\j) to throw an error.

    \",\n\t\ttoken:\"u\"\n\t\t},\n\t\t{\n\t\tid:\"sticky\",\n\t\tdesc:\"The expression will only match from its lastIndex position and ignores the global (g) flag if set.\",\n\t\text:\" Because each search in RegExr is discrete, this flag has no further impact on the displayed results.\",\n\t\ttoken:\"y\"\n\t\t},\n\t\t{\n\t\tid:\"dotall\",\n\t\tdesc:\"Dot (.) will match any character, including newline.\",\n\t\ttoken:\"s\"\n\t\t},\n\t\t{\n\t\tid:\"extended\",\n\t\tdesc:\"Literal whitespace characters are ignored, except in character sets.\",\n\t\ttoken:\"x\"\n\t\t},\n\t\t{\n\t\tid:\"ungreedy\",\n\t\ttip:\"Makes quantifiers ungreedy (lazy) by default.\",\n\t\tdesc:\"Makes quantifiers ungreedy (lazy) by default. Quantifiers followed by ? will become greedy.\",\n\t\ttoken:\"U\"\n\t\t}\n\t]\n\t}\n];\n\n// content that isn't included in the Reference menu item:\no.misc = {\n\tkids:[\n\t\t{\n\t\tid:\"ignorews\",\n\t\tlabel:\"ignored whitespace\",\n\t\ttip:\"Whitespace character ignored due to the extended flag or mode.\"\n\t\t},\n\t\t{\n\t\tid:\"extnumref\", // alternative syntaxes.\n\t\tproxy:\"numref\"\n\t\t},\n\t\t{\n\t\tid:\"char\",\n\t\tlabel:\"character\",\n\t\ttip:\"Matches a {{getChar()}} character (char code {{code}}). {{getInsensitive()}}\"\n\t\t},\n\t\t{\n\t\tid:\"escchar\",\n\t\tlabel:\"escaped character\",\n\t\ttip:\"Matches a {{getChar()}} character (char code {{code}}).\"\n\t\t},\n\t\t{\n\t\tid:\"open\",\n\t\ttip:\"Indicates the start of a regular expression.\"\n\t\t},\n\t\t{\n\t\tid:\"close\",\n\t\ttip:\"Indicates the end of a regular expression and the start of expression flags.\"\n\t\t},\n\t\t{\n\t\tid:\"condition\",\n\t\ttip:\"The lookaround to match in resolving the enclosing conditional statement. See 'conditional' in the Reference for info.\"\n\t\t},\n\t\t{\n\t\tid:\"conditionalelse\",\n\t\tlabel:\"conditional else\",\n\t\ttip:\"Delimits the 'else' portion of the conditional.\"\n\t\t},\n\t\t{\n\t\tid:\"ERROR\",\n\t\ttip:\"Errors in the expression are underlined in red. Roll over errors for more info.\"\n\t\t},\n\t\t{\n\t\tid:\"PREG_INTERNAL_ERROR\",\n\t\ttip:\"Internal PCRE error\"\n\t\t},\n\t\t{\n\t\tid:\"PREG_BACKTRACK_LIMIT_ERROR\",\n\t\ttip:\"Backtrack limit was exhausted.\"\n\t\t},\n\t\t{\n\t\tid:\"PREG_RECURSION_LIMIT_ERROR\",\n\t\ttip:\"Recursion limit was exhausted\"\n\t\t},\n\t\t{\n\t\tid:\"PREG_BAD_UTF8_ERROR\",\n\t\ttip:\"Malformed UTF-8 data\"\n\t\t},\n\t\t{\n\t\tid:\"PREG_BAD_UTF8_OFFSET_ERROR\",\n\t\ttip:\"Malformed UTF-8 data\"\n\t\t}\n\t]\n};\n\no.errors = {\n\tgroupopen:\"Unmatched opening parenthesis.\",\n\tgroupclose:\"Unmatched closing parenthesis.\",\n\tsetopen:\"Unmatched opening square bracket.\",\n\trangerev:\"Range values reversed. Start char code is greater than end char code.\",\n\tquanttarg:\"Invalid target for quantifier.\",\n\tquantrev:\"Quantifier minimum is greater than maximum.\",\n\tesccharopen:\"Dangling backslash.\",\n\tesccharbad:\"Unrecognized or malformed escape character.\",\n\tunicodebad:\"Unrecognized unicode category or script.\",\n\tposixcharclassbad:\"Unrecognized POSIX character class.\",\n\tposixcharclassnoset:\"POSIX character class must be in a character set.\",\n\tnotsupported:\"The \\\"{{~getLabel()}}\\\" feature is not supported in this flavor of RegEx.\",\n\tfwdslash:\"Unescaped forward slash. This may cause issues if copying/pasting this expression into code.\",\n\tesccharbad:\"Invalid escape sequence.\",\n\tservercomm:\"An error occurred while communicating with the server.\",\n\textraelse:\"Extra else in conditional group.\",\n\tunmatchedref:\"Reference to non-existent group \\\"{{name}}\\\".\",\n\tmodebad:\"Unrecognized mode flag \\\"{{errmode}}\\\".\",\n\tbadname:\"Group name can not start with a digit.\",\n\tdupname:\"Duplicate group name.\",\n\tbranchreseterr:\"Branch Reset. Results will be ok, but RegExr's parser does not number branch reset groups correctly. Coming soon!\",\n\ttimeout:\"The expression took longer than 250ms to execute.\", // TODO: can we couple this to the help content somehow?\n\n\t// warnings:\n\tjsfuture:\"The \\\"{{~getLabel()}}\\\" feature may not be supported in all browsers.\",\n\tinfinite:\"The expression can return empty matches, and may match infinitely in some use cases.\", // TODO: can we couple this to the help content somehow?\n};\n\n/*\nclasses:\nquant\nset\nspecial\nref\nesc\nanchor\ncharclass\ngroup\ncomment\n */\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"../utils/Utils\";\n\nexport default class BrowserSolver {\n\n\tconstructor() {\n\t\tconst workerBlob = new Blob([\n\t\t\tdocument.querySelector('#regexWorker').textContent\n\t\t], { type: \"text/javascript\" });\n\t\tthis._workerObjectURL = URL.createObjectURL(workerBlob);\n\t}\n\n\tsolve(o, callback) {\n\t\tthis._callback = callback;\n\t\tthis._req = o;\n\n\t\tlet regex, text=o.text, tests=o.tests, mode = o.mode;\n\t\ttry {\n\t\t\tthis._regex = regex = new RegExp(o.pattern, o.flags);\n\t\t} catch(e) {\n\t\t\treturn this._onRegExComplete({id:\"regexparse\", name: e.name, message: e.message}, null, mode);\n\t\t}\n\n\t\tif (window.Worker) {\n\t\t\tconst worker = new Worker(this._workerObjectURL);\n\n\t\t\tworker.onmessage = (evt) => {\n\t\t\t\tif (evt.data === \"onload\") {\n\t\t\t\t\tthis._startTime = Utils.now();\n\t\t\t\t\tthis._timeoutId = setTimeout(() => {\n\t\t\t\t\t\tworker.terminate();\n\t\t\t\t\t\tthis._onRegExComplete({id: \"timeout\"}, null, mode); // TODO: make this a warning, and return all results so far.\n\t\t\t\t\t}, 250);\n\t\t\t\t} else {\n\t\t\t\t\tclearTimeout(this._timeoutId);\n\t\t\t\t\tworker.terminate();\n\t\t\t\t\tthis._onRegExComplete(evt.data.error, evt.data.matches, evt.data.mode);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// we need to pass the pattern and flags as text, because Safari strips the unicode flag when passing a RegExp to a Worker\n\t\t\tworker.postMessage({pattern:o.pattern, flags:o.flags, text, tests, mode});\n\t\t} else {\n\t\t\tthis._startTime = Utils.now();\n\n\t\t\t// shared between BrowserSolver & RegExWorker\n\t\t\tvar matches = [], match, index, error;\n\t\t\tif (mode === \"tests\") {\n\t\t\t\tfor (var i=0, l=tests.length; i source.length);\n\t\t\tif (index === -1) { break; }\n\t\t\trepl = source.replace(regex, str);\n\t\t\tresult += repl.substr(index, repl.length-ref.length+1);\n\t\t\tsource = ref.substr(index+(empty?2:1));\n\t\t} while (source.length);\n\t\tif (trimR) { result = result.substr(0,result.length-trimR); }\n\t\treturn result;\n\t}\n}\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"../utils/Utils\";\nimport Server from \"../net/Server\";\n\nexport default class ServerSolver {\n\t\n\tsolve(o, callback) {\n\t\t// unescape tool input:\n\t\tif (o.tool && o.tool.input != null) { o.tool.input = Utils.unescSubstStr(o.tool.input); }\n\t\tif (this._serverPromise) { this._serverPromise.abort(); }\n\t\tUtils.defer(()=>this._solve(o, callback), \"ServerSolver._solve\", 250);\n\t}\n\t\n\t_solve(o, callback) {\n\t\tthis._callback = callback;\n\t\tthis._serverPromise = Server.solve(o).then((o) => this._onLoad(o)).catch((o) => this._onError(o));\n\t}\n\t\n\t_onLoad(data) {\n\t\tthis._callback(data);\n\t}\n\t\n\t_onError(msg) {\n\t\tthis._callback({error:{id:msg}});\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Track from \"./utils/Track\";\n\nimport EventDispatcher from \"./events/EventDispatcher.js\";\nimport BrowserSolver from \"./helpers/BrowserSolver.js\";\nimport ServerSolver from \"./helpers/ServerSolver.js\";\nimport profiles from \"./profiles/profiles.js\";\n\nimport app from \"./app\";\n\nexport default class Flavor extends EventDispatcher {\n\t\n\tconstructor(flavor) {\n\t\tsuper();\n\t\tthis.value = app.prefs.read(\"flavor\");\n\t\tthis._browserSolver = new BrowserSolver();\n\t\tthis._serverSolver = new ServerSolver();\n\t}\n\t\n\tset value(id) {\n\t\tlet profile = profiles[(id && id.toLowerCase()) || \"js\"];\n\t\tif (!profile || profile === this._profile) { return; }\n\n\t\tthis._profile = profile;\n\t\tthis._buildSupportMap(profile);\n\t\tapp.prefs.write(\"flavor\", id);\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\t\n\tget value() {\n\t\treturn this._profile.id;\n\t}\n\t\n\tget profile() {\n\t\treturn this._profile;\n\t}\n\t\n\tget profiles() {\n\t\treturn [profiles.js, profiles.pcre];\n\t}\n\t\n\tget solver() {\n\t\treturn this._profile.browser ? this._browserSolver : this._serverSolver;\n\t}\n\t\n\tisTokenSupported(id) {\n\t\treturn !!this._profile._supportMap[id];\n\t}\n\t\n\tgetDocs(id) {\n\t\treturn this._profile.docs[id];\n\t}\n\t\n\tvalidateFlags(list) {\n\t\tlet flags = this._profile.flags, dupes = {};\n\t\treturn list.filter((id)=>(!!flags[id] && !dupes[id] && (dupes[id] = true)));\n\t}\n\t\n\tvalidateFlagsStr(str) {\n\t\treturn this.validateFlags(str.split(\"\")).join(\"\");\n\t}\n\t\n\tisFlagSupported(id) {\n\t\treturn !!this._profile.flags[id];\n\t}\n\t\n\t_buildSupportMap(profile) {\n\t\tif (profile._supportMap) { return; }\n\t\tlet map = profile._supportMap = {}, props = Flavor.SUPPORT_MAP_PROPS, n;\n\t\tfor (n in props) { this._addToSupportMap(map, profile[n], !!props[n]); }\n\t\tlet o = profile.escCharCodes, esc = profile.escChars;\n\t\tfor (n in o) { map[\"esc_\"+o[n]] = true; }\n\t\tfor (n in esc) { map[\"esc_\"+esc[n]] = true; }\n\t}\n\t\n\t_addToSupportMap(map, o, rev) {\n\t\tif (rev) { for (let n in o) { map[o[n]] = true; } }\n\t\telse { for (let n in o) { map[n] = o[n]; } }\n\t}\n}\n\nFlavor.SUPPORT_MAP_PROPS = {\n\t// 1 = reverse, 0 - normal\n\tflags: 1,\n\t// escape is handled separately\n\t// escCharCodes is handled separately\n\tescCharTypes: 1,\n\tcharTypes: 1,\n\t// unquantifiables not included\n\t// unicodeScripts not included\n\t// unicodeCategories not included\n\t// posixCharClasses not included\n\t// modes not included\n\ttokens: 0,\n\tsubstTokens: 0\n\t// config not included\n\t// docs not included\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport core from \"./profiles/core.js\";\nimport app from \"./app\";\n\nexport default class RefCoverage {\n\tconstructor() {\n\t\tapp.flavor._buildSupportMap(core);\n\t\tlet ref = app.reference._idMap, undoc=[], unused=[], all=core._supportMap;\n\t\tlet ignore = {\n\t\t\t\"escchar\": true, // literal char\n\t\t\t\"groupclose\": true,\n\t\t\t\"setclose\": true,\n\t\t\t\"condition\": true, // proxies to conditional\n\t\t\t\"conditionalelse\": true, // proxies to conditional\n\t\t\tsubst_$group: true, // resolved to subst_group\n\t\t\tsubst_$bgroup: true, // resolved to subst_group\n\t\t\tsubst_bsgroup: true, // resolved to subst_group\n\t\t\tescoctalo: true // resolved to escoctal\n\t\t}\n\t\t\n\t\tfor (let n in all) { if (!ref[n] && !ignore[n]) { undoc.push(n); } }\n\t\tfor (let n in ref) { if (!all[n] && !ref[n].kids) { unused.push(n); } }\n\t\t\n\t\tconsole.log(\"--- UNDOCUMENTED IDS ---\\n\"+undoc.join(\"\\n\")+\"\\n\\n--- UNUSED DOCS? ---\\n\"+unused.join(\"\\n\"));\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n\nexport default class Prefs {\n\tconstructor (el) {\n\t\tthis._load();\n\t}\n\n\tread(key) {\n\t\treturn this._data[key];\n\t}\n\n\twrite(key, value) {\n\t\tif (this._data[key] === value) { return; }\n\t\tthis._data[key] = value;\n\t\tthis._save();\n\t}\n\t\n\tclear(key) {\n\t\tdelete(this._data[key]);\n\t\tthis._save();\n\t}\n\t\n\t_load() {\n\t\tlet match = /(?:^|;\\s*)prefs=\\s*([^;]*)/.exec(document.cookie);\n\t\tif (match && match[1]) {\n\t\t\ttry {\n\t\t\t\tthis._data = JSON.parse(unescape(match[1]));\n\t\t\t\treturn;\n\t\t\t} catch (e) {}\n\t\t}\n\t\tthis._data = {};\n\t}\n\n\t_save() {\n\t\tlet str = escape(JSON.stringify(this._data));\n\t\tdocument.cookie = \"prefs=\"+str+\"; expires=Fri, 31 Dec 9999 23:59:59 GMT;\";\n\t}\n\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport EventDispatcher from \"./events/EventDispatcher\";\n\nimport $ from \"./utils/DOMUtils\";\nimport Utils from \"./utils/Utils\";\n\nimport Tooltip from \"./controls/Tooltip\";\n\nimport Server from \"./net/Server\";\n\nimport Expression from \"./views/Expression\";\nimport Text from \"./views/Text\";\nimport Tools from \"./views/Tools\";\nimport Sidebar from \"./views/Sidebar\";\nimport Account from \"./views/Account\";\nimport Theme from \"./views/Theme\";\n\nimport Reference from \"./docs/Reference\";\nimport reference_content from \"./docs/reference_content\";\nimport Flavor from \"./Flavor\";\n\nimport RefCoverage from \"./RefCoverage\";\nimport Prefs from \"./helpers/Prefs\";\n\nexport default class RegExr extends EventDispatcher {\n\tconstructor () { super(); }\n\n\tinit(state, account, config={}) {\n\t\tthis.prefs = new Prefs();\n\t\tthis.flavor = new Flavor();\n\t\tthis.reference = new Reference(reference_content, this.flavor, config);\n\t\tthis._migrateFavorites();\n\t\tthis._initUI();\n\n\t\tthis.account.value = account;\n\t\tif (state === false) {\n\t\t\tthis._localInit();\n\t\t} else if (this.account.authenticated && !state) {\n\t\t\tthis.newDoc(false);\n\t\t} else {\n\t\t\tthis.state = state;\n\t\t}\n\t\tthis._savedHash = null;\n\n\t\tlet params = Utils.getUrlParams();\n\t\tif (Utils.isLocal && params.id) {\n\t\t\tServer.load(params.id).then((o) => this.state = o);\n\t\t\tparams = {};\n\t\t}\n\t\tif (params.engine) { this.flavor.value = params.engine; }\n\t\tif (params.expression) { this.expression.value = params.expression; }\n\t\tif (params.text) { this.text.value = params.text; }\n\t\tif (params.tool) { this.tools.value = {id:params.tool, input:params.input}; }\n\n\t\twindow.onbeforeunload = (e) => this.unsaved ? \"You have unsaved changes.\" : null;\n\t\tthis.resetUnsaved();\n\n\t\tsetTimeout(() => this._initAds(), 100);\n\t}\n\n\t_initAds() {\n\t\t_native && _native.init(\"CK7D65QM\", { // \"CK7D65QM\" use \"CK7D4KQE\" to test Carbon ads\n\t\t\tcarbonZoneKey: 'CK7DPKQU',\n\t\t\ttargetClass: 'native-js'\n\t\t});\n\t}\n\n\t_localInit() {\n\t\tconsole.log(\"local init\");\n\t\t//Server.verify().then((data) => this.account.value = data);\n\t\tnew RefCoverage();\n\t}\n\n// getter / setters:\n\tget state() {\n\t\tconsole.log(this.text.mode);\n\t\tlet o = {\n\t\t\texpression: this.expression.value,\n\t\t\ttext: this.text.value,\n\t\t\ttests: this.text.tests,\n\t\t\tflavor: this.flavor.value,\n\t\t\ttool: this.tools.value,\n\t\t\tmode: this.text.mode,\n\t\t};\n\t\t// copy share values onto the pattern object:\n\t\treturn Utils.copy(this.share.value, o);\n\t}\n\n\tset state(o) {\n\t\tif (!o) { return; }\n\t\tthis.flavor.value = o.flavor;\n\t\tthis.expression.value = o.expression;\n\t\tthis.text.value = o.text;\n\t\tthis.text.tests = o.tests;\n\t\tthis.text.mode = o.mode;\n\t\tthis.tools.value = o.tool;\n\t\tthis.share.pattern = o;\n\t\tthis.resetUnsaved();\n\t}\n\n\tget hash() {\n\t\tlet share = this.share;\n\t\treturn Utils.getHashCode(\n\t\t\tthis.expression.value+\"\\t\"\n\t\t\t+ this.text.value+\"\\t\"\n\t\t\t+ this.flavor.value+\"\\t\"\n\t\t\t+ share.author+\"\\t\" + share.name+\"\\t\" + share.description+\"\\t\" + share.keywords+\"\\t\"\n\t\t\t+ JSON.stringify(this.text.tests)+\"\\t\"\n\t\t\t//+ this.tools.value.input+\"\\t\"\n\t\t\t//+ this.tools.value.id+\"\\t\"\n\t\t)\n\t}\n\n\tget unsaved() {\n\t\treturn this.hash !== this._savedHash;\n\t}\n\n\tget isNarrow() {\n\t\treturn this._matchList.matches;\n\t}\n\n// public methods:\n\tresetUnsaved() {\n\t\tthis._savedHash = this.hash;\n\t}\n\n\tnewDoc(warn=true) {\n\t\tthis.load({flavor: this.flavor.value, expression: \".\", text:\"Text\"}, warn);\n\t\tthis.expression.selectAll();\n\t}\n\n\tload(state, warn=true) {\n\t\tif (warn === true) { warn = \"You have unsaved changes. Continue without saving?\"; }\n\t\tif (warn && this.unsaved && !confirm(warn)) { return; }\n\t\tthis.state = Utils.clone(state);\n\t}\n\n// private methods:\n\t_initUI() {\n\t\t// TODO: break into own Device class? Rename mobile.scss too?\n\t\t// mobile setup\n\t\t// keep synced with \"mobile.scss\":\n\t\tif (screen.width < 500) {\n\t\t\tdocument.getElementById(\"viewport\").setAttribute(\"content\", \"width=500, user-scalable=0\");\n\t\t}\n\t\tthis._matchList = window.matchMedia(\"(max-width: 900px)\");\n\t\tthis._matchList.addListener((q)=>this.dispatchEvent(\"narrow\")); // currently unused.\n\n\t\t// UI:\n\t\tthis.el = $.query(\".container\");\n\n\t\tthis.tooltip = {\n\t\t\thover: new Tooltip($.query(\"#library #tooltip\").cloneNode(true)),\n\t\t\ttoggle: new Tooltip($.query(\"#library #tooltip\"), true)\n\t\t};\n\n\t\tthis.theme = new Theme(this.el);\n\n\t\tlet el = this.docEl = $.query(\".app > .doc\", this.el);\n\t\tthis.expression = new Expression($.query(\"> section.expression\", el));\n\t\tthis.text = new Text($.query(\"> section.text\", el));\n\t\tthis.tools = new Tools($.query(\"> section.tools\", el));\n\n\t\tthis.account = new Account();\n\t\tthis.sidebar = new Sidebar($.query(\".app > .sidebar\", this.el));\n\t\tthis.share = this.sidebar.share;\n\n\t\tthis.expression.on(\"change\", ()=> this._change());\n\t\tthis.text.on(\"change\", ()=> this._change());\n\t\tthis.text.on(\"modechange\", ()=> this._modeChange());\n\t\tthis.flavor.on(\"change\", ()=> this._change());\n\t\tthis.tools.on(\"change\", ()=> this._change());\n\t\tthis.share.on(\"change\", ()=> this._change());\n\t}\n\n\t_migrateFavorites() {\n\t\tlet ls = window.localStorage, l=ls.length;\n\t\tif (!l || ls.getItem(\"f_v3\") >= \"1\") { return }\n\t\tlet ids = [];\n\t\tfor (let i=0; i ls.setItem(\"f_v3\", \"1\"));\n\t}\n\n\t_change() {\n\t\tthis.dispatchEvent(\"change\");\n\t\tlet solver = this.flavor.solver, exp = this.expression;\n\t\tlet o = {pattern:exp.pattern, flags:exp.flags, mode:this.text.mode};\n\t\tif (o.mode === \"tests\") {\n\t\t\to.tests = this.text.tests;\n\t\t} else {\n\t\t\to.text = this.text.value;\n\t\t\to.tool = this.tools.value;\n\t\t}\n\t\tsolver.solve(o, (result) => this._handleResult(result));\n\t}\n\n\t_modeChange() {\n\t\t$.toggleClass(this.docEl, \"tests-mode\", this.text.mode === \"tests\");\n\t\tthis._change();\n\t}\n\t\n\t_handleResult(result) {\n\t\tthis.result = this._processResult(result);\n\t\tthis.dispatchEvent(\"result\");\n\t}\n\n\t_processResult(result) {\n\t\tif (result.mode === \"text\") {\n\t\t\tresult.matches && result.matches.forEach((o, i)=>o.num=i);\n\t\t}\n\t\treturn result;\n\t}\n}\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport \"../lib/codemirror.js\";\nimport \"../lib/clipboard.js\";\nimport \"../lib/native.js\";\nimport RegExr from \"./RegExr\";\n\nlet app = new RegExr();\nexport default app;"],"names":["global","factory","exports","module","define","amd","CodeMirror","this","userAgent","navigator","platform","gecko","test","ie_upto10","ie_11up","exec","edge","ie","ie_version","document","documentMode","webkit","qtwebkit","chrome","presto","safari","vendor","mac_geMountainLion","phantom","ios","android","mobile","mac","chromeOS","windows","presto_version","match","Number","flipCtrlCmd","captureRightClick","classTest","cls","RegExp","rmClass","node","current","className","after","slice","index","length","removeChildren","e","count","childNodes","removeChild","firstChild","removeChildrenAndAdd","parent","appendChild","elt","tag","content","style","createElement","cssText","createTextNode","i","eltP","setAttribute","range","createRange","start","end","endNode","r","setEnd","setStart","body","createTextRange","moveToElementText","parentNode","collapse","moveEnd","moveStart","contains","child","nodeType","host","activeElt","activeElement","shadowRoot","addClass","joinClasses","a","b","as","split","selectInput","select","selectionStart","selectionEnd","value","_e","bind","f","args","Array","prototype","call","arguments","apply","copyObj","obj","target","overwrite","prop","hasOwnProperty","countColumn","string","tabSize","startIndex","startValue","search","n","nextTab","indexOf","Delayed","id","set","ms","clearTimeout","setTimeout","array","scrollerGap","Pass","toString","sel_dontScroll","scroll","sel_mouse","origin","sel_move","findColumn","goal","pos","col","skipped","Math","min","spaceStrs","spaceStr","push","lst","arr","map","out","insertSorted","score","priority","splice","nothing","createObj","base","props","inst","Object","create","nonASCIISingleCaseWordChar","isWordCharBasic","ch","toUpperCase","toLowerCase","isWordChar","helper","source","isEmpty","extendingChars","isExtendingChar","charCodeAt","skipExtendingChars","str","dir","charAt","findFirst","pred","from","to","abs","mid","floor","Display","place","doc","input","d","scrollbarFiller","gutterFiller","lineDiv","selectionDiv","cursorDiv","measure","lineMeasure","lineSpace","lines","mover","sizer","sizerWidth","heightForcer","gutters","lineGutter","scroller","wrapper","zIndex","paddingRight","draggable","viewFrom","viewTo","first","reportedViewFrom","reportedViewTo","view","renderedView","externalMeasured","viewOffset","lastWrapHeight","lastWrapWidth","updateLineNumbers","nativeBarWidth","barHeight","barWidth","scrollbarsClipped","lineNumWidth","lineNumInnerWidth","lineNumChars","alignWidgets","cachedCharWidth","cachedTextHeight","cachedPaddingH","maxLine","maxLineLength","maxLineChanged","wheelDX","wheelDY","wheelStartX","wheelStartY","shift","selForContextMenu","activeTouch","init","getLine","size","Error","chunk","children","sz","chunkSize","getBetween","line","iter","text","getLines","updateLineHeight","height","diff","lineNo","cur","no","lineAtHeight","h","outer","i$1","lh","isLine","l","lineNumberFor","options","String","lineNumberFormatter","firstLineNumber","Pos","sticky","cmp","equalCursorPos","copyPos","x","maxPos","minPos","clipLine","max","clipPos","last","clipToLen","linelen","clipPosArray","sawReadOnlySpans","sawCollapsedSpans","seeReadOnlySpans","seeCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","addMarkedSpan","markedSpans","concat","attachLine","markedSpansBefore","old","startCh","isInsert","nw","startsBefore","inclusiveLeft","type","insertLeft","endsAfter","inclusiveRight","markedSpansAfter","endCh","stretchSpansOverChange","change","full","oldFirst","oldLast","sameLine","offset","found","span$1","found$1","clearEmptySpans","newMarkers","gap","gapMarkers","i$2","i$3","clearWhenEmpty","removeReadOnlyRanges","markers","mark","readOnly","parts","mk","m","find","j","p","newParts","dfrom","dto","detachMarkedSpans","detachLine","attachMarkedSpans","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","conflictingCollapsedRange","visualLine","merged","visualLineEnd","visualLineContinued","visualLineNo","lineN","vis","visualLineEndNo","lastLine","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","len","findMaxLine","cm","display","iterateBidiSections","order","part","level","bidiOther","getBidiPartAt","bidiOrdering","lowTypes","arabicTypes","charType","code","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","BidiSpan","direction","outerType","types","prev","type$1","prev$1","type$2","i$4","type$3","replace","i$5","cur$1","type$4","i$6","end$1","before","replace$1","j$1","i$7","at","j$2","nstart","unshift","reverse","getOrder","moveCharLogically","moveLogically","endOfLine","visually","moveInStorageOrder","prep","prepareMeasureForLine","targetTop","measureCharPrepared","top","moveVisually","bidi","partPos","mv","getWrappedLineExtent","lineWrapping","begin","wrappedLineExtentChar","wrappedLineExtent","searchInVisualLine","getRes","res","nextCh","noHandlers","on","emitter","addEventListener","attachEvent","_handlers","getHandlers","off","removeEventListener","detachEvent","signal","handlers","signalDOMEvent","override","preventDefault","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","returnValue","e_stopPropagation","stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","which","button","ctrlKey","dragAndDrop","div","zwspSupported","zeroWidthElement","offsetHeight","offsetWidth","badBidiRects","hasBadBidiRects","txt","r0","getBoundingClientRect","r1","left","right","splitLinesAuto","result","nl","rt","hasSelection","window","getSelection","te","ownerDocument","selection","parentElement","compareEndPoints","hasCopyEvent","oncopy","badZoomedRects","hasBadZoomedRects","normal","fromRange","modes","mimeModes","defineMode","name","mode","dependencies","defineMIME","mime","spec","resolveMode","getMode","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","extendMode","properties","copyState","state","nstate","val","innerMode","info","startState","a1","a2","StringStream","lineOracle","lastColumnPos","lastColumnValue","lineStart","eol","sol","peek","undefined","next","eat","ok","eatWhile","eatSpace","this$1","skipToEnd","skipTo","backUp","column","indentation","pattern","consume","caseInsensitive","cased","substr","hideFirstChars","inner","lookAhead","oracle","SavedContext","Context","maxLookAhead","nextLine","fromSaved","saved","save","copy","highlightLine","context","forceToEnd","st","modeGen","lineClasses","runMode","loop","o","overlay","overlays","i_end","opaque","styles","classes","bgClass","textClass","getLineStyles","updateFrontier","getContextBefore","resetState","maxHighlightLength","stateAfter","styleClasses","highlightFrontier","modeFrontier","precise","findStartLine","processLine","startAt","stream","callBlankLine","readToken","blankLine","token","Token","takeToken","asArray","tokens","extractLineClasses","output","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","minindent","minline","lim","indented","retreatFrontier","Line","estimateHeight","updateLine","estHeight","cleanUpLine","styleToClassCache","styleToClassCacheWithMode","interpretTokenStyle","cache","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","getOption","rest","addToken","buildToken","buildTokenBadBidi","allowFrontierUpdate","insertLineContent","maps","caches","lastChild","querySelector","defaultSpecialCharPlaceholder","title","startStyle","endStyle","css","displayText","special","specialChars","mustWrap","createDocumentFragment","lastIndex","txt$1","tabWidth","specialCharPlaceholder","fullStyle","trailingBefore","spaceBefore","buildCollapsedSpan","ignoreWidget","widget","needsContentAttribute","setUneditable","allText","nextChange","spanStyle","spanEndStyle","spanStartStyle","Infinity","foundBookmarks","endStyles","upto","tokenText","LineView","hidden","buildViewArray","nextPos","operationGroup","pushOperation","op","ops","ownsGroup","delayedCallbacks","fireCallbacksForOps","group","callbacks","cursorActivityCalled","finishOperation","endCb","orphanDelayedCallbacks","signalLater","list","fireOrphanDelayed","delayed","updateLineForChanges","dims","changes","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","updateLineBackground","background","wrap","insertBefore","getLineContent","ext","built","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutterWidth","alignable","nextSibling","insertLineWidgets","buildLineElement","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","width","wrapperWidth","coverGutter","paddingLeft","position","marginLeft","widgetHeight","parentStyle","clientWidth","eventInWidget","getAttribute","paddingTop","offsetTop","paddingVert","paddingH","getComputedStyle","currentStyle","data","parseInt","isNaN","scrollGap","displayWidth","displayHeight","clientHeight","ensureLineHeights","rect","wrapping","curWidth","heights","rects","getClientRects","bottom","mapFromLineView","updateExternalMeasurement","measureChar","bias","findViewForLine","findViewIndex","getDimensions","forceUpdate","hasHeights","prepared","varHeight","key","measureCharInner","bogus","rtop","rbottom","nullRect","nodeAndOffsetInLineMap","mStart","mEnd","coverStart","coverEnd","getUsefulRect","maybeUpdateRectForZooming","rSpan","charWidth","rbot","bot","singleCursorHeightPerLine","screen","logicalXDPI","deviceXDPI","scaleX","scaleY","logicalYDPI","deviceYDPI","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","pageScrollX","pageXOffset","documentElement","scrollLeft","pageScrollY","marginTop","pageYOffset","scrollTop","intoCoordSystem","includeWidgets","yOff","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","get","getBidi","invert","other","estimateCoords","PosWithInfo","outside","xRel","coordsChar","y","coordsCharInner","mergedPos","assign","beginLeft","prevDiff","prevPos","steps","ceil","prevPos$1","diff_change_per_step","box","measureText","textHeight","anchor","clientLeft","offsetLeft","compensateForHScroll","th","perLine","widgetsHeight","estimateLineHeights","est","posFromMouse","liberal","forRect","space","clientX","clientY","colDiff","round","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","sel","ranges","primIndex","empty","showCursorWhenSelecting","drawSelectionCursor","head","drawSelectionRange","cursor","cursorHeight","otherCursor","fragment","padding","leftSide","rightSide","add","drawForLine","fromArg","toArg","lineLen","leftPos","rightPos","tmp","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","focused","clearInterval","blinker","visibility","cursorBlinkRate","setInterval","ensureFocus","focus","onFocus","delayBlurEvent","delayingBlurEvent","onBlur","reset","receivedFocus","updateHeightsInViewport","prevBottom","updateWidgetHeight","visibleLines","viewport","ensure","ensureFrom","ensureTo","alignHorizontally","comp","gutterW","align","maybeUpdateLineNumberWidth","innerW","updateGutterSpace","maybeScrollWindow","doScroll","innerHeight","scrollNode","scrollIntoView","scrollPosIntoView","margin","limit","changed","endCoords","scrollPos","calculateScrollPos","startTop","startLeft","updateScrollTop","setScrollLeft","snapMargin","screentop","docBottom","atTop","atBottom","newTop","screenleft","screenw","tooWide","addToScrollTop","resolveScrollToPos","ensureCursorVisible","getCursor","scrollToPos","cursorScrollMargin","scrollToCoords","scrollToRange","scrollToCoordsRange","sPos","updateDisplaySimple","setScrollTop","startWorker","forceScroll","scrollHeight","scrollbars","isScroller","scrollWidth","measureForScrollbars","docH","viewHeight","viewWidth","barLeft","docHeight","NativeScrollbars","vert","horiz","checkedZeroWidth","minHeight","minWidth","update","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","w","pointerEvents","bar","delay","maybeDisable","elementFromPoint","clear","NullScrollbars","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","paddingBottom","borderBottom","coverGutterNextToScrollbar","scrollbarModel","initScrollbars","scrollbarStyle","axis","nextOpId","startOperation","viewChanged","updateInput","typing","changeObjs","selectionChanged","updateMaxLine","endOperation","endOperations","endOperation_R1","endOperation_W1","endOperation_R2","endOperation_W2","endOperation_finish","maybeClipScrollbars","mustUpdate","DisplayUpdate","updatedDisplay","updateDisplayIfNeeded","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","hasFocus","setDocumentHeight","postUpdateDisplay","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","operation","methodOp","docMethodOp","regChange","lendiff","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","adjustView","countDirtyView","dirty","time","highlight","highlightWorker","Date","workTime","changedLines","oldStyles","highlighted","oldCls","newCls","ischange","workDelay","force","visible","editorIsHidden","wrapperHeight","oldDisplayWidth","events","marginBottom","borderRightWidth","selectionSnapshot","active","anchorNode","extend","anchorOffset","focusNode","focusOffset","restoreSelection","snapshot","removeAllRanges","addRange","viewportMargin","different","toUpdate","selSnapshot","patchDisplay","updateNumbersFrom","container","rm","currentWheelTarget","updateNumber","updateGutters","specs","gElt","setGuttersForLineNumbers","wheelSamples","wheelPixelsPerUnit","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","delta","onScrollWheel","canScrollX","canScrollY","pixels","movedX","movedY","sample","Selection","equals","here","there","deepCopy","Range","somethingSelected","normalizeSelection","prim","sort","inv","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","computeReplacedSel","hint","oldPrev","newPrev","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","spansFor","linesFor","firstLine","lastText","lastSpans","nlines","insert","remove","added","added$1","added$2","linkedDocs","sharedHistOnly","propagate","skip","sharedHist","linked","rel","shared","attachDoc","setDirectionClass","directionChanged","History","startGen","done","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","pop","lastChangeEvent","hist","addChangeToHistory","selAfter","opId","history","historyEventDelay","pushSelectionToHistory","selectionEventCanBeMerged","addSelectionToHistory","clearRedo","dest","existing","removeClearedSpans","explicitlyCleared","getOldSpans","mergeOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","event","newChanges","extendRange","posBefore","extendSelection","setSelection","extendSelections","heads","newSel","replaceOneSelection","setSimpleSelection","filterSelectionChange","setSelectionReplaceHistory","setSelectionNoUndo","NaN","setSelectionInner","skipAtomicInSelection","reCheckSelection","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","cancel","makeChange","ignoreReadOnly","suppressEdits","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","antiChanges","filter","returned","v","shiftDoc","distance","removed","makeChangeSingleDocInEditor","recomputeMaxLength","checkWidthStart","changesHandler","changeHandler","replaceRange","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","copied","changeLine","handle","changeType","LeafChunk","removeInner","insertInner","iterN","BranchChunk","oldHeight","remaining","leaf","maybeSpill","me","spilled","sibling","myIndex","used","LineWidget","opt","adjustScrollWhenAboveVisible","oldH","addLineWidget","insertAt","aboveVisible","nextMarkerId","TextMarker","withOp","visual","side","dHeight","markText","markTextShared","replacedWith","addToHistory","curLine","clearOnEnter","clearHistory","SharedTextMarker","cloneNode","isParent","findSharedMarkers","findMarks","copySharedMarkers","mFrom","mTo","subMark","detachSharedMarkers","subMarker","nextDocId","Doc","lineSep","cleanGeneration","constructor","getValue","join","lineSeparator","setValue","getRange","getLineHandle","getLineNumber","getLineHandleVisualStart","lineCount","listSelections","setCursor","extendSelectionsBy","setSelections","addSelection","getSelections","replaceSelection","dup","replaceSelections","undo","redo","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","setGutterMarker","gutterID","clearGutter","lineInfo","addLineClass","where","removeLineClass","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","unlinkDoc","link","splitIds","iterLinkedDocs","getEditor","setDirection","eachLine","lastDrop","onDrop","clearDragCursor","files","dataTransfer","isReadOnly","FileReader","File","read","loadFile","file","allowDropFileTypes","reader","onload","readAsText","draggingText","text$1","getData","selected","onDragStart","setData","effectAllowed","setDragImage","img","src","_top","onDragOver","frag","dragCursor","forEachCodeMirror","getElementsByClassName","byClass","globalsRegistered","ensureGlobalHandlers","registerGlobalHandlers","resizeTimer","onResize","setSize","keyNames","fromCharCode","keyMap","basic","pcDefault","fallthrough","emacsy","macDefault","normalizeKeyName","alt","ctrl","cmd","mod","normalizeKeyMap","keymap","keyname","keys","lookupKey","getKeyMap","isModifierKey","keyCode","addModifierNames","noShift","altKey","metaKey","shiftKey","keyName","altGraphKey","deleteNearSelection","compute","kill","toKill","replaced","commands","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","goDocStart","goDocEnd","goLineStart","goLineStartSmart","lineStartSmart","goLineEnd","lineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","moveV","goLineDown","goPageUp","goPageDown","goCharLeft","moveH","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","deleteH","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentSelection","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","execCommand","transposeChars","newlineAndIndent","sels","indentLine","openLine","toggleOverwrite","firstNonWS","inWS","doHandleBinding","bound","dropShift","ensurePolled","prevShift","lookupKeyForEditor","keyMaps","extraKeys","stopSeq","dispatchKey","seq","keySeq","handleKeyBinding","motion","handleCharBinding","lastStoppedKey","onKeyDown","handled","showCrossHair","up","onKeyUp","onKeyPress","charCode","DOUBLECLICK_DELAY","PastClick","compare","lastClick","lastDoubleClick","clickRepeat","now","onMouseDown","supportsTouch","clickInGutter","repeat","selectingText","handleMappedButton","leftButtonDown","onContextMenu","configureMouse","option","unit","addNew","moveOnDrag","behavior","contained","dragDrop","leftButtonStartDrag","leftButtonSelect","moved","dragEnd","mouseMove","dragStart","e2","rangeForUnit","findWordAt","ourRange","ourIndex","startSel","lastPos","extendTo","startCol","posCol","oldRange","ranges$1","editorSize","counter","curCount","move","gutterEvent","prevent","mX","mY","lineBox","g","contextMenuInGutter","themeChanged","theme","Init","defaults","optionHandlers","defineOptions","deflt","notOnInit","defineOption","newBreaks","refresh","getInputField","spellcheck","guttersChanged","detach","attach","wrappingChanged","integer","blur","readOnlyChanged","dragDropChanged","resetPosition","getField","tabIndex","wasOn","funcs","dragFunctions","toggle","enter","over","leave","drop","inputStyles","inputStyle","pasteIncoming","cutIncoming","autofocus","registerEventHandlers","finishInit","initHooks","textRendering","word","touchFinished","prevTouch","finishTouch","isMouseLikeTouchEvent","touches","touch","radiusX","radiusY","farAway","pageX","pageY","inp","defineInitHook","how","aggressive","indent","curSpace","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","lastCopied","setLastCopied","newLastCopied","applyTextInput","inserted","deleted","paste","textLines","multiPaste","pasteLinesPerSelection","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","disableBrowserMagic","field","hiddenTextarea","border","addEditorMethods","helpers","setOption","getDoc","addKeyMap","removeKeyMap","addOverlay","modeSpec","removeOverlay","newRanges","getTokenAt","getLineTokens","getTokenTypeAt","getHelper","getHelpers","help","_global","getStateAfter","defaultTextHeight","defaultCharWidth","getViewport","addWidget","vspace","hspace","triggerOnKeyDown","triggerOnKeyPress","triggerOnKeyUp","triggerOnMouseDown","findPosH","amount","hitSide","rtlMoveVisually","findPosV","goalColumn","goals","headPos","startChar","check","scrollTo","getScrollInfo","interpret","swapDoc","getWrapperElement","getScrollerElement","getGutterElement","registerHelper","registerGlobalHelper","predicate","origDir","findNextLine","moveOnce","boundToLine","sawType","pageSize","moveAmount","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","composing","gracePeriod","readDOMTimeout","updateFromDOM","readFromDOMSoon","forceCompositionEnd","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","showMultipleSelections","curAnchor","domToPos","curFocus","bad","posToDOM","rangeCount","getRangeAt","rng","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","pollSelection","poll","pollInterval","isInGutter","pollContent","fromIndex","fromNode","toIndex","toNode","previousSibling","newText","domTextBetween","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","contentEditable","scan","badPos","closing","recognizeMarker","close","addText","walk","cmText","textContent","markerID","isBlock","nodeName","nodeValue","lineNode","locateNodeInLineView","textNode","topNode","curNode","dist","dist$1","TextareaInput","prevInput","pollingFast","textarea","fastPoll","prepareCopyCut","moveInputWithCursor","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","slowPoll","missed","same","resetSelectionOnContextMenu","oldCSS","oldWrapperCSS","wrapperBox","oldScrollY","scrollY","detectingSelectAll","prepareSelectAllHack","extval","rehide","mouseup","disabled","fromTextArea","tabindex","placeholder","realSubmit","form","leaveSubmitMethodAlone","submit","wrappedSubmit","getTextArea","toTextArea","addLegacyProps","cmpPos","dontDelegate","method","defineExtension","func","defineDocExtension","version","self","Clipboard","t","s","u","require","DOCUMENT_NODE_TYPE","Element","matches","proto","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","closest","element","selector","delegate","callback","useCapture","listenerFn","listener","destroy","delegateTarget","HTMLElement","SVGElement","nodeList","fn","is","listen","TypeError","listenNode","listenNodeList","listenSelector","forEach","selectedText","hasAttribute","setSelectionRange","removeAttribute","selectNodeContents","E","ctx","once","_","emit","evtArr","evts","liveEvents","clipboardAction","_select","_select2","_interopRequireDefault","__esModule","default","_typeof","Symbol","iterator","_classCallCheck","instance","Constructor","_createClass","defineProperties","descriptor","enumerable","configurable","writable","defineProperty","protoProps","staticProps","ClipboardAction","resolveOptions","initSelection","action","trigger","selectFake","selectTarget","_this","isRTL","removeFake","fakeHandlerCallback","fakeHandler","fakeElem","fontSize","yPosition","copyText","succeeded","err","handleResult","clearSelection","_action","_target","tinyEmitter","goodListener","clipboard","_clipboardAction","_tinyEmitter","_goodListener","_clipboardAction2","_tinyEmitter2","_goodListener2","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","setPrototypeOf","__proto__","_Emitter","getPrototypeOf","listenClick","defaultAction","defaultTarget","defaultText","_this2","onClick","currentTarget","getAttributeValue","isSupported","actions","support","queryCommandSupported","suffix","attribute","_native","_options","_construct","defaultOptions","carbonZoneKey","fallback","ignore","placement","prefix","targetClass","zone","jsonUrl","srv","getElementsByTagName","carbon","sanitize","ads","ad","pixel","timestamp","c","_native_go","json","selectedClass","querySelectorAll","selectedTarget","innerHTML","adElement","adInnerHtml","Event","bubbles","cancelable","eventPhase","timeStamp","getTime","propagationStopped","immediatePropagationStopped","stopImmediatePropagation","clone","EventDispatcher","_listeners","_captureListeners","removeAllEventListeners","hasEventListener","dispatchEvent","_dispatchEvent","willTrigger","listeners","scope","handleEvent","evt","eventObj","captureListeners","DOMUtils","$","query","_childQuery","queryAll","removeClass","_runOnNodeList","re","classList","names","toggleClass","curValue","hasClass","swapClass","oldClass","newClass","getEl","togglePanel","openEl","closedEl","open","el1","el2","isOpen","transition","then","template","strings","getCSSValue","el","getPropertyValue","nodelist","Utils","prepMenuContent","idMap","__next_id","kids","findIndex","JSON","parse","stringify","searchRank","searchTest","access","keywords","description","author","label","desc","weight","htmlSafe","shorten","unescSubstStr","SUBST_ESC_RE","SUBST_ESC_CHARS","getRegExp","regex","decomposeRegEx","delim","flags","isMac","getCtrlKey","performance","getUrlParams","params","url","location","decodeURIComponent","deferIds","defer","getHashCode","hash","getPatternURL","isLocal","hostname","getPatternURLStr","getForkName","num","Tooltip","contentEl","tipEl","hideF","_showT","handleBodyClick","curId","autohide","hide","show","toggleOn","showOn","toggleEl","elStyle","opacity","pad","wh","ww","innerWidth","marginRight","Server","solve","req","_getRequest","flavor","communitySearch","_processPatternList","load","patternId","_processPattern","fork","community","_prepPattern","rate","rating","userRating","delete","favorite","private","setAccess","multiFavorite","ids","patternIds","login","service","logout","verify","patterns","results","dateAdded","tool","parentId","userId","tests","postprocess","XMLHttpRequest","ServerPromise","setRequestHeader","timeout","useBeta","encodeURIComponent","console","log","send","_req","_postprocess","_load","_error","cf","ff","_loadF","catch","_data","finally","_errorF","_err","_finallyF","_complete","abort","response","responseText","success","error","message","CMUtils","opts","enforceMaxLength","enforceSingleLine","getCharIndexAt","winX","winY","getCharRect","maxLength","calcRangePos","startPos","endPos","Track","GA_ID","page","path","gtag","category","event_category","event_label","List","multi","addItem","els","dataset","selectedIndex","selectedEl","selectedItem","item","handleClick","removeItem","scrollEl","ExpressionLexer","profile","_profile","errors","captureGroups","namedGroups","_modes","capgroups","namedgroups","brgroups","branchResetGroups","groups","refs","charset","prv","unquantifiable","charTypes","closeIndex","lastIndexOf","parseFlag","parseParen","depth","capture","addCaptureGroup","parseSquareBracket","clss","possessive","related","parseQuant","parseBackSlash","parseChar","curGroup","curGroupNum","inGroupNum","validateRange","addJSWarnings","addError","matchRefs","warning","brgroup","getRef","relIndex","indexes","sign","refToOctal","config","reftooctalalways","char","mergeNext","parseEscChar","ANCHOR_TYPES","posixcharclass","posixCharClasses","isCond","behind","negative","condition","namedgroupalt","parseMode","namedref","parseRef","unicodecat","parseUnicode","escsequence","escunicodeub","escunicodeu","escunicodexb","ctrlcodeerr","escoctalo","escCharTypes","escCharCodes","badEscChars","escchar","escChars","isRef","not","unicodeScripts","unicodeCategories","unicodenegated","supModes","errmode","substring","proxy","ExpressionHighlighter","_activeMarks","_hoverMarks","_hoverToken","marks","draw","CSS_PREFIX","groupClasses","GROUP_CLASS_BY_TYPE","endToken","_calcTokenPos","hoverToken","_drawSelect","setnot","lookaround","ExpressionHover","editor","highlighter","isMouseDown","_handleMouseMove","_handleMouseOut","_handleMouseDown","app","tooltip","hover","reference","tipForToken","core","reduce","substTokens","docs","pcre","browser","expr","flag","testFlag","unicodeFlag","stickyFlag","dotallFlag","lookbehind","namedgroup","javascript","notunicodecat","unicodescript","notunicodescript","profiles","merge","js","p1","p2","Expression","lexer","_initUI","_onFlavorChange","expression","DEFAULT_EXPRESSION","_deferUpdate","validateFlagsStr","showFlags","flagsList","flagsEl","flagsBtn","toggleFlag","showFlavors","flavorEl","flavorBtn","editorEl","singleLine","_onEditorMouseDown","_onEditorChange","_onEditorKeyDown","errorEl","_onMouseError","_setInitialExpression","_initTooltips","_update","flavorData","flavorList","_onFlavorListChange","sidebar","goto","_onFlagListChange","innerText","supported","FLAGS","labels","FLAG_LABELS","tt","errs","getError","UID","_next","TextHighlighter","canvas","fill","stroke","lineSpacing","capWidth","lastBottom","lastRight","_matches","hoverMatch","_hoverMatch","selectedMatch","_selectedMatch","redraw","getContext","fillStyle","strokeStyle","lineWidth","emphasis","startRect","endRect","drawHighlight","lw","startCap","endCap","capW","globalAlpha","fillRect","strokeRect","TextHover","_x","_y","getMatchAt","tip","tipForMatch","Text","_initTestUI","_setResult","_handleThemeChange","testsEl","_tests","testList","_testMatches","_reselectTest","modeList","_handleModeChange","getMatchValue","inclusive","_result","getEmptyTest","resultEl","_mouseResult","modeListEl","textEl","_change","_updateSelected","detector","win","contentWindow","onresize","_startResize","_handleResize","_updateTests","_updateEmptyCount","_updateResult","_emptyCount","_showResult","parseFloat","toFixed","_errorText","_testFails","i0","i1","typeLabels","testItemEl","testListEl","_testItemTemplate","_handleTestChange","_addTest","typesEl","typesList","_handleTypesChange","fails","pass","_updateSelTest","_testMark","testEditor","typeBtn","_showTypes","delBtn","_deleteTest","nameFld","_handleTestNameChange","_updateTestHeader","edit","typeLbl","_selTest","_getTestEditor","fld","_handleTestTextChange","Explain","_bound_handleEvent","_handleEvent","cleanup","_divs","set0","set2","_handleMouseEvent","_insertApplied","divs","insertAdjacentElement","_handleHoverChange","_findDiv","showToken","Details","_addMatch","textVal","matchVal","_getMatchVal","extStr","groupTokens","tableEl","matchEl","_getRangeStr","inGroups","inGroup","ge","tr","Replace","SubstLexer","capGroups","subst","parseDollar","subst_bsgroup","_getRef","$_TYPES","numStr","substdecomposeref","Tools","_toolValues","DEFAULT_VALUES","_toolId","hasInput","toolList","_tool","_updateHighlights","headerEl","_handleHeaderClick","toolListEl","_handleListChange","_handleEditorChange","home","LinkRow","_pattern","showMessage","onclick","_onClick","copyBtn","Example","ex","example","_example","exp","CommunityContent","_rate","_favorite","linkRow","_share","_updateRating","_updateFavorite","_handleRate","share","_handleFavorite","Status","_showTooltip","_hideTooltip","distract","_show","_clearTimeout","_timeoutId","_hide","msg","_ttMsg","Account","_value","_updateUI","username","authenticated","showTooltip","tooltipEl","signinBtn","signinEl","signoutEl","_doSignout","signinList","_signinListChange","auth","_handleSignout","_cleanSignout","Share","_handleAppChange","_handleAppLoad","account","_handleAccountChange","_pushHistory","hNameFld","authorFld","descriptionFld","keywordsFld","mainEl","comEl","communityEl","hEl","hNewBtn","hForkBtn","hSaveBtn","_doSave","_doNew","_defaultName","_privateRow","_doPrivate","_privateStatus","_favoritesRow","_doFavorite","_favoritesStatus","_communityRow","_showCommunity","_deleteRow","_doDelete","_deleteStatus","_doSignin","_linkRow","saveEl","saveBtn","forkBtn","saveStatus","saveMessage","infoEl","_handleChange","comInputsEl","_doComSave","comSaveStatus","_comNameFld","_comAuthorFld","_comDescriptionFld","_comKeywordsFld","_handleKey","isChanged","_isChanged","isNew","_isNew","isOwned","_isOwned","_canFork","_canSave","_setSaveText","unsaved","replaceState","pushState","_handleSave","_handleSaveErr","isFork","_getErrMsg","newDoc","_handlePrivate","_handleErr","confirm","_handleDelete","status","_handleComSave","_handleComSaveErr","acc","rowEl","Sidebar","itemEl","openReq","_content","_prepContent","minList","prefs","_idMap","isNarrow","minimize","track","_minimized","idForToken","_isInReference","write","searchMode","curItem","selItem","menuList","_showContent","_resetFull","titleEl","_showEl","fullEl","communityListTemplate","_onSearchSubmit","_loadFavorites","back","menuListTemplate","searchEl","searchFld","_onSearchChange","searchBtn","listEl","lastId","_onDblClick","minEl","Community","_prepCheatsheet","_abortReq","ref","getContent","fillTags","_isIn","_searchReference","_searchFavorites","rank","search_term","_showListMsg","_showServerResults","_reqCleanup","Theme","urlTemplate","targetNode","_node","_dark","dark","themeBtn","_toggleTheme","_id","tmpl","href","Reference","_config","_flavor","_flavorChange","_injectEscChars","_misc","misc","searchStr","srch","kid","points","__searchPoints","errId","getChar","chr","NONPRINTING_CHARS","getQuant","getUniCat","UNICODE_CATEGORIES","getModes","getInsensitive","getDotAll","getLabel","getNodeForToken","getDesc","getVal","getLazy","U","getLazyFew","getPHPVersion","PHPVersion","getPCREVersion","PCREVersion","getEscChars","functs","safe","match2","pDocs","getDocs","pRef","getNode","more","_updateHide","isTokenSupported","chars","_getEscCharDocs","reference_content","groupopen","groupclose","setopen","rangerev","quanttarg","quantrev","esccharopen","esccharbad","unicodebad","posixcharclassbad","posixcharclassnoset","notsupported","fwdslash","servercomm","extraelse","unmatchedref","modebad","badname","dupname","branchreseterr","jsfuture","infinite","BrowserSolver","workerBlob","Blob","_workerObjectURL","URL","createObjectURL","_callback","_regex","_onRegExComplete","Worker","worker","onmessage","_startTime","terminate","postMessage","_getReplace","_getList","repl","trimR","ServerSolver","_serverPromise","_solve","_onLoad","_onError","Flavor","_browserSolver","_serverSolver","_buildSupportMap","solver","_supportMap","validateFlags","dupes","isFlagSupported","SUPPORT_MAP_PROPS","_addToSupportMap","esc","rev","RefCoverage","undoc","unused","all","subst_$group","subst_$bgroup","Prefs","_save","cookie","unescape","escape","RegExr","_migrateFavorites","_localInit","_savedHash","engine","tools","onbeforeunload","resetUnsaved","_initAds","_matchList","warn","getElementById","matchMedia","addListener","q","docEl","_modeChange","ls","localStorage","getItem","setItem","_handleResult","_processResult"],"mappings":";;;EAAA;EACA;;EAEA;EACA;EACA;EACA;EACA;;EAEC,WAAUA,MAAM,EAAEC,OAAO,EAAE;IAC1B,OAAOC,OAAO,KAAK,QAAQ,IAAI,OAAOC,MAAM,KAAK,WAAW,GAAGA,MAAM,CAACD,OAAO,GAAGD,OAAO,EAAE,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AAW,CAAC,CAAC;QACpFQ,cAAc,CAAC/6D,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC;OACpD,MAAM;QACN+6D,cAAc,CAACC,SAAS,GAAG,EAAE;;KAE9B,CAAC;EACH,CAAC;;EC9GD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AACA,EAAe,MAAMG,KAAK,CAAC;IAG1BtqB,WAAWA,CAACvhC,IAAI,EAAE8rD,OAAO,EAAEC,UAAU,EAAE;;;EAGxC;EACA;EACA;EACA;MACE,IAAI,CAAC/rD,IAAI,GAAGA,IAAI;;;EAGlB;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACzM,MAAM,GAAG,IAAI;;;EAGpB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACi2D,aAAa,GAAG,IAAI;;;EAG3B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACwC,UAAU,GAAG,CAAC;;;EAGrB;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACF,OAAO,GAAG,CAAC,CAACA,OAAO;;;EAG1B;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACC,UAAU,GAAG,CAAC,CAACA,UAAU;;;EAGhC;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACE,SAAS,GAAI,IAAIj7B,IAAI,EAAE,CAAEk7B,OAAO,EAAE;;;EAGzC;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACziD,gBAAgB,GAAG,KAAK;;;EAG/B;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAAC0iD,kBAAkB,GAAG,KA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AK,MAAM,EAAE;QAC3BrB,MAAM,CAAC82C,OAAO,IAAI92C,MAAM,CAAC82C,OAAO,CAAC2B,OAAO,CAAC,CAAC9yC,CAAC,EAAEjhB,CAAC,KAAGihB,CAAC,CAACygD,GAAG,GAAC1hE,CAAC,CAAC;;MAE1D,OAAOsb,MAAM;;EAEf;;EC3OA;EACA;EACA;AACA;EACA;EACA;EACA;EACA;AACA;EACA;EACA;EACA;EACA;AACA;EACA;EACA;EACA;EAOA,IAAIk0D,GAAG,GAAG,IAAI0gB,MAAM,EAAE;;;;;;;;"} \ No newline at end of file diff --git a/deploy/en/regexr.css b/deploy/en/regexr.css new file mode 100644 index 0000000..cec44eb --- /dev/null +++ b/deploy/en/regexr.css @@ -0,0 +1,2086 @@ +@charset "UTF-8"; +.CodeMirror { +font-family:monospace; +height:300px; +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!important; +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-rulers { +position:absolute; +left:0; +right:0; +top:-50px; +bottom:-20px; +overflow:hidden +} +.CodeMirror-ruler { +border-left:1px solid #ccc; +top:0; +bottom:0; +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-type,.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 { +color:#555 +} +.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-s-default .cm-error { +color:red +} +.cm-invalidchar { +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; +min-height:100%; +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 +} +.CodeMirror-gutter-background { +position:absolute; +top:0; +bottom:0; +z-index:4 +} +.CodeMirror-gutter-elt { +position:absolute; +cursor:default; +z-index:4 +} +.CodeMirror-gutter-wrapper ::selection { +background-color:transparent +} +.CodeMirror-gutter-wrapper ::-moz-selection { +background-color:transparent +} +.CodeMirror-lines { +cursor:text; +min-height:1px +} +.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; +-webkit-font-variant-ligatures:contextual; +font-variant-ligatures:contextual +} +.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-rtl pre { +direction:rtl +} +.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; +pointer-events:none +} +.CodeMirror-measure pre { +position:static +} +div.CodeMirror-cursors { +visibility:hidden; +position:relative; +z-index:3 +} +div.CodeMirror-dragcursors { +visibility:visible +} +.CodeMirror-focused div.CodeMirror-cursors { +visibility:visible +} +.CodeMirror-selected { +background:#d9d9d9 +} +.CodeMirror-focused .CodeMirror-selected { +background:#d7d4f0 +} +.CodeMirror-crosshair { +cursor:crosshair +} +.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection { +background:#d7d4f0 +} +.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 +} +.doc>section.text .tests .list li header,.doc>section>header,.sidebar>.min>.list>li:first-child { +display:flex; +align-items:center; +padding:0 1rem 0 1rem; +flex:0 2.5rem +} +.doc>section.text .tests .list li header h1,.doc>section>header h1,.sidebar>.min>.list>li:first-child h1 { +flex:1 +} +#cheatsheet table th,.community>header .icon,.container .header .settings,.doc>section.text .tests .list li header .icon.delete,.doc>section.tools>article .icon.help,.example svg.icon.load,.sidebar>.full .list .row,.sidebar>.full .list li,.sidebar>.full>header .icon,.sidebar>.min .list .row,.sidebar>.min .list li,.tooltip .list li,.tooltip header .help.icon,a { +transition:color .2s; +color:#d7dadc +} +#cheatsheet table th:not(.inactive),.community>header .icon:not(.inactive),.container .header .settings:not(.inactive),.doc>section.text .tests .list li header .icon.delete:not(.inactive),.doc>section.tools>article .icon.help:not(.inactive),.example svg.icon.load:not(.inactive),.sidebar>.full .list .row:not(.inactive),.sidebar>.full .list li:not(.inactive),.sidebar>.full>header .icon:not(.inactive),.sidebar>.min .list .row:not(.inactive),.sidebar>.min .list li:not(.inactive),.tooltip .list li:not(.inactive),.tooltip header .help.icon:not(.inactive),a:not(.inactive) { +cursor:pointer +} +#cheatsheet table th:not(.inactive):hover,.community>header .icon:not(.inactive):hover,.container .header .settings:not(.inactive):hover,.doc>section.text .tests .list li header .icon.delete:not(.inactive):hover,.doc>section.tools>article .icon.help:not(.inactive):hover,.example svg.icon.load:not(.inactive):hover,.sidebar>.full .list .row:not(.inactive):hover,.sidebar>.full .list li:not(.inactive):hover,.sidebar>.full>header .icon:not(.inactive):hover,.sidebar>.min .list .row:not(.inactive):hover,.sidebar>.min .list li:not(.inactive):hover,.tooltip .list li:not(.inactive):hover,.tooltip header .help.icon:not(.inactive):hover,a:not(.inactive):hover { +color:#e7e9ea +} +#cheatsheet table th:not(.inactive):hover svg.icon,.community>header .icon:not(.inactive):hover svg.icon,.container .header .settings:not(.inactive):hover svg.icon,.doc>section.text .tests .list li header .icon.delete:not(.inactive):hover svg.icon,.doc>section.tools>article .icon.help:not(.inactive):hover svg.icon,.example svg.icon.load:not(.inactive):hover svg.icon,.sidebar>.full .list .row:not(.inactive):hover svg.icon,.sidebar>.full .list li:not(.inactive):hover svg.icon,.sidebar>.full>header .icon:not(.inactive):hover svg.icon,.sidebar>.min .list .row:not(.inactive):hover svg.icon,.sidebar>.min .list li:not(.inactive):hover svg.icon,.tooltip .list li:not(.inactive):hover svg.icon,.tooltip header .help.icon:not(.inactive):hover svg.icon,a:not(.inactive):hover svg.icon { +color:currentColor +} +#cheatsheet table th svg.icon,.community>header .icon svg.icon,.container .header .settings svg.icon,.doc>section.text .tests .list li header .icon.delete svg.icon,.doc>section.tools>article .icon.help svg.icon,.example svg.icon.load svg.icon,.sidebar>.full .list .row svg.icon,.sidebar>.full .list li svg.icon,.sidebar>.full>header .icon svg.icon,.sidebar>.min .list .row svg.icon,.sidebar>.min .list li svg.icon,.tooltip .list li svg.icon,.tooltip header .help.icon svg.icon,a svg.icon { +transition:fill .2s +} +#tooltip .texthover i,.example code i { +background:#595f64; +color:#f0f1f2; +font-weight:400; +padding:0 .25em; +margin-left:.25em +} +.doc>section.tools>article .details span.hover,.doc>section.tools>article .details table tr.group:hover,.doc>section.tools>article .explain div.selected { +outline:solid 2px rgba(16,17,18,.3); +z-index:10 +} +.doc>section.tools>article .explain div.related { +outline:solid 1px rgba(16,17,18,.3); +z-index:9 +} +body,html { +margin:0; +width:100%; +height:100%; +min-height:540px; +min-width:500px; +font-family:"Roboto Condensed",sans-serif; +font-size:16px; +color:#f0f1f2; +-webkit-user-select:none; +user-select:none; +cursor:default +} +body>.container,html>.container { +height:100%; +display:flex; +flex-flow:column +} +body>.container>.app,html>.container>.app { +flex:1; +min-height:0; +display:flex; +align-items:stretch +} +::-webkit-scrollbar { +width:.5em; +height:.5em +} +::-webkit-scrollbar-track { +background:rgba(126,135,142,.25) +} +::-webkit-scrollbar-thumb { +background-color:#7e878e; +border-radius:.5em +} +.app .sidebar,.container .header,.tooltip { +-moz-osx-font-smoothing:grayscale; +-webkit-font-smoothing:antialiased +} +code,pre { +font-family:"Source Code Pro",monospace +} +pre { +margin:0 +} +a { +color:#70b0e0; +text-decoration:none +} +h1,h2 { +font-size:1rem; +font-weight:700; +margin:0 +} +.list { +display:flex; +flex-direction:column; +margin:0; +padding:0 +} +.list li { +display:block +} +hr { +border:0; +border-top:1px solid rgba(126,135,142,.25); +margin:.75em 0 1em 0 +} +span.match { +background:rgba(112,176,224,.5); +color:#101112 +} +span.error { +color:#d22; +font-weight:700 +} +span.error.warning { +color:#d22 +} +.anim-spin { +animation:1s linear infinite spin +} +@keyframes spin { +from { +transform:rotate(0) +} +to { +transform:rotate(360deg) +} + +} +#tooltip-signin ul.list li,.button,.buttonbar>*,.container .header ul.file li,.control,.segcontrol>*,input,textarea { +padding:.375rem .75rem; +font-size:.875rem; +border-radius:.125rem +} +input,textarea { +border-radius:0; +background:rgba(240,241,242,.05); +border:none; +border-bottom:solid 1px rgba(240,241,242,.05); +font-family:"Roboto Condensed",sans-serif; +font-size:1rem; +display:block; +width:100%; +box-sizing:border-box; +color:#f0f1f2; +resize:vertical +} +input::placeholder,textarea::placeholder { +color:currentColor; +opacity:.4 +} +input:focus,textarea:focus { +outline:0 +} +input:focus::placeholder,textarea:focus::placeholder { +opacity:.2 +} +.status { +display:inline-block; +color:rgba(240,241,242,.5) +} +.status .icon.success { +color:#70b0e0 +} +.status .icon.alert { +color:#d22 +} +svg.icon { +width:1.125em; +height:1.125em; +display:inline-block; +fill:currentColor; +vertical-align:middle +} +svg.icon.small { +width:.75em; +height:.75em +} +svg.icon.inline { +margin-top:-.25em +} +.control { +background:rgba(240,241,242,.2) +} +#tooltip-signin ul.list li,.button,.buttonbar>*,.container .header ul.file li,.segcontrol>* { +background:rgba(240,241,242,.35); +display:inline-block; +cursor:pointer; +transition:background-color .2s ease-out; +transition:opacity .2s ease-out; +box-shadow:0 2px 1px rgba(0,0,0,.1); +line-height:normal +} +#tooltip-signin ul.list li.default,.button.default,.buttonbar>.default,.container .header ul.file li.default,.segcontrol>.default { +font-weight:700; +background:#70b0e0; +color:#101112 +} +#tooltip-signin ul.list li.default:hover,.button.default:hover,.buttonbar>.default:hover,.container .header ul.file li.default:hover,.segcontrol>.default:hover { +background:#f0f1f2 +} +#tooltip-signin ul.list li.selected,#tooltip-signin ul.list li:hover,.button.selected,.button:hover,.buttonbar>.selected,.buttonbar>:hover,.container .header ul.file li.selected,.container .header ul.file li:hover,.segcontrol>.selected,.segcontrol>:hover { +background:rgba(240,241,242,.75) +} +#tooltip-signin ul.list li.selected>svg.icon.dropdown,#tooltip-signin ul.list li:hover>svg.icon.dropdown,.button.selected>svg.icon.dropdown,.button:hover>svg.icon.dropdown,.buttonbar>.selected>svg.icon.dropdown,.buttonbar>:hover>svg.icon.dropdown,.container .header ul.file li.selected>svg.icon.dropdown,.container .header ul.file li:hover>svg.icon.dropdown,.segcontrol>.selected>svg.icon.dropdown,.segcontrol>:hover>svg.icon.dropdown { +margin-top:.5em +} +#tooltip-signin ul.list li.disabled,.button.disabled,.buttonbar>.disabled,.container .header ul.file li.disabled,.segcontrol>.disabled { +opacity:.35; +cursor:default; +pointer-events:none +} +#tooltip-signin ul.list li>svg.icon,.button>svg.icon,.buttonbar>*>svg.icon,.container .header ul.file li>svg.icon,.segcontrol>*>svg.icon { +margin-top:-.125em +} +#tooltip-signin ul.list li>svg.icon+*,.button>svg.icon+*,.buttonbar>*>svg.icon+*,.container .header ul.file li>svg.icon+*,.segcontrol>*>svg.icon+* { +margin-left:.25em +} +#tooltip-signin ul.list li>svg.icon.dropdown,.button>svg.icon.dropdown,.buttonbar>*>svg.icon.dropdown,.container .header ul.file li>svg.icon.dropdown,.segcontrol>*>svg.icon.dropdown { +transition:margin-top .2s; +margin-top:.125em; +width:.375em; +height:.375em +} +.buttonbar,.controlbar,.segcontrol { +display:flex; +padding:0; +margin:0 +} +.buttonbar>*,.controlbar>*,.segcontrol>* { +margin-left:.25rem +} +.buttonbar>*,.segcontrol>* { +margin-left:1px; +border-radius:0; +display:inline-block +} +.buttonbar>:first-child,.segcontrol>:first-child { +border-radius:.125rem 0 0 .125rem +} +.buttonbar>:last-child,.segcontrol>:last-child { +border-radius:0 .125rem .125rem 0 +} +.segcontrol>:first-child { +border-radius:.125rem 0 0 .125rem +} +.segcontrol>:last-child { +border-radius:0 .125rem .125rem 0 +} +.tooltip { +display:flex; +flex-flow:column; +align-items:center; +z-index:10000; +position:absolute; +transform:translate(-50%,0); +transition-property:opacity,margin-top; +transition-duration:.2s +} +.tooltip>.content { +background:rgba(16,17,18,.85); +color:#f0f1f2; +padding:1rem; +border-radius:.125rem; +max-width:15rem; +box-shadow:0 3px 4px rgba(0,0,0,.25); +overflow-wrap:break-word; +-webkit-backdrop-filter:blur(3px); +backdrop-filter:blur(3px) +} +.tooltip>.content code { +font-weight:700 +} +.tooltip>.content>.warningtext { +display:block; +color:#b7bcc0; +margin-top:.5rem +} +.tooltip header { +display:flex +} +.tooltip header h1 { +flex:1 +} +.tooltip header .help.icon { +margin-left:1em; +color:#7e878e +} +.tooltip>.tip { +fill:rgba(16,17,18,.85); +width:8px; +height:8px; +transform:scale(1,-1) +} +.tooltip.flipped { +transform:translate(-50%,-100%) +} +.tooltip.flipped .tip { +transform:scale(1,1); +order:1 +} +.tooltip .list li { +color:#b7bcc0 +} +.tooltip .list li+li { +margin-top:.5em +} +.tooltip .list li .check.icon { +color:#585e63; +margin-right:.25em +} +.tooltip .list li.selected .check.icon { +color:#70b0e0 +} +.tooltip .list li:not(.inactive):hover { +color:#e7e9ea +} +.tooltip .list li em { +font-style:normal; +font-weight:700; +color:#f0f1f2; +padding:0 .15em; +background:rgba(126,135,142,.3); +border-radius:.125rem +} +.example svg.icon.load { +color:#595f64; +float:right; +display:inline-block; +padding-left:.5rem +} +.example code { +display:inline-block; +word-break:break-all; +width:100% +} +.container .header { +display:flex; +align-items:center; +justify-content:space-between; +background:#101112; +padding:0 1rem; +height:54px; +z-index:1000 +} +.container .header .logo { +flex:none; +font-size:1.125rem; +margin-top:.0625rem; +color:#70b0e0; +width:1.5em; +height:1.5em +} +.container .header .settings { +color:#70b0e0; +display:flex; +min-width:0; +max-width:20em +} +.container .header .settings .name { +margin:0 .25rem 0 .5rem; +text-overflow:ellipsis; +white-space:nowrap; +overflow:hidden +} +.container .header .settings .icon.share { +flex:none; +color:#595f64; +width:1em; +margin-right:.5rem +} +.container .header .signin.selected a { +color:#f0f1f2!important +} +.container .header ul { +padding:0; +white-space:nowrap +} +.container .header ul li { +display:inline-block +} +.container .header ul li:first-child { +margin-left:0 +} +.container .header ul.file { +text-align:right +} +.container .header ul.file li { +color:#b7bcc0; +background:#282b2d +} +.container .header ul.file li:hover { +background:#3a3e41 +} +.container .header ul.file li.save { +color:#70b0e0; +font-weight:700 +} +.container .header ul.file li.save .savekey { +font-size:.875em; +font-weight:400; +color:#7e878e +} +#tooltip-signin ul.list .container .header li.theme,.container .header #tooltip-signin ul.list li.theme,.container .header .button.theme,.container .header ul.file li.theme { +padding:.3755rem; +background:#282b2d +} +#tooltip-signin ul.list .container .header li.theme.selected .icon,.container .header #tooltip-signin ul.list li.theme.selected .icon,.container .header .button.theme.selected .icon,.container .header ul.file li.theme.selected .icon { +color:#70b0e0 +} +#tooltip-signin ul.list .container .header li.theme:hover,.container .header #tooltip-signin ul.list li.theme:hover,.container .header .button.theme:hover,.container .header ul.file li.theme:hover { +background:#3a3e41 +} +.container .header ul.etc { +flex:1; +text-align:right; +font-size:.875rem; +color:#595f64 +} +.container .header ul.etc li { +margin-left:1rem +} +#tooltip-signin ul.list li { +margin:.25rem 0; +padding:.625rem; +color:#e7e9ea; +opacity:.85 +} +#tooltip-signin ul.list li:hover { +opacity:1 +} +#tooltip-signin ul.list li[data-id=GitHub] { +background:#777!important +} +#tooltip-signin ul.list li[data-id=Google] { +background:#c94130!important +} +#tooltip-signin ul.list li>svg.icon { +margin-right:.625rem +} +#tooltip-signin .signout { +display:none +} +#tooltip-signin .signout .signoutbtn { +cursor:pointer; +color:#70b0e0; +font-weight:700 +} +#tooltip-signin .signout .signoutbtn:hover { +color:#f0f1f2 +} +#tooltip-signin.authenticated .signin { +display:none +} +#tooltip-signin.authenticated .signout { +display:block +} +#tooltip-signin .distract { +display:none; +color:#7e878e +} +#tooltip-signin .distract .distractor { +margin-right:.5rem +} +#tooltip-signin.wait .distract { +display:block +} +#tooltip-signin.wait .signin .list,#tooltip-signin.wait .signout .signoutbtn { +display:none +} +.doc { +flex:8 800px; +display:flex; +flex-flow:column +} +.doc>section { +background:#f0f1f2; +color:#585e63; +flex:1 1 0%; +min-height:0; +transition:flex .2s ease-out; +display:flex; +flex-direction:column +} +.doc>section>header { +color:#26292b; +background:#b7bcc0 +} +.doc>section>header>.max { +transition:transform .2s; +color:#7e878e; +margin-left:1rem; +cursor:pointer +} +.doc>section>header>.max:hover { +color:#f0f1f2 +} +.doc>section>article { +flex:1; +min-height:0 +} +.doc>section.closed { +flex:0 2.5rem +} +.doc>section.closed>header { +cursor:pointer +} +.doc>section.closed>header>:not(h1) { +opacity:.8 +} +.doc>section.closed>header>.max { +transform:rotate(45deg) +} +.doc.tests-mode section.tools { +display:none +} +.doc input,.doc textarea { +background:rgba(240,241,242,.05); +border-color:rgba(240,241,242,.05) +} +.doc .control { +background:rgba(240,241,242,.2) +} +#tooltip-signin ul.list .doc li,.container .header ul.file .doc li,.doc #tooltip-signin ul.list li,.doc .button,.doc .buttonbar>*,.doc .container .header ul.file li,.doc .segcontrol>* { +background:rgba(240,241,242,.35) +} +.doc .segcontrol>* { +color:#000; +font-weight:bold +} +#tooltip-signin ul.list .doc li.selected,#tooltip-signin ul.list .doc li:hover,.container .header ul.file .doc li.selected,.container .header ul.file .doc li:hover,.doc #tooltip-signin ul.list li.selected,.doc #tooltip-signin ul.list li:hover,.doc .button.selected,.doc .button:hover,.doc .buttonbar>.selected,.doc .buttonbar>:hover,.doc .container .header ul.file li.selected,.doc .container .header ul.file li:hover,.doc .segcontrol>.selected,.doc .segcontrol>:hover { +background:rgba(240,241,242,.75) +} +#tooltip-signin ul.list .doc li.default:hover,.container .header ul.file .doc li.default:hover,.doc #tooltip-signin ul.list li.default:hover,.doc .button.default:hover,.doc .buttonbar>.default:hover,.doc .container .header ul.file li.default:hover,.doc .segcontrol>.default:hover { +background:#f0f1f2 +} +.doc>section.expression { +flex:0 6.25rem +} +.doc>section.expression>header { +background:#70b0e0 +} +.doc>section.expression>.editor { +position:relative +} +.doc>section.expression>.editor .icon.alert { +display:none; +position:relative; +float:right; +margin:1.25rem; +color:#d22; +z-index:10; +-webkit-user-select:none; +user-select:none +} +.doc>section.expression>.editor>.CodeMirror { +padding:1rem 0 0 1rem; +font-weight:700 +} +.doc>section.expression>.editor.error>.icon.alert { +display:block +} +#tooltip-flags>.list li,#tooltip-flavor>.list li { +cursor:pointer; +color:#b7bcc0 +} +#tooltip-flags>.list li:hover,#tooltip-flavor>.list li:hover { +color:#f0f1f2 +} +#tooltip-flags>.list li+li,#tooltip-flavor>.list li+li { +margin-top:.5em +} +#tooltip-flags>.list li .check.icon,#tooltip-flavor>.list li .check.icon { +color:#585e63; +margin-right:.25em +} +#tooltip-flags>.list li.selected .check.icon,#tooltip-flavor>.list li.selected .check.icon { +color:#70b0e0 +} +#tooltip-flags>.list li em,#tooltip-flavor>.list li em { +font-style:normal; +font-weight:700; +color:#f0f1f2; +padding:0 .15em; +background:rgba(126,135,142,.3); +border-radius:.125rem +} +.exp-related { +border-bottom:solid 1px rgba(16,17,18,.3); +border-top:solid 1px rgba(16,17,18,.3); +margin-bottom:-1px; +margin-top:-1px +} +.exp-related-left { +border-left:solid 1px rgba(16,17,18,.3); +margin-left:-1px +} +.exp-related-right { +border-right:solid 1px rgba(16,17,18,.3); +margin-right:-1px +} +.exp-selected { +border-top:solid 2px rgba(16,17,18,.3); +border-bottom:solid 2px rgba(16,17,18,.3) +} +.exp-selected-left { +border-left:solid 2px rgba(16,17,18,.3); +margin-left:-2px +} +.exp-selected-right { +border-right:solid 2px rgba(16,17,18,.3); +margin-right:-2px +} +.exp-error { +border-bottom:solid 2px #d22 +} +.exp-warning { +border-bottom:dotted 2px #d22 +} +.exp-char { +color:#101112 +} +.exp-decorator { +color:#b7bcc0 +} +.exp-esc { +color:#c0c +} +.exp-lazy,.exp-possessive,.exp-quant { +color:#58f +} +.exp-alt { +color:#0a0 +} +.exp-anchor { +color:#840 +} +.exp-group,.exp-lookaround,.exp-ref { +color:#0a0 +} +.exp-charclass,.exp-set,.exp-subst { +color:#d70 +} +.exp-group-0 { +background:rgba(0,238,0,.11) +} +.exp-group-1 { +background:rgba(0,238,0,.22) +} +.exp-group-2 { +background:rgba(0,238,0,.33) +} +.exp-group-3 { +background:rgba(0,238,0,.44) +} +.exp-group-set { +background:rgba(255,238,0,.3) +} +.exp-comment { +color:#b7bcc0; +background:rgba(16,17,18,.05); +font-style:italic; +border-bottom:solid 3px #d7dadc +} +.exp-special { +color:#c0c +} +.doc>section.text article { +display:flex +} +.doc>section.text>header .modelist li { +font-size:1rem; +padding-top:.275rem; +padding-bottom:.275rem +} +.doc>section.text>header .modelist li:last-child::after { +transition:opacity 1s; +font-size:.625rem; +padding:.25em .5em; +display:inline-block; +position:absolute; +color:#f0f1f2; +background:#70b0e0; +letter-spacing:.075em; +transform:translate(.25rem,-.125rem); +content:"NEW" +} +#tooltip-signin ul.list .doc>section.text>header li.add,.container .header ul.file .doc>section.text>header li.add,.doc>section.text>header #tooltip-signin ul.list li.add,.doc>section.text>header .button.add,.doc>section.text>header .container .header ul.file li.add { +display:none!important +} +.doc>section.text>header .result { +font-weight:700 +} +.doc>section.text>header .result.error { +background:#d22; +color:#e7e9ea +} +.doc>section.text>header .result.error.warning { +background:#d22 +} +.doc>section.text>header .result.pass { +background:#0a0; +color:#e7e9ea +} +.doc>section.text>header .result.fail { +background:#d22; +color:#e7e9ea +} +.doc>section.text>header .result em { +font-style:normal; +font-weight:400; +opacity:.75 +} +.doc>section.text.tests-viewed>header .modelist li:last-child::after { +opacity:0 +} +.doc>section.text .editor { +position:relative; +box-sizing:border-box; +display:flex; +height:100%; +width:100%; +padding:1rem 0 1rem 1rem +} +.doc>section.text .editor>.pad { +box-sizing:border-box; +position:relative; +overflow:hidden; +width:100%; +flex:1 +} +.doc>section.text .editor>.pad>.CodeMirror { +color:#101112 +} +.doc>section.text .editor>.pad>iframe.resizedetector { +opacity:0; +z-index:-1000; +border:none; +width:100%; +height:100%; +position:absolute +} +.doc>section.text .editor>.pad>canvas.highlights { +transition:opacity .2s; +position:absolute +} +.doc>section.text .tests { +display:none; +width:100%; +background:#d7dadc; +padding:1rem; +box-sizing:border-box; +overflow:auto +} +.doc>section.text .tests .default { +transition:opacity 1s; +padding:1rem .5rem; +color:#585e63 +} +.doc>section.text .tests .list:empty~.default { +opacity:1 +} +.doc>section.text .tests.tests-added .default { +opacity:0 +} +#tooltip-signin ul.list .doc>section.text .tests li.add,.container .header ul.file .doc>section.text .tests li.add,.doc>section.text .tests #tooltip-signin ul.list li.add,.doc>section.text .tests .add.button,.doc>section.text .tests .container .header ul.file li.add { +box-sizing:border-box; +width:100%; +box-shadow:none; +opacity:.5; +background:rgba(183,188,192,.75); +color:#101112; +padding:.75rem .625rem; +margin-top:.125rem; +font-weight:700; +border-radius:.125rem +} +#tooltip-signin ul.list .doc>section.text .tests li.add:hover,.container .header ul.file .doc>section.text .tests li.add:hover,.doc>section.text .tests #tooltip-signin ul.list li.add:hover,.doc>section.text .tests .add.button:hover,.doc>section.text .tests .container .header ul.file li.add:hover { +opacity:1 +} +.doc>section.text .tests .list li { +background:#e7e9ea; +box-shadow:0 1px 2px rgba(0,0,0,.1); +transition:margin .1s linear; +margin:.125rem 0; +display:inline-block; +width:100% +} +.doc>section.text .tests .list li:first-child { +margin-top:0 +} +.doc>section.text .tests .list li:hover { +outline:solid 2px rgba(16,17,18,.3) +} +.doc>section.text .tests .list li header { +padding:.5rem .75rem +} +.doc>section.text .tests .list li header input.name { +color:#383b3f; +font-weight:700; +padding:0; +margin:0 .5rem; +background:0 0; +border:none +} +.doc>section.text .tests .list li header .icon.delete { +color:#b7bcc0 +} +.doc>section.text .tests .list li header .icon.delete:hover { +color:#d22!important +} +.doc>section.text .tests .list li header .icon.fail { +display:none; +color:#d22 +} +.doc>section.text .tests .list li header .icon.pass { +color:#0a0 +} +.doc>section.text .tests .list li header .type { +background:0 0; +text-transform:uppercase; +font-size:.75em; +color:#b7bcc0; +font-weight:700; +box-shadow:none +} +.doc>section.text .tests .list li article { +border-top:solid 1px #d7dadc; +padding:.5rem 0 .5rem .75rem; +display:none; +height:6em; +align-items:stretch +} +.doc>section.text .tests .list li article .bar { +background:#0a0; +width:0; +outline:solid 1px #0a0; +margin:.25rem .875rem .25rem .375rem +} +.doc>section.text .tests .list li article .editor { +padding:0 +} +.doc>section.text .tests .list li:not(.selected) { +cursor:pointer +} +.doc>section.text .tests .list li:not(.selected) .type .icon.dropdown { +opacity:0 +} +.doc>section.text .tests .list li:not(.selected) * { +pointer-events:none +} +.doc>section.text .tests .list li.selected { +outline:solid 2px rgba(16,17,18,.3); +background:#f0f1f2; +box-shadow:0 2px 3px rgba(0,0,0,.25); +margin:.75rem 0 +} +.doc>section.text .tests .list li.selected:first-child { +margin-top:0 +} +.doc>section.text .tests .list li.selected article { +display:flex +} +.doc>section.text .tests .list li.selected .type { +color:#585e63 +} +.doc>section.text .tests .list li.selected .type:hover { +color:#26292b +} +.doc>section.text .tests .list li.fail .icon.fail { +display:block +} +.doc>section.text .tests .list li.fail .icon.pass { +display:none +} +.doc>section.text .tests .list li.fail .bar { +outline:solid 1px #d22 +} +#tooltip-signin ul.list .doc.tests-mode>section.text>header li.add,.container .header ul.file .doc.tests-mode>section.text>header li.add,.doc.tests-mode>section.text>header #tooltip-signin ul.list li.add,.doc.tests-mode>section.text>header .button.add,.doc.tests-mode>section.text>header .container .header ul.file li.add { +display:inline-block +} +.doc.tests-mode>section.text>article>.editor { +display:none +} +.doc.tests-mode>section.text .tests { +display:block +} +#tooltip .texthover .more { +display:inline-block; +color:#b7bcc0; +font-style:italic; +margin-top:.75rem +} +.doc>section.tools>article { +display:flex; +flex-direction:column; +background:#e7e9ea +} +.doc>section.tools>article .icon.help { +position:absolute; +right:.25rem; +transform:translate(0,-50%) translate(0,1.875rem); +padding:1rem; +color:rgba(16,17,18,.25); +z-index:10 +} +.doc>section.tools>article .icon.help:hover { +color:#26292b!important +} +.doc>section.tools>article .inputtool { +display:none; +flex-direction:column; +flex:1 +} +.doc>section.tools>article .inputtool .editor { +position:relative; +flex:0 3.75rem; +background:#f0f1f2; +border-bottom:solid 1px #d7dadc +} +.doc>section.tools>article .inputtool .editor>.CodeMirror { +padding:1rem 0 0 1rem; +height:100%; +font-weight:700 +} +.doc>section.tools>article .inputtool .result { +flex:1 +} +.doc>section.tools>article .inputtool .result textarea { +box-sizing:border-box; +padding:1rem 0 1rem 1rem; +resize:none; +display:block; +border:0; +background:0 0; +width:100%; +height:100%; +margin:0; +font-family:"Source Code Pro",monospace; +font-size:16px; +color:#101112 +} +.doc>section.tools>article .inputtool .result textarea:focus { +outline:0 +} +.doc>section.tools>article .content { +flex:1 1 0%; +min-height:0; +overflow-y:auto; +display:block; +padding:1rem +} +.doc>section.tools>article.showinput .inputtool { +display:flex +} +.doc>section.tools>article.showinput .content { +display:none +} +.doc>section.tools>article .explain>.desc { +color:#7e878e; +display:block; +padding:.5rem +} +.doc>section.tools>article .explain div { +padding:.5em 1em .5em 2.5em; +margin-top:.75em; +border:solid 1px rgba(183,188,192,.5); +border-left:solid .25em rgba(183,188,192,.5); +background:#f0f1f2; +cursor:pointer +} +.doc>section.tools>article .explain div.applied { +margin-left:1em; +margin-top:0; +border:none; +background:rgba(183,188,192,.3) +} +.doc>section.tools>article .explain div.applied+div.applied { +margin-top:1px; +margin-left:2em +} +.doc>section.tools>article .explain div.error { +background:#edd2d3; +border-color:#d22 +} +.doc>section.tools>article .explain div.error .error-title { +font-weight:700 +} +.doc>section.tools>article .explain div.error .warningtext { +color:#7e878e; +margin-left:.5rem +} +.doc>section.tools>article .explain code { +font-weight:700 +} +.doc>section.tools>article .explain code.token { +display:inline-block; +min-width:1.25em; +margin:-1px .5em 0 -1.75em; +float:left +} +.doc>section.tools>article .explain div.close { +margin:0; +padding:0; +border:none; +background:0 0 +} +.doc>section.tools>article .explain .exp-group-0,.doc>section.tools>article .explain .exp-group-1,.doc>section.tools>article .explain .exp-group-2,.doc>section.tools>article .explain .exp-group-3 { +border-color:rgba(0,170,0,.25) +} +.doc>section.tools>article .explain .exp-group-0 { +background:#ddf1df +} +.doc>section.tools>article .explain .exp-group-1 { +background:#d1f1d3 +} +.doc>section.tools>article .explain .exp-group-2 { +background:#c5f0c6 +} +.doc>section.tools>article .explain .exp-group-3 { +background:#b9f0ba +} +.doc>section.tools>article .explain .exp-group-4 { +background:#383b3f; +color:#f0f1f2; +padding:1rem +} +.doc>section.tools>article .explain .exp-group-set { +background:#f4f0b6; +border-color:rgba(221,119,0,.25) +} +.doc>section.tools>article .details>div.desc { +padding:.5rem; +color:#7e878e; +margin-bottom:.5em +} +.doc>section.tools>article .details>div.desc code { +color:#585e63; +font-weight:700 +} +.doc>section.tools>article .details table { +font-family:"Source Code Pro",monospace; +width:100%; +border-spacing:0; +border:0 +} +.doc>section.tools>article .details table tr:nth-child(odd) td { +background:#e1e3e4 +} +.doc>section.tools>article .details table tr.match td { +background:#d7dadc; +border-bottom:1px dotted #b7bcc0 +} +.doc>section.tools>article .details table td { +padding:.5rem 1rem; +vertical-align:top +} +.doc>section.tools>article .details table td:first-child { +font-weight:700; +white-space:nowrap; +padding-right:0 +} +.doc>section.tools>article .details table td:nth-child(2) { +color:#7e878e; +white-space:nowrap; +border-right:1px dotted #b7bcc0 +} +.doc>section.tools>article .details table td:nth-child(3) { +white-space:pre-wrap; +width:100%; +color:#101112; +-webkit-user-select:text; +user-select:text; +-webkit-user-select:contain; +user-select:contain +} +.doc>section.tools>article .details table td:nth-child(3) em { +color:#7e878e +} +.doc>section.tools>article .details .group-1 { +background:hsla(60,100%,50%,.5) +} +.doc>section.tools>article .details .group-2 { +background:hsla(120,100%,50%,.5) +} +.doc>section.tools>article .details .group-3 { +background:hsla(230,100%,70%,.5) +} +.doc>section.tools>article .details .group-4 { +background:hsla(280,100%,60%,.5) +} +.doc>section.tools>article .details .group-5 { +background:hsla(350,100%,60%,.5) +} +.doc>section.tools>article .details .group-0 { +background:hsla(30,100%,50%,.5) +} +.doc>section.tools>article .details .group-0,.doc>section.tools>article .details .group-1,.doc>section.tools>article .details .group-2,.doc>section.tools>article .details .group-3,.doc>section.tools>article .details .group-4,.doc>section.tools>article .details .group-5 { +outline:.5px solid rgba(16,17,18,.25) +} +.sidebar>.full .list .row.active:hover,.sidebar>.full .list li.active:hover,.sidebar>.min .list .row.active:hover,.sidebar>.min .list li.active:hover { +color:#f0f1f2 +} +.sidebar>.full .list .row.active>.icon.check,.sidebar>.full .list .row.active>.icon:first-child,.sidebar>.full .list li.active>.icon.check,.sidebar>.full .list li.active>.icon:first-child,.sidebar>.min .list .row.active>.icon.check,.sidebar>.min .list .row.active>.icon:first-child,.sidebar>.min .list li.active>.icon.check,.sidebar>.min .list li.active>.icon:first-child { +color:#70b0e0 +} +.sidebar { +flex:1 0 350px; +width:350px; +transition:flex .2s ease-out; +background:#282b2d; +display:flex; +flex-direction:column; +color:#b7bcc0; +border-right:1px solid #3a3e41; +box-shadow:1px 2px 8px rgba(0,0,0,.45); +z-index:100 +} +.sidebar>.blocker { +display:none +} +.sidebar .list>li,.sidebar .row { +display:flex; +flex:0 0 auto; +padding:.5rem; +align-items:center; +justify-content:center; +border-bottom:1px solid rgba(240,241,242,.06); +transition:background .2s; +color:#b7bcc0 +} +.sidebar .list>li>*,.sidebar .row>* { +margin:0 .5rem +} +.sidebar .list>li .label,.sidebar .list>li input,.sidebar .row .label,.sidebar .row input { +flex:1 +} +.sidebar .list>li .icon,.sidebar .row .icon { +color:#595f64 +} +.sidebar header.row { +flex:0 0 2.5rem; +padding:0 +} +.sidebar header.row .backrow { +display:flex; +flex:1 0 auto; +align-items:center; +cursor:pointer; +margin:0; +padding:.5rem 0 +} +.sidebar header.row .backrow .icon { +flex:0 0 auto; +margin:0 1rem +} +.sidebar header.row .backrow:hover { +color:#f0f1f2 +} +.sidebar header.row .backrow:hover .icon { +color:currentColor +} +.sidebar header.row .close.icon { +padding:.75rem 1rem; +margin:0 +} +.sidebar code { +color:#f0f1f2 +} +.sidebar.closed { +flex:0 50px +} +.sidebar>.full .list,.sidebar>.min .list { +flex:1 1 0%; +display:flex; +align-items:stretch; +overflow-y:auto; +background:#3a3e41; +border-bottom:2px solid #3a3e41 +} +.sidebar>.full .list .row,.sidebar>.full .list li,.sidebar>.min .list .row,.sidebar>.min .list li { +color:#b7bcc0 +} +.sidebar>.full .list .row:hover:not(.inactive),.sidebar>.full .list li:hover:not(.inactive),.sidebar>.min .list .row:hover:not(.inactive),.sidebar>.min .list li:hover:not(.inactive) { +background:#4a4f53 +} +.sidebar>.full .list .row:hover:not(.inactive) .icon,.sidebar>.full .list .row:hover:not(.inactive) .rating,.sidebar>.full .list .row:hover:not(.inactive) .token,.sidebar>.full .list li:hover:not(.inactive) .icon,.sidebar>.full .list li:hover:not(.inactive) .rating,.sidebar>.full .list li:hover:not(.inactive) .token,.sidebar>.min .list .row:hover:not(.inactive) .icon,.sidebar>.min .list .row:hover:not(.inactive) .rating,.sidebar>.min .list .row:hover:not(.inactive) .token,.sidebar>.min .list li:hover:not(.inactive) .icon,.sidebar>.min .list li:hover:not(.inactive) .rating,.sidebar>.min .list li:hover:not(.inactive) .token { +color:currentColor +} +.sidebar>.full .list .row.selected,.sidebar>.full .list li.selected,.sidebar>.min .list .row.selected,.sidebar>.min .list li.selected { +background:#595f64; +color:#d7dadc +} +.sidebar>.full .list .row.selected .icon,.sidebar>.full .list .row.selected .rating,.sidebar>.full .list .row.selected .token,.sidebar>.full .list li.selected .icon,.sidebar>.full .list li.selected .rating,.sidebar>.full .list li.selected .token,.sidebar>.min .list .row.selected .icon,.sidebar>.min .list .row.selected .rating,.sidebar>.min .list .row.selected .token,.sidebar>.min .list li.selected .icon,.sidebar>.min .list li.selected .rating,.sidebar>.min .list li.selected .token { +color:currentColor +} +.sidebar>.full .list .row.selected:hover,.sidebar>.full .list li.selected:hover,.sidebar>.min .list .row.selected:hover,.sidebar>.min .list li.selected:hover { +background:#595f64; +color:#f0f1f2 +} +.sidebar>.full .list .row.disabled,.sidebar>.full .list li.disabled,.sidebar>.min .list .row.disabled,.sidebar>.min .list li.disabled { +pointer-events:none; +opacity:.35 +} +.sidebar>.full .list .row.link:not(.disabled),.sidebar>.full .list li.link:not(.disabled),.sidebar>.min .list .row.link:not(.disabled),.sidebar>.min .list li.link:not(.disabled) { +overflow:hidden +} +.sidebar>.full .list .row.link:not(.disabled) .url,.sidebar>.full .list li.link:not(.disabled) .url,.sidebar>.min .list .row.link:not(.disabled) .url,.sidebar>.min .list li.link:not(.disabled) .url { +color:#70b0e0; +margin:0 +} +.sidebar>.full .list .row.link:not(.disabled):hover,.sidebar>.full .list li.link:not(.disabled):hover,.sidebar>.min .list .row.link:not(.disabled):hover,.sidebar>.min .list li.link:not(.disabled):hover { +color:#f0f1f2 +} +.sidebar>.full .list .row.link:not(.disabled):hover .url,.sidebar>.full .list li.link:not(.disabled):hover .url,.sidebar>.min .list .row.link:not(.disabled):hover .url,.sidebar>.min .list li.link:not(.disabled):hover .url { +color:#f0f1f2 +} +.sidebar>.full .list .row.link:not(.disabled) .icon.copy,.sidebar>.full .list li.link:not(.disabled) .icon.copy,.sidebar>.min .list .row.link:not(.disabled) .icon.copy,.sidebar>.min .list li.link:not(.disabled) .icon.copy { +padding:1rem; +margin:-1rem -.5rem; +color:#595f64 +} +.sidebar>.full .list .row.link:not(.disabled) .icon.copy:hover,.sidebar>.full .list li.link:not(.disabled) .icon.copy:hover,.sidebar>.min .list .row.link:not(.disabled) .icon.copy:hover,.sidebar>.min .list li.link:not(.disabled) .icon.copy:hover { +color:#f0f1f2 +} +.sidebar>.full .list .row.loading,.sidebar>.full .list li.loading,.sidebar>.min .list .row.loading,.sidebar>.min .list li.loading { +padding:1rem; +display:block; +border:none; +color:#7e878e; +pointer-events:none +} +.sidebar>.full .list .row .token,.sidebar>.full .list li .token,.sidebar>.min .list .row .token,.sidebar>.min .list li .token { +color:#7e878e; +font-family:"Source Code Pro",monospace; +font-weight:700 +} +.sidebar>.full .list .row .rating,.sidebar>.full .list li .rating,.sidebar>.min .list .row .rating,.sidebar>.min .list li .rating { +display:flex; +align-items:center; +color:#7e878e; +font-size:.875em +} +.sidebar>.full .list .row .rating .favorites.icon,.sidebar>.full .list li .rating .favorites.icon,.sidebar>.min .list .row .rating .favorites.icon,.sidebar>.min .list li .rating .favorites.icon { +color:#70b0e0; +padding:0 .25rem +} +.sidebar>.min { +display:none; +background:#3a3e41 +} +.sidebar>.min>.list>li:first-child { +background:#282b2d; +padding:0 +} +.sidebar>.full { +display:flex; +flex-direction:column; +flex:1; +min-height:0 +} +.sidebar>.full.no-search>.search { +display:none +} +.sidebar>.full.no-list>.list { +display:none +} +.sidebar>.full>header h1 { +color:#f0f1f2 +} +.sidebar>.full>header .icon { +color:#595f64 +} +.sidebar>.full>.search { +padding:0 .5rem +} +.sidebar>.full>.search input { +background:0 0; +padding:0 +} +.sidebar>.full>.search input:focus { +border-bottom:1px dotted #3a3e41; +margin-bottom:-1px +} +.sidebar>.full>.search svg.icon { +width:1em; +height:1em; +margin-right:.375em +} +.sidebar>.full>.search svg.icon.search:hover { +color:#f0f1f2; +cursor:pointer +} +.sidebar>.full>.search svg.icon.distractor { +display:none +} +.sidebar>.full>.search.wait svg.icon.search { +display:none +} +.sidebar>.full>.search.wait svg.icon.distractor { +display:block +} +.sidebar>.full>.content { +flex:1 1 0%; +overflow-y:auto; +overflow-x:hidden; +padding:1rem; +-webkit-user-select:text; +user-select:text; +overflow-wrap:break-word; +border-top:2px solid #282b2d; +line-height:1.4em +} +.sidebar>.full>.content h1 { +margin-top:1.5em; +color:#f0f1f2 +} +.sidebar>.full>.content code em { +font-style:normal; +background:rgba(112,176,224,.5); +color:#f0f1f2; +margin-right:1px +} +.sidebar>.full>.content b { +color:#d7dadc +} +.sidebar>.full>.content ul { +padding-left:1.5em; +margin-bottom:0 +} +.sidebar>.full>.hello { +flex:0 0 0; +padding:0; +border:.25rem solid #101112; +background:#101112 +} +.sidebar>.full>.hello .noad { +padding:.75rem; +color:#7e878e +} +.sidebar>.full>.hello .noad b { +color:#b7bcc0 +} +#cheatsheet table { +width:100% +} +#cheatsheet table th { +text-align:left; +background:#3a3e41; +padding:.25rem .5rem; +color:#70b0e0 +} +#cheatsheet table tr+tr>th { +border-top:.5rem solid #282b2d +} +#cheatsheet table td { +padding:0 +} +#cheatsheet table td:first-child { +font-family:"Source Code Pro",monospace +} +#cheatsheet table a { +color:#f0f1f2 +} +#cheatsheet table a+a { +margin-left:.375em +} +.community>header { +background:#101112; +padding:1rem; +margin:-1rem; +margin-bottom:.5rem; +display:flex; +justify-content:space-between +} +.community>header .icon { +color:#595f64 +} +.community>header .icon.selected:not(:hover) { +color:#70b0e0 +} +.community>header>.name { +color:#f0f1f2; +font-weight:700; +overflow:hidden; +display:block; +white-space:nowrap; +text-overflow:ellipsis +} +.community>header>div { +display:flex +} +.community>header>div .favorites { +margin:0 1rem +} +.community .row.rate .icon.thumbdown,.community .row.rate .icon.thumbup { +cursor:pointer +} +.community .row.rate .icon.thumbdown.selected:hover,.community .row.rate .icon.thumbdown:hover,.community .row.rate .icon.thumbup.selected:hover,.community .row.rate .icon.thumbup:hover { +color:#f0f1f2 +} +.community .row.rate .icon.thumbdown.selected,.community .row.rate .icon.thumbup.selected { +color:#70b0e0 +} +.community .row.rate .icon.thumbdown { +transform:translate(0,.125em) scale(1,-1) +} +.community>.author { +margin-top:.125em; +color:#7e878e +} +.community .actions.list { +background:0; +margin:-.5rem -1rem 0 -1rem +} +.community>.desc { +margin-top:1rem +} +#share_community,#share_main { +margin:-1rem +} +#share_community .list,#share_main .list { +background:0 0; +border:none +} +#share_community .inputs input,#share_community .inputs textarea,#share_main .inputs input,#share_main .inputs textarea { +color:#f0f1f2; +margin:2px 0 +} +#share_community #tooltip-signin ul.list li,#share_community .button,#share_community .container .header ul.file li,#share_main #tooltip-signin ul.list li,#share_main .button,#share_main .container .header ul.file li,#tooltip-signin ul.list #share_community li,#tooltip-signin ul.list #share_main li,.container .header ul.file #share_community li,.container .header ul.file #share_main li { +padding-left:2rem; +padding-right:2rem +} +#share_community .buttons.wait #tooltip-signin ul.list li,#share_community .buttons.wait .button,#share_community .buttons.wait .container .header ul.file li,#share_main .buttons.wait #tooltip-signin ul.list li,#share_main .buttons.wait .button,#share_main .buttons.wait .container .header ul.file li,#tooltip-signin ul.list #share_community .buttons.wait li,#tooltip-signin ul.list #share_main .buttons.wait li,.container .header ul.file #share_community .buttons.wait li,.container .header ul.file #share_main .buttons.wait li { +opacity:.35; +pointer-events:none +} +#share_community .status,#share_main .status { +margin-left:.5rem +} +#share_main .signin.row .signout { +display:none +} +#share_main .signin.row.authenticated { +display:none +} +#share_main .row:not(.active) .icon.check { +display:none +} +#share_main .delete.row:hover { +background:rgba(221,34,34,.6) +} +#share_main>.info { +padding:1rem; +margin-bottom:.5rem; +border-bottom:solid 1px #3a3e41 +} +#share_main>.info>.row { +padding:0 0 .5rem 0; +border:0; +color:#b7bcc0; +align-items:flex-start +} +#share_main>.info>.row svg.icon { +color:currentColor; +margin:0 +} +#share_main>.save { +flex-direction:column; +align-items:flex-start; +padding:1.25rem .5rem; +margin-bottom:.5rem; +background:#3a3e41; +border:0; +box-shadow:-3px 3px 6px rgba(0,0,0,.1) +} +#share_main>.save .message { +color:#f0f1f2 +} +#share_main>.save .buttons { +padding:.5rem 0 0 0; +border:0; +color:#f0f1f2 +} +#share_main>.save .buttons #tooltip-signin ul.list li,#share_main>.save .buttons .button,#share_main>.save .buttons .container .header ul.file li,#tooltip-signin ul.list #share_main>.save .buttons li,.container .header ul.file #share_main>.save .buttons li { +margin:0 .5rem 0 0 +} +#share_community { +margin:0 .5rem +} +#share_community>.buttons { +justify-content:flex-end; +color:#f0f1f2; +border:none +} +#share_community .buttons,#share_community .inputs { +margin:1rem 0 +} +.native-js { +transition:all .25s ease-in-out; +opacity:0; +position:absolute; +top:0 +} +.native-js[data-state=visible] { +position:static; +opacity:1 +} +.native-js[data-state=visible]+.noad { +display:none +} +.native-img { +margin-right:.75rem; +max-height:40px; +max-width:27%; +border-radius:3px +} +.native-flex { +display:flex; +padding:.75rem; +text-decoration:none; +flex-flow:row nowrap; +justify-content:space-between; +align-items:center +} +.native-main { +display:flex; +flex-flow:row nowrap; +align-items:center +} +.native-details { +display:flex; +font-size:12px; +position:relative; +max-height:5em; +flex-flow:column +} +.native-company { +margin-bottom:4px; +text-transform:uppercase; +letter-spacing:1px; +font-weight:700; +font-size:11px +} +.native-desc { +letter-spacing:1px; +font-weight:300; +line-height:1.3em; +text-overflow:ellipsis; +max-height:5em; +overflow:hidden; +position:relative +} +#carbonads { +display:block; +overflow:hidden; +background-color:#101112; +font-size:13px; +line-height:1.5 +} +#carbonads a { +color:inherit; +text-decoration:none +} +#carbonads a:hover { +color:inherit +} +#carbonads span { +position:relative; +display:block; +overflow:hidden +} +.carbon-img { +display:block; +float:left; +margin:0; +line-height:1 +} +.carbon-img img { +display:block +} +.carbon-text { +display:block; +float:left; +padding:8px 1em; +max-width:calc(100% - 130px - 2em); +text-align:left; +letter-spacing:.5px +} +.carbon-poweredby { +position:absolute; +right:0; +bottom:0; +left:130px; +display:block; +padding:8px 13px; +border-top:solid 1px #282b2d; +text-transform:uppercase; +letter-spacing:1px; +font-weight:400; +font-size:9px; +line-height:1 +} +@media (max-width:900px) { +body>.container>.header>.etc>.github { +display:none +} +body>.container>.header>.file .savekey { +display:none +} +body>.container>.app { +display:block; +position:relative; +background:#e7e9ea +} +body>.container>.app>.doc { +position:absolute; +top:0; +bottom:0; +left:50px; +right:0 +} +body>.container>.app>.doc>.blocker { +display:none; +width:100%; +height:100%; +position:fixed; +background:rgba(215,218,220,.5); +z-index:10 +} +body>.container>.app>.doc.fadeback { +filter:blur(2px) +} +body>.container>.app>.doc.fadeback>.blocker { +display:block +} +body>.container>.app>.sidebar { +position:absolute; +top:0; +bottom:0; +left:0; +z-index:10000; +transition:width .2s ease-out; +width:calc(10% + 350px); +box-shadow:10px 0 12px rgba(0,0,0,.45); +background:#282b2d; +opacity:.94 +} +body>.container>.app>.sidebar.closed { +width:50px; +min-width:50px; +box-shadow:1px 2px 8px rgba(0,0,0,.45); +opacity:1 +} +body>.container>.app>.sidebar.closed:before { +content:none +} + +} +#export.theme { +color:#70b0e0 +} +#export.match { +color:rgba(112,176,224,.5) +} +#export.selected-stroke { +color:rgba(16,17,18,.3) +} +.CodeMirror { +font-family:"Source Code Pro",monospace; +background:0 0; +position:absolute; +box-sizing:border-box +} +.CodeMirror div.CodeMirror-cursor { +pointer-events:none; +border-left:1px solid #101112 +} +.CodeMirror-selected { +background:rgba(170,170,170,.55) +} +.CodeMirror-focused .CodeMirror-selected { +background:rgba(140,150,255,.8) +} +.editor.multiline .CodeMirror-line:not(:last-child)>span:after { +pointer-events:none; +color:rgba(127,127,127,.33); +content:"¬" +} +.CodeMirror-line .cm-space::before,.CodeMirror-line .cm-special::before { +color:rgba(127,127,127,.33); +content:"•"; +position:absolute +} +.CodeMirror-line .cm-special::before { +color:#d22 +} +.CodeMirror-line .cm-tab { +background:url(data:image/png; +base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6REZENEEyN0Q3NTc0MTFFNzlFMTZGQ0Q1MEREODEyREEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6REZENEEyN0U3NTc0MTFFNzlFMTZGQ0Q1MEREODEyREEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpERkQ0QTI3Qjc1NzQxMUU3OUUxNkZDRDUwREQ4MTJEQSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpERkQ0QTI3Qzc1NzQxMUU3OUUxNkZDRDUwREQ4MTJEQSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgWEz28AAABVSURBVHja7JVBCgAgCAQt+rf6cstjYN4iFxoQxJMjos3MCJlO4HyB26iqZLXyAswskQTUCmUSI7OruE4usxX9jCKELKK8w04e6Qqdmnfa/8SPmQIMANcZrZCVJGBIAAAAAElFTkSuQmCC); +background-position:100%; +background-repeat:no-repeat +} + diff --git a/deploy/en/regexr.js b/deploy/en/regexr.js new file mode 100644 index 0000000..6111932 --- /dev/null +++ b/deploy/en/regexr.js @@ -0,0 +1,21008 @@ +var regexr = (function () { + 'use strict'; + + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + + // This is CodeMirror (http://codemirror.net), a code editor + // implemented in JavaScript on top of the browser's DOM. + // + // You can find some technical background for some of the code below + // at http://marijnhaverbeke.nl/blog/#cm-internals . + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.CodeMirror = factory(); + })(window, function () { + + // Kludges for bugs and behavior differences that can't be feature + // detected are enabled based on userAgent etc sniffing. + var userAgent = navigator.userAgent; + var platform = navigator.platform; + var gecko = /gecko\/\d/i.test(userAgent); + var ie_upto10 = /MSIE \d/.test(userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); + var edge = /Edge\/(\d+)/.exec(userAgent); + var ie = ie_upto10 || ie_11up || edge; + var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); + var webkit = !edge && /WebKit\//.test(userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); + var chrome = !edge && /Chrome\//.test(userAgent); + var presto = /Opera\//.test(userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); + var phantom = /PhantomJS/.test(userAgent); + var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent); + var android = /Android/.test(userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); + var mac = ios || /Mac/.test(platform); + var chromeOS = /\bCrOS\b/.test(userAgent); + var windows = /win/i.test(platform); + var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); + if (presto_version) { + presto_version = Number(presto_version[1]); + } + if (presto_version && presto_version >= 15) { + presto = false; + webkit = true; + } + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || ie && ie_version >= 9; + function classTest(cls) { + return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); + } + var rmClass = function (node, cls) { + var current = node.className; + var match = classTest(cls).exec(current); + if (match) { + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); + } + }; + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) { + e.removeChild(e.firstChild); + } + return e; + } + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e); + } + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) { + e.className = className; + } + if (style) { + e.style.cssText = style; + } + if (typeof content == "string") { + e.appendChild(document.createTextNode(content)); + } else if (content) { + for (var i = 0; i < content.length; ++i) { + e.appendChild(content[i]); + } + } + return e; + } + // wrapper for elt, which removes the elt from the accessibility tree + function eltP(tag, content, className, style) { + var e = elt(tag, content, className, style); + e.setAttribute("role", "presentation"); + return e; + } + var range; + if (document.createRange) { + range = function (node, start, end, endNode) { + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); + return r; + }; + } else { + range = function (node, start, end) { + var r = document.body.createTextRange(); + try { + r.moveToElementText(node.parentNode); + } catch (e) { + return r; + } + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r; + }; + } + function contains(parent, child) { + if (child.nodeType == 3) + // Android browser always returns false when child is a textnode + { + child = child.parentNode; + } + if (parent.contains) { + return parent.contains(child); + } + do { + if (child.nodeType == 11) { + child = child.host; + } + if (child == parent) { + return true; + } + } while (child = child.parentNode); + } + function activeElt() { + // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. + // IE < 10 will throw when accessed while the page is loading or in an iframe. + // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var activeElement; + try { + activeElement = document.activeElement; + } catch (e) { + activeElement = document.body || null; + } + while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) { + activeElement = activeElement.shadowRoot.activeElement; + } + return activeElement; + } + function addClass(node, cls) { + var current = node.className; + if (!classTest(cls).test(current)) { + node.className += (current ? " " : "") + cls; + } + } + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) { + if (as[i] && !classTest(as[i]).test(b)) { + b += " " + as[i]; + } + } + return b; + } + var selectInput = function (node) { + node.select(); + }; + if (ios) + // Mobile Safari apparently has a bug where select() is broken. + { + selectInput = function (node) { + node.selectionStart = 0; + node.selectionEnd = node.value.length; + }; + } else if (ie) + // Suppress mysterious IE10 errors + { + selectInput = function (node) { + try { + node.select(); + } catch (_e) {} + }; + } + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function () { + return f.apply(null, args); + }; + } + function copyObj(obj, target, overwrite) { + if (!target) { + target = {}; + } + for (var prop in obj) { + if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) { + target[prop] = obj[prop]; + } + } + return target; + } + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + function countColumn(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) { + end = string.length; + } + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) { + return n + (end - i); + } + n += nextTab - i; + n += tabSize - n % tabSize; + i = nextTab + 1; + } + } + var Delayed = function () { + this.id = null; + }; + Delayed.prototype.set = function (ms, f) { + clearTimeout(this.id); + this.id = setTimeout(f, ms); + }; + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) { + if (array[i] == elt) { + return i; + } + } + return -1; + } + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerGap = 30; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = { + toString: function () { + return "CodeMirror.Pass"; + } + }; + + // Reused option objects for setSelection & friends + var sel_dontScroll = { + scroll: false + }; + var sel_mouse = { + origin: "*mouse" + }; + var sel_move = { + origin: "+move" + }; + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) { + nextTab = string.length; + } + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) { + return pos + Math.min(skipped, goal - col); + } + col += nextTab - pos; + col += tabSize - col % tabSize; + pos = nextTab + 1; + if (col >= goal) { + return pos; + } + } + } + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) { + spaceStrs.push(lst(spaceStrs) + " "); + } + return spaceStrs[n]; + } + function lst(arr) { + return arr[arr.length - 1]; + } + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) { + out[i] = f(array[i], i); + } + return out; + } + function insertSorted(array, value, score) { + var pos = 0, + priority = score(value); + while (pos < array.length && score(array[pos]) <= priority) { + pos++; + } + array.splice(pos, 0, value); + } + function nothing() {} + function createObj(base, props) { + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + nothing.prototype = base; + inst = new nothing(); + } + if (props) { + copyObj(props, inst); + } + return inst; + } + var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + function isWordCharBasic(ch) { + return /\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); + } + function isWordChar(ch, helper) { + if (!helper) { + return isWordCharBasic(ch); + } + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { + return true; + } + return helper.test(ch); + } + function isEmpty(obj) { + for (var n in obj) { + if (obj.hasOwnProperty(n) && obj[n]) { + return false; + } + } + return true; + } + + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. + var extendingChars = /[\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]/; + function isExtendingChar(ch) { + return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); + } + + // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. + function skipExtendingChars(str, pos, dir) { + while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { + pos += dir; + } + return pos; + } + + // Returns the value from the range [`from`; `to`] that satisfies + // `pred` and is closest to `from`. Assumes that at least `to` satisfies `pred`. + function findFirst(pred, from, to) { + for (;;) { + if (Math.abs(from - to) <= 1) { + return pred(from) ? from : to; + } + var mid = Math.floor((from + to) / 2); + if (pred(mid)) { + to = mid; + } else { + from = mid; + } + } + } + + // The display handles the DOM integration, both for input reading + // and content drawing. It holds references to DOM nodes and + // display-related state. + + function Display(place, doc, input) { + var d = this; + this.input = input; + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + d.scrollbarFiller.setAttribute("cm-not-content", "true"); + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); + d.gutterFiller.setAttribute("cm-not-content", "true"); + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = eltP("div", null, "CodeMirror-code"); + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure"); + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], null, "position: relative; outline: none"); + var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); + // Moved around its parent to cover visible view. + d.mover = elt("div", [lines], null, "position: relative"); + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + d.sizerWidth = null; + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { + d.gutters.style.zIndex = -1; + d.scroller.style.paddingRight = 0; + } + if (!webkit && !(gecko && mobile)) { + d.scroller.draggable = true; + } + if (place) { + if (place.appendChild) { + place.appendChild(d.wrapper); + } else { + place(d.wrapper); + } + } + + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first; + d.reportedViewFrom = d.reportedViewTo = doc.first; + // Information about the rendered lines. + d.view = []; + d.renderedView = null; + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null; + // Empty space (in pixels) above the view + d.viewOffset = 0; + d.lastWrapHeight = d.lastWrapWidth = 0; + d.updateLineNumbers = null; + d.nativeBarWidth = d.barHeight = d.barWidth = 0; + d.scrollbarsClipped = false; + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false; + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + + // True when shift is held down. + d.shift = false; + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; + d.activeTouch = null; + input.init(d); + } + + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) { + throw new Error("There is no line " + (n + doc.first) + " in the document."); + } + var chunk = doc; + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], + sz = child.chunkSize(); + if (n < sz) { + chunk = child; + break; + } + n -= sz; + } + } + return chunk.lines[n]; + } + + // Get the part of a document between two positions, as an array of + // strings. + function getBetween(doc, start, end) { + var out = [], + n = start.line; + doc.iter(start.line, end.line + 1, function (line) { + var text = line.text; + if (n == end.line) { + text = text.slice(0, end.ch); + } + if (n == start.line) { + text = text.slice(start.ch); + } + out.push(text); + ++n; + }); + return out; + } + // Get the lines between from and to, as array of strings. + function getLines(doc, from, to) { + var out = []; + doc.iter(from, to, function (line) { + out.push(line.text); + }); // iter aborts when callback returns truthy value + return out; + } + + // Update the height of a line, propagating the height change + // upwards to parent nodes. + function updateLineHeight(line, height) { + var diff = height - line.height; + if (diff) { + for (var n = line; n; n = n.parent) { + n.height += diff; + } + } + } + + // Given a line object, find its line number by walking up through + // its parent links. + function lineNo(line) { + if (line.parent == null) { + return null; + } + var cur = line.parent, + no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) { + break; + } + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first; + } + + // Find the line at the given vertical position, using the height + // information in the document tree. + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { + var child = chunk.children[i$1], + ch = child.height; + if (h < ch) { + chunk = child; + continue outer; + } + h -= ch; + n += child.chunkSize(); + } + return n; + } while (!chunk.lines); + var i = 0; + for (; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], + lh = line.height; + if (h < lh) { + break; + } + h -= lh; + } + return n + i; + } + function isLine(doc, l) { + return l >= doc.first && l < doc.first + doc.size; + } + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)); + } + + // A Pos instance represents a position within the text. + function Pos(line, ch, sticky) { + if (sticky === void 0) sticky = null; + if (!(this instanceof Pos)) { + return new Pos(line, ch, sticky); + } + this.line = line; + this.ch = ch; + this.sticky = sticky; + } + + // Compare two positions, return 0 if they are the same, a negative + // number when a is less, and a positive number otherwise. + function cmp(a, b) { + return a.line - b.line || a.ch - b.ch; + } + function equalCursorPos(a, b) { + return a.sticky == b.sticky && cmp(a, b) == 0; + } + function copyPos(x) { + return Pos(x.line, x.ch); + } + function maxPos(a, b) { + return cmp(a, b) < 0 ? b : a; + } + function minPos(a, b) { + return cmp(a, b) < 0 ? a : b; + } + + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) { + return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1)); + } + function clipPos(doc, pos) { + if (pos.line < doc.first) { + return Pos(doc.first, 0); + } + var last = doc.first + doc.size - 1; + if (pos.line > last) { + return Pos(last, getLine(doc, last).text.length); + } + return clipToLen(pos, getLine(doc, pos.line).text.length); + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) { + return Pos(pos.line, linelen); + } else if (ch < 0) { + return Pos(pos.line, 0); + } else { + return pos; + } + } + function clipPosArray(doc, array) { + var out = []; + for (var i = 0; i < array.length; i++) { + out[i] = clipPos(doc, array[i]); + } + return out; + } + + // Optimize some code when these features are not used. + var sawReadOnlySpans = false; + var sawCollapsedSpans = false; + function seeReadOnlySpans() { + sawReadOnlySpans = true; + } + function seeCollapsedSpans() { + sawCollapsedSpans = true; + } + + // TEXTMARKER SPANS + + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; + this.to = to; + } + + // Search an array of spans for a span matching the given marker. + function getMarkedSpanFor(spans, marker) { + if (spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) { + return span; + } + } + } + } + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). + function removeMarkedSpan(spans, span) { + var r; + for (var i = 0; i < spans.length; ++i) { + if (spans[i] != span) { + (r || (r = [])).push(spans[i]); + } + } + return r; + } + // Add a span to a line. + function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.attachLine(line); + } + + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). + function markedSpansBefore(old, startCh, isInsert) { + var nw; + if (old) { + for (var i = 0; i < old.length; ++i) { + var span = old[i], + marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); + (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); + } + } + } + return nw; + } + function markedSpansAfter(old, endCh, isInsert) { + var nw; + if (old) { + for (var i = 0; i < old.length; ++i) { + var span = old[i], + marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); + (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, span.to == null ? null : span.to - endCh)); + } + } + } + return nw; + } + + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. + function stretchSpansOverChange(doc, change) { + if (change.full) { + return null; + } + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) { + return null; + } + var startCh = change.from.ch, + endCh = change.to.ch, + isInsert = cmp(change.from, change.to) == 0; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, + offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) { + span.to = startCh; + } else if (sameLine) { + span.to = found.to == null ? null : found.to + offset; + } + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i$1 = 0; i$1 < last.length; ++i$1) { + var span$1 = last[i$1]; + if (span$1.to != null) { + span$1.to += offset; + } + if (span$1.from == null) { + var found$1 = getMarkedSpanFor(first, span$1.marker); + if (!found$1) { + span$1.from = offset; + if (sameLine) { + (first || (first = [])).push(span$1); + } + } + } else { + span$1.from += offset; + if (sameLine) { + (first || (first = [])).push(span$1); + } + } + } + } + // Make sure we didn't create any zero-length spans + if (first) { + first = clearEmptySpans(first); + } + if (last && last != first) { + last = clearEmptySpans(last); + } + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, + gapMarkers; + if (gap > 0 && first) { + for (var i$2 = 0; i$2 < first.length; ++i$2) { + if (first[i$2].to == null) { + (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); + } + } + } + for (var i$3 = 0; i$3 < gap; ++i$3) { + newMarkers.push(gapMarkers); + } + newMarkers.push(last); + } + return newMarkers; + } + + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. + function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) { + spans.splice(i--, 1); + } + } + if (!spans.length) { + return null; + } + return spans; + } + + // Used to 'clip' out readOnly ranges when making a change. + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function (line) { + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) { + (markers || (markers = [])).push(mark); + } + } + } + }); + if (!markers) { + return null; + } + var parts = [{ + from: from, + to: to + }]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], + m = mk.find(0); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { + continue; + } + var newParts = [j, 1], + dfrom = cmp(p.from, m.from), + dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) { + newParts.push({ + from: p.from, + to: m.from + }); + } + if (dto > 0 || !mk.inclusiveRight && !dto) { + newParts.push({ + from: m.to, + to: p.to + }); + } + parts.splice.apply(parts, newParts); + j += newParts.length - 3; + } + } + return parts; + } + + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) { + return; + } + for (var i = 0; i < spans.length; ++i) { + spans[i].marker.detachLine(line); + } + line.markedSpans = null; + } + function attachMarkedSpans(line, spans) { + if (!spans) { + return; + } + for (var i = 0; i < spans.length; ++i) { + spans[i].marker.attachLine(line); + } + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. + function extraLeft(marker) { + return marker.inclusiveLeft ? -1 : 0; + } + function extraRight(marker) { + return marker.inclusiveRight ? 1 : 0; + } + + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. + function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length; + if (lenDiff != 0) { + return lenDiff; + } + var aPos = a.find(), + bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); + if (fromCmp) { + return -fromCmp; + } + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); + if (toCmp) { + return toCmp; + } + return b.id - a.id; + } + + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. + function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, + found; + if (sps) { + for (var sp = void 0, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { + found = sp.marker; + } + } + } + return found; + } + function collapsedSpanAtStart(line) { + return collapsedSpanAtSide(line, true); + } + function collapsedSpanAtEnd(line) { + return collapsedSpanAtSide(line, false); + } + + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. + function conflictingCollapsedRange(doc, lineNo, from, to, marker) { + var line = getLine(doc, lineNo); + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { + for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (!sp.marker.collapsed) { + continue; + } + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { + continue; + } + if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) { + return true; + } + } + } + } + + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). + function visualLine(line) { + var merged; + while (merged = collapsedSpanAtStart(line)) { + line = merged.find(-1, true).line; + } + return line; + } + function visualLineEnd(line) { + var merged; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + } + return line; + } + + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + (lines || (lines = [])).push(line); + } + return lines; + } + + // Get the line number of the start of the visual line that the + // given line number is part of. + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), + vis = visualLine(line); + if (line == vis) { + return lineN; + } + return lineNo(vis); + } + + // Get the line number of the start of the next visual line after + // the given line. + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) { + return lineN; + } + var line = getLine(doc, lineN), + merged; + if (!lineIsHidden(doc, line)) { + return lineN; + } + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + } + return lineNo(line) + 1; + } + + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { + for (var sp = void 0, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) { + continue; + } + if (sp.from == null) { + return true; + } + if (sp.marker.widgetNode) { + continue; + } + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) { + return true; + } + } + } + } + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); + } + if (span.marker.inclusiveRight && span.to == line.text.length) { + return true; + } + for (var sp = void 0, i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && (sp.to == null || sp.to != span.from) && (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && lineIsHiddenInner(doc, line, sp)) { + return true; + } + } + } + + // Find the height above the given line. + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); + var h = 0, + chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) { + break; + } else { + h += line.height; + } + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i$1 = 0; i$1 < p.children.length; ++i$1) { + var cur = p.children[i$1]; + if (cur == chunk) { + break; + } else { + h += cur.height; + } + } + } + return h; + } + + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. + function lineLength(line) { + if (line.height == 0) { + return 0; + } + var len = line.text.length, + merged, + cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found$1 = merged.find(0, true); + len -= cur.text.length - found$1.from.ch; + cur = found$1.to.line; + len += cur.text.length - found$1.to.ch; + } + return len; + } + + // Find the longest line in the document. + function findMaxLine(cm) { + var d = cm.display, + doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; + doc.iter(function (line) { + var len = lineLength(line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); + } + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) { + return f(from, to, "ltr"); + } + var found = false; + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); + found = true; + } + } + if (!found) { + f(from, to, "ltr"); + } + } + var bidiOther = null; + function getBidiPartAt(order, ch, sticky) { + var found; + bidiOther = null; + for (var i = 0; i < order.length; ++i) { + var cur = order[i]; + if (cur.from < ch && cur.to > ch) { + return i; + } + if (cur.to == ch) { + if (cur.from != cur.to && sticky == "before") { + found = i; + } else { + bidiOther = i; + } + } + if (cur.from == ch) { + if (cur.from != cur.to && sticky != "before") { + found = i; + } else { + bidiOther = i; + } + } + } + return found != null ? found : bidiOther; + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = function () { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; + // Character types for codepoints 0x600 to 0x6f9 + var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; + function charType(code) { + if (code <= 0xf7) { + return lowTypes.charAt(code); + } else if (0x590 <= code && code <= 0x5f4) { + return "R"; + } else if (0x600 <= code && code <= 0x6f9) { + return arabicTypes.charAt(code - 0x600); + } else if (0x6ee <= code && code <= 0x8ac) { + return "r"; + } else if (0x2000 <= code && code <= 0x200b) { + return "w"; + } else if (code == 0x200c) { + return "b"; + } else { + return "L"; + } + } + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, + isStrong = /[LRr]/, + countsAsLeft = /[Lb1n]/, + countsAsNum = /[1n]/; + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; + this.to = to; + } + return function (str, direction) { + var outerType = direction == "ltr" ? "L" : "R"; + if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { + return false; + } + var len = str.length, + types = []; + for (var i = 0; i < len; ++i) { + types.push(charType(str.charCodeAt(i))); + } + + // 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. + for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { + var type = types[i$1]; + if (type == "m") { + types[i$1] = prev; + } else { + prev = type; + } + } + + // 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. + // W3. Change all ALs to R. + for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { + var type$1 = types[i$2]; + if (type$1 == "1" && cur == "r") { + types[i$2] = "n"; + } else if (isStrong.test(type$1)) { + cur = type$1; + if (type$1 == "r") { + types[i$2] = "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 (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { + var type$2 = types[i$3]; + if (type$2 == "+" && prev$1 == "1" && types[i$3 + 1] == "1") { + types[i$3] = "1"; + } else if (type$2 == "," && prev$1 == types[i$3 + 1] && (prev$1 == "1" || prev$1 == "n")) { + types[i$3] = prev$1; + } + prev$1 = type$2; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i$4 = 0; i$4 < len; ++i$4) { + var type$3 = types[i$4]; + if (type$3 == ",") { + types[i$4] = "N"; + } else if (type$3 == "%") { + var end = void 0; + for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} + var replace = i$4 && types[i$4 - 1] == "!" || end < len && types[end] == "1" ? "1" : "N"; + for (var j = i$4; j < end; ++j) { + types[j] = replace; + } + i$4 = end - 1; + } + } + + // 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. + for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { + var type$4 = types[i$5]; + if (cur$1 == "L" && type$4 == "1") { + types[i$5] = "L"; + } else if (isStrong.test(type$4)) { + cur$1 = type$4; + } + } + + // 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 act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i$6 = 0; i$6 < len; ++i$6) { + if (isNeutral.test(types[i$6])) { + var end$1 = void 0; + for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} + var before = (i$6 ? types[i$6 - 1] : outerType) == "L"; + var after = (end$1 < len ? types[end$1] : outerType) == "L"; + var replace$1 = before == after ? before ? "L" : "R" : outerType; + for (var j$1 = i$6; j$1 < end$1; ++j$1) { + types[j$1] = replace$1; + } + i$6 = end$1 - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], + m; + for (var i$7 = 0; i$7 < len;) { + if (countsAsLeft.test(types[i$7])) { + var start = i$7; + for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} + order.push(new BidiSpan(0, start, i$7)); + } else { + var pos = i$7, + at = order.length; + for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} + for (var j$2 = pos; j$2 < i$7;) { + if (countsAsNum.test(types[j$2])) { + if (pos < j$2) { + order.splice(at, 0, new BidiSpan(1, pos, j$2)); + } + var nstart = j$2; + for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} + order.splice(at, 0, new BidiSpan(2, nstart, j$2)); + pos = j$2; + } else { + ++j$2; + } + } + if (pos < i$7) { + order.splice(at, 0, new BidiSpan(1, pos, i$7)); + } + } + } + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } + return direction == "rtl" ? order.reverse() : order; + }; + }(); + + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. + function getOrder(line, direction) { + var order = line.order; + if (order == null) { + order = line.order = bidiOrdering(line.text, direction); + } + return order; + } + function moveCharLogically(line, ch, dir) { + var target = skipExtendingChars(line.text, ch + dir, dir); + return target < 0 || target > line.text.length ? null : target; + } + function moveLogically(line, start, dir) { + var ch = moveCharLogically(line, start.ch, dir); + return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before"); + } + function endOfLine(visually, cm, lineObj, lineNo, dir) { + if (visually) { + var order = getOrder(lineObj, cm.doc.direction); + if (order) { + var part = dir < 0 ? lst(order) : order[0]; + var moveInStorageOrder = dir < 0 == (part.level == 1); + var sticky = moveInStorageOrder ? "after" : "before"; + var ch; + // With a wrapped rtl chunk (possibly spanning multiple bidi parts), + // it could be that the last bidi part is not on the last visual line, + // since visual lines contain content order-consecutive chunks. + // Thus, in rtl, we are looking for the first (content-order) character + // in the rtl chunk that is on the last line (that is, the same line + // as the last (content-order) character). + if (part.level > 0) { + var prep = prepareMeasureForLine(cm, lineObj); + ch = dir < 0 ? lineObj.text.length - 1 : 0; + var targetTop = measureCharPrepared(cm, prep, ch).top; + ch = findFirst(function (ch) { + return measureCharPrepared(cm, prep, ch).top == targetTop; + }, dir < 0 == (part.level == 1) ? part.from : part.to - 1, ch); + if (sticky == "before") { + ch = moveCharLogically(lineObj, ch, 1); + } + } else { + ch = dir < 0 ? part.to : part.from; + } + return new Pos(lineNo, ch, sticky); + } + } + return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after"); + } + function moveVisually(cm, line, start, dir) { + var bidi = getOrder(line, cm.doc.direction); + if (!bidi) { + return moveLogically(line, start, dir); + } + if (start.ch >= line.text.length) { + start.ch = line.text.length; + start.sticky = "before"; + } else if (start.ch <= 0) { + start.ch = 0; + start.sticky = "after"; + } + var partPos = getBidiPartAt(bidi, start.ch, start.sticky), + part = bidi[partPos]; + if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { + // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, + // nothing interesting happens. + return moveLogically(line, start, dir); + } + var mv = function (pos, dir) { + return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); + }; + var prep; + var getWrappedLineExtent = function (ch) { + if (!cm.options.lineWrapping) { + return { + begin: 0, + end: line.text.length + }; + } + prep = prep || prepareMeasureForLine(cm, line); + return wrappedLineExtentChar(cm, line, prep, ch); + }; + var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch); + if (cm.doc.direction == "rtl" || part.level == 1) { + var moveInStorageOrder = part.level == 1 == dir < 0; + var ch = mv(start, moveInStorageOrder ? 1 : -1); + if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { + // Case 2: We move within an rtl part or in an rtl editor on the same visual line + var sticky = moveInStorageOrder ? "before" : "after"; + return new Pos(start.line, ch, sticky); + } + } + + // Case 3: Could not move within this bidi part in this visual line, so leave + // the current bidi part + + var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { + var getRes = function (ch, moveInStorageOrder) { + return moveInStorageOrder ? new Pos(start.line, mv(ch, 1), "before") : new Pos(start.line, ch, "after"); + }; + for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { + var part = bidi[partPos]; + var moveInStorageOrder = dir > 0 == (part.level != 1); + var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1); + if (part.from <= ch && ch < part.to) { + return getRes(ch, moveInStorageOrder); + } + ch = moveInStorageOrder ? part.from : mv(part.to, -1); + if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { + return getRes(ch, moveInStorageOrder); + } + } + }; + + // Case 3a: Look for other bidi parts on the same visual line + var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent); + if (res) { + return res; + } + + // Case 3b: Look for other bidi parts on the next visual line + var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1); + if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { + res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)); + if (res) { + return res; + } + } + + // Case 4: Nowhere to move + return null; + } + + // EVENT HANDLING + + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var noHandlers = []; + var on = function (emitter, type, f) { + if (emitter.addEventListener) { + emitter.addEventListener(type, f, false); + } else if (emitter.attachEvent) { + emitter.attachEvent("on" + type, f); + } else { + var map = emitter._handlers || (emitter._handlers = {}); + map[type] = (map[type] || noHandlers).concat(f); + } + }; + function getHandlers(emitter, type) { + return emitter._handlers && emitter._handlers[type] || noHandlers; + } + function off(emitter, type, f) { + if (emitter.removeEventListener) { + emitter.removeEventListener(type, f, false); + } else if (emitter.detachEvent) { + emitter.detachEvent("on" + type, f); + } else { + var map = emitter._handlers, + arr = map && map[type]; + if (arr) { + var index = indexOf(arr, f); + if (index > -1) { + map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); + } + } + } + } + function signal(emitter, type /*, values...*/) { + var handlers = getHandlers(emitter, type); + if (!handlers.length) { + return; + } + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < handlers.length; ++i) { + handlers[i].apply(null, args); + } + } + + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + if (typeof e == "string") { + e = { + type: e, + preventDefault: function () { + this.defaultPrevented = true; + } + }; + } + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore; + } + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) { + return; + } + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) { + if (indexOf(set, arr[i]) == -1) { + set.push(arr[i]); + } + } + } + function hasHandler(emitter, type) { + return getHandlers(emitter, type).length > 0; + } + + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. + function eventMixin(ctor) { + ctor.prototype.on = function (type, f) { + on(this, type, f); + }; + ctor.prototype.off = function (type, f) { + off(this, type, f); + }; + } + + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. + + function e_preventDefault(e) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + } + function e_stopPropagation(e) { + if (e.stopPropagation) { + e.stopPropagation(); + } else { + e.cancelBubble = true; + } + } + function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; + } + function e_stop(e) { + e_preventDefault(e); + e_stopPropagation(e); + } + function e_target(e) { + return e.target || e.srcElement; + } + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) { + b = 1; + } else if (e.button & 2) { + b = 3; + } else if (e.button & 4) { + b = 2; + } + } + if (mac && e.ctrlKey && b == 1) { + b = 3; + } + return b; + } + + // Detect drag-and-drop + var dragAndDrop = function () { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) { + return false; + } + var div = elt('div'); + return "draggable" in div || "dragDrop" in div; + }(); + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) { + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); + } + } + var node = zwspSupported ? elt("span", "\u200b") : elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); + return node; + } + + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) { + return badBidiRects; + } + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + var r1 = range(txt, 1, 2).getBoundingClientRect(); + removeChildren(measure); + if (!r0 || r0.left == r0.right) { + return false; + } // Safari returns null in some cases (#2780) + return badBidiRects = r1.right - r0.right < 3; + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { + var pos = 0, + result = [], + l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) { + nl = string.length; + } + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result; + } : function (string) { + return string.split(/\r\n?|\n/); + }; + var hasSelection = window.getSelection ? function (te) { + try { + return te.selectionStart != te.selectionEnd; + } catch (e) { + return false; + } + } : function (te) { + var range; + try { + range = te.ownerDocument.selection.createRange(); + } catch (e) {} + if (!range || range.parentElement() != te) { + return false; + } + return range.compareEndPoints("StartToEnd", range) != 0; + }; + var hasCopyEvent = function () { + var e = elt("div"); + if ("oncopy" in e) { + return true; + } + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == "function"; + }(); + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) { + return badZoomedRects; + } + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; + } + var modes = {}; + var mimeModes = {}; + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + function defineMode(name, mode) { + if (arguments.length > 2) { + mode.dependencies = Array.prototype.slice.call(arguments, 2); + } + modes[name] = mode; + } + function defineMIME(mime, spec) { + mimeModes[mime] = spec; + } + + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. + function resolveMode(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec]; + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name]; + if (typeof found == "string") { + found = { + name: found + }; + } + spec = createObj(found, spec); + spec.name = found.name; + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return resolveMode("application/xml"); + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { + return resolveMode("application/json"); + } + if (typeof spec == "string") { + return { + name: spec + }; + } else { + return spec || { + name: "null" + }; + } + } + + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. + function getMode(options, spec) { + spec = resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) { + return getMode(options, "text/plain"); + } + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) { + continue; + } + if (modeObj.hasOwnProperty(prop)) { + modeObj["_" + prop] = modeObj[prop]; + } + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + if (spec.helperType) { + modeObj.helperType = spec.helperType; + } + if (spec.modeProps) { + for (var prop$1 in spec.modeProps) { + modeObj[prop$1] = spec.modeProps[prop$1]; + } + } + return modeObj; + } + + // This can be used to attach properties to mode objects from + // outside the actual mode definition. + var modeExtensions = {}; + function extendMode(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : modeExtensions[mode] = {}; + copyObj(properties, exts); + } + function copyState(mode, state) { + if (state === true) { + return state; + } + if (mode.copyState) { + return mode.copyState(state); + } + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) { + val = val.concat([]); + } + nstate[n] = val; + } + return nstate; + } + + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. + function innerMode(mode, state) { + var info; + while (mode.innerMode) { + info = mode.innerMode(state); + if (!info || info.mode == mode) { + break; + } + state = info.state; + mode = info.mode; + } + return info || { + mode: mode, + state: state + }; + } + function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; + } + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + var StringStream = function (string, tabSize, lineOracle) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + this.lineOracle = lineOracle; + }; + StringStream.prototype.eol = function () { + return this.pos >= this.string.length; + }; + StringStream.prototype.sol = function () { + return this.pos == this.lineStart; + }; + StringStream.prototype.peek = function () { + return this.string.charAt(this.pos) || undefined; + }; + StringStream.prototype.next = function () { + if (this.pos < this.string.length) { + return this.string.charAt(this.pos++); + } + }; + StringStream.prototype.eat = function (match) { + var ch = this.string.charAt(this.pos); + var ok; + if (typeof match == "string") { + ok = ch == match; + } else { + ok = ch && (match.test ? match.test(ch) : match(ch)); + } + if (ok) { + ++this.pos; + return ch; + } + }; + StringStream.prototype.eatWhile = function (match) { + var start = this.pos; + while (this.eat(match)) {} + return this.pos > start; + }; + StringStream.prototype.eatSpace = function () { + var this$1 = this; + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { + ++this$1.pos; + } + return this.pos > start; + }; + StringStream.prototype.skipToEnd = function () { + this.pos = this.string.length; + }; + StringStream.prototype.skipTo = function (ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) { + this.pos = found; + return true; + } + }; + StringStream.prototype.backUp = function (n) { + this.pos -= n; + }; + StringStream.prototype.column = function () { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }; + StringStream.prototype.indentation = function () { + return countColumn(this.string, null, this.tabSize) - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }; + StringStream.prototype.match = function (pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function (str) { + return caseInsensitive ? str.toLowerCase() : str; + }; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) { + this.pos += pattern.length; + } + return true; + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) { + return null; + } + if (match && consume !== false) { + this.pos += match[0].length; + } + return match; + } + }; + StringStream.prototype.current = function () { + return this.string.slice(this.start, this.pos); + }; + StringStream.prototype.hideFirstChars = function (n, inner) { + this.lineStart += n; + try { + return inner(); + } finally { + this.lineStart -= n; + } + }; + StringStream.prototype.lookAhead = function (n) { + var oracle = this.lineOracle; + return oracle && oracle.lookAhead(n); + }; + var SavedContext = function (state, lookAhead) { + this.state = state; + this.lookAhead = lookAhead; + }; + var Context = function (doc, state, line, lookAhead) { + this.state = state; + this.doc = doc; + this.line = line; + this.maxLookAhead = lookAhead || 0; + }; + Context.prototype.lookAhead = function (n) { + var line = this.doc.getLine(this.line + n); + if (line != null && n > this.maxLookAhead) { + this.maxLookAhead = n; + } + return line; + }; + Context.prototype.nextLine = function () { + this.line++; + if (this.maxLookAhead > 0) { + this.maxLookAhead--; + } + }; + Context.fromSaved = function (doc, saved, line) { + if (saved instanceof SavedContext) { + return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead); + } else { + return new Context(doc, copyState(doc.mode, saved), line); + } + }; + Context.prototype.save = function (copy) { + var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; + return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state; + }; + + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. + function highlightLine(cm, line, context, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], + lineClasses = {}; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, context, function (end, style) { + return st.push(end, style); + }, lineClasses, forceToEnd); + var state = context.state; + + // Run overlays, adjust style array. + var loop = function (o) { + var overlay = cm.state.overlays[o], + i = 1, + at = 0; + context.state = true; + runMode(cm, line.text, overlay.mode, context, function (end, style) { + var start = i; + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i]; + if (i_end > end) { + st.splice(i, 1, end, st[i + 1], i_end); + } + i += 2; + at = Math.min(end, i_end); + } + if (!style) { + return; + } + if (overlay.opaque) { + st.splice(start, i - start, end, "overlay " + style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start + 1]; + st[start + 1] = (cur ? cur + " " : "") + "overlay " + style; + } + } + }, lineClasses); + }; + for (var o = 0; o < cm.state.overlays.length; ++o) loop(o); + context.state = state; + return { + styles: st, + classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null + }; + } + function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var context = getContextBefore(cm, lineNo(line)); + var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); + var result = highlightLine(cm, line, context); + if (resetState) { + context.state = resetState; + } + line.stateAfter = context.save(!resetState); + line.styles = result.styles; + if (result.classes) { + line.styleClasses = result.classes; + } else if (line.styleClasses) { + line.styleClasses = null; + } + if (updateFrontier === cm.doc.highlightFrontier) { + cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); + } + } + return line.styles; + } + function getContextBefore(cm, n, precise) { + var doc = cm.doc, + display = cm.display; + if (!doc.mode.startState) { + return new Context(doc, true, n); + } + var start = findStartLine(cm, n, precise); + var saved = start > doc.first && getLine(doc, start - 1).stateAfter; + var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); + doc.iter(start, n, function (line) { + processLine(cm, line.text, context); + var pos = context.line; + line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; + context.nextLine(); + }); + if (precise) { + doc.modeFrontier = context.line; + } + return context; + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. Used for lines that + // aren't currently visible. + function processLine(cm, text, context, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize, context); + stream.start = stream.pos = startAt || 0; + if (text == "") { + callBlankLine(mode, context.state); + } + while (!stream.eol()) { + readToken(mode, stream, context.state); + stream.start = stream.pos; + } + } + function callBlankLine(mode, state) { + if (mode.blankLine) { + return mode.blankLine(state); + } + if (!mode.innerMode) { + return; + } + var inner = innerMode(mode, state); + if (inner.mode.blankLine) { + return inner.mode.blankLine(inner.state); + } + } + function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) { + inner[0] = innerMode(mode, state).mode; + } + var style = mode.token(stream, state); + if (stream.pos > stream.start) { + return style; + } + } + throw new Error("Mode " + mode.name + " failed to advance stream."); + } + var Token = function (stream, type, state) { + this.start = stream.start; + this.end = stream.pos; + this.string = stream.current(); + this.type = type || null; + this.state = state; + }; + + // Utility for getTokenAt and getLineTokens + function takeToken(cm, pos, precise, asArray) { + var doc = cm.doc, + mode = doc.mode, + style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), + context = getContextBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize, context), + tokens; + if (asArray) { + tokens = []; + } + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos; + style = readToken(mode, stream, context.state); + if (asArray) { + tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); + } + } + return asArray ? tokens : new Token(stream, style, context.state); + } + function extractLineClasses(type, output) { + if (type) { + for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) { + break; + } + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) { + output[prop] = lineClass[2]; + } else if (!new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)").test(output[prop])) { + output[prop] += " " + lineClass[2]; + } + } + } + return type; + } + + // Run the given mode's parser over a line, calling f for each token. + function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) { + flattenSpans = cm.options.flattenSpans; + } + var curStart = 0, + curStyle = null; + var stream = new StringStream(text, cm.options.tabSize, context), + style; + var inner = cm.options.addModeClass && [null]; + if (text == "") { + extractLineClasses(callBlankLine(mode, context.state), lineClasses); + } + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false; + if (forceToEnd) { + processLine(cm, text, context, stream.pos); + } + stream.pos = text.length; + style = null; + } else { + style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); + } + if (inner) { + var mName = inner[0].name; + if (mName) { + style = "m-" + (style ? mName + " " + style : mName); + } + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 5000); + f(curStart, curStyle); + } + curStyle = style; + } + stream.start = stream.pos; + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 + // characters, and returns inaccurate measurements in nodes + // starting around 5000 chars. + var pos = Math.min(stream.pos, curStart + 5000); + f(pos, curStyle); + curStart = pos; + } + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n, precise) { + var minindent, + minline, + doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); + for (var search = n; search > lim; --search) { + if (search <= doc.first) { + return doc.first; + } + var line = getLine(doc, search - 1), + after = line.stateAfter; + if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) { + return search; + } + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline; + } + function retreatFrontier(doc, n) { + doc.modeFrontier = Math.min(doc.modeFrontier, n); + if (doc.highlightFrontier < n - 10) { + return; + } + var start = doc.first; + for (var line = n - 1; line > start; line--) { + var saved = getLine(doc, line).stateAfter; + // change is on 3 + // state on line 1 looked ahead 2 -- so saw 3 + // test 1 + 2 < 3 should cover this + if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { + start = line + 1; + break; + } + } + doc.highlightFrontier = Math.min(doc.highlightFrontier, start); + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + var Line = function (text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; + }; + Line.prototype.lineNo = function () { + return lineNo(this); + }; + eventMixin(Line); + + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) { + line.stateAfter = null; + } + if (line.styles) { + line.styles = null; + } + if (line.order != null) { + line.order = null; + } + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) { + updateLineHeight(line, estHeight); + } + } + + // Detach a line from the document tree and its markers. + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. + var styleToClassCache = {}; + var styleToClassCacheWithMode = {}; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) { + return null; + } + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + return cache[style] || (cache[style] = style.replace(/\S+/g, "cm-$&")); + } + + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = { + pre: eltP("pre", [content], "CodeMirror-line"), + content: content, + col: 0, + pos: 0, + cm: cm, + trailingSpace: false, + splitSpaces: (ie || webkit) && cm.getOption("lineWrapping") + }; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, + order = void 0; + builder.pos = 0; + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) { + builder.addToken = buildTokenBadBidi(builder.addToken, order); + } + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) { + builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); + } + if (line.styleClasses.textClass) { + builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); + } + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) { + builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); + } + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); + (lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + // See issue #2901 + if (webkit) { + var last = builder.content.lastChild; + if (/\bcm-tab\b/.test(last.className) || last.querySelector && last.querySelector(".cm-tab")) { + builder.content.className = "cm-tab-wrap-hack"; + } + } + signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) { + builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); + } + return builder; + } + function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); + return token; + } + + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, title, css) { + if (!text) { + return; + } + var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; + var special = builder.cm.state.specialChars, + mustWrap = false; + var content; + if (!special.test(text)) { + builder.col += text.length; + content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) { + mustWrap = true; + } + builder.pos += text.length; + } else { + content = document.createDocumentFragment(); + var pos = 0; + while (true) { + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) { + content.appendChild(elt("span", [txt])); + } else { + content.appendChild(txt); + } + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; + } + if (!m) { + break; + } + pos += skipped + 1; + var txt$1 = void 0; + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, + tabWidth = tabSize - builder.col % tabSize; + txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt$1.setAttribute("role", "presentation"); + txt$1.setAttribute("cm-text", "\t"); + builder.col += tabWidth; + } else if (m[0] == "\r" || m[0] == "\n") { + txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); + txt$1.setAttribute("cm-text", m[0]); + builder.col += 1; + } else { + txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); + txt$1.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) { + content.appendChild(elt("span", [txt$1])); + } else { + content.appendChild(txt$1); + } + builder.col += 1; + } + builder.map.push(builder.pos, builder.pos + 1, txt$1); + builder.pos++; + } + } + builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; + if (style || startStyle || endStyle || mustWrap || css) { + var fullStyle = style || ""; + if (startStyle) { + fullStyle += startStyle; + } + if (endStyle) { + fullStyle += endStyle; + } + var token = elt("span", [content], fullStyle, css); + if (title) { + token.title = title; + } + return builder.content.appendChild(token); + } + builder.content.appendChild(content); + } + function splitSpaces(text, trailingBefore) { + if (text.length > 1 && !/ /.test(text)) { + return text; + } + var spaceBefore = trailingBefore, + result = ""; + for (var i = 0; i < text.length; i++) { + var ch = text.charAt(i); + if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) { + ch = "\u00a0"; + } + result += ch; + spaceBefore = ch == " "; + } + return result; + } + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { + return function (builder, text, style, startStyle, endStyle, title, css) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, + end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + var part = void 0; + for (var i = 0; i < order.length; i++) { + part = order[i]; + if (part.to > start && part.from <= start) { + break; + } + } + if (part.to >= end) { + return inner(builder, text, style, startStyle, endStyle, title, css); + } + inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; + } + }; + } + function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode; + if (widget) { + builder.map.push(builder.pos, builder.pos + size, widget); + } + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) { + widget = builder.content.appendChild(document.createElement("span")); + } + widget.setAttribute("cm-marker", marker.id); + } + if (widget) { + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); + } + builder.pos += size; + builder.trailingSpace = false; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, + allText = line.text, + at = 0; + if (!spans) { + for (var i$1 = 1; i$1 < styles.length; i$1 += 2) { + builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1 + 1], builder.cm.options)); + } + return; + } + var len = allText.length, + pos = 0, + i = 1, + text = "", + style, + css; + var nextChange = 0, + spanStyle, + spanEndStyle, + spanStartStyle, + title, + collapsed; + for (;;) { + if (nextChange == pos) { + // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = title = css = ""; + collapsed = null; + nextChange = Infinity; + var foundBookmarks = [], + endStyles = void 0; + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], + m = sp.marker; + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m); + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to; + spanEndStyle = ""; + } + if (m.className) { + spanStyle += " " + m.className; + } + if (m.css) { + css = (css ? css + ";" : "") + m.css; + } + if (m.startStyle && sp.from == pos) { + spanStartStyle += " " + m.startStyle; + } + if (m.endStyle && sp.to == nextChange) { + (endStyles || (endStyles = [])).push(m.endStyle, sp.to); + } + if (m.title && !title) { + title = m.title; + } + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) { + collapsed = sp; + } + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + } + if (endStyles) { + for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) { + if (endStyles[j$1 + 1] == nextChange) { + spanEndStyle += " " + endStyles[j$1]; + } + } + } + if (!collapsed || collapsed.from == pos) { + for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) { + buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); + } + } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null); + if (collapsed.to == null) { + return; + } + if (collapsed.to == pos) { + collapsed = false; + } + } + } + if (pos >= len) { + break; + } + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); + } + if (end >= upto) { + text = text.slice(upto - pos); + pos = upto; + break; + } + pos = end; + spanStartStyle = ""; + } + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); + } + } + } + + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], + nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array; + } + var operationGroup = null; + function pushOperation(op) { + if (operationGroup) { + operationGroup.ops.push(op); + } else { + op.ownsGroup = operationGroup = { + ops: [op], + delayedCallbacks: [] + }; + } + } + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, + i = 0; + do { + for (; i < callbacks.length; i++) { + callbacks[i].call(null); + } + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) { + while (op.cursorActivityCalled < op.cursorActivityHandlers.length) { + op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); + } + } + } + } while (i < callbacks.length); + } + function finishOperation(op, endCb) { + var group = op.ownsGroup; + if (!group) { + return; + } + try { + fireCallbacksForOps(group); + } finally { + operationGroup = null; + endCb(group); + } + } + var orphanDelayedCallbacks = null; + + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. + function signalLater(emitter, type /*, values...*/) { + var arr = getHandlers(emitter, type); + if (!arr.length) { + return; + } + var args = Array.prototype.slice.call(arguments, 2), + list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); + } + var loop = function (i) { + list.push(function () { + return arr[i].apply(null, args); + }); + }; + for (var i = 0; i < arr.length; ++i) loop(i); + } + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) { + delayed[i](); + } + } + + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") { + updateLineText(cm, lineView); + } else if (type == "gutter") { + updateLineGutter(cm, lineView, lineN, dims); + } else if (type == "class") { + updateLineClasses(cm, lineView); + } else if (type == "widget") { + updateLineWidgets(cm, lineView, dims); + } + } + lineView.changes = null; + } + + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) { + lineView.text.parentNode.replaceChild(lineView.node, lineView.text); + } + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) { + lineView.node.style.zIndex = 2; + } + } + return lineView.node; + } + function updateLineBackground(cm, lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) { + cls += " CodeMirror-linebackground"; + } + if (lineView.background) { + if (cls) { + lineView.background.className = cls; + } else { + lineView.background.parentNode.removeChild(lineView.background); + lineView.background = null; + } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + cm.display.input.setUneditable(lineView.background); + } + } + + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built; + } + return buildLineContent(cm, lineView); + } + + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) { + lineView.node = built.pre; + } + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(cm, lineView); + } else if (cls) { + lineView.text.className = cls; + } + } + function updateLineClasses(cm, lineView) { + updateLineBackground(cm, lineView); + if (lineView.line.wrapClass) { + ensureLineWrapped(lineView).className = lineView.line.wrapClass; + } else if (lineView.node != lineView.text) { + lineView.node.className = ""; + } + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; + } + if (lineView.gutterBackground) { + lineView.node.removeChild(lineView.gutterBackground); + lineView.gutterBackground = null; + } + if (lineView.line.gutterClass) { + var wrap = ensureLineWrapped(lineView); + lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + dims.gutterTotalWidth + "px"); + cm.display.input.setUneditable(lineView.gutterBackground); + wrap.insertBefore(lineView.gutterBackground, lineView.text); + } + var markers = lineView.line.gutterMarkers; + if (cm.options.lineNumbers || markers) { + var wrap$1 = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"); + cm.display.input.setUneditable(gutterWrap); + wrap$1.insertBefore(gutterWrap, lineView.text); + if (lineView.line.gutterClass) { + gutterWrap.className += " " + lineView.line.gutterClass; + } + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) { + lineView.lineNumber = gutterWrap.appendChild(elt("div", lineNumberFor(cm.options, lineN), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + cm.display.lineNumInnerWidth + "px")); + } + if (markers) { + for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], + found = markers.hasOwnProperty(id) && markers[id]; + if (found) { + gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); + } + } + } + } + } + function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) { + lineView.alignable = null; + } + for (var node = lineView.node.firstChild, next = void 0; node; node = next) { + next = node.nextSibling; + if (node.className == "CodeMirror-linewidget") { + lineView.node.removeChild(node); + } + } + insertLineWidgets(cm, lineView, dims); + } + + // Build a line's DOM representation from scratch + function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) { + lineView.bgClass = built.bgClass; + } + if (built.textClass) { + lineView.textClass = built.textClass; + } + updateLineClasses(cm, lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(cm, lineView, dims); + return lineView.node; + } + + // A lineView may contain multiple logical lines (when merged by + // collapsed spans). The widgets for all of them need to be drawn. + function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); + if (lineView.rest) { + for (var i = 0; i < lineView.rest.length; i++) { + insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); + } + } + } + function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) { + return; + } + var wrap = ensureLineWrapped(lineView); + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], + node = elt("div", [widget.node], "CodeMirror-linewidget"); + if (!widget.handleMouseEvents) { + node.setAttribute("cm-ignore-events", "true"); + } + positionLineWidget(widget, node, lineView, dims); + cm.display.input.setUneditable(node); + if (allowAbove && widget.above) { + wrap.insertBefore(node, lineView.gutter || lineView.text); + } else { + wrap.appendChild(node); + } + signalLater(widget, "redraw"); + } + } + function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + (lineView.alignable || (lineView.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) { + node.style.marginLeft = -dims.gutterTotalWidth + "px"; + } + } + } + function widgetHeight(widget) { + if (widget.height != null) { + return widget.height; + } + var cm = widget.doc.cm; + if (!cm) { + return 0; + } + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) { + parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; + } + if (widget.noHScroll) { + parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; + } + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.parentNode.offsetHeight; + } + + // Return true when the given mouse event happened in a widget + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true" || n.parentNode == display.sizer && n != display.mover) { + return true; + } + } + } + + // POSITION MEASUREMENT + + function paddingTop(display) { + return display.lineSpace.offsetTop; + } + function paddingVert(display) { + return display.mover.offsetHeight - display.lineSpace.offsetHeight; + } + function paddingH(display) { + if (display.cachedPaddingH) { + return display.cachedPaddingH; + } + var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = { + left: parseInt(style.paddingLeft), + right: parseInt(style.paddingRight) + }; + if (!isNaN(data.left) && !isNaN(data.right)) { + display.cachedPaddingH = data; + } + return data; + } + function scrollGap(cm) { + return scrollerGap - cm.display.nativeBarWidth; + } + function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; + } + function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; + } + + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], + next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) { + heights.push((cur.bottom + next.top) / 2 - rect.top); + } + } + } + heights.push(rect.bottom - rect.top); + } + } + + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) { + return { + map: lineView.measure.map, + cache: lineView.measure.cache + }; + } + for (var i = 0; i < lineView.rest.length; i++) { + if (lineView.rest[i] == line) { + return { + map: lineView.measure.maps[i], + cache: lineView.measure.caches[i] + }; + } + } + for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) { + if (lineNo(lineView.rest[i$1]) > lineN) { + return { + map: lineView.measure.maps[i$1], + cache: lineView.measure.caches[i$1], + before: true + }; + } + } + } + + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view; + } + + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); + } + + // Find a line view that corresponds to the given line number. + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) { + return cm.display.view[findViewIndex(cm, lineN)]; + } + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) { + return ext; + } + } + + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) { + view = null; + } else if (view && view.changes) { + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + cm.curOp.forceUpdate = true; + } + if (!view) { + view = updateExternalMeasurement(cm, line); + } + var info = mapFromLineView(view, line, lineN); + return { + line: line, + view: view, + rect: null, + map: info.map, + cache: info.cache, + before: info.before, + hasHeights: false + }; + } + + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) { + ch = -1; + } + var key = ch + (bias || ""), + found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; + } else { + if (!prepared.rect) { + prepared.rect = prepared.view.text.getBoundingClientRect(); + } + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; + } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) { + prepared.cache[key] = found; + } + } + return { + left: found.left, + right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom + }; + } + var nullRect = { + left: 0, + right: 0, + top: 0, + bottom: 0 + }; + function nodeAndOffsetInLineMap(map, ch, bias) { + var node, start, end, collapse, mStart, mEnd; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map.length; i += 3) { + mStart = map[i]; + mEnd = map[i + 1]; + if (ch < mStart) { + start = 0; + end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) { + collapse = "right"; + } + } + if (start != null) { + node = map[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) { + collapse = bias; + } + if (bias == "left" && start == 0) { + while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2]; + collapse = "left"; + } + } + if (bias == "right" && start == mEnd - mStart) { + while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2]; + collapse = "right"; + } + } + break; + } + } + return { + node: node, + start: start, + end: end, + collapse: collapse, + coverStart: mStart, + coverEnd: mEnd + }; + } + function getUsefulRect(rects, bias) { + var rect = nullRect; + if (bias == "left") { + for (var i = 0; i < rects.length; i++) { + if ((rect = rects[i]).left != rect.right) { + break; + } + } + } else { + for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { + if ((rect = rects[i$1]).left != rect.right) { + break; + } + } + } + return rect; + } + function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, + start = place.start, + end = place.end, + collapse = place.collapse; + var rect; + if (node.nodeType == 3) { + // If it is a text node, use a range to retrieve the coordinates. + for (var i$1 = 0; i$1 < 4; i$1++) { + // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { + --start; + } + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { + ++end; + } + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) { + rect = node.parentNode.getBoundingClientRect(); + } else { + rect = getUsefulRect(range(node, start, end).getClientRects(), bias); + } + if (rect.left || rect.right || start == 0) { + break; + } + end = start; + start = start - 1; + collapse = "right"; + } + if (ie && ie_version < 11) { + rect = maybeUpdateRectForZooming(cm.display.measure, rect); + } + } else { + // If it is a widget, simply get the box for the whole widget. + if (start > 0) { + collapse = bias = "right"; + } + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) { + rect = rects[bias == "right" ? rects.length - 1 : 0]; + } else { + rect = node.getBoundingClientRect(); + } + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) { + rect = { + left: rSpan.left, + right: rSpan.left + charWidth(cm.display), + top: rSpan.top, + bottom: rSpan.bottom + }; + } else { + rect = nullRect; + } + } + var rtop = rect.top - prepared.rect.top, + rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + var i = 0; + for (; i < heights.length - 1; i++) { + if (mid < heights[i]) { + break; + } + } + var top = i ? heights[i - 1] : 0, + bot = heights[i]; + var result = { + left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, + bottom: bot + }; + if (!rect.left && !rect.right) { + result.bogus = true; + } + if (!cm.options.singleCursorHeightPerLine) { + result.rtop = rtop; + result.rbottom = rbot; + } + return result; + } + + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) { + return rect; + } + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return { + left: rect.left * scaleX, + right: rect.right * scaleX, + top: rect.top * scaleY, + bottom: rect.bottom * scaleY + }; + } + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) { + for (var i = 0; i < lineView.rest.length; i++) { + lineView.measure.caches[i] = {}; + } + } + } + } + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) { + clearLineMeasurementCacheFor(cm.display.view[i]); + } + } + function clearCaches(cm) { + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) { + cm.display.maxLineChanged = true; + } + cm.display.lineNumChars = null; + } + function pageScrollX() { + // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 + // which causes page_Offset and bounding client rects to use + // different reference viewports and invalidate our calculations. + if (chrome && android) { + return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)); + } + return window.pageXOffset || (document.documentElement || document.body).scrollLeft; + } + function pageScrollY() { + if (chrome && android) { + return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)); + } + return window.pageYOffset || (document.documentElement || document.body).scrollTop; + } + + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"./null (editor), "window", + // or "page". + function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { + if (!includeWidgets && lineObj.widgets) { + for (var i = 0; i < lineObj.widgets.length; ++i) { + if (lineObj.widgets[i].above) { + var size = widgetHeight(lineObj.widgets[i]); + rect.top += size; + rect.bottom += size; + } + } + } + if (context == "line") { + return rect; + } + if (!context) { + context = "local"; + } + var yOff = heightAtLine(lineObj); + if (context == "local") { + yOff += paddingTop(cm.display); + } else { + yOff -= cm.display.viewOffset; + } + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); + rect.left += xOff; + rect.right += xOff; + } + rect.top += yOff; + rect.bottom += yOff; + return rect; + } + + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"./null. + function fromCoordSystem(cm, coords, context) { + if (context == "div") { + return coords; + } + var left = coords.left, + top = coords.top; + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX(); + top -= pageScrollY(); + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; + } + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); + return { + left: left - lineSpaceBox.left, + top: top - lineSpaceBox.top + }; + } + function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) { + lineObj = getLine(cm.doc, pos.line); + } + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); + } + + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. + // A cursor Pos(line, char, "before") is on the same visual line as `char - 1` + // and after `char - 1` in writing order of `char - 1` + // A cursor Pos(line, char, "after") is on the same visual line as `char` + // and before `char` in writing order of `char` + // Examples (upper-case letters are RTL, lower-case are LTR): + // Pos(0, 1, ...) + // before after + // ab a|b a|b + // aB a|B aB| + // Ab |Ab A|b + // AB B|A B|A + // Every position after the last character on a line is considered to stick + // to the last character on the line. + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) { + preparedMeasure = prepareMeasureForLine(cm, lineObj); + } + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) { + m.left = m.right; + } else { + m.right = m.left; + } + return intoCoordSystem(cm, lineObj, m, context); + } + var order = getOrder(lineObj, cm.doc.direction), + ch = pos.ch, + sticky = pos.sticky; + if (ch >= lineObj.text.length) { + ch = lineObj.text.length; + sticky = "before"; + } else if (ch <= 0) { + ch = 0; + sticky = "after"; + } + if (!order) { + return get(sticky == "before" ? ch - 1 : ch, sticky == "before"); + } + function getBidi(ch, partPos, invert) { + var part = order[partPos], + right = part.level % 2 != 0; + return get(invert ? ch - 1 : ch, right != invert); + } + var partPos = getBidiPartAt(order, ch, sticky); + var other = bidiOther; + var val = getBidi(ch, partPos, sticky == "before"); + if (other != null) { + val.other = getBidi(ch, other, sticky != "before"); + } + return val; + } + + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. + function estimateCoords(cm, pos) { + var left = 0; + pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) { + left = charWidth(cm.display) * pos.ch; + } + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return { + left: left, + right: left, + top: top, + bottom: top + lineObj.height + }; + } + + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. + function PosWithInfo(line, ch, sticky, outside, xRel) { + var pos = Pos(line, ch, sticky); + pos.xRel = xRel; + if (outside) { + pos.outside = true; + } + return pos; + } + + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) { + return PosWithInfo(doc.first, 0, null, true, -1); + } + var lineN = lineAtHeight(doc, y), + last = doc.first + doc.size - 1; + if (lineN > last) { + return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1); + } + if (x < 0) { + x = 0; + } + var lineObj = getLine(doc, lineN); + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var merged = collapsedSpanAtEnd(lineObj); + var mergedPos = merged && merged.find(0, true); + if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) { + lineN = lineNo(lineObj = mergedPos.to.line); + } else { + return found; + } + } + } + function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { + var measure = function (ch) { + return intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), "line"); + }; + var end = lineObj.text.length; + var begin = findFirst(function (ch) { + return measure(ch - 1).bottom <= y; + }, end, 0); + end = findFirst(function (ch) { + return measure(ch).top > y; + }, begin, end); + return { + begin: begin, + end: end + }; + } + function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { + var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; + return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop); + } + function coordsCharInner(cm, lineObj, lineNo, x, y) { + y -= heightAtLine(lineObj); + var begin = 0, + end = lineObj.text.length; + var preparedMeasure = prepareMeasureForLine(cm, lineObj); + var pos; + var order = getOrder(lineObj, cm.doc.direction); + if (order) { + if (cm.options.lineWrapping) { + var assign; + assign = wrappedLineExtent(cm, lineObj, preparedMeasure, y), begin = assign.begin, end = assign.end, assign; + } + pos = new Pos(lineNo, Math.floor(begin + (end - begin) / 2)); + var beginLeft = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left; + var dir = beginLeft < x ? 1 : -1; + var prevDiff, + diff = beginLeft - x, + prevPos; + var steps = Math.ceil((end - begin) / 4); + outer: do { + prevDiff = diff; + prevPos = pos; + var i = 0; + for (; i < steps; ++i) { + var prevPos$1 = pos; + pos = moveVisually(cm, lineObj, pos, dir); + if (pos == null || pos.ch < begin || end <= (pos.sticky == "before" ? pos.ch - 1 : pos.ch)) { + pos = prevPos$1; + break outer; + } + } + diff = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left - x; + if (steps > 1) { + var diff_change_per_step = Math.abs(diff - prevDiff) / steps; + steps = Math.min(steps, Math.ceil(Math.abs(diff) / diff_change_per_step)); + dir = diff < 0 ? 1 : -1; + } + } while (diff != 0 && (steps > 1 || dir < 0 != diff < 0 && Math.abs(diff) <= Math.abs(prevDiff))); + if (Math.abs(diff) > Math.abs(prevDiff)) { + if (diff < 0 == prevDiff < 0) { + throw new Error("Broke out of infinite loop in coordsCharInner"); + } + pos = prevPos; + } + } else { + var ch = findFirst(function (ch) { + var box = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), "line"); + if (box.top > y) { + // For the cursor stickiness + end = Math.min(ch, end); + return true; + } else if (box.bottom <= y) { + return false; + } else if (box.left > x) { + return true; + } else if (box.right < x) { + return false; + } else { + return x - box.left < box.right - x; + } + }, begin, end); + ch = skipExtendingChars(lineObj.text, ch, 1); + pos = new Pos(lineNo, ch, ch == end ? "before" : "after"); + } + var coords = cursorCoords(cm, pos, "line", lineObj, preparedMeasure); + if (y < coords.top || coords.bottom < y) { + pos.outside = true; + } + pos.xRel = x < coords.left ? -1 : x > coords.right ? 1 : 0; + return pos; + } + var measureText; + // Compute the default text height. + function textHeight(display) { + if (display.cachedTextHeight != null) { + return display.cachedTextHeight; + } + if (measureText == null) { + measureText = elt("pre"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) { + display.cachedTextHeight = height; + } + removeChildren(display.measure); + return height || 1; + } + + // Compute the default character width. + function charWidth(display) { + if (display.cachedCharWidth != null) { + return display.cachedCharWidth; + } + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor]); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), + width = (rect.right - rect.left) / 10; + if (width > 2) { + display.cachedCharWidth = width; + } + return width || 10; + } + + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. + function getDimensions(cm) { + var d = cm.display, + left = {}, + width = {}; + var gutterLeft = d.gutters.clientLeft; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; + width[cm.options.gutters[i]] = n.clientWidth; + } + return { + fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth + }; + } + + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; + } + + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). + function estimateHeight(cm) { + var th = textHeight(cm.display), + wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function (line) { + if (lineIsHidden(cm.doc, line)) { + return 0; + } + var widgetsHeight = 0; + if (line.widgets) { + for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) { + widgetsHeight += line.widgets[i].height; + } + } + } + if (wrapping) { + return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; + } else { + return widgetsHeight + th; + } + }; + } + function estimateLineHeights(cm) { + var doc = cm.doc, + est = estimateHeight(cm); + doc.iter(function (line) { + var estHeight = est(line); + if (estHeight != line.height) { + updateLineHeight(line, estHeight); + } + }); + } + + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. + function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display; + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { + return null; + } + var x, + y, + space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { + x = e.clientX - space.left; + y = e.clientY - space.top; + } catch (e) { + return null; + } + var coords = coordsChar(cm, x, y), + line; + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); + } + return coords; + } + + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) { + return null; + } + n -= cm.display.viewFrom; + if (n < 0) { + return null; + } + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) { + return i; + } + } + } + function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()); + } + function prepareSelection(cm, primary) { + var doc = cm.doc, + result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (primary === false && i == doc.sel.primIndex) { + continue; + } + var range = doc.sel.ranges[i]; + if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { + continue; + } + var collapsed = range.empty(); + if (collapsed || cm.options.showCursorWhenSelecting) { + drawSelectionCursor(cm, range.head, curFragment); + } + if (!collapsed) { + drawSelectionRange(cm, range, selFragment); + } + } + return result; + } + + // Draws a cursor for the given range + function drawSelectionCursor(cm, head, output) { + var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } + } + + // Draws the given range as a highlighted selection + function drawSelectionRange(cm, range, output) { + var display = cm.display, + doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), + leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; + function add(left, top, width, bottom) { + if (top < 0) { + top = 0; + } + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")); + } + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias); + } + iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) { + var leftPos = coords(from, "left"), + rightPos, + left, + right; + if (from == to) { + rightPos = leftPos; + left = right = leftPos.left; + } else { + rightPos = coords(to - 1, "right"); + if (dir == "rtl") { + var tmp = leftPos; + leftPos = rightPos; + rightPos = tmp; + } + left = leftPos.left; + right = rightPos.right; + } + if (fromArg == null && from == 0) { + left = leftSide; + } + if (rightPos.top - leftPos.top > 3) { + // Different lines, draw top part + add(left, leftPos.top, null, leftPos.bottom); + left = leftSide; + if (leftPos.bottom < rightPos.top) { + add(left, leftPos.bottom, null, rightPos.top); + } + } + if (toArg == null && to == lineLen) { + right = rightSide; + } + if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) { + start = leftPos; + } + if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) { + end = rightPos; + } + if (left < leftSide + 1) { + left = leftSide; + } + add(left, rightPos.top, right - left, rightPos.bottom); + }); + return { + start: start, + end: end + }; + } + var sFrom = range.from(), + sTo = range.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); + } else { + var fromLine = getLine(doc, sFrom.line), + toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); + } + } + if (leftEnd.bottom < rightStart.top) { + add(leftSide, leftEnd.bottom, null, rightStart.top); + } + } + output.appendChild(fragment); + } + + // Cursor-blinking + function restartBlink(cm) { + if (!cm.state.focused) { + return; + } + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; + if (cm.options.cursorBlinkRate > 0) { + display.blinker = setInterval(function () { + return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; + }, cm.options.cursorBlinkRate); + } else if (cm.options.cursorBlinkRate < 0) { + display.cursorDiv.style.visibility = "hidden"; + } + } + function ensureFocus(cm) { + if (!cm.state.focused) { + cm.display.input.focus(); + onFocus(cm); + } + } + function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true; + setTimeout(function () { + if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + onBlur(cm); + } + }, 100); + } + function onFocus(cm, e) { + if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + } + if (cm.options.readOnly == "nocursor") { + return; + } + if (!cm.state.focused) { + signal(cm, "focus", cm, e); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset(); + if (webkit) { + setTimeout(function () { + return cm.display.input.reset(true); + }, 20); + } // Issue #1730 + } + cm.display.input.receivedFocus(); + } + restartBlink(cm); + } + function onBlur(cm, e) { + if (cm.state.delayingBlurEvent) { + return; + } + if (cm.state.focused) { + signal(cm, "blur", cm, e); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); + } + clearInterval(cm.display.blinker); + setTimeout(function () { + if (!cm.state.focused) { + cm.display.shift = false; + } + }, 150); + } + + // Read the actual heights of the rendered lines, and update their + // stored heights to match. + function updateHeightsInViewport(cm) { + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], + height = void 0; + if (cur.hidden) { + continue; + } + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + } + var diff = cur.line.height - height; + if (height < 2) { + height = textHeight(display); + } + if (diff > .005 || diff < -.005) { + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) { + for (var j = 0; j < cur.rest.length; j++) { + updateWidgetHeight(cur.rest[j]); + } + } + } + } + } + + // Read and store the height of line widgets associated with the + // given line. + function updateWidgetHeight(line) { + if (line.widgets) { + for (var i = 0; i < line.widgets.length; ++i) { + line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; + } + } + } + + // Compute the lines that are visible in a given viewport (defaults + // the the current scroll position). viewport may contain top, + // height, and ensure (see op.scrollToPos) properties. + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; + var from = lineAtHeight(doc, top), + to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, + ensureTo = viewport.ensure.to.line; + if (ensureFrom < from) { + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; + } + } + return { + from: from, + to: Math.max(to, from + 1) + }; + } + + // Re-align line numbers and gutter marks to compensate for + // horizontal scrolling. + function alignHorizontally(cm) { + var display = cm.display, + view = display.view; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { + return; + } + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, + left = comp + "px"; + for (var i = 0; i < view.length; i++) { + if (!view[i].hidden) { + if (cm.options.fixedGutter) { + if (view[i].gutter) { + view[i].gutter.style.left = left; + } + if (view[i].gutterBackground) { + view[i].gutterBackground.style.left = left; + } + } + var align = view[i].alignable; + if (align) { + for (var j = 0; j < align.length; j++) { + align[j].style.left = left; + } + } + } + } + if (cm.options.fixedGutter) { + display.gutters.style.left = comp + gutterW + "px"; + } + } + + // Used to ensure that the line number gutter is still the right + // size for the current document size. Returns true when an update + // is needed. + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) { + return false; + } + var doc = cm.doc, + last = lineNumberFor(cm.options, doc.first + doc.size - 1), + display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, + padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + updateGutterSpace(cm); + return true; + } + return false; + } + + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. + function maybeScrollWindow(cm, rect) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) { + return; + } + var display = cm.display, + box = display.sizer.getBoundingClientRect(), + doScroll = null; + if (rect.top + box.top < 0) { + doScroll = true; + } else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { + doScroll = false; + } + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, "position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + rect.left + "px; width: " + Math.max(2, rect.right - rect.left) + "px;"); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } + } + + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). + function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) { + margin = 0; + } + var rect; + if (!cm.options.lineWrapping && pos == end) { + // Set pos and end to the cursor positions around the character pos sticks to + // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch + // If pos == Pos(_, 0, "before"), pos and end are unchanged + pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; + end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; + } + for (var limit = 0; limit < 5; limit++) { + var changed = false; + var coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + rect = { + left: Math.min(coords.left, endCoords.left), + top: Math.min(coords.top, endCoords.top) - margin, + right: Math.max(coords.left, endCoords.left), + bottom: Math.max(coords.bottom, endCoords.bottom) + margin + }; + var scrollPos = calculateScrollPos(cm, rect); + var startTop = cm.doc.scrollTop, + startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) { + changed = true; + } + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { + changed = true; + } + } + if (!changed) { + break; + } + } + return rect; + } + + // Scroll a given set of coordinates into view (immediately). + function scrollIntoView(cm, rect) { + var scrollPos = calculateScrollPos(cm, rect); + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop); + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + } + } + + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. + function calculateScrollPos(cm, rect) { + var display = cm.display, + snapMargin = textHeight(cm.display); + if (rect.top < 0) { + rect.top = 0; + } + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), + result = {}; + if (rect.bottom - rect.top > screen) { + rect.bottom = rect.top + screen; + } + var docBottom = cm.doc.height + paddingVert(display); + var atTop = rect.top < snapMargin, + atBottom = rect.bottom > docBottom - snapMargin; + if (rect.top < screentop) { + result.scrollTop = atTop ? 0 : rect.top; + } else if (rect.bottom > screentop + screen) { + var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen); + if (newTop != screentop) { + result.scrollTop = newTop; + } + } + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); + var tooWide = rect.right - rect.left > screenw; + if (tooWide) { + rect.right = rect.left + screenw; + } + if (rect.left < 10) { + result.scrollLeft = 0; + } else if (rect.left < screenleft) { + result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); + } else if (rect.right > screenw + screenleft - 3) { + result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; + } + return result; + } + + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). + function addToScrollTop(cm, top) { + if (top == null) { + return; + } + resolveScrollToPos(cm); + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; + } + + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(); + cm.curOp.scrollToPos = { + from: cur, + to: cur, + margin: cm.options.cursorScrollMargin + }; + } + function scrollToCoords(cm, x, y) { + if (x != null || y != null) { + resolveScrollToPos(cm); + } + if (x != null) { + cm.curOp.scrollLeft = x; + } + if (y != null) { + cm.curOp.scrollTop = y; + } + } + function scrollToRange(cm, range) { + resolveScrollToPos(cm); + cm.curOp.scrollToPos = range; + } + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. + function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos; + if (range) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range.from), + to = estimateCoords(cm, range.to); + scrollToCoordsRange(cm, from, to, range.margin); + } + } + function scrollToCoordsRange(cm, from, to, margin) { + var sPos = calculateScrollPos(cm, { + left: Math.min(from.left, to.left), + top: Math.min(from.top, to.top) - margin, + right: Math.max(from.right, to.right), + bottom: Math.max(from.bottom, to.bottom) + margin + }); + scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); + } + + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. + function updateScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) { + return; + } + if (!gecko) { + updateDisplaySimple(cm, { + top: val + }); + } + setScrollTop(cm, val, true); + if (gecko) { + updateDisplaySimple(cm); + } + startWorker(cm, 100); + } + function setScrollTop(cm, val, forceScroll) { + val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val); + if (cm.display.scroller.scrollTop == val && !forceScroll) { + return; + } + cm.doc.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (cm.display.scroller.scrollTop != val) { + cm.display.scroller.scrollTop = val; + } + } + + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. + function setScrollLeft(cm, val, isScroller, forceScroll) { + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); + if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { + return; + } + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) { + cm.display.scroller.scrollLeft = val; + } + cm.display.scrollbars.setScrollLeft(val); + } + + // SCROLLBARS + + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. + function measureForScrollbars(cm) { + var d = cm.display, + gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, + clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + }; + } + var NativeScrollbars = function (place, scroll, cm) { + this.cm = cm; + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + place(vert); + place(horiz); + on(vert, "scroll", function () { + if (vert.clientHeight) { + scroll(vert.scrollTop, "vertical"); + } + }); + on(horiz, "scroll", function () { + if (horiz.clientWidth) { + scroll(horiz.scrollLeft, "horizontal"); + } + }); + this.checkedZeroWidth = false; + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) { + this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; + } + }; + NativeScrollbars.prototype.update = function (measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + var sWidth = measure.nativeBarWidth; + if (needsV) { + this.vert.style.display = "block"; + this.vert.style.bottom = needsH ? sWidth + "px" : "0"; + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; + } else { + this.vert.style.display = ""; + this.vert.firstChild.style.height = "0"; + } + if (needsH) { + this.horiz.style.display = "block"; + this.horiz.style.right = needsV ? sWidth + "px" : "0"; + this.horiz.style.left = measure.barLeft + "px"; + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); + this.horiz.firstChild.style.width = Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; + } else { + this.horiz.style.display = ""; + this.horiz.firstChild.style.width = "0"; + } + if (!this.checkedZeroWidth && measure.clientHeight > 0) { + if (sWidth == 0) { + this.zeroWidthHack(); + } + this.checkedZeroWidth = true; + } + return { + right: needsV ? sWidth : 0, + bottom: needsH ? sWidth : 0 + }; + }; + NativeScrollbars.prototype.setScrollLeft = function (pos) { + if (this.horiz.scrollLeft != pos) { + this.horiz.scrollLeft = pos; + } + if (this.disableHoriz) { + this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); + } + }; + NativeScrollbars.prototype.setScrollTop = function (pos) { + if (this.vert.scrollTop != pos) { + this.vert.scrollTop = pos; + } + if (this.disableVert) { + this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); + } + }; + NativeScrollbars.prototype.zeroWidthHack = function () { + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + this.horiz.style.height = this.vert.style.width = w; + this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; + this.disableHoriz = new Delayed(); + this.disableVert = new Delayed(); + }; + NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { + bar.style.pointerEvents = "auto"; + function maybeDisable() { + // To find out whether the scrollbar is still visible, we + // check whether the element under the pixel in the bottom + // right corner of the scrollbar box is the scrollbar box + // itself (when the bar is still visible) or its filler child + // (when the bar is hidden). If it is still visible, we keep + // it enabled, if it's hidden, we disable pointer events. + var box = bar.getBoundingClientRect(); + var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1); + if (elt != bar) { + bar.style.pointerEvents = "none"; + } else { + delay.set(1000, maybeDisable); + } + } + delay.set(1000, maybeDisable); + }; + NativeScrollbars.prototype.clear = function () { + var parent = this.horiz.parentNode; + parent.removeChild(this.horiz); + parent.removeChild(this.vert); + }; + var NullScrollbars = function () {}; + NullScrollbars.prototype.update = function () { + return { + bottom: 0, + right: 0 + }; + }; + NullScrollbars.prototype.setScrollLeft = function () {}; + NullScrollbars.prototype.setScrollTop = function () {}; + NullScrollbars.prototype.clear = function () {}; + function updateScrollbars(cm, measure) { + if (!measure) { + measure = measureForScrollbars(cm); + } + var startWidth = cm.display.barWidth, + startHeight = cm.display.barHeight; + updateScrollbarsInner(cm, measure); + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) { + updateHeightsInViewport(cm); + } + updateScrollbarsInner(cm, measureForScrollbars(cm)); + startWidth = cm.display.barWidth; + startHeight = cm.display.barHeight; + } + } + + // Re-synchronize the fake scrollbars with the actual size of the + // content. + function updateScrollbarsInner(cm, measure) { + var d = cm.display; + var sizes = d.scrollbars.update(measure); + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; + d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = sizes.bottom + "px"; + d.scrollbarFiller.style.width = sizes.right + "px"; + } else { + d.scrollbarFiller.style.display = ""; + } + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block"; + d.gutterFiller.style.height = sizes.bottom + "px"; + d.gutterFiller.style.width = measure.gutterWidth + "px"; + } else { + d.gutterFiller.style.display = ""; + } + } + var scrollbarModel = { + "native": NativeScrollbars, + "null": NullScrollbars + }; + function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear(); + if (cm.display.scrollbars.addClass) { + rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } + } + cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function () { + if (cm.state.focused) { + setTimeout(function () { + return cm.display.input.focus(); + }, 0); + } + }); + node.setAttribute("cm-not-content", "true"); + }, function (pos, axis) { + if (axis == "horizontal") { + setScrollLeft(cm, pos); + } else { + updateScrollTop(cm, pos); + } + }, cm); + if (cm.display.scrollbars.addClass) { + addClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } + } + + // Operations are used to wrap a series of changes to the editor + // state in such a way that each change won't have to update the + // cursor and display (which would be awkward, slow, and + // error-prone). Instead, display updates are batched and then all + // combined and executed at once. + + var nextOpId = 0; + // Start a new operation. + function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, + // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, + // Used to detect need to update scrollbar + forceUpdate: false, + // Used to force a redraw + updateInput: null, + // Whether to reset the input textarea + typing: false, + // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, + // Accumulated changes, for firing change events + cursorActivityHandlers: null, + // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, + // Tracks which cursorActivity handlers have been called already + selectionChanged: false, + // Whether the selection needs to be redrawn + updateMaxLine: false, + // Set when the widest line needs to be determined anew + scrollLeft: null, + scrollTop: null, + // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, + // Used to scroll to a specific position + focus: false, + id: ++nextOpId // Unique ID + }; + pushOperation(cm.curOp); + } + + // Finish an operation, updating the display and signalling delayed events + function endOperation(cm) { + var op = cm.curOp; + finishOperation(op, function (group) { + for (var i = 0; i < group.ops.length; i++) { + group.ops[i].cm.curOp = null; + } + endOperations(group); + }); + } + + // The DOM updates done when an operation finishes are batched so + // that the minimum number of relayouts are required. + function endOperations(group) { + var ops = group.ops; + for (var i = 0; i < ops.length; i++) + // Read DOM + { + endOperation_R1(ops[i]); + } + for (var i$1 = 0; i$1 < ops.length; i$1++) + // Write DOM (maybe) + { + endOperation_W1(ops[i$1]); + } + for (var i$2 = 0; i$2 < ops.length; i$2++) + // Read DOM + { + endOperation_R2(ops[i$2]); + } + for (var i$3 = 0; i$3 < ops.length; i$3++) + // Write DOM (maybe) + { + endOperation_W2(ops[i$3]); + } + for (var i$4 = 0; i$4 < ops.length; i$4++) + // Read DOM + { + endOperation_finish(ops[i$4]); + } + } + function endOperation_R1(op) { + var cm = op.cm, + display = cm.display; + maybeClipScrollbars(cm); + if (op.updateMaxLine) { + findMaxLine(cm); + } + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || op.scrollToPos.to.line >= display.viewTo) || display.maxLineChanged && cm.options.lineWrapping; + op.update = op.mustUpdate && new DisplayUpdate(cm, op.mustUpdate && { + top: op.scrollTop, + ensure: op.scrollToPos + }, op.forceUpdate); + } + function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } + function endOperation_R2(op) { + var cm = op.cm, + display = cm.display; + if (op.updatedDisplay) { + updateHeightsInViewport(cm); + } + op.barMeasure = measureForScrollbars(cm); + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + cm.display.sizerWidth = op.adjustWidthTo; + op.barMeasure.scrollWidth = Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); + } + if (op.updatedDisplay || op.selectionChanged) { + op.preparedSelection = display.input.prepareSelection(op.focus); + } + } + function endOperation_W2(op) { + var cm = op.cm; + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; + if (op.maxScrollLeft < cm.doc.scrollLeft) { + setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); + } + cm.display.maxLineChanged = false; + } + var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus()); + if (op.preparedSelection) { + cm.display.input.showSelection(op.preparedSelection, takeFocus); + } + if (op.updatedDisplay || op.startHeight != cm.doc.height) { + updateScrollbars(cm, op.barMeasure); + } + if (op.updatedDisplay) { + setDocumentHeight(cm, op.barMeasure); + } + if (op.selectionChanged) { + restartBlink(cm); + } + if (cm.state.focused && op.updateInput) { + cm.display.input.reset(op.typing); + } + if (takeFocus) { + ensureFocus(op.cm); + } + } + function endOperation_finish(op) { + var cm = op.cm, + display = cm.display, + doc = cm.doc; + if (op.updatedDisplay) { + postUpdateDisplay(cm, op.update); + } + + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) { + display.wheelStartX = display.wheelStartY = null; + } + + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null) { + setScrollTop(cm, op.scrollTop, op.forceScroll); + } + if (op.scrollLeft != null) { + setScrollLeft(cm, op.scrollLeft, true, true); + } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); + maybeScrollWindow(cm, rect); + } + + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, + unhidden = op.maybeUnhiddenMarkers; + if (hidden) { + for (var i = 0; i < hidden.length; ++i) { + if (!hidden[i].lines.length) { + signal(hidden[i], "hide"); + } + } + } + if (unhidden) { + for (var i$1 = 0; i$1 < unhidden.length; ++i$1) { + if (unhidden[i$1].lines.length) { + signal(unhidden[i$1], "unhide"); + } + } + } + if (display.wrapper.offsetHeight) { + doc.scrollTop = cm.display.scroller.scrollTop; + } + + // Fire change events, and delayed event handlers + if (op.changeObjs) { + signal(cm, "changes", cm, op.changeObjs); + } + if (op.update) { + op.update.finish(); + } + } + + // Run the given function in an operation + function runInOp(cm, f) { + if (cm.curOp) { + return f(); + } + startOperation(cm); + try { + return f(); + } finally { + endOperation(cm); + } + } + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm, f) { + return function () { + if (cm.curOp) { + return f.apply(cm, arguments); + } + startOperation(cm); + try { + return f.apply(cm, arguments); + } finally { + endOperation(cm); + } + }; + } + // Used to add methods to editor and doc instances, wrapping them in + // operations. + function methodOp(f) { + return function () { + if (this.curOp) { + return f.apply(this, arguments); + } + startOperation(this); + try { + return f.apply(this, arguments); + } finally { + endOperation(this); + } + }; + } + function docMethodOp(f) { + return function () { + var cm = this.cm; + if (!cm || cm.curOp) { + return f.apply(this, arguments); + } + startOperation(cm); + try { + return f.apply(this, arguments); + } finally { + endOperation(cm); + } + }; + } + + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) { + from = cm.doc.first; + } + if (to == null) { + to = cm.doc.first + cm.doc.size; + } + if (!lendiff) { + lendiff = 0; + } + var display = cm.display; + if (lendiff && to < display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers > from)) { + display.updateLineNumbers = from; + } + cm.curOp.viewChanged = true; + if (from >= display.viewTo) { + // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) { + resetView(cm); + } + } else if (to <= display.viewFrom) { + // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } + } else if (from <= display.viewFrom && to >= display.viewTo) { + // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { + // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } + } else if (to >= display.viewTo) { + // Bottom overlap + var cut$1 = viewCuttingPoint(cm, from, from, -1); + if (cut$1) { + display.view = display.view.slice(0, cut$1.index); + display.viewTo = cut$1.lineN; + } else { + resetView(cm); + } + } else { + // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index).concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)).concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } + } + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) { + ext.lineN += lendiff; + } else if (from < ext.lineN + ext.size) { + display.externalMeasured = null; + } + } + } + + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, + ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) { + display.externalMeasured = null; + } + if (line < display.viewFrom || line >= display.viewTo) { + return; + } + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) { + return; + } + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) { + arr.push(type); + } + } + + // Clear the view. + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; + } + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), + diff, + view = cm.display.view; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) { + return { + index: index, + lineN: newN + }; + } + var n = cm.display.viewFrom; + for (var i = 0; i < index; i++) { + n += view[i].size; + } + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) { + return null; + } + diff = n + view[index].size - oldN; + index++; + } else { + diff = n - oldN; + } + oldN += diff; + newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) { + return null; + } + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return { + index: index, + lineN: newN + }; + } + + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. + function adjustView(cm, from, to) { + var display = cm.display, + view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) { + display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); + } else if (display.viewFrom < from) { + display.view = display.view.slice(findViewIndex(cm, from)); + } + display.viewFrom = from; + if (display.viewTo < to) { + display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); + } else if (display.viewTo > to) { + display.view = display.view.slice(0, findViewIndex(cm, to)); + } + } + display.viewTo = to; + } + + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, + dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) { + ++dirty; + } + } + return dirty; + } + + // HIGHLIGHT WORKER + + function startWorker(cm, time) { + if (cm.doc.highlightFrontier < cm.display.viewTo) { + cm.state.highlight.set(time, bind(highlightWorker, cm)); + } + } + function highlightWorker(cm) { + var doc = cm.doc; + if (doc.highlightFrontier >= cm.display.viewTo) { + return; + } + var end = +new Date() + cm.options.workTime; + var context = getContextBefore(cm, doc.highlightFrontier); + var changedLines = []; + doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { + if (context.line >= cm.display.viewFrom) { + // Visible + var oldStyles = line.styles; + var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null; + var highlighted = highlightLine(cm, line, context, true); + if (resetState) { + context.state = resetState; + } + line.styles = highlighted.styles; + var oldCls = line.styleClasses, + newCls = highlighted.classes; + if (newCls) { + line.styleClasses = newCls; + } else if (oldCls) { + line.styleClasses = null; + } + var ischange = !oldStyles || oldStyles.length != line.styles.length || oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); + for (var i = 0; !ischange && i < oldStyles.length; ++i) { + ischange = oldStyles[i] != line.styles[i]; + } + if (ischange) { + changedLines.push(context.line); + } + line.stateAfter = context.save(); + context.nextLine(); + } else { + if (line.text.length <= cm.options.maxHighlightLength) { + processLine(cm, line.text, context); + } + line.stateAfter = context.line % 5 == 0 ? context.save() : null; + context.nextLine(); + } + if (+new Date() > end) { + startWorker(cm, cm.options.workDelay); + return true; + } + }); + doc.highlightFrontier = context.line; + doc.modeFrontier = Math.max(doc.modeFrontier, context.line); + if (changedLines.length) { + runInOp(cm, function () { + for (var i = 0; i < changedLines.length; i++) { + regLineChange(cm, changedLines[i], "text"); + } + }); + } + } + + // DISPLAY DRAWING + + var DisplayUpdate = function (cm, viewport, force) { + var display = cm.display; + this.viewport = viewport; + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.wrapperWidth = display.wrapper.clientWidth; + this.oldDisplayWidth = displayWidth(cm); + this.force = force; + this.dims = getDimensions(cm); + this.events = []; + }; + DisplayUpdate.prototype.signal = function (emitter, type) { + if (hasHandler(emitter, type)) { + this.events.push(arguments); + } + }; + DisplayUpdate.prototype.finish = function () { + var this$1 = this; + for (var i = 0; i < this.events.length; i++) { + signal.apply(null, this$1.events[i]); + } + }; + function maybeClipScrollbars(cm) { + var display = cm.display; + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; + display.heightForcer.style.height = scrollGap(cm) + "px"; + display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; + display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; + display.scrollbarsClipped = true; + } + } + function selectionSnapshot(cm) { + if (cm.hasFocus()) { + return null; + } + var active = activeElt(); + if (!active || !contains(cm.display.lineDiv, active)) { + return null; + } + var result = { + activeElt: active + }; + if (window.getSelection) { + var sel = window.getSelection(); + if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { + result.anchorNode = sel.anchorNode; + result.anchorOffset = sel.anchorOffset; + result.focusNode = sel.focusNode; + result.focusOffset = sel.focusOffset; + } + } + return result; + } + function restoreSelection(snapshot) { + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { + return; + } + snapshot.activeElt.focus(); + if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { + var sel = window.getSelection(), + range = document.createRange(); + range.setEnd(snapshot.anchorNode, snapshot.anchorOffset); + range.collapse(false); + sel.removeAllRanges(); + sel.addRange(range); + sel.extend(snapshot.focusNode, snapshot.focusOffset); + } + } + + // Does the actual updating of the line display. Bails out + // (returning false) when there is nothing to be done and forced is + // false. + function updateDisplayIfNeeded(cm, update) { + var display = cm.display, + doc = cm.doc; + if (update.editorIsHidden) { + resetView(cm); + return false; + } + + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && display.renderedView == display.view && countDirtyView(cm) == 0) { + return false; + } + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm); + update.dims = getDimensions(cm); + } + + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size; + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); + if (display.viewFrom < from && from - display.viewFrom < 20) { + from = Math.max(doc.first, display.viewFrom); + } + if (display.viewTo > to && display.viewTo - to < 20) { + to = Math.min(end, display.viewTo); + } + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); + } + var different = from != display.viewFrom || to != display.viewTo || display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; + adjustView(cm, from, to); + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px"; + var toUpdate = countDirtyView(cm); + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) { + return false; + } + + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var selSnapshot = selectionSnapshot(cm); + if (toUpdate > 4) { + display.lineDiv.style.display = "none"; + } + patchDisplay(cm, display.updateLineNumbers, update.dims); + if (toUpdate > 4) { + display.lineDiv.style.display = ""; + } + display.renderedView = display.view; + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + restoreSelection(selSnapshot); + + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); + display.gutters.style.height = display.sizer.style.minHeight = 0; + if (different) { + display.lastWrapHeight = update.wrapperHeight; + display.lastWrapWidth = update.wrapperWidth; + startWorker(cm, 400); + } + display.updateLineNumbers = null; + return true; + } + function postUpdateDisplay(cm, update) { + var viewport = update.viewport; + for (var first = true;; first = false) { + if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) { + viewport = { + top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top) + }; + } + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport); + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) { + break; + } + } + if (!updateDisplayIfNeeded(cm, update)) { + break; + } + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.force = false; + } + update.signal(cm, "update", cm); + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + cm.display.reportedViewFrom = cm.display.viewFrom; + cm.display.reportedViewTo = cm.display.viewTo; + } + } + function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport); + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.finish(); + } + } + + // Sync the actual display DOM structure with display.view, removing + // nodes for lines that are no longer in view, and creating the ones + // that are not there yet, and updating the ones that are out of + // date. + function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, + lineNumbers = cm.options.lineNumbers; + var container = display.lineDiv, + cur = container.firstChild; + function rm(node) { + var next = node.nextSibling; + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) { + node.style.display = "none"; + } else { + node.parentNode.removeChild(node); + } + return next; + } + var view = display.view, + lineN = display.viewFrom; + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { + // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); + } else { + // Already drawn + while (cur != lineView.node) { + cur = rm(cur); + } + var updateNumber = lineNumbers && updateNumbersFrom != null && updateNumbersFrom <= lineN && lineView.lineNumber; + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) { + updateNumber = false; + } + updateLineForChanges(cm, lineView, lineN, dims); + } + if (updateNumber) { + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); + } + cur = lineView.node.nextSibling; + } + lineN += lineView.size; + } + while (cur) { + cur = rm(cur); + } + } + function updateGutterSpace(cm) { + var width = cm.display.gutters.offsetWidth; + cm.display.sizer.style.marginLeft = width + "px"; + } + function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px"; + cm.display.heightForcer.style.top = measure.docHeight + "px"; + cm.display.gutters.style.height = measure.docHeight + cm.display.barHeight + scrollGap(cm) + "px"; + } + + // Rebuild the gutter elements, ensure the margin to the left of the + // code matches their width. + function updateGutters(cm) { + var gutters = cm.display.gutters, + specs = cm.options.gutters; + removeChildren(gutters); + var i = 0; + for (; i < specs.length; ++i) { + var gutterClass = specs[i]; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); + if (gutterClass == "CodeMirror-linenumbers") { + cm.display.lineGutter = gElt; + gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = i ? "" : "none"; + updateGutterSpace(cm); + } + + // Make sure the gutters options contains the element + // "CodeMirror-linenumbers" when the lineNumbers option is true. + function setGuttersForLineNumbers(options) { + var found = indexOf(options.gutters, "CodeMirror-linenumbers"); + if (found == -1 && options.lineNumbers) { + options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); + } else if (found > -1 && !options.lineNumbers) { + options.gutters = options.gutters.slice(0); + options.gutters.splice(found, 1); + } + } + var wheelSamples = 0; + var wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) { + wheelPixelsPerUnit = -.53; + } else if (gecko) { + wheelPixelsPerUnit = 15; + } else if (chrome) { + wheelPixelsPerUnit = -.7; + } else if (safari) { + wheelPixelsPerUnit = -1 / 3; + } + function wheelEventDelta(e) { + var dx = e.wheelDeltaX, + dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { + dx = e.detail; + } + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { + dy = e.detail; + } else if (dy == null) { + dy = e.wheelDelta; + } + return { + x: dx, + y: dy + }; + } + function wheelEventPixels(e) { + var delta = wheelEventDelta(e); + delta.x *= wheelPixelsPerUnit; + delta.y *= wheelPixelsPerUnit; + return delta; + } + function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), + dx = delta.x, + dy = delta.y; + var display = cm.display, + scroll = display.scroller; + // Quit if there's nothing to scroll here + var canScrollX = scroll.scrollWidth > scroll.clientWidth; + var canScrollY = scroll.scrollHeight > scroll.clientHeight; + if (!(dx && canScrollX || dy && canScrollY)) { + return; + } + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer; + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy && canScrollY) { + updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); + } + setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit)); + // Only prevent default scrolling if vertical scrolling is + // actually possible. Otherwise, it causes vertical scroll + // jitter on OSX trackpads when deltaX is small and deltaY + // is large (issue #3579) + if (!dy || dy && canScrollY) { + e_preventDefault(e); + } + display.wheelStartX = null; // Abort measurement, if in progress + return; + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.doc.scrollTop, + bot = top + display.wrapper.clientHeight; + if (pixels < 0) { + top = Math.max(0, top + pixels - 50); + } else { + bot = Math.min(cm.doc.height, bot + pixels + 50); + } + updateDisplaySimple(cm, { + top: top, + bottom: bot + }); + } + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; + display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; + display.wheelDY = dy; + setTimeout(function () { + if (display.wheelStartX == null) { + return; + } + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = movedY && display.wheelDY && movedY / display.wheelDY || movedX && display.wheelDX && movedX / display.wheelDX; + display.wheelStartX = display.wheelStartY = null; + if (!sample) { + return; + } + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; + display.wheelDY += dy; + } + } + } + + // Selection objects are immutable. A new one is created every time + // the selection changes. A selection is one or more non-overlapping + // (and non-touching) ranges, sorted, and an integer that indicates + // which one is the primary selection (the one that's scrolled into + // view, that getCursor returns, etc). + var Selection = function (ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; + }; + Selection.prototype.primary = function () { + return this.ranges[this.primIndex]; + }; + Selection.prototype.equals = function (other) { + var this$1 = this; + if (other == this) { + return true; + } + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { + return false; + } + for (var i = 0; i < this.ranges.length; i++) { + var here = this$1.ranges[i], + there = other.ranges[i]; + if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { + return false; + } + } + return true; + }; + Selection.prototype.deepCopy = function () { + var this$1 = this; + var out = []; + for (var i = 0; i < this.ranges.length; i++) { + out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); + } + return new Selection(out, this.primIndex); + }; + Selection.prototype.somethingSelected = function () { + var this$1 = this; + for (var i = 0; i < this.ranges.length; i++) { + if (!this$1.ranges[i].empty()) { + return true; + } + } + return false; + }; + Selection.prototype.contains = function (pos, end) { + var this$1 = this; + if (!end) { + end = pos; + } + for (var i = 0; i < this.ranges.length; i++) { + var range = this$1.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) { + return i; + } + } + return -1; + }; + var Range = function (anchor, head) { + this.anchor = anchor; + this.head = head; + }; + Range.prototype.from = function () { + return minPos(this.anchor, this.head); + }; + Range.prototype.to = function () { + return maxPos(this.anchor, this.head); + }; + Range.prototype.empty = function () { + return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; + }; + + // Take an unsorted, potentially overlapping set of ranges, and + // build a selection out of it. 'Consumes' ranges array (modifying + // it). + function normalizeSelection(ranges, primIndex) { + var prim = ranges[primIndex]; + ranges.sort(function (a, b) { + return cmp(a.from(), b.from()); + }); + primIndex = indexOf(ranges, prim); + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], + prev = ranges[i - 1]; + if (cmp(prev.to(), cur.from()) >= 0) { + var from = minPos(prev.from(), cur.from()), + to = maxPos(prev.to(), cur.to()); + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; + if (i <= primIndex) { + --primIndex; + } + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); + } + } + return new Selection(ranges, primIndex); + } + function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0); + } + + // Compute the position of the end of a change (its 'to' property + // refers to the pre-change end). + function changeEnd(change) { + if (!change.text) { + return change.to; + } + return Pos(change.from.line + change.text.length - 1, lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); + } + + // Adjust a position to refer to the post-change position of the + // same text, or the end of the change if the change covers it. + function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) { + return pos; + } + if (cmp(pos, change.to) <= 0) { + return changeEnd(change); + } + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, + ch = pos.ch; + if (pos.line == change.to.line) { + ch += changeEnd(change).ch - change.to.ch; + } + return Pos(line, ch); + } + function computeSelAfterChange(doc, change) { + var out = []; + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + out.push(new Range(adjustForChange(range.anchor, change), adjustForChange(range.head, change))); + } + return normalizeSelection(out, doc.sel.primIndex); + } + function offsetPos(pos, old, nw) { + if (pos.line == old.line) { + return Pos(nw.line, pos.ch - old.ch + nw.ch); + } else { + return Pos(nw.line + (pos.line - old.line), pos.ch); + } + } + + // Used by replaceSelections to allow moving the selection to the + // start or around the replaced test. Hint may be "start" or "around". + function computeReplacedSel(doc, changes, hint) { + var out = []; + var oldPrev = Pos(doc.first, 0), + newPrev = oldPrev; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; + if (hint == "around") { + var range = doc.sel.ranges[i], + inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); + } else { + out[i] = new Range(from, from); + } + } + return new Selection(out, doc.sel.primIndex); + } + + // Used to get the editor into a consistent state again when options change. + + function loadMode(cm) { + cm.doc.mode = getMode(cm.options, cm.doc.modeOption); + resetModeState(cm); + } + function resetModeState(cm) { + cm.doc.iter(function (line) { + if (line.stateAfter) { + line.stateAfter = null; + } + if (line.styles) { + line.styles = null; + } + }); + cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) { + regChange(cm); + } + } + + // DOCUMENT DATA STRUCTURE + + // By default, updates that start and end at the beginning of a line + // are treated specially, in order to make the association of line + // widgets and marker elements with the text behave more intuitive. + function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && (!doc.cm || doc.cm.options.wholeLineUpdateBefore); + } + + // Perform a change on the document data structure. + function updateDoc(doc, change, markedSpans, estimateHeight) { + function spansFor(n) { + return markedSpans ? markedSpans[n] : null; + } + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight); + signalLater(line, "change", line, change); + } + function linesFor(start, end) { + var result = []; + for (var i = start; i < end; ++i) { + result.push(new Line(text[i], spansFor(i), estimateHeight)); + } + return result; + } + var from = change.from, + to = change.to, + text = change.text; + var firstLine = getLine(doc, from.line), + lastLine = getLine(doc, to.line); + var lastText = lst(text), + lastSpans = spansFor(text.length - 1), + nlines = to.line - from.line; + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)); + doc.remove(text.length, doc.size - text.length); + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1); + update(lastLine, lastLine.text, lastSpans); + if (nlines) { + doc.remove(from.line, nlines); + } + if (added.length) { + doc.insert(from.line, added); + } + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + } else { + var added$1 = linesFor(1, text.length - 1); + added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added$1); + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + var added$2 = linesFor(1, text.length - 1); + if (nlines > 1) { + doc.remove(from.line + 1, nlines - 1); + } + doc.insert(from.line + 1, added$2); + } + signalLater(doc, "change", doc, change); + } + + // Call f for all linked documents. + function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) { + for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i]; + if (rel.doc == skip) { + continue; + } + var shared = sharedHist && rel.sharedHist; + if (sharedHistOnly && !shared) { + continue; + } + f(rel.doc, shared); + propagate(rel.doc, doc, shared); + } + } + } + propagate(doc, null, true); + } + + // Attach a document to an editor. + function attachDoc(cm, doc) { + if (doc.cm) { + throw new Error("This document is already in use."); + } + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + setDirectionClass(cm); + if (!cm.options.lineWrapping) { + findMaxLine(cm); + } + cm.options.mode = doc.modeOption; + regChange(cm); + } + function setDirectionClass(cm) { + (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl"); + } + function directionChanged(cm) { + runInOp(cm, function () { + setDirectionClass(cm); + regChange(cm); + }); + } + function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; + this.undone = []; + this.undoDepth = Infinity; + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0; + this.lastOp = this.lastSelOp = null; + this.lastOrigin = this.lastSelOrigin = null; + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1; + } + + // Create a history change event from an updateDoc-style change + // object. + function historyChangeFromChange(doc, change) { + var histChange = { + from: copyPos(change.from), + to: changeEnd(change), + text: getBetween(doc, change.from, change.to) + }; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function (doc) { + return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + }, true); + return histChange; + } + + // Pop all selection events off the end of a history array. Stop at + // a change event. + function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array); + if (last.ranges) { + array.pop(); + } else { + break; + } + } + } + + // Find the top change event in the history. Pop off selection + // events that are in the way. + function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done); + return lst(hist.done); + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done); + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop(); + return lst(hist.done); + } + } + + // Register a change in the history. Merges changes that are within + // a single operation, or are close together with an origin that + // allows merging (starting with "+") into a single event. + function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date(), + cur; + var last; + if ((hist.lastOp == opId || hist.lastOrigin == change.origin && change.origin && (change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay || change.origin.charAt(0) == "*")) && (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + last = lst(cur.changes); + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change); + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)); + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done); + if (!before || !before.ranges) { + pushSelectionToHistory(doc.sel, hist.done); + } + cur = { + changes: [historyChangeFromChange(doc, change)], + generation: hist.generation + }; + hist.done.push(cur); + while (hist.done.length > hist.undoDepth) { + hist.done.shift(); + if (!hist.done[0].ranges) { + hist.done.shift(); + } + } + } + hist.done.push(selAfter); + hist.generation = ++hist.maxGeneration; + hist.lastModTime = hist.lastSelTime = time; + hist.lastOp = hist.lastSelOp = opId; + hist.lastOrigin = hist.lastSelOrigin = change.origin; + if (!last) { + signal(doc, "historyAdded"); + } + } + function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0); + return ch == "*" || ch == "+" && prev.ranges.length == sel.ranges.length && prev.somethingSelected() == sel.somethingSelected() && new Date() - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); + } + + // Called whenever the selection changes, sets the new selection as + // the pending selection in the history, and pushes the old pending + // selection into the 'done' array when it was significantly + // different (in number of selected ranges, emptiness, or time). + function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, + origin = options && options.origin; + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || origin && hist.lastSelOrigin == origin && (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))) { + hist.done[hist.done.length - 1] = sel; + } else { + pushSelectionToHistory(sel, hist.done); + } + hist.lastSelTime = +new Date(); + hist.lastSelOrigin = origin; + hist.lastSelOp = opId; + if (options && options.clearRedo !== false) { + clearSelectionEvents(hist.undone); + } + } + function pushSelectionToHistory(sel, dest) { + var top = lst(dest); + if (!(top && top.ranges && top.equals(sel))) { + dest.push(sel); + } + } + + // Used to store marked span information in the history. + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], + n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { + if (line.markedSpans) { + (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; + } + ++n; + }); + } + + // When un/re-doing restores text containing marked spans, those + // that have been explicitly cleared should not be restored. + function removeClearedSpans(spans) { + if (!spans) { + return null; + } + var out; + for (var i = 0; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { + if (!out) { + out = spans.slice(0, i); + } + } else if (out) { + out.push(spans[i]); + } + } + return !out ? spans : out.length ? out : null; + } + + // Retrieve and filter the old marked spans stored in a change event. + function getOldSpans(doc, change) { + var found = change["spans_" + doc.id]; + if (!found) { + return null; + } + var nw = []; + for (var i = 0; i < change.text.length; ++i) { + nw.push(removeClearedSpans(found[i])); + } + return nw; + } + + // Used for un/re-doing changes from the history. Combines the + // result of computing the existing spans with the set of spans that + // existed in the history (so that deleting around a span and then + // undoing brings back the span). + function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); + if (!old) { + return stretched; + } + if (!stretched) { + return old; + } + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], + stretchCur = stretched[i]; + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j]; + for (var k = 0; k < oldCur.length; ++k) { + if (oldCur[k].marker == span.marker) { + continue spans; + } + } + oldCur.push(span); + } + } else if (stretchCur) { + old[i] = stretchCur; + } + } + return old; + } + + // Used both to provide a JSON-safe object in .getHistory, and, when + // detaching a document, to split the history in two + function copyHistoryArray(events, newGroup, instantiateSel) { + var copy = []; + for (var i = 0; i < events.length; ++i) { + var event = events[i]; + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); + continue; + } + var changes = event.changes, + newChanges = []; + copy.push({ + changes: newChanges + }); + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], + m = void 0; + newChanges.push({ + from: change.from, + to: change.to, + text: change.text + }); + if (newGroup) { + for (var prop in change) { + if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop]; + delete change[prop]; + } + } + } + } + } + } + return copy; + } + + // The 'scroll' parameter given to many of these indicated whether + // the new cursor position should be scrolled into view after + // modifying the selection. + + // If shift is held or the extend flag is set, extends a range to + // include a given position (and optionally a second position). + // Otherwise, simply returns the range between the given positions. + // Used for cursor motion and such. + function extendRange(range, head, other, extend) { + if (extend) { + var anchor = range.anchor; + if (other) { + var posBefore = cmp(head, anchor) < 0; + if (posBefore != cmp(other, anchor) < 0) { + anchor = head; + head = other; + } else if (posBefore != cmp(head, other) < 0) { + head = other; + } + } + return new Range(anchor, head); + } else { + return new Range(other || head, head); + } + } + + // Extend the primary selection range, discard the rest. + function extendSelection(doc, head, other, options, extend) { + if (extend == null) { + extend = doc.cm && (doc.cm.display.shift || doc.extend); + } + setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options); + } + + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, options) { + var out = []; + var extend = doc.cm && (doc.cm.display.shift || doc.extend); + for (var i = 0; i < doc.sel.ranges.length; i++) { + out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); + } + var newSel = normalizeSelection(out, doc.sel.primIndex); + setSelection(doc, newSel, options); + } + + // Updates a single range in the selection. + function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); + } + + // Reset the selection to a single range. + function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options); + } + + // Give beforeSelectionChange handlers a change to influence a + // selection update. + function filterSelectionChange(doc, sel, options) { + var obj = { + ranges: sel.ranges, + update: function (ranges) { + var this$1 = this; + this.ranges = []; + for (var i = 0; i < ranges.length; i++) { + this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), clipPos(doc, ranges[i].head)); + } + }, + origin: options && options.origin + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) { + signal(doc.cm, "beforeSelectionChange", doc.cm, obj); + } + if (obj.ranges != sel.ranges) { + return normalizeSelection(obj.ranges, obj.ranges.length - 1); + } else { + return sel; + } + } + function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, + last = lst(done); + if (last && last.ranges) { + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); + } else { + setSelection(doc, sel, options); + } + } + + // Set a new selection. + function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); + } + function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) { + sel = filterSelectionChange(doc, sel, options); + } + var bias = options && options.bias || (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); + if (!(options && options.scroll === false) && doc.cm) { + ensureCursorVisible(doc.cm); + } + } + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) { + return; + } + doc.sel = sel; + if (doc.cm) { + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); + } + signalLater(doc, "cursorActivity", doc); + } + + // Verify that the selection does not partially select any atomic + // marked ranges. + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)); + } + + // Return a selection that does not partially select any atomic + // ranges. + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) { + out = sel.ranges.slice(0, i); + } + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(out, sel.primIndex) : sel; + } + function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { + var line = getLine(doc, pos.line); + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], + m = sp.marker; + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) { + break; + } else { + --i; + continue; + } + } + } + if (!m.atomic) { + continue; + } + if (oldPos) { + var near = m.find(dir < 0 ? 1 : -1), + diff = void 0; + if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) { + near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); + } + if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) { + return skipAtomicInner(doc, near, pos, dir, mayClear); + } + } + var far = m.find(dir < 0 ? -1 : 1); + if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) { + far = movePos(doc, far, dir, far.line == pos.line ? line : null); + } + return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null; + } + } + } + return pos; + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, oldPos, bias, mayClear) { + var dir = bias || 1; + var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || !mayClear && skipAtomicInner(doc, pos, oldPos, dir, true) || skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || !mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true); + if (!found) { + doc.cantEdit = true; + return Pos(doc.first, 0); + } + return found; + } + function movePos(doc, pos, dir, line) { + if (dir < 0 && pos.ch == 0) { + if (pos.line > doc.first) { + return clipPos(doc, Pos(pos.line - 1)); + } else { + return null; + } + } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { + if (pos.line < doc.first + doc.size - 1) { + return Pos(pos.line + 1, 0); + } else { + return null; + } + } else { + return new Pos(pos.line, pos.ch + dir); + } + } + function selectAll(cm) { + cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll); + } + + // UPDATING + + // Allow "beforeChange" event handlers to influence a change + function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function () { + return obj.canceled = true; + } + }; + if (update) { + obj.update = function (from, to, text, origin) { + if (from) { + obj.from = clipPos(doc, from); + } + if (to) { + obj.to = clipPos(doc, to); + } + if (text) { + obj.text = text; + } + if (origin !== undefined) { + obj.origin = origin; + } + }; + } + signal(doc, "beforeChange", doc, obj); + if (doc.cm) { + signal(doc.cm, "beforeChange", doc.cm, obj); + } + if (obj.canceled) { + return null; + } + return { + from: obj.from, + to: obj.to, + text: obj.text, + origin: obj.origin + }; + } + + // Apply a change to a document, and add it to the document's + // history, and propagating it to all linked documents. + function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) { + return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); + } + if (doc.cm.state.suppressEdits) { + return; + } + } + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true); + if (!change) { + return; + } + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); + if (split) { + for (var i = split.length - 1; i >= 0; --i) { + makeChangeInner(doc, { + from: split[i].from, + to: split[i].to, + text: i ? [""] : change.text + }); + } + } else { + makeChangeInner(doc, change); + } + } + function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { + return; + } + var selAfter = computeSelAfterChange(doc, change); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); + } + + // Revert a change stored in a document's history. + function makeChangeFromHistory(doc, type, allowSelectionOnly) { + if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { + return; + } + var hist = doc.history, + event, + selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, + dest = type == "undo" ? hist.undone : hist.done; + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + var i = 0; + for (; i < source.length; i++) { + event = source[i]; + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) { + break; + } + } + if (i == source.length) { + return; + } + hist.lastOrigin = hist.lastSelOrigin = null; + for (;;) { + event = source.pop(); + if (event.ranges) { + pushSelectionToHistory(event, dest); + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, { + clearRedo: false + }); + return; + } + selAfter = event; + } else { + break; + } + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({ + changes: antiChanges, + generation: hist.generation + }); + hist.generation = event.generation || ++hist.maxGeneration; + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); + var loop = function (i) { + var change = event.changes[i]; + change.origin = type; + if (filter && !filterChange(doc, change, false)) { + source.length = 0; + return {}; + } + antiChanges.push(historyChangeFromChange(doc, change)); + var after = i ? computeSelAfterChange(doc, change) : lst(source); + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (!i && doc.cm) { + doc.cm.scrollIntoView({ + from: change.from, + to: changeEnd(change) + }); + } + var rebased = []; + + // Propagate to the linked documents + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); + }; + for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { + var returned = loop(i$1); + if (returned) return returned.v; + } + } + + // Sub-views need their line numbers shifted when text is added + // above or below them in the parent document. + function shiftDoc(doc, distance) { + if (distance == 0) { + return; + } + doc.first += distance; + doc.sel = new Selection(map(doc.sel.ranges, function (range) { + return new Range(Pos(range.anchor.line + distance, range.anchor.ch), Pos(range.head.line + distance, range.head.ch)); + }), doc.sel.primIndex); + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance); + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) { + regLineChange(doc.cm, l, "gutter"); + } + } + } + + // More lower-level change function, handling only a single document + // (not linked ones). + function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) { + return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); + } + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); + return; + } + if (change.from.line > doc.lastLine()) { + return; + } + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); + change = { + from: Pos(doc.first, 0), + to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], + origin: change.origin + }; + } + var last = doc.lastLine(); + if (change.to.line > last) { + change = { + from: change.from, + to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], + origin: change.origin + }; + } + change.removed = getBetween(doc, change.from, change.to); + if (!selAfter) { + selAfter = computeSelAfterChange(doc, change); + } + if (doc.cm) { + makeChangeSingleDocInEditor(doc.cm, change, spans); + } else { + updateDoc(doc, change, spans); + } + setSelectionNoUndo(doc, selAfter, sel_dontScroll); + } + + // Handle the interaction of a change to a document with the editor + // that this document is part of. + function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, + display = cm.display, + from = change.from, + to = change.to; + var recomputeMaxLength = false, + checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function (line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true; + } + }); + } + if (doc.sel.contains(change.from, change.to) > -1) { + signalCursorActivity(cm); + } + updateDoc(doc, change, spans, estimateHeight(cm)); + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function (line) { + var len = lineLength(line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) { + cm.curOp.updateMaxLine = true; + } + } + retreatFrontier(doc, from.line); + startWorker(cm, 400); + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + if (change.full) { + regChange(cm); + } else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) { + regLineChange(cm, from.line, "text"); + } else { + regChange(cm, from.line, to.line + 1, lendiff); + } + var changesHandler = hasHandler(cm, "changes"), + changeHandler = hasHandler(cm, "change"); + if (changeHandler || changesHandler) { + var obj = { + from: from, + to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }; + if (changeHandler) { + signalLater(cm, "change", cm, obj); + } + if (changesHandler) { + (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); + } + } + cm.display.selForContextMenu = null; + } + function replaceRange(doc, code, from, to, origin) { + if (!to) { + to = from; + } + if (cmp(to, from) < 0) { + var tmp = to; + to = from; + from = tmp; + } + if (typeof code == "string") { + code = doc.splitLines(code); + } + makeChange(doc, { + from: from, + to: to, + text: code, + origin: origin + }); + } + + // Rebasing/resetting history to deal with externally-sourced changes + + function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff; + } else if (from < pos.line) { + pos.line = from; + pos.ch = 0; + } + } + + // Tries to rebase an array of history events given a change in the + // document. If the change touches the same lines as the event, the + // event, and everything 'behind' it, is discarded. If the change is + // before the event, the event's positions are updated. Uses a + // copy-on-write scheme for the positions, to avoid having to + // reallocate them all on every rebase, but also avoid problems with + // shared position objects being unsafely updated. + function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], + ok = true; + if (sub.ranges) { + if (!sub.copied) { + sub = array[i] = sub.deepCopy(); + sub.copied = true; + } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); + } + continue; + } + for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { + var cur = sub.changes[j$1]; + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); + } else if (from <= cur.to.line) { + ok = false; + break; + } + } + if (!ok) { + array.splice(0, i + 1); + i = 0; + } + } + } + function rebaseHist(hist, change) { + var from = change.from.line, + to = change.to.line, + diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); + } + + // Utility for applying a change to a line by handle or number, + // returning the number and optionally registering the line as + // changed. + function changeLine(doc, handle, changeType, op) { + var no = handle, + line = handle; + if (typeof handle == "number") { + line = getLine(doc, clipLine(doc, handle)); + } else { + no = lineNo(handle); + } + if (no == null) { + return null; + } + if (op(line, no) && doc.cm) { + regLineChange(doc.cm, no, changeType); + } + return line; + } + + // The document is represented as a BTree consisting of leaves, with + // chunk of lines in them, and branches, with up to ten leaves or + // other branch nodes below them. The top node is always a branch + // node, and is the document object itself (meaning it has + // additional methods and properties). + // + // All nodes have parent links. The tree is used both to go from + // line numbers to line objects, and to go from objects to numbers. + // It also indexes by height, and is used to convert between height + // and line object, and to find the total height of the document. + // + // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + + function LeafChunk(lines) { + var this$1 = this; + this.lines = lines; + this.parent = null; + var height = 0; + for (var i = 0; i < lines.length; ++i) { + lines[i].parent = this$1; + height += lines[i].height; + } + this.height = height; + } + LeafChunk.prototype = { + chunkSize: function chunkSize() { + return this.lines.length; + }, + // Remove the n lines at offset 'at'. + removeInner: function removeInner(at, n) { + var this$1 = this; + for (var i = at, e = at + n; i < e; ++i) { + var line = this$1.lines[i]; + this$1.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); + } + this.lines.splice(at, n); + }, + // Helper used to collapse a small branch into a single leaf. + collapse: function collapse(lines) { + lines.push.apply(lines, this.lines); + }, + // Insert the given array of lines at offset 'at', count them as + // having the given height. + insertInner: function insertInner(at, lines, height) { + var this$1 = this; + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0; i < lines.length; ++i) { + lines[i].parent = this$1; + } + }, + // Used to iterate over a part of the tree. + iterN: function iterN(at, n, op) { + var this$1 = this; + for (var e = at + n; at < e; ++at) { + if (op(this$1.lines[at])) { + return true; + } + } + } + }; + function BranchChunk(children) { + var this$1 = this; + this.children = children; + var size = 0, + height = 0; + for (var i = 0; i < children.length; ++i) { + var ch = children[i]; + size += ch.chunkSize(); + height += ch.height; + ch.parent = this$1; + } + this.size = size; + this.height = height; + this.parent = null; + } + BranchChunk.prototype = { + chunkSize: function chunkSize() { + return this.size; + }, + removeInner: function removeInner(at, n) { + var this$1 = this; + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], + sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), + oldHeight = child.height; + child.removeInner(at, rm); + this$1.height -= oldHeight - child.height; + if (sz == rm) { + this$1.children.splice(i--, 1); + child.parent = null; + } + if ((n -= rm) == 0) { + break; + } + at = 0; + } else { + at -= sz; + } + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + collapse: function collapse(lines) { + var this$1 = this; + for (var i = 0; i < this.children.length; ++i) { + this$1.children[i].collapse(lines); + } + }, + insertInner: function insertInner(at, lines, height) { + var this$1 = this; + this.size += lines.length; + this.height += height; + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], + sz = child.chunkSize(); + if (at <= sz) { + child.insertInner(at, lines, height); + if (child.lines && child.lines.length > 50) { + // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. + // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. + var remaining = child.lines.length % 25 + 25; + for (var pos = remaining; pos < child.lines.length;) { + var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); + child.height -= leaf.height; + this$1.children.splice(++i, 0, leaf); + leaf.parent = this$1; + } + child.lines = child.lines.slice(0, remaining); + this$1.maybeSpill(); + } + break; + } + at -= sz; + } + }, + // When a node has grown, check whether it should be split. + maybeSpill: function maybeSpill() { + if (this.children.length <= 10) { + return; + } + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { + // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10); + me.parent.maybeSpill(); + }, + iterN: function iterN(at, n, op) { + var this$1 = this; + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], + sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) { + return true; + } + if ((n -= used) == 0) { + break; + } + at = 0; + } else { + at -= sz; + } + } + } + }; + + // Line widgets are block elements displayed above or below a line. + + var LineWidget = function (doc, node, options) { + var this$1 = this; + if (options) { + for (var opt in options) { + if (options.hasOwnProperty(opt)) { + this$1[opt] = options[opt]; + } + } + } + this.doc = doc; + this.node = node; + }; + LineWidget.prototype.clear = function () { + var this$1 = this; + var cm = this.doc.cm, + ws = this.line.widgets, + line = this.line, + no = lineNo(line); + if (no == null || !ws) { + return; + } + for (var i = 0; i < ws.length; ++i) { + if (ws[i] == this$1) { + ws.splice(i--, 1); + } + } + if (!ws.length) { + line.widgets = null; + } + var height = widgetHeight(this); + updateLineHeight(line, Math.max(0, line.height - height)); + if (cm) { + runInOp(cm, function () { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + }); + signalLater(cm, "lineWidgetCleared", cm, this, no); + } + }; + LineWidget.prototype.changed = function () { + var this$1 = this; + var oldH = this.height, + cm = this.doc.cm, + line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) { + return; + } + updateLineHeight(line, line.height + diff); + if (cm) { + runInOp(cm, function () { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)); + }); + } + }; + eventMixin(LineWidget); + function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < (cm.curOp && cm.curOp.scrollTop || cm.doc.scrollTop)) { + addToScrollTop(cm, diff); + } + } + function addLineWidget(doc, handle, node, options) { + var widget = new LineWidget(doc, node, options); + var cm = doc.cm; + if (cm && widget.noHScroll) { + cm.display.alignWidgets = true; + } + changeLine(doc, handle, "widget", function (line) { + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) { + widgets.push(widget); + } else { + widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); + } + widget.line = line; + if (cm && !lineIsHidden(doc, line)) { + var aboveVisible = heightAtLine(line) < doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) { + addToScrollTop(cm, widget.height); + } + cm.curOp.forceUpdate = true; + } + return true; + }); + signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); + return widget; + } + + // TEXTMARKERS + + // Created with markText and setBookmark methods. A TextMarker is a + // handle that can be used to clear or find a marked position in the + // document. Line objects hold arrays (markedSpans) containing + // {from, to, marker} object pointing to such marker objects, and + // indicating that such a marker is present on that line. Multiple + // lines may point to the same marker when it spans across lines. + // The spans will have null for their from/to properties when the + // marker continues beyond the start/end of the line. Markers have + // links back to the lines they currently touch. + + // Collapsed markers have unique ids, in order to be able to order + // them, which is needed for uniquely determining an outer marker + // when they overlap (they may nest, but not partially overlap). + var nextMarkerId = 0; + var TextMarker = function (doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + this.id = ++nextMarkerId; + }; + + // Clear the marker. + TextMarker.prototype.clear = function () { + var this$1 = this; + if (this.explicitlyCleared) { + return; + } + var cm = this.doc.cm, + withOp = cm && !cm.curOp; + if (withOp) { + startOperation(cm); + } + if (hasHandler(this, "clear")) { + var found = this.find(); + if (found) { + signalLater(this, "clear", found.from, found.to); + } + } + var min = null, + max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this$1); + if (cm && !this$1.collapsed) { + regLineChange(cm, lineNo(line), "text"); + } else if (cm) { + if (span.to != null) { + max = lineNo(line); + } + if (span.from != null) { + min = lineNo(line); + } + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm) { + updateLineHeight(line, textHeight(cm.display)); + } + } + if (cm && this.collapsed && !cm.options.lineWrapping) { + for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { + var visual = visualLine(this$1.lines[i$1]), + len = lineLength(visual); + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; + } + } + } + if (min != null && cm && this.collapsed) { + regChange(cm, min, max + 1); + } + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false; + if (cm) { + reCheckSelection(cm.doc); + } + } + if (cm) { + signalLater(cm, "markerCleared", cm, this, min, max); + } + if (withOp) { + endOperation(cm); + } + if (this.parent) { + this.parent.clear(); + } + }; + + // Find the position of the marker in the document. Returns a {from, + // to} object by default. Side can be passed to get a specific side + // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the + // Pos objects returned contain a line object, rather than a line + // number (used to prevent looking up the same line twice). + TextMarker.prototype.find = function (side, lineObj) { + var this$1 = this; + if (side == null && this.type == "bookmark") { + side = 1; + } + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this$1); + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from); + if (side == -1) { + return from; + } + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to); + if (side == 1) { + return to; + } + } + } + return from && { + from: from, + to: to + }; + }; + + // Signals that the marker's widget changed, and surrounding layout + // should be recomputed. + TextMarker.prototype.changed = function () { + var this$1 = this; + var pos = this.find(-1, true), + widget = this, + cm = this.doc.cm; + if (!pos || !cm) { + return; + } + runInOp(cm, function () { + var line = pos.line, + lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) { + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; + } + cm.curOp.updateMaxLine = true; + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; + if (dHeight) { + updateLineHeight(line, line.height + dHeight); + } + } + signalLater(cm, "markerChanged", cm, this$1); + }); + }; + TextMarker.prototype.attachLine = function (line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) { + (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); + } + } + this.lines.push(line); + }; + TextMarker.prototype.detachLine = function (line) { + this.lines.splice(indexOf(this.lines, line), 1); + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); + } + }; + eventMixin(TextMarker); + + // Create a marker, wire it up to the right lines, and + function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) { + return markTextShared(doc, from, to, options, type); + } + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) { + return operation(doc.cm, markText)(doc, from, to, options, type); + } + var marker = new TextMarker(doc, type), + diff = cmp(from, to); + if (options) { + copyObj(options, marker, false); + } + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) { + return marker; + } + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true; + marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) { + marker.widgetNode.setAttribute("cm-ignore-events", "true"); + } + if (options.insertLeft) { + marker.widgetNode.insertLeft = true; + } + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) { + throw new Error("Inserting collapsed marker partially overlapping an existing one"); + } + seeCollapsedSpans(); + } + if (marker.addToHistory) { + addChangeToHistory(doc, { + from: from, + to: to, + origin: "markText" + }, doc.sel, NaN); + } + var curLine = from.line, + cm = doc.cm, + updateMaxLine; + doc.iter(curLine, to.line + 1, function (line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) { + updateMaxLine = true; + } + if (marker.collapsed && curLine != from.line) { + updateLineHeight(line, 0); + } + addMarkedSpan(line, new MarkedSpan(marker, curLine == from.line ? from.ch : null, curLine == to.line ? to.ch : null)); + ++curLine; + }); + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) { + doc.iter(from.line, to.line + 1, function (line) { + if (lineIsHidden(doc, line)) { + updateLineHeight(line, 0); + } + }); + } + if (marker.clearOnEnter) { + on(marker, "beforeCursorEnter", function () { + return marker.clear(); + }); + } + if (marker.readOnly) { + seeReadOnlySpans(); + if (doc.history.done.length || doc.history.undone.length) { + doc.clearHistory(); + } + } + if (marker.collapsed) { + marker.id = ++nextMarkerId; + marker.atomic = true; + } + if (cm) { + // Sync editor state + if (updateMaxLine) { + cm.curOp.updateMaxLine = true; + } + if (marker.collapsed) { + regChange(cm, from.line, to.line + 1); + } else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) { + for (var i = from.line; i <= to.line; i++) { + regLineChange(cm, i, "text"); + } + } + if (marker.atomic) { + reCheckSelection(cm.doc); + } + signalLater(cm, "markerAdded", cm, marker); + } + return marker; + } + + // SHARED TEXTMARKERS + + // A shared marker spans multiple linked documents. It is + // implemented as a meta-marker-object controlling multiple normal + // markers. + var SharedTextMarker = function (markers, primary) { + var this$1 = this; + this.markers = markers; + this.primary = primary; + for (var i = 0; i < markers.length; ++i) { + markers[i].parent = this$1; + } + }; + SharedTextMarker.prototype.clear = function () { + var this$1 = this; + if (this.explicitlyCleared) { + return; + } + this.explicitlyCleared = true; + for (var i = 0; i < this.markers.length; ++i) { + this$1.markers[i].clear(); + } + signalLater(this, "clear"); + }; + SharedTextMarker.prototype.find = function (side, lineObj) { + return this.primary.find(side, lineObj); + }; + eventMixin(SharedTextMarker); + function markTextShared(doc, from, to, options, type) { + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], + primary = markers[0]; + var widget = options.widgetNode; + linkedDocs(doc, function (doc) { + if (widget) { + options.widgetNode = widget.cloneNode(true); + } + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); + for (var i = 0; i < doc.linked.length; ++i) { + if (doc.linked[i].isParent) { + return; + } + } + primary = lst(markers); + }); + return new SharedTextMarker(markers, primary); + } + function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { + return m.parent; + }); + } + function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], + pos = marker.find(); + var mFrom = doc.clipPos(pos.from), + mTo = doc.clipPos(pos.to); + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; + } + } + } + function detachSharedMarkers(markers) { + var loop = function (i) { + var marker = markers[i], + linked = [marker.primary.doc]; + linkedDocs(marker.primary.doc, function (d) { + return linked.push(d); + }); + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j]; + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null; + marker.markers.splice(j--, 1); + } + } + }; + for (var i = 0; i < markers.length; i++) loop(i); + } + var nextDocId = 0; + var Doc = function (text, mode, firstLine, lineSep, direction) { + if (!(this instanceof Doc)) { + return new Doc(text, mode, firstLine, lineSep, direction); + } + if (firstLine == null) { + firstLine = 0; + } + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.cleanGeneration = 1; + this.modeFrontier = this.highlightFrontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = simpleSelection(start); + this.history = new History(null); + this.id = ++nextDocId; + this.modeOption = mode; + this.lineSep = lineSep; + this.direction = direction == "rtl" ? "rtl" : "ltr"; + this.extend = false; + if (typeof text == "string") { + text = this.splitLines(text); + } + updateDoc(this, { + from: start, + to: start, + text: text + }); + setSelection(this, simpleSelection(start), sel_dontScroll); + }; + Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function (from, to, op) { + if (op) { + this.iterN(from - this.first, to - from, op); + } else { + this.iterN(this.first, this.first + this.size, from); + } + }, + // Non-public interface for adding and removing lines. + insert: function (at, lines) { + var height = 0; + for (var i = 0; i < lines.length; ++i) { + height += lines[i].height; + } + this.insertInner(at - this.first, lines, height); + }, + remove: function (at, n) { + this.removeInner(at - this.first, n); + }, + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function (lineSep) { + var lines = getLines(this, this.first, this.first + this.size); + if (lineSep === false) { + return lines; + } + return lines.join(lineSep || this.lineSeparator()); + }, + setValue: docMethodOp(function (code) { + var top = Pos(this.first, 0), + last = this.first + this.size - 1; + makeChange(this, { + from: top, + to: Pos(last, getLine(this, last).text.length), + text: this.splitLines(code), + origin: "setValue", + full: true + }, true); + if (this.cm) { + scrollToCoords(this.cm, 0, 0); + } + setSelection(this, simpleSelection(top), sel_dontScroll); + }), + replaceRange: function (code, from, to, origin) { + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); + }, + getRange: function (from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); + if (lineSep === false) { + return lines; + } + return lines.join(lineSep || this.lineSeparator()); + }, + getLine: function (line) { + var l = this.getLineHandle(line); + return l && l.text; + }, + getLineHandle: function (line) { + if (isLine(this, line)) { + return getLine(this, line); + } + }, + getLineNumber: function (line) { + return lineNo(line); + }, + getLineHandleVisualStart: function (line) { + if (typeof line == "number") { + line = getLine(this, line); + } + return visualLine(line); + }, + lineCount: function () { + return this.size; + }, + firstLine: function () { + return this.first; + }, + lastLine: function () { + return this.first + this.size - 1; + }, + clipPos: function (pos) { + return clipPos(this, pos); + }, + getCursor: function (start) { + var range = this.sel.primary(), + pos; + if (start == null || start == "head") { + pos = range.head; + } else if (start == "anchor") { + pos = range.anchor; + } else if (start == "end" || start == "to" || start === false) { + pos = range.to(); + } else { + pos = range.from(); + } + return pos; + }, + listSelections: function () { + return this.sel.ranges; + }, + somethingSelected: function () { + return this.sel.somethingSelected(); + }, + setCursor: docMethodOp(function (line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); + }), + setSelection: docMethodOp(function (anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); + }), + extendSelection: docMethodOp(function (head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); + }), + extendSelections: docMethodOp(function (heads, options) { + extendSelections(this, clipPosArray(this, heads), options); + }), + extendSelectionsBy: docMethodOp(function (f, options) { + var heads = map(this.sel.ranges, f); + extendSelections(this, clipPosArray(this, heads), options); + }), + setSelections: docMethodOp(function (ranges, primary, options) { + var this$1 = this; + if (!ranges.length) { + return; + } + var out = []; + for (var i = 0; i < ranges.length; i++) { + out[i] = new Range(clipPos(this$1, ranges[i].anchor), clipPos(this$1, ranges[i].head)); + } + if (primary == null) { + primary = Math.min(ranges.length - 1, this.sel.primIndex); + } + setSelection(this, normalizeSelection(out, primary), options); + }), + addSelection: docMethodOp(function (anchor, head, options) { + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); + }), + getSelection: function (lineSep) { + var this$1 = this; + var ranges = this.sel.ranges, + lines; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; + } + if (lineSep === false) { + return lines; + } else { + return lines.join(lineSep || this.lineSeparator()); + } + }, + getSelections: function (lineSep) { + var this$1 = this; + var parts = [], + ranges = this.sel.ranges; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) { + sel = sel.join(lineSep || this$1.lineSeparator()); + } + parts[i] = sel; + } + return parts; + }, + replaceSelection: function (code, collapse, origin) { + var dup = []; + for (var i = 0; i < this.sel.ranges.length; i++) { + dup[i] = code; + } + this.replaceSelections(dup, collapse, origin || "+input"); + }, + replaceSelections: docMethodOp(function (code, collapse, origin) { + var this$1 = this; + var changes = [], + sel = this.sel; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + changes[i] = { + from: range.from(), + to: range.to(), + text: this$1.splitLines(code[i]), + origin: origin + }; + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); + for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) { + makeChange(this$1, changes[i$1]); + } + if (newSel) { + setSelectionReplaceHistory(this, newSel); + } else if (this.cm) { + ensureCursorVisible(this.cm); + } + }), + undo: docMethodOp(function () { + makeChangeFromHistory(this, "undo"); + }), + redo: docMethodOp(function () { + makeChangeFromHistory(this, "redo"); + }), + undoSelection: docMethodOp(function () { + makeChangeFromHistory(this, "undo", true); + }), + redoSelection: docMethodOp(function () { + makeChangeFromHistory(this, "redo", true); + }), + setExtending: function (val) { + this.extend = val; + }, + getExtending: function () { + return this.extend; + }, + historySize: function () { + var hist = this.history, + done = 0, + undone = 0; + for (var i = 0; i < hist.done.length; i++) { + if (!hist.done[i].ranges) { + ++done; + } + } + for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { + if (!hist.undone[i$1].ranges) { + ++undone; + } + } + return { + undo: done, + redo: undone + }; + }, + clearHistory: function () { + this.history = new History(this.history.maxGeneration); + }, + markClean: function () { + this.cleanGeneration = this.changeGeneration(true); + }, + changeGeneration: function (forceSplit) { + if (forceSplit) { + this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; + } + return this.history.generation; + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration); + }, + getHistory: function () { + return { + done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone) + }; + }, + setHistory: function (histData) { + var hist = this.history = new History(this.history.maxGeneration); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); + }, + setGutterMarker: docMethodOp(function (line, gutterID, value) { + return changeLine(this, line, "gutter", function (line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) { + line.gutterMarkers = null; + } + return true; + }); + }), + clearGutter: docMethodOp(function (gutterID) { + var this$1 = this; + this.iter(function (line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + changeLine(this$1, line, "gutter", function () { + line.gutterMarkers[gutterID] = null; + if (isEmpty(line.gutterMarkers)) { + line.gutterMarkers = null; + } + return true; + }); + } + }); + }), + lineInfo: function (line) { + var n; + if (typeof line == "number") { + if (!isLine(this, line)) { + return null; + } + n = line; + line = getLine(this, line); + if (!line) { + return null; + } + } else { + n = lineNo(line); + if (n == null) { + return null; + } + } + return { + line: n, + handle: line, + text: line.text, + gutterMarkers: line.gutterMarkers, + textClass: line.textClass, + bgClass: line.bgClass, + wrapClass: line.wrapClass, + widgets: line.widgets + }; + }, + addLineClass: docMethodOp(function (handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : where == "gutter" ? "gutterClass" : "wrapClass"; + if (!line[prop]) { + line[prop] = cls; + } else if (classTest(cls).test(line[prop])) { + return false; + } else { + line[prop] += " " + cls; + } + return true; + }); + }), + removeLineClass: docMethodOp(function (handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : where == "gutter" ? "gutterClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) { + return false; + } else if (cls == null) { + line[prop] = null; + } else { + var found = cur.match(classTest(cls)); + if (!found) { + return false; + } + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; + } + return true; + }); + }), + addLineWidget: docMethodOp(function (handle, node, options) { + return addLineWidget(this, handle, node, options); + }), + removeLineWidget: function (widget) { + widget.clear(); + }, + markText: function (from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range"); + }, + setBookmark: function (pos, options) { + var realOpts = { + replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, + shared: options && options.shared, + handleMouseEvents: options && options.handleMouseEvents + }; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark"); + }, + findMarksAt: function (pos) { + pos = clipPos(this, pos); + var markers = [], + spans = getLine(this, pos.line).markedSpans; + if (spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && (span.to == null || span.to >= pos.ch)) { + markers.push(span.marker.parent || span.marker); + } + } + } + return markers; + }, + findMarks: function (from, to, filter) { + from = clipPos(this, from); + to = clipPos(this, to); + var found = [], + lineNo = from.line; + this.iter(from.line, to.line + 1, function (line) { + var spans = line.markedSpans; + if (spans) { + for (var i = 0; i < spans.length; i++) { + var span = spans[i]; + if (!(span.to != null && lineNo == from.line && from.ch >= span.to || span.from == null && lineNo != from.line || span.from != null && lineNo == to.line && span.from >= to.ch) && (!filter || filter(span.marker))) { + found.push(span.marker.parent || span.marker); + } + } + } + ++lineNo; + }); + return found; + }, + getAllMarks: function () { + var markers = []; + this.iter(function (line) { + var sps = line.markedSpans; + if (sps) { + for (var i = 0; i < sps.length; ++i) { + if (sps[i].from != null) { + markers.push(sps[i].marker); + } + } + } + }); + return markers; + }, + posFromIndex: function (off) { + var ch, + lineNo = this.first, + sepSize = this.lineSeparator().length; + this.iter(function (line) { + var sz = line.text.length + sepSize; + if (sz > off) { + ch = off; + return true; + } + off -= sz; + ++lineNo; + }); + return clipPos(this, Pos(lineNo, ch)); + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords); + var index = coords.ch; + if (coords.line < this.first || coords.ch < 0) { + return 0; + } + var sepSize = this.lineSeparator().length; + this.iter(this.first, coords.line, function (line) { + // iter aborts when callback returns a truthy value + index += line.text.length + sepSize; + }); + return index; + }, + copy: function (copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first, this.lineSep, this.direction); + doc.scrollTop = this.scrollTop; + doc.scrollLeft = this.scrollLeft; + doc.sel = this.sel; + doc.extend = false; + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); + } + return doc; + }, + linkedDoc: function (options) { + if (!options) { + options = {}; + } + var from = this.first, + to = this.first + this.size; + if (options.from != null && options.from > from) { + from = options.from; + } + if (options.to != null && options.to < to) { + to = options.to; + } + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction); + if (options.sharedHist) { + copy.history = this.history; + } + (this.linked || (this.linked = [])).push({ + doc: copy, + sharedHist: options.sharedHist + }); + copy.linked = [{ + doc: this, + isParent: true, + sharedHist: options.sharedHist + }]; + copySharedMarkers(copy, findSharedMarkers(this)); + return copy; + }, + unlinkDoc: function (other) { + var this$1 = this; + if (other instanceof CodeMirror) { + other = other.doc; + } + if (this.linked) { + for (var i = 0; i < this.linked.length; ++i) { + var link = this$1.linked[i]; + if (link.doc != other) { + continue; + } + this$1.linked.splice(i, 1); + other.unlinkDoc(this$1); + detachSharedMarkers(findSharedMarkers(this$1)); + break; + } + } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id]; + linkedDocs(other, function (doc) { + return splitIds.push(doc.id); + }, true); + other.history = new History(null); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); + } + }, + iterLinkedDocs: function (f) { + linkedDocs(this, f); + }, + getMode: function () { + return this.mode; + }, + getEditor: function () { + return this.cm; + }, + splitLines: function (str) { + if (this.lineSep) { + return str.split(this.lineSep); + } + return splitLinesAuto(str); + }, + lineSeparator: function () { + return this.lineSep || "\n"; + }, + setDirection: docMethodOp(function (dir) { + if (dir != "rtl") { + dir = "ltr"; + } + if (dir == this.direction) { + return; + } + this.direction = dir; + this.iter(function (line) { + return line.order = null; + }); + if (this.cm) { + directionChanged(this.cm); + } + }) + }); + + // Public alias. + Doc.prototype.eachLine = Doc.prototype.iter; + + // Kludge to work around strange IE behavior where it'll sometimes + // re-fire a series of drag-related events right after the drop (#1551) + var lastDrop = 0; + function onDrop(e) { + var cm = this; + clearDragCursor(cm); + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { + return; + } + e_preventDefault(e); + if (ie) { + lastDrop = +new Date(); + } + var pos = posFromMouse(cm, e, true), + files = e.dataTransfer.files; + if (!pos || cm.isReadOnly()) { + return; + } + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, + text = Array(n), + read = 0; + var loadFile = function (file, i) { + if (cm.options.allowDropFileTypes && indexOf(cm.options.allowDropFileTypes, file.type) == -1) { + return; + } + var reader = new FileReader(); + reader.onload = operation(cm, function () { + var content = reader.result; + if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { + content = ""; + } + text[i] = content; + if (++read == n) { + pos = clipPos(cm.doc, pos); + var change = { + from: pos, + to: pos, + text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), + origin: "paste" + }; + makeChange(cm.doc, change); + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); + } + }); + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) { + loadFile(files[i], i); + } + } else { + // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e); + // Ensure the editor is re-focused + setTimeout(function () { + return cm.display.input.focus(); + }, 20); + return; + } + try { + var text$1 = e.dataTransfer.getData("Text"); + if (text$1) { + var selected; + if (cm.state.draggingText && !cm.state.draggingText.copy) { + selected = cm.listSelections(); + } + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); + if (selected) { + for (var i$1 = 0; i$1 < selected.length; ++i$1) { + replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag"); + } + } + cm.replaceSelection(text$1, "around", "paste"); + cm.display.input.focus(); + } + } catch (e) {} + } + } + function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date() - lastDrop < 100)) { + e_stop(e); + return; + } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { + return; + } + e.dataTransfer.setData("Text", cm.getSelection()); + e.dataTransfer.effectAllowed = "copyMove"; + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (presto) { + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop; + } + e.dataTransfer.setDragImage(img, 0, 0); + if (presto) { + img.parentNode.removeChild(img); + } + } + } + function onDragOver(cm, e) { + var pos = posFromMouse(cm, e); + if (!pos) { + return; + } + var frag = document.createDocumentFragment(); + drawSelectionCursor(cm, pos, frag); + if (!cm.display.dragCursor) { + cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); + cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); + } + removeChildrenAndAdd(cm.display.dragCursor, frag); + } + function clearDragCursor(cm) { + if (cm.display.dragCursor) { + cm.display.lineSpace.removeChild(cm.display.dragCursor); + cm.display.dragCursor = null; + } + } + + // These must be handled carefully, because naively registering a + // handler for each editor will cause the editors to never be + // garbage collected. + + function forEachCodeMirror(f) { + if (!document.getElementsByClassName) { + return; + } + var byClass = document.getElementsByClassName("CodeMirror"); + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror; + if (cm) { + f(cm); + } + } + } + var globalsRegistered = false; + function ensureGlobalHandlers() { + if (globalsRegistered) { + return; + } + registerGlobalHandlers(); + globalsRegistered = true; + } + function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer; + on(window, "resize", function () { + if (resizeTimer == null) { + resizeTimer = setTimeout(function () { + resizeTimer = null; + forEachCodeMirror(onResize); + }, 100); + } + }); + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function () { + return forEachCodeMirror(onBlur); + }); + } + // Called when the window resizes + function onResize(cm) { + var d = cm.display; + if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) { + return; + } + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + d.scrollbarsClipped = false; + cm.setSize(); + } + var 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" + }; + + // Number keys + for (var i = 0; i < 10; i++) { + keyNames[i + 48] = keyNames[i + 96] = String(i); + } + // Alphabetic keys + for (var i$1 = 65; i$1 <= 90; i$1++) { + keyNames[i$1] = String.fromCharCode(i$1); + } + // Function keys + for (var i$2 = 1; i$2 <= 12; i$2++) { + keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; + } + var keyMap = {}; + keyMap.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" + }; + // Note that the save and find-related commands aren't defined by + // default. User code or addons can define them. Unknown commands + // are simply ignored. + keyMap.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" + }; + // Very basic readline/emacs-style bindings, which are standard on Mac. + keyMap.emacsy = { + "Ctrl-F": "goCharRight", + "Ctrl-B": "goCharLeft", + "Ctrl-P": "goLineUp", + "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", + "Alt-B": "goWordLeft", + "Ctrl-A": "goLineStart", + "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", + "Shift-Ctrl-V": "goPageUp", + "Ctrl-D": "delCharAfter", + "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", + "Alt-Backspace": "delWordBefore", + "Ctrl-K": "killLine", + "Ctrl-T": "transposeChars", + "Ctrl-O": "openLine" + }; + keyMap.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"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + + // KEYMAP DISPATCH + + function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/); + name = parts[parts.length - 1]; + var alt, ctrl, shift, cmd; + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i]; + if (/^(cmd|meta|m)$/i.test(mod)) { + cmd = true; + } else if (/^a(lt)?$/i.test(mod)) { + alt = true; + } else if (/^(c|ctrl|control)$/i.test(mod)) { + ctrl = true; + } else if (/^s(hift)?$/i.test(mod)) { + shift = true; + } else { + throw new Error("Unrecognized modifier name: " + mod); + } + } + if (alt) { + name = "Alt-" + name; + } + if (ctrl) { + name = "Ctrl-" + name; + } + if (cmd) { + name = "Cmd-" + name; + } + if (shift) { + name = "Shift-" + name; + } + return name; + } + + // This is a kludge to keep keymaps mostly working as raw objects + // (backwards compatibility) while at the same time support features + // like normalization and multi-stroke key bindings. It compiles a + // new normalized keymap, and then updates the old object to reflect + // this. + function normalizeKeyMap(keymap) { + var copy = {}; + for (var keyname in keymap) { + if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname]; + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { + continue; + } + if (value == "...") { + delete keymap[keyname]; + continue; + } + var keys = map(keyname.split(" "), normalizeKeyName); + for (var i = 0; i < keys.length; i++) { + var val = void 0, + name = void 0; + if (i == keys.length - 1) { + name = keys.join(" "); + val = value; + } else { + name = keys.slice(0, i + 1).join(" "); + val = "..."; + } + var prev = copy[name]; + if (!prev) { + copy[name] = val; + } else if (prev != val) { + throw new Error("Inconsistent bindings for " + name); + } + } + delete keymap[keyname]; + } + } + for (var prop in copy) { + keymap[prop] = copy[prop]; + } + return keymap; + } + function lookupKey(key, map, handle, context) { + map = getKeyMap(map); + var found = map.call ? map.call(key, context) : map[key]; + if (found === false) { + return "nothing"; + } + if (found === "...") { + return "multi"; + } + if (found != null && handle(found)) { + return "handled"; + } + if (map.fallthrough) { + if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") { + return lookupKey(key, map.fallthrough, handle, context); + } + for (var i = 0; i < map.fallthrough.length; i++) { + var result = lookupKey(key, map.fallthrough[i], handle, context); + if (result) { + return result; + } + } + } + } + + // Modifier key presses don't count as 'real' key presses for the + // purpose of keymap fallthrough. + function isModifierKey(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; + } + function addModifierNames(name, event, noShift) { + var base = name; + if (event.altKey && base != "Alt") { + name = "Alt-" + name; + } + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { + name = "Ctrl-" + name; + } + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { + name = "Cmd-" + name; + } + if (!noShift && event.shiftKey && base != "Shift") { + name = "Shift-" + name; + } + return name; + } + + // Look up the name of a key as indicated by an event object. + function keyName(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) { + return false; + } + var name = keyNames[event.keyCode]; + if (name == null || event.altGraphKey) { + return false; + } + return addModifierNames(name, event, noShift); + } + function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val; + } + + // Helper for deleting text near the selection(s), used to implement + // backspace, delete, and similar functionality. + function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, + kill = []; + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]); + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop(); + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from; + break; + } + } + kill.push(toKill); + } + // Next, remove those actual ranges. + runInOp(cm, function () { + for (var i = kill.length - 1; i >= 0; i--) { + replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); + } + ensureCursorVisible(cm); + }); + } + + // Commands are parameter-less actions that can be performed on an + // editor, mostly used for keybindings. + var commands = { + selectAll: selectAll, + singleSelection: function (cm) { + return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); + }, + killLine: function (cm) { + return deleteNearSelection(cm, function (range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length; + if (range.head.ch == len && range.head.line < cm.lastLine()) { + return { + from: range.head, + to: Pos(range.head.line + 1, 0) + }; + } else { + return { + from: range.head, + to: Pos(range.head.line, len) + }; + } + } else { + return { + from: range.from(), + to: range.to() + }; + } + }); + }, + deleteLine: function (cm) { + return deleteNearSelection(cm, function (range) { + return { + from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) + }; + }); + }, + delLineLeft: function (cm) { + return deleteNearSelection(cm, function (range) { + return { + from: Pos(range.from().line, 0), + to: range.from() + }; + }); + }, + delWrappedLineLeft: function (cm) { + return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({ + left: 0, + top: top + }, "div"); + return { + from: leftPos, + to: range.from() + }; + }); + }, + delWrappedLineRight: function (cm) { + return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({ + left: cm.display.lineDiv.offsetWidth + 100, + top: top + }, "div"); + return { + from: range.from(), + to: rightPos + }; + }); + }, + undo: function (cm) { + return cm.undo(); + }, + redo: function (cm) { + return cm.redo(); + }, + undoSelection: function (cm) { + return cm.undoSelection(); + }, + redoSelection: function (cm) { + return cm.redoSelection(); + }, + goDocStart: function (cm) { + return cm.extendSelection(Pos(cm.firstLine(), 0)); + }, + goDocEnd: function (cm) { + return cm.extendSelection(Pos(cm.lastLine())); + }, + goLineStart: function (cm) { + return cm.extendSelectionsBy(function (range) { + return lineStart(cm, range.head.line); + }, { + origin: "+move", + bias: 1 + }); + }, + goLineStartSmart: function (cm) { + return cm.extendSelectionsBy(function (range) { + return lineStartSmart(cm, range.head); + }, { + origin: "+move", + bias: 1 + }); + }, + goLineEnd: function (cm) { + return cm.extendSelectionsBy(function (range) { + return lineEnd(cm, range.head.line); + }, { + origin: "+move", + bias: -1 + }); + }, + goLineRight: function (cm) { + return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + return cm.coordsChar({ + left: cm.display.lineDiv.offsetWidth + 100, + top: top + }, "div"); + }, sel_move); + }, + goLineLeft: function (cm) { + return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + return cm.coordsChar({ + left: 0, + top: top + }, "div"); + }, sel_move); + }, + goLineLeftSmart: function (cm) { + return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({ + left: 0, + top: top + }, "div"); + if (pos.ch < cm.getLine(pos.line).search(/\S/)) { + return lineStartSmart(cm, range.head); + } + return pos; + }, sel_move); + }, + goLineUp: function (cm) { + return cm.moveV(-1, "line"); + }, + goLineDown: function (cm) { + return cm.moveV(1, "line"); + }, + goPageUp: function (cm) { + return cm.moveV(-1, "page"); + }, + goPageDown: function (cm) { + return cm.moveV(1, "page"); + }, + goCharLeft: function (cm) { + return cm.moveH(-1, "char"); + }, + goCharRight: function (cm) { + return cm.moveH(1, "char"); + }, + goColumnLeft: function (cm) { + return cm.moveH(-1, "column"); + }, + goColumnRight: function (cm) { + return cm.moveH(1, "column"); + }, + goWordLeft: function (cm) { + return cm.moveH(-1, "word"); + }, + goGroupRight: function (cm) { + return cm.moveH(1, "group"); + }, + goGroupLeft: function (cm) { + return cm.moveH(-1, "group"); + }, + goWordRight: function (cm) { + return cm.moveH(1, "word"); + }, + delCharBefore: function (cm) { + return cm.deleteH(-1, "char"); + }, + delCharAfter: function (cm) { + return cm.deleteH(1, "char"); + }, + delWordBefore: function (cm) { + return cm.deleteH(-1, "word"); + }, + delWordAfter: function (cm) { + return cm.deleteH(1, "word"); + }, + delGroupBefore: function (cm) { + return cm.deleteH(-1, "group"); + }, + delGroupAfter: function (cm) { + return cm.deleteH(1, "group"); + }, + indentAuto: function (cm) { + return cm.indentSelection("smart"); + }, + indentMore: function (cm) { + return cm.indentSelection("add"); + }, + indentLess: function (cm) { + return cm.indentSelection("subtract"); + }, + insertTab: function (cm) { + return cm.replaceSelection("\t"); + }, + insertSoftTab: function (cm) { + var spaces = [], + ranges = cm.listSelections(), + tabSize = cm.options.tabSize; + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(spaceStr(tabSize - col % tabSize)); + } + cm.replaceSelections(spaces); + }, + defaultTab: function (cm) { + if (cm.somethingSelected()) { + cm.indentSelection("add"); + } else { + cm.execCommand("insertTab"); + } + }, + // Swap the two chars left and right of each selection's head. + // Move cursor behind the two swapped characters afterwards. + // + // Doesn't consider line feeds a character. + // Doesn't scan more than one line above to find a character. + // Doesn't do anything on an empty line. + // Doesn't do anything with non-empty selections. + transposeChars: function (cm) { + return runInOp(cm, function () { + var ranges = cm.listSelections(), + newSel = []; + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) { + continue; + } + var cur = ranges[i].head, + line = getLine(cm.doc, cur.line).text; + if (line) { + if (cur.ch == line.length) { + cur = new Pos(cur.line, cur.ch - 1); + } + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1); + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), Pos(cur.line, cur.ch - 2), cur, "+transpose"); + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text; + if (prev) { + cur = new Pos(cur.line, 1); + cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + prev.charAt(prev.length - 1), Pos(cur.line - 1, prev.length - 1), cur, "+transpose"); + } + } + } + newSel.push(new Range(cur, cur)); + } + cm.setSelections(newSel); + }); + }, + newlineAndIndent: function (cm) { + return runInOp(cm, function () { + var sels = cm.listSelections(); + for (var i = sels.length - 1; i >= 0; i--) { + cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input"); + } + sels = cm.listSelections(); + for (var i$1 = 0; i$1 < sels.length; i$1++) { + cm.indentLine(sels[i$1].from().line, null, true); + } + ensureCursorVisible(cm); + }); + }, + openLine: function (cm) { + return cm.replaceSelection("\n", "start"); + }, + toggleOverwrite: function (cm) { + return cm.toggleOverwrite(); + } + }; + function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLine(line); + if (visual != line) { + lineN = lineNo(visual); + } + return endOfLine(true, cm, visual, lineN, 1); + } + function lineEnd(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLineEnd(line); + if (visual != line) { + lineN = lineNo(visual); + } + return endOfLine(true, cm, line, lineN, -1); + } + function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line, cm.doc.direction); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky); + } + return start; + } + + // Run a handler that was bound to a key. + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) { + return false; + } + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled(); + var prevShift = cm.display.shift, + done = false; + try { + if (cm.isReadOnly()) { + cm.state.suppressEdits = true; + } + if (dropShift) { + cm.display.shift = false; + } + done = bound(cm) != Pass; + } finally { + cm.display.shift = prevShift; + cm.state.suppressEdits = false; + } + return done; + } + function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); + if (result) { + return result; + } + } + return cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm) || lookupKey(name, cm.options.keyMap, handle, cm); + } + + // Note that, despite the name, this function is also used to check + // for bound mouse clicks. + + var stopSeq = new Delayed(); + function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq; + if (seq) { + if (isModifierKey(name)) { + return "handled"; + } + stopSeq.set(50, function () { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null; + cm.display.input.reset(); + } + }); + name = seq + " " + name; + } + var result = lookupKeyForEditor(cm, name, handle); + if (result == "multi") { + cm.state.keySeq = name; + } + if (result == "handled") { + signalLater(cm, "keyHandled", cm, name, e); + } + if (result == "handled" || result == "multi") { + e_preventDefault(e); + restartBlink(cm); + } + if (seq && !result && /\'$/.test(name)) { + e_preventDefault(e); + return true; + } + return !!result; + } + + // Handle a key from the keydown event. + function handleKeyBinding(cm, e) { + var name = keyName(e, true); + if (!name) { + return false; + } + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function (b) { + return doHandleBinding(cm, b, true); + }) || dispatchKey(cm, name, e, function (b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) { + return doHandleBinding(cm, b); + } + }); + } else { + return dispatchKey(cm, name, e, function (b) { + return doHandleBinding(cm, b); + }); + } + } + + // Handle a key from the keypress event + function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, function (b) { + return doHandleBinding(cm, b, true); + }); + } + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + cm.curOp.focus = activeElt(); + if (signalDOMEvent(cm, e)) { + return; + } + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) { + e.returnValue = false; + } + var code = e.keyCode; + cm.display.shift = code == 16 || e.shiftKey; + var handled = handleKeyBinding(cm, e); + if (presto) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) { + cm.replaceSelection("", null, "cut"); + } + } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) { + showCrossHair(cm); + } + } + function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv; + addClass(lineDiv, "CodeMirror-crosshair"); + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair"); + off(document, "keyup", up); + off(document, "mouseover", up); + } + } + on(document, "keyup", up); + on(document, "mouseover", up); + } + function onKeyUp(e) { + if (e.keyCode == 16) { + this.doc.sel.shift = false; + } + signalDOMEvent(this, e); + } + function onKeyPress(e) { + var cm = this; + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { + return; + } + var keyCode = e.keyCode, + charCode = e.charCode; + if (presto && keyCode == lastStoppedKey) { + lastStoppedKey = null; + e_preventDefault(e); + return; + } + if (presto && (!e.which || e.which < 10) && handleKeyBinding(cm, e)) { + return; + } + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + // Some browsers fire keypress events for backspace + if (ch == "\x08") { + return; + } + if (handleCharBinding(cm, e, ch)) { + return; + } + cm.display.input.onKeyPress(e); + } + var DOUBLECLICK_DELAY = 400; + var PastClick = function (time, pos, button) { + this.time = time; + this.pos = pos; + this.button = button; + }; + PastClick.prototype.compare = function (time, pos, button) { + return this.time + DOUBLECLICK_DELAY > time && cmp(pos, this.pos) == 0 && button == this.button; + }; + var lastClick; + var lastDoubleClick; + function clickRepeat(pos, button) { + var now = +new Date(); + if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { + lastClick = lastDoubleClick = null; + return "triple"; + } else if (lastClick && lastClick.compare(now, pos, button)) { + lastDoubleClick = new PastClick(now, pos, button); + lastClick = null; + return "double"; + } else { + lastClick = new PastClick(now, pos, button); + lastDoubleClick = null; + return "single"; + } + } + + // A mouse down can be a single click, double click, triple click, + // start of selection drag, start of text drag, new cursor + // (ctrl-click), rectangle drag (alt-drag), or xwin + // middle-click-paste. Or it might be a click on something we should + // not interfere with, such as a scrollbar or widget. + function onMouseDown(e) { + var cm = this, + display = cm.display; + if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { + return; + } + display.input.ensurePolled(); + display.shift = e.shiftKey; + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false; + setTimeout(function () { + return display.scroller.draggable = true; + }, 100); + } + return; + } + if (clickInGutter(cm, e)) { + return; + } + var pos = posFromMouse(cm, e), + button = e_button(e), + repeat = pos ? clickRepeat(pos, button) : "single"; + window.focus(); + + // #3261: make sure, that we're not starting a second selection + if (button == 1 && cm.state.selectingText) { + cm.state.selectingText(e); + } + if (pos && handleMappedButton(cm, button, pos, repeat, e)) { + return; + } + if (button == 1) { + if (pos) { + leftButtonDown(cm, pos, repeat, e); + } else if (e_target(e) == display.scroller) { + e_preventDefault(e); + } + } else if (button == 2) { + if (pos) { + extendSelection(cm.doc, pos); + } + setTimeout(function () { + return display.input.focus(); + }, 20); + } else if (button == 3) { + if (captureRightClick) { + onContextMenu(cm, e); + } else { + delayBlurEvent(cm); + } + } + } + function handleMappedButton(cm, button, pos, repeat, event) { + var name = "Click"; + if (repeat == "double") { + name = "Double" + name; + } else if (repeat == "triple") { + name = "Triple" + name; + } + name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name; + return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { + if (typeof bound == "string") { + bound = commands[bound]; + } + if (!bound) { + return false; + } + var done = false; + try { + if (cm.isReadOnly()) { + cm.state.suppressEdits = true; + } + done = bound(cm, pos) != Pass; + } finally { + cm.state.suppressEdits = false; + } + return done; + }); + } + function configureMouse(cm, repeat, event) { + var option = cm.getOption("configureMouse"); + var value = option ? option(cm, repeat, event) : {}; + if (value.unit == null) { + var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; + value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"; + } + if (value.extend == null || cm.doc.extend) { + value.extend = cm.doc.extend || event.shiftKey; + } + if (value.addNew == null) { + value.addNew = mac ? event.metaKey : event.ctrlKey; + } + if (value.moveOnDrag == null) { + value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); + } + return value; + } + function leftButtonDown(cm, pos, repeat, event) { + if (ie) { + setTimeout(bind(ensureFocus, cm), 0); + } else { + cm.curOp.focus = activeElt(); + } + var behavior = configureMouse(cm, repeat, event); + var sel = cm.doc.sel, + contained; + if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && repeat == "single" && (contained = sel.contains(pos)) > -1 && (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) { + leftButtonStartDrag(cm, event, pos, behavior); + } else { + leftButtonSelect(cm, event, pos, behavior); + } + } + + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. + function leftButtonStartDrag(cm, event, pos, behavior) { + var display = cm.display, + moved = false; + var dragEnd = operation(cm, function (e) { + if (webkit) { + display.scroller.draggable = false; + } + cm.state.draggingText = false; + off(document, "mouseup", dragEnd); + off(document, "mousemove", mouseMove); + off(display.scroller, "dragstart", dragStart); + off(display.scroller, "drop", dragEnd); + if (!moved) { + e_preventDefault(e); + if (!behavior.addNew) { + extendSelection(cm.doc, pos, null, null, behavior.extend); + } + // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) + if (webkit || ie && ie_version == 9) { + setTimeout(function () { + document.body.focus(); + display.input.focus(); + }, 20); + } else { + display.input.focus(); + } + } + }); + var mouseMove = function (e2) { + moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10; + }; + var dragStart = function () { + return moved = true; + }; + // Let the drag handler handle this. + if (webkit) { + display.scroller.draggable = true; + } + cm.state.draggingText = dragEnd; + dragEnd.copy = !behavior.moveOnDrag; + // IE's approach to draggable + if (display.scroller.dragDrop) { + display.scroller.dragDrop(); + } + on(document, "mouseup", dragEnd); + on(document, "mousemove", mouseMove); + on(display.scroller, "dragstart", dragStart); + on(display.scroller, "drop", dragEnd); + delayBlurEvent(cm); + setTimeout(function () { + return display.input.focus(); + }, 20); + } + function rangeForUnit(cm, pos, unit) { + if (unit == "char") { + return new Range(pos, pos); + } + if (unit == "word") { + return cm.findWordAt(pos); + } + if (unit == "line") { + return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); + } + var result = unit(cm, pos); + return new Range(result.from, result.to); + } + + // Normal selection, as opposed to text dragging. + function leftButtonSelect(cm, event, start, behavior) { + var display = cm.display, + doc = cm.doc; + e_preventDefault(event); + var ourRange, + ourIndex, + startSel = doc.sel, + ranges = startSel.ranges; + if (behavior.addNew && !behavior.extend) { + ourIndex = doc.sel.contains(start); + if (ourIndex > -1) { + ourRange = ranges[ourIndex]; + } else { + ourRange = new Range(start, start); + } + } else { + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; + } + if (behavior.unit == "rectangle") { + if (!behavior.addNew) { + ourRange = new Range(start, start); + } + start = posFromMouse(cm, event, true, true); + ourIndex = -1; + } else { + var range = rangeForUnit(cm, start, behavior.unit); + if (behavior.extend) { + ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); + } else { + ourRange = range; + } + } + if (!behavior.addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; + } else if (ourIndex == -1) { + ourIndex = ranges.length; + setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), { + scroll: false, + origin: "*mouse" + }); + } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { + setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), { + scroll: false, + origin: "*mouse" + }); + startSel = doc.sel; + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); + } + var lastPos = start; + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) { + return; + } + lastPos = pos; + if (behavior.unit == "rectangle") { + var ranges = [], + tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), + right = Math.max(startCol, posCol); + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); line <= end; line++) { + var text = getLine(doc, line).text, + leftPos = findColumn(text, left, tabSize); + if (left == right) { + ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); + } else if (text.length > leftPos) { + ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); + } + } + if (!ranges.length) { + ranges.push(new Range(start, start)); + } + setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), { + origin: "*mouse", + scroll: false + }); + cm.scrollIntoView(pos); + } else { + var oldRange = ourRange; + var range = rangeForUnit(cm, pos, behavior.unit); + var anchor = oldRange.anchor, + head; + if (cmp(range.anchor, anchor) > 0) { + head = range.head; + anchor = minPos(oldRange.from(), range.anchor); + } else { + head = range.anchor; + anchor = maxPos(oldRange.to(), range.head); + } + var ranges$1 = startSel.ranges.slice(0); + ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head); + setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse); + } + } + var editorSize = display.wrapper.getBoundingClientRect(); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); + if (!cur) { + return; + } + if (cmp(cur, lastPos) != 0) { + cm.curOp.focus = activeElt(); + extendTo(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) { + setTimeout(operation(cm, function () { + if (counter == curCount) { + extend(e); + } + }), 150); + } + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) { + setTimeout(operation(cm, function () { + if (counter != curCount) { + return; + } + display.scroller.scrollTop += outside; + extend(e); + }), 50); + } + } + } + function done(e) { + cm.state.selectingText = false; + counter = Infinity; + e_preventDefault(e); + display.input.focus(); + off(document, "mousemove", move); + off(document, "mouseup", up); + doc.history.lastSelOrigin = null; + } + var move = operation(cm, function (e) { + if (!e_button(e)) { + done(e); + } else { + extend(e); + } + }); + var up = operation(cm, done); + cm.state.selectingText = up; + on(document, "mousemove", move); + on(document, "mouseup", up); + } + + // Determines whether an event happened in the gutter, and fires the + // handlers for the corresponding event. + function gutterEvent(cm, e, type, prevent) { + var mX, mY; + try { + mX = e.clientX; + mY = e.clientY; + } catch (e) { + return false; + } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { + return false; + } + if (prevent) { + e_preventDefault(e); + } + var display = cm.display; + var lineBox = display.lineDiv.getBoundingClientRect(); + if (mY > lineBox.bottom || !hasHandler(cm, type)) { + return e_defaultPrevented(e); + } + mY -= lineBox.top - display.viewOffset; + for (var i = 0; i < cm.options.gutters.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.options.gutters[i]; + signal(cm, type, cm, line, gutter, e); + return e_defaultPrevented(e); + } + } + } + function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true); + } + + // CONTEXT MENU HANDLING + + // To make the context menu work, we need to briefly unhide the + // textarea (making it as unobtrusive as possible) to let the + // right-click take effect on it. + function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { + return; + } + if (signalDOMEvent(cm, e, "contextmenu")) { + return; + } + cm.display.input.onContextMenu(e); + } + function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) { + return false; + } + return gutterEvent(cm, e, "gutterContextMenu", false); + } + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } + var Init = { + toString: function () { + return "CodeMirror.Init"; + } + }; + var defaults = {}; + var optionHandlers = {}; + function defineOptions(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) { + optionHandlers[name] = notOnInit ? function (cm, val, old) { + if (old != Init) { + handle(cm, val, old); + } + } : handle; + } + } + CodeMirror.defineOption = option; + + // Passed to option handlers when there is no old value. + CodeMirror.Init = Init; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function (cm, val) { + return cm.setValue(val); + }, true); + option("mode", null, function (cm, val) { + cm.doc.modeOption = val; + loadMode(cm); + }, true); + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function (cm) { + resetModeState(cm); + clearCaches(cm); + regChange(cm); + }, true); + option("lineSeparator", null, function (cm, val) { + cm.doc.lineSep = val; + if (!val) { + return; + } + var newBreaks = [], + lineNo = cm.doc.first; + cm.doc.iter(function (line) { + for (var pos = 0;;) { + var found = line.text.indexOf(val, pos); + if (found == -1) { + break; + } + pos = found + val.length; + newBreaks.push(Pos(lineNo, found)); + } + lineNo++; + }); + for (var i = newBreaks.length - 1; i >= 0; i--) { + replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); + } + }); + option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); + if (old != Init) { + cm.refresh(); + } + }); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { + return cm.refresh(); + }, true); + option("electricChars", true); + option("inputStyle", mobile ? "contenteditable" : "textarea", function () { + throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME + }, true); + option("spellcheck", false, function (cm, val) { + return cm.getInputField().spellcheck = val; + }, true); + option("rtlMoveVisually", !windows); + option("wholeLineUpdateBefore", true); + option("theme", "default", function (cm) { + themeChanged(cm); + guttersChanged(cm); + }, true); + option("keyMap", "default", function (cm, val, old) { + var next = getKeyMap(val); + var prev = old != Init && getKeyMap(old); + if (prev && prev.detach) { + prev.detach(cm, next); + } + if (next.attach) { + next.attach(cm, prev || null); + } + }); + option("extraKeys", null); + option("configureMouse", null); + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function (cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("fixedGutter", true, function (cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("coverGutterNextToScrollbar", false, function (cm) { + return updateScrollbars(cm); + }, true); + option("scrollbarStyle", "native", function (cm) { + initScrollbars(cm); + updateScrollbars(cm); + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); + }, true); + option("lineNumbers", false, function (cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("firstLineNumber", 1, guttersChanged, true); + option("lineNumberFormatter", function (integer) { + return integer; + }, guttersChanged, true); + option("showCursorWhenSelecting", false, updateSelection, true); + option("resetSelectionOnContextMenu", true); + option("lineWiseCopyCut", true); + option("pasteLinesPerSelection", true); + option("readOnly", false, function (cm, val) { + if (val == "nocursor") { + onBlur(cm); + cm.display.input.blur(); + } + cm.display.input.readOnlyChanged(val); + }); + option("disableInput", false, function (cm, val) { + if (!val) { + cm.display.input.reset(); + } + }, true); + option("dragDrop", true, dragDropChanged); + option("allowDropFileTypes", null); + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true, resetModeState, true); + option("addModeClass", false, resetModeState, true); + option("pollInterval", 100); + option("undoDepth", 200, function (cm, val) { + return cm.doc.history.undoDepth = val; + }); + option("historyEventDelay", 1250); + option("viewportMargin", 10, function (cm) { + return cm.refresh(); + }, true); + option("maxHighlightLength", 10000, resetModeState, true); + option("moveInputWithCursor", true, function (cm, val) { + if (!val) { + cm.display.input.resetPosition(); + } + }); + option("tabindex", null, function (cm, val) { + return cm.display.input.getField().tabIndex = val || ""; + }); + option("autofocus", null); + option("direction", "ltr", function (cm, val) { + return cm.doc.setDirection(val); + }, true); + } + function guttersChanged(cm) { + updateGutters(cm); + regChange(cm); + alignHorizontally(cm); + } + function dragDropChanged(cm, value, old) { + var wasOn = old && old != Init; + if (!value != !wasOn) { + var funcs = cm.display.dragFunctions; + var toggle = value ? on : off; + toggle(cm.display.scroller, "dragstart", funcs.start); + toggle(cm.display.scroller, "dragenter", funcs.enter); + toggle(cm.display.scroller, "dragover", funcs.over); + toggle(cm.display.scroller, "dragleave", funcs.leave); + toggle(cm.display.scroller, "drop", funcs.drop); + } + } + function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap"); + cm.display.sizer.style.minWidth = ""; + cm.display.sizerWidth = null; + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap"); + findMaxLine(cm); + } + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function () { + return updateScrollbars(cm); + }, 100); + } + + // A CodeMirror instance represents an editor. This is the object + // that user code is usually dealing with. + + function CodeMirror(place, options) { + var this$1 = this; + if (!(this instanceof CodeMirror)) { + return new CodeMirror(place, options); + } + this.options = options = options ? copyObj(options) : {}; + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false); + setGuttersForLineNumbers(options); + var doc = options.value; + if (typeof doc == "string") { + doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); + } + this.doc = doc; + var input = new CodeMirror.inputStyles[options.inputStyle](this); + var display = this.display = new Display(place, doc, input); + display.wrapper.CodeMirror = this; + updateGutters(this); + themeChanged(this); + if (options.lineWrapping) { + this.display.wrapper.className += " CodeMirror-wrap"; + } + initScrollbars(this); + this.state = { + keyMaps: [], + // stores maps added by addKeyMap + overlays: [], + // highlighting overlays, as added by addOverlay + modeGen: 0, + // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, + delayingBlurEvent: false, + focused: false, + suppressEdits: false, + // used to disable editing during key handlers when in readOnly mode + pasteIncoming: false, + cutIncoming: false, + // help recognize paste/cut edits in input.poll + selectingText: false, + draggingText: false, + highlight: new Delayed(), + // stores highlight worker timeout + keySeq: null, + // Unfinished key sequence + specialChars: null + }; + if (options.autofocus && !mobile) { + display.input.focus(); + } + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) { + setTimeout(function () { + return this$1.display.input.reset(true); + }, 20); + } + registerEventHandlers(this); + ensureGlobalHandlers(); + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); + if (options.autofocus && !mobile || this.hasFocus()) { + setTimeout(bind(onFocus, this), 20); + } else { + onBlur(this); + } + for (var opt in optionHandlers) { + if (optionHandlers.hasOwnProperty(opt)) { + optionHandlers[opt](this$1, options[opt], Init); + } + } + maybeUpdateLineNumberWidth(this); + if (options.finishInit) { + options.finishInit(this); + } + for (var i = 0; i < initHooks.length; ++i) { + initHooks[i](this$1); + } + endOperation(this); + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") { + display.lineDiv.style.textRendering = "auto"; + } + } + + // The default configuration options. + CodeMirror.defaults = defaults; + // Functions to run when options are changed. + CodeMirror.optionHandlers = optionHandlers; + + // Attach the necessary event handlers when initializing the editor + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) { + on(d.scroller, "dblclick", operation(cm, function (e) { + if (signalDOMEvent(cm, e)) { + return; + } + var pos = posFromMouse(cm, e); + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { + return; + } + e_preventDefault(e); + var word = cm.findWordAt(pos); + extendSelection(cm.doc, word.anchor, word.head); + })); + } else { + on(d.scroller, "dblclick", function (e) { + return signalDOMEvent(cm, e) || e_preventDefault(e); + }); + } + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + if (!captureRightClick) { + on(d.scroller, "contextmenu", function (e) { + return onContextMenu(cm, e); + }); + } + + // Used to suppress mouse event handling when a touch happens + var touchFinished, + prevTouch = { + end: 0 + }; + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function () { + return d.activeTouch = null; + }, 1000); + prevTouch = d.activeTouch; + prevTouch.end = +new Date(); + } + } + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) { + return false; + } + var touch = e.touches[0]; + return touch.radiusX <= 1 && touch.radiusY <= 1; + } + function farAway(touch, other) { + if (other.left == null) { + return true; + } + var dx = other.left - touch.left, + dy = other.top - touch.top; + return dx * dx + dy * dy > 20 * 20; + } + on(d.scroller, "touchstart", function (e) { + if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) { + d.input.ensurePolled(); + clearTimeout(touchFinished); + var now = +new Date(); + d.activeTouch = { + start: now, + moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null + }; + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX; + d.activeTouch.top = e.touches[0].pageY; + } + } + }); + on(d.scroller, "touchmove", function () { + if (d.activeTouch) { + d.activeTouch.moved = true; + } + }); + on(d.scroller, "touchend", function (e) { + var touch = d.activeTouch; + if (touch && !eventInWidget(d, e) && touch.left != null && !touch.moved && new Date() - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), + range; + if (!touch.prev || farAway(touch, touch.prev)) + // Single tap + { + range = new Range(pos, pos); + } else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) + // Double tap + { + range = cm.findWordAt(pos); + } else + // Triple tap + { + range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); + } + cm.setSelection(range.anchor, range.head); + cm.focus(); + e_preventDefault(e); + } + finishTouch(); + }); + on(d.scroller, "touchcancel", finishTouch); + + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function () { + if (d.scroller.clientHeight) { + updateScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + } + }); + + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function (e) { + return onScrollWheel(cm, e); + }); + on(d.scroller, "DOMMouseScroll", function (e) { + return onScrollWheel(cm, e); + }); + + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function () { + return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; + }); + d.dragFunctions = { + enter: function (e) { + if (!signalDOMEvent(cm, e)) { + e_stop(e); + } + }, + over: function (e) { + if (!signalDOMEvent(cm, e)) { + onDragOver(cm, e); + e_stop(e); + } + }, + start: function (e) { + return onDragStart(cm, e); + }, + drop: operation(cm, onDrop), + leave: function (e) { + if (!signalDOMEvent(cm, e)) { + clearDragCursor(cm); + } + } + }; + var inp = d.input.getField(); + on(inp, "keyup", function (e) { + return onKeyUp.call(cm, e); + }); + on(inp, "keydown", operation(cm, onKeyDown)); + on(inp, "keypress", operation(cm, onKeyPress)); + on(inp, "focus", function (e) { + return onFocus(cm, e); + }); + on(inp, "blur", function (e) { + return onBlur(cm, e); + }); + } + var initHooks = []; + CodeMirror.defineInitHook = function (f) { + return initHooks.push(f); + }; + + // Indent the given line. The how parameter can be "smart", + // "add"/null, "subtract", or "prev". When aggressive is false + // (typically set to true for forced single-line indents), empty + // lines are not indented, and places where the mode returns Pass + // are left alone. + function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, + state; + if (how == null) { + how = "add"; + } + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) { + how = "prev"; + } else { + state = getContextBefore(cm, n).state; + } + } + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), + curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) { + line.stateAfter = null; + } + var curSpaceString = line.text.match(/^\s*/)[0], + indentation; + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0; + how = "not"; + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass || indentation > 150) { + if (!aggressive) { + return; + } + how = "prev"; + } + } + if (how == "prev") { + if (n > doc.first) { + indentation = countColumn(getLine(doc, n - 1).text, null, tabSize); + } else { + indentation = 0; + } + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit; + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit; + } else if (typeof how == "number") { + indentation = curSpace + how; + } + indentation = Math.max(0, indentation); + var indentString = "", + pos = 0; + if (cm.options.indentWithTabs) { + for (var i = Math.floor(indentation / tabSize); i; --i) { + pos += tabSize; + indentString += "\t"; + } + } + if (pos < indentation) { + indentString += spaceStr(indentation - pos); + } + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + line.stateAfter = null; + return true; + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { + var range = doc.sel.ranges[i$1]; + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos$1 = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)); + break; + } + } + } + } + + // This will be set to a {lineWise: bool, text: [string]} object, so + // that, when pasting, we know what kind of selections the copied + // text was made out of. + var lastCopied = null; + function setLastCopied(newLastCopied) { + lastCopied = newLastCopied; + } + function applyTextInput(cm, inserted, deleted, sel, origin) { + var doc = cm.doc; + cm.display.shift = false; + if (!sel) { + sel = doc.sel; + } + var paste = cm.state.pasteIncoming || origin == "paste"; + var textLines = splitLinesAuto(inserted), + multiPaste = null; + // When pasing N lines into N selections, insert one line per selection + if (paste && sel.ranges.length > 1) { + if (lastCopied && lastCopied.text.join("\n") == inserted) { + if (sel.ranges.length % lastCopied.text.length == 0) { + multiPaste = []; + for (var i = 0; i < lastCopied.text.length; i++) { + multiPaste.push(doc.splitLines(lastCopied.text[i])); + } + } + } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { + multiPaste = map(textLines, function (l) { + return [l]; + }); + } + } + var updateInput; + // Normal behavior is to insert the new text into every selection + for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { + var range = sel.ranges[i$1]; + var from = range.from(), + to = range.to(); + if (range.empty()) { + if (deleted && deleted > 0) + // Handle deletion + { + from = Pos(from.line, from.ch - deleted); + } else if (cm.state.overwrite && !paste) + // Handle overwrite + { + to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); + } else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) { + from = to = Pos(from.line, 0); + } + } + updateInput = cm.curOp.updateInput; + var changeEvent = { + from: from, + to: to, + text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, + origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input") + }; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); + } + if (inserted && !paste) { + triggerElectric(cm, inserted); + } + ensureCursorVisible(cm); + cm.curOp.updateInput = updateInput; + cm.curOp.typing = true; + cm.state.pasteIncoming = cm.state.cutIncoming = false; + } + function handlePaste(e, cm) { + var pasted = e.clipboardData && e.clipboardData.getData("Text"); + if (pasted) { + e.preventDefault(); + if (!cm.isReadOnly() && !cm.options.disableInput) { + runInOp(cm, function () { + return applyTextInput(cm, pasted, 0, null, "paste"); + }); + } + return true; + } + } + function triggerElectric(cm, inserted) { + // When an 'electric' character is inserted, immediately trigger a reindent + if (!cm.options.electricChars || !cm.options.smartIndent) { + return; + } + var sel = cm.doc.sel; + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i]; + if (range.head.ch > 100 || i && sel.ranges[i - 1].head.line == range.head.line) { + continue; + } + var mode = cm.getModeAt(range.head); + var indented = false; + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) { + if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indented = indentLine(cm, range.head.line, "smart"); + break; + } + } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) { + indented = indentLine(cm, range.head.line, "smart"); + } + } + if (indented) { + signalLater(cm, "electricInput", cm, range.head.line); + } + } + } + function copyableRanges(cm) { + var text = [], + ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = { + anchor: Pos(line, 0), + head: Pos(line + 1, 0) + }; + ranges.push(lineRange); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); + } + return { + text: text, + ranges: ranges + }; + } + function disableBrowserMagic(field, spellcheck) { + field.setAttribute("autocorrect", "off"); + field.setAttribute("autocapitalize", "off"); + field.setAttribute("spellcheck", !!spellcheck); + } + function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"); + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) { + te.style.width = "1000px"; + } else { + te.setAttribute("wrap", "off"); + } + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) { + te.style.border = "1px solid black"; + } + disableBrowserMagic(te); + return div; + } + + // The publicly visible API. Note that methodOp(f) means + // 'wrap f in an operation, performed on its `this` parameter'. + + // This is not the complete set of editor methods. Most of the + // methods defined on the Doc type are also injected into + // CodeMirror.prototype, for backwards compatibility and + // convenience. + + function addEditorMethods(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; + var helpers = CodeMirror.helpers = {}; + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function () { + window.focus(); + this.display.input.focus(); + }, + setOption: function (option, value) { + var options = this.options, + old = options[option]; + if (options[option] == value && option != "mode") { + return; + } + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) { + operation(this, optionHandlers[option])(this, value, old); + } + signal(this, "optionChange", this, option); + }, + getOption: function (option) { + return this.options[option]; + }, + getDoc: function () { + return this.doc; + }, + addKeyMap: function (map, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); + }, + removeKeyMap: function (map) { + var maps = this.state.keyMaps; + for (var i = 0; i < maps.length; ++i) { + if (maps[i] == map || maps[i].name == map) { + maps.splice(i, 1); + return true; + } + } + }, + addOverlay: methodOp(function (spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); + if (mode.startState) { + throw new Error("Overlays may not be stateful."); + } + insertSorted(this.state.overlays, { + mode: mode, + modeSpec: spec, + opaque: options && options.opaque, + priority: options && options.priority || 0 + }, function (overlay) { + return overlay.priority; + }); + this.state.modeGen++; + regChange(this); + }), + removeOverlay: methodOp(function (spec) { + var this$1 = this; + var overlays = this.state.overlays; + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec; + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1); + this$1.state.modeGen++; + regChange(this$1); + return; + } + } + }), + indentLine: methodOp(function (n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) { + dir = this.options.smartIndent ? "smart" : "prev"; + } else { + dir = dir ? "add" : "subtract"; + } + } + if (isLine(this.doc, n)) { + indentLine(this, n, dir, aggressive); + } + }), + indentSelection: methodOp(function (how) { + var this$1 = this; + var ranges = this.doc.sel.ranges, + end = -1; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (!range.empty()) { + var from = range.from(), + to = range.to(); + var start = Math.max(end, from.line); + end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; + for (var j = start; j < end; ++j) { + indentLine(this$1, j, how); + } + var newRanges = this$1.doc.sel.ranges; + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) { + replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); + } + } else if (range.head.line > end) { + indentLine(this$1, range.head.line, how, true); + end = range.head.line; + if (i == this$1.doc.sel.primIndex) { + ensureCursorVisible(this$1); + } + } + } + }), + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function (pos, precise) { + return takeToken(this, pos, precise); + }, + getLineTokens: function (line, precise) { + return takeToken(this, Pos(line), precise, true); + }, + getTokenTypeAt: function (pos) { + pos = clipPos(this.doc, pos); + var styles = getLineStyles(this, getLine(this.doc, pos.line)); + var before = 0, + after = (styles.length - 1) / 2, + ch = pos.ch; + var type; + if (ch == 0) { + type = styles[2]; + } else { + for (;;) { + var mid = before + after >> 1; + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { + after = mid; + } else if (styles[mid * 2 + 1] < ch) { + before = mid + 1; + } else { + type = styles[mid * 2 + 2]; + break; + } + } + } + var cut = type ? type.indexOf("overlay ") : -1; + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); + }, + getModeAt: function (pos) { + var mode = this.doc.mode; + if (!mode.innerMode) { + return mode; + } + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode; + }, + getHelper: function (pos, type) { + return this.getHelpers(pos, type)[0]; + }, + getHelpers: function (pos, type) { + var this$1 = this; + var found = []; + if (!helpers.hasOwnProperty(type)) { + return found; + } + var help = helpers[type], + mode = this.getModeAt(pos); + if (typeof mode[type] == "string") { + if (help[mode[type]]) { + found.push(help[mode[type]]); + } + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]]; + if (val) { + found.push(val); + } + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]); + } else if (help[mode.name]) { + found.push(help[mode.name]); + } + for (var i$1 = 0; i$1 < help._global.length; i$1++) { + var cur = help._global[i$1]; + if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1) { + found.push(cur.val); + } + } + return found; + }, + getStateAfter: function (line, precise) { + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1 : line); + return getContextBefore(this, line + 1, precise).state; + }, + cursorCoords: function (start, mode) { + var pos, + range = this.doc.sel.primary(); + if (start == null) { + pos = range.head; + } else if (typeof start == "object") { + pos = clipPos(this.doc, start); + } else { + pos = start ? range.from() : range.to(); + } + return cursorCoords(this, pos, mode || "page"); + }, + charCoords: function (pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page"); + }, + coordsChar: function (coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page"); + return coordsChar(this, coords.left, coords.top); + }, + lineAtHeight: function (height, mode) { + height = fromCoordSystem(this, { + top: height, + left: 0 + }, mode || "page").top; + return lineAtHeight(this.doc, height + this.display.viewOffset); + }, + heightAtLine: function (line, mode, includeWidgets) { + var end = false, + lineObj; + if (typeof line == "number") { + var last = this.doc.first + this.doc.size - 1; + if (line < this.doc.first) { + line = this.doc.first; + } else if (line > last) { + line = last; + end = true; + } + lineObj = getLine(this.doc, line); + } else { + lineObj = line; + } + return intoCoordSystem(this, lineObj, { + top: 0, + left: 0 + }, mode || "page", includeWidgets || end).top + (end ? this.doc.height - heightAtLine(lineObj) : 0); + }, + defaultTextHeight: function () { + return textHeight(this.display); + }, + defaultCharWidth: function () { + return charWidth(this.display); + }, + getViewport: function () { + return { + from: this.display.viewFrom, + to: this.display.viewTo + }; + }, + addWidget: function (pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, + left = pos.left; + node.style.position = "absolute"; + node.setAttribute("cm-ignore-events", "true"); + this.display.input.setUneditable(node); + display.sizer.appendChild(node); + if (vert == "over") { + top = pos.top; + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) { + top = pos.top - node.offsetHeight; + } else if (pos.bottom + node.offsetHeight <= vspace) { + top = pos.bottom; + } + if (left + node.offsetWidth > hspace) { + left = hspace - node.offsetWidth; + } + } + node.style.top = top + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") { + left = 0; + } else if (horiz == "middle") { + left = (display.sizer.clientWidth - node.offsetWidth) / 2; + } + node.style.left = left + "px"; + } + if (scroll) { + scrollIntoView(this, { + left: left, + top: top, + right: left + node.offsetWidth, + bottom: top + node.offsetHeight + }); + } + }, + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + triggerOnMouseDown: methodOp(onMouseDown), + execCommand: function (cmd) { + if (commands.hasOwnProperty(cmd)) { + return commands[cmd].call(null, this); + } + }, + triggerElectric: methodOp(function (text) { + triggerElectric(this, text); + }), + findPosH: function (from, amount, unit, visually) { + var this$1 = this; + var dir = 1; + if (amount < 0) { + dir = -1; + amount = -amount; + } + var cur = clipPos(this.doc, from); + for (var i = 0; i < amount; ++i) { + cur = findPosH(this$1.doc, cur, dir, unit, visually); + if (cur.hitSide) { + break; + } + } + return cur; + }, + moveH: methodOp(function (dir, unit) { + var this$1 = this; + this.extendSelectionsBy(function (range) { + if (this$1.display.shift || this$1.doc.extend || range.empty()) { + return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually); + } else { + return dir < 0 ? range.from() : range.to(); + } + }, sel_move); + }), + deleteH: methodOp(function (dir, unit) { + var sel = this.doc.sel, + doc = this.doc; + if (sel.somethingSelected()) { + doc.replaceSelection("", null, "+delete"); + } else { + deleteNearSelection(this, function (range) { + var other = findPosH(doc, range.head, dir, unit, false); + return dir < 0 ? { + from: other, + to: range.head + } : { + from: range.head, + to: other + }; + }); + } + }), + findPosV: function (from, amount, unit, goalColumn) { + var this$1 = this; + var dir = 1, + x = goalColumn; + if (amount < 0) { + dir = -1; + amount = -amount; + } + var cur = clipPos(this.doc, from); + for (var i = 0; i < amount; ++i) { + var coords = cursorCoords(this$1, cur, "div"); + if (x == null) { + x = coords.left; + } else { + coords.left = x; + } + cur = findPosV(this$1, coords, dir, unit); + if (cur.hitSide) { + break; + } + } + return cur; + }, + moveV: methodOp(function (dir, unit) { + var this$1 = this; + var doc = this.doc, + goals = []; + var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function (range) { + if (collapse) { + return dir < 0 ? range.from() : range.to(); + } + var headPos = cursorCoords(this$1, range.head, "div"); + if (range.goalColumn != null) { + headPos.left = range.goalColumn; + } + goals.push(headPos.left); + var pos = findPosV(this$1, headPos, dir, unit); + if (unit == "page" && range == doc.sel.primary()) { + addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); + } + return pos; + }, sel_move); + if (goals.length) { + for (var i = 0; i < doc.sel.ranges.length; i++) { + doc.sel.ranges[i].goalColumn = goals[i]; + } + } + }), + // Find the word at the given position (as returned by coordsChar). + findWordAt: function (pos) { + var doc = this.doc, + line = getLine(doc, pos.line).text; + var start = pos.ch, + end = pos.ch; + if (line) { + var helper = this.getHelper(pos, "wordChars"); + if ((pos.sticky == "before" || end == line.length) && start) { + --start; + } else { + ++end; + } + var startChar = line.charAt(start); + var check = isWordChar(startChar, helper) ? function (ch) { + return isWordChar(ch, helper); + } : /\s/.test(startChar) ? function (ch) { + return /\s/.test(ch); + } : function (ch) { + return !/\s/.test(ch) && !isWordChar(ch); + }; + while (start > 0 && check(line.charAt(start - 1))) { + --start; + } + while (end < line.length && check(line.charAt(end))) { + ++end; + } + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)); + }, + toggleOverwrite: function (value) { + if (value != null && value == this.state.overwrite) { + return; + } + if (this.state.overwrite = !this.state.overwrite) { + addClass(this.display.cursorDiv, "CodeMirror-overwrite"); + } else { + rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); + } + signal(this, "overwriteToggle", this, this.state.overwrite); + }, + hasFocus: function () { + return this.display.input.getField() == activeElt(); + }, + isReadOnly: function () { + return !!(this.options.readOnly || this.doc.cantEdit); + }, + scrollTo: methodOp(function (x, y) { + scrollToCoords(this, x, y); + }), + getScrollInfo: function () { + var scroller = this.display.scroller; + return { + left: scroller.scrollLeft, + top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), + clientWidth: displayWidth(this) + }; + }, + scrollIntoView: methodOp(function (range, margin) { + if (range == null) { + range = { + from: this.doc.sel.primary().head, + to: null + }; + if (margin == null) { + margin = this.options.cursorScrollMargin; + } + } else if (typeof range == "number") { + range = { + from: Pos(range, 0), + to: null + }; + } else if (range.from == null) { + range = { + from: range, + to: null + }; + } + if (!range.to) { + range.to = range.from; + } + range.margin = margin || 0; + if (range.from.line != null) { + scrollToRange(this, range); + } else { + scrollToCoordsRange(this, range.from, range.to, range.margin); + } + }), + setSize: methodOp(function (width, height) { + var this$1 = this; + var interpret = function (val) { + return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; + }; + if (width != null) { + this.display.wrapper.style.width = interpret(width); + } + if (height != null) { + this.display.wrapper.style.height = interpret(height); + } + if (this.options.lineWrapping) { + clearLineMeasurementCache(this); + } + var lineNo = this.display.viewFrom; + this.doc.iter(lineNo, this.display.viewTo, function (line) { + if (line.widgets) { + for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].noHScroll) { + regLineChange(this$1, lineNo, "widget"); + break; + } + } + } + ++lineNo; + }); + this.curOp.forceUpdate = true; + signal(this, "refresh", this); + }), + operation: function (f) { + return runInOp(this, f); + }, + startOperation: function () { + return startOperation(this); + }, + endOperation: function () { + return endOperation(this); + }, + refresh: methodOp(function () { + var oldHeight = this.display.cachedTextHeight; + regChange(this); + this.curOp.forceUpdate = true; + clearCaches(this); + scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this); + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) { + estimateLineHeights(this); + } + signal(this, "refresh", this); + }), + swapDoc: methodOp(function (doc) { + var old = this.doc; + old.cm = null; + attachDoc(this, doc); + clearCaches(this); + this.display.input.reset(); + scrollToCoords(this, doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; + signalLater(this, "swapDoc", this, old); + return old; + }), + 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; + } + }; + eventMixin(CodeMirror); + CodeMirror.registerHelper = function (type, name, value) { + if (!helpers.hasOwnProperty(type)) { + helpers[type] = CodeMirror[type] = { + _global: [] + }; + } + helpers[type][name] = value; + }; + CodeMirror.registerGlobalHelper = function (type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value); + helpers[type]._global.push({ + pred: predicate, + val: value + }); + }; + } + + // Used for horizontal relative motion. Dir is -1 or 1 (left or + // right), unit can be "char", "column" (like char, but doesn't + // cross line boundaries), "word" (across next word), or "group" (to + // the start of next group of word or non-word-non-whitespace + // chars). The visually param controls whether, in right-to-left + // text, direction 1 means to move towards the next index in the + // string, or towards the character to the right of the current + // position. The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosH(doc, pos, dir, unit, visually) { + var oldPos = pos; + var origDir = dir; + var lineObj = getLine(doc, pos.line); + function findNextLine() { + var l = pos.line + dir; + if (l < doc.first || l >= doc.first + doc.size) { + return false; + } + pos = new Pos(l, pos.ch, pos.sticky); + return lineObj = getLine(doc, l); + } + function moveOnce(boundToLine) { + var next; + if (visually) { + next = moveVisually(doc.cm, lineObj, pos, dir); + } else { + next = moveLogically(lineObj, pos, dir); + } + if (next == null) { + if (!boundToLine && findNextLine()) { + pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); + } else { + return false; + } + } else { + pos = next; + } + return true; + } + if (unit == "char") { + moveOnce(); + } else if (unit == "column") { + moveOnce(true); + } else if (unit == "word" || unit == "group") { + var sawType = null, + group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) { + break; + } + var cur = lineObj.text.charAt(pos.ch) || "\n"; + var type = isWordChar(cur, helper) ? "w" : group && cur == "\n" ? "n" : !group || /\s/.test(cur) ? null : "p"; + if (group && !first && !type) { + type = "s"; + } + if (sawType && sawType != type) { + if (dir < 0) { + dir = 1; + moveOnce(); + pos.sticky = "after"; + } + break; + } + if (type) { + sawType = type; + } + if (dir > 0 && !moveOnce(!first)) { + break; + } + } + } + var result = skipAtomic(doc, pos, oldPos, origDir, true); + if (equalCursorPos(oldPos, result)) { + result.hitSide = true; + } + return result; + } + + // For relative vertical movement. Dir may be -1 or 1. Unit can be + // "page" or "line". The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, + x = pos.left, + y; + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3); + y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + var target; + for (;;) { + target = coordsChar(cm, x, y); + if (!target.outside) { + break; + } + if (dir < 0 ? y <= 0 : y >= doc.height) { + target.hitSide = true; + break; + } + y += dir * 5; + } + return target; + } + + // CONTENTEDITABLE INPUT STYLE + + var ContentEditableInput = function (cm) { + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); + this.composing = null; + this.gracePeriod = false; + this.readDOMTimeout = null; + }; + ContentEditableInput.prototype.init = function (display) { + var this$1 = this; + var input = this, + cm = input.cm; + var div = input.div = display.lineDiv; + disableBrowserMagic(div, cm.options.spellcheck); + on(div, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { + return; + } + // IE doesn't fire input events, so we schedule a read for the pasted content in this way + if (ie_version <= 11) { + setTimeout(operation(cm, function () { + return this$1.updateFromDOM(); + }), 20); + } + }); + on(div, "compositionstart", function (e) { + this$1.composing = { + data: e.data, + done: false + }; + }); + on(div, "compositionupdate", function (e) { + if (!this$1.composing) { + this$1.composing = { + data: e.data, + done: false + }; + } + }); + on(div, "compositionend", function (e) { + if (this$1.composing) { + if (e.data != this$1.composing.data) { + this$1.readFromDOMSoon(); + } + this$1.composing.done = true; + } + }); + on(div, "touchstart", function () { + return input.forceCompositionEnd(); + }); + on(div, "input", function () { + if (!this$1.composing) { + this$1.readFromDOMSoon(); + } + }); + function onCopyCut(e) { + if (signalDOMEvent(cm, e)) { + return; + } + if (cm.somethingSelected()) { + setLastCopied({ + lineWise: false, + text: cm.getSelections() + }); + if (e.type == "cut") { + cm.replaceSelection("", null, "cut"); + } + } else if (!cm.options.lineWiseCopyCut) { + return; + } else { + var ranges = copyableRanges(cm); + setLastCopied({ + lineWise: true, + text: ranges.text + }); + if (e.type == "cut") { + cm.operation(function () { + cm.setSelections(ranges.ranges, 0, sel_dontScroll); + cm.replaceSelection("", null, "cut"); + }); + } + } + if (e.clipboardData) { + e.clipboardData.clearData(); + var content = lastCopied.text.join("\n"); + // iOS exposes the clipboard API, but seems to discard content inserted into it + e.clipboardData.setData("Text", content); + if (e.clipboardData.getData("Text") == content) { + e.preventDefault(); + return; + } + } + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), + te = kludge.firstChild; + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.text.join("\n"); + var hadFocus = document.activeElement; + selectInput(te); + setTimeout(function () { + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + if (hadFocus == div) { + input.showPrimarySelection(); + } + }, 50); + } + on(div, "copy", onCopyCut); + on(div, "cut", onCopyCut); + }; + ContentEditableInput.prototype.prepareSelection = function () { + var result = prepareSelection(this.cm, false); + result.focus = this.cm.state.focused; + return result; + }; + ContentEditableInput.prototype.showSelection = function (info, takeFocus) { + if (!info || !this.cm.display.view.length) { + return; + } + if (info.focus || takeFocus) { + this.showPrimarySelection(); + } + this.showMultipleSelections(info); + }; + ContentEditableInput.prototype.showPrimarySelection = function () { + var sel = window.getSelection(), + cm = this.cm, + prim = cm.doc.sel.primary(); + var from = prim.from(), + to = prim.to(); + if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { + sel.removeAllRanges(); + return; + } + var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset); + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && cmp(minPos(curAnchor, curFocus), from) == 0 && cmp(maxPos(curAnchor, curFocus), to) == 0) { + return; + } + var view = cm.display.view; + var start = from.line >= cm.display.viewFrom && posToDOM(cm, from) || { + node: view[0].measure.map[2], + offset: 0 + }; + var end = to.line < cm.display.viewTo && posToDOM(cm, to); + if (!end) { + var measure = view[view.length - 1].measure; + var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; + end = { + node: map[map.length - 1], + offset: map[map.length - 2] - map[map.length - 3] + }; + } + if (!start || !end) { + sel.removeAllRanges(); + return; + } + var old = sel.rangeCount && sel.getRangeAt(0), + rng; + try { + rng = range(start.node, start.offset, end.offset, end.node); + } catch (e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + if (!gecko && cm.state.focused) { + sel.collapse(start.node, start.offset); + if (!rng.collapsed) { + sel.removeAllRanges(); + sel.addRange(rng); + } + } else { + sel.removeAllRanges(); + sel.addRange(rng); + } + if (old && sel.anchorNode == null) { + sel.addRange(old); + } else if (gecko) { + this.startGracePeriod(); + } + } + this.rememberSelection(); + }; + ContentEditableInput.prototype.startGracePeriod = function () { + var this$1 = this; + clearTimeout(this.gracePeriod); + this.gracePeriod = setTimeout(function () { + this$1.gracePeriod = false; + if (this$1.selectionChanged()) { + this$1.cm.operation(function () { + return this$1.cm.curOp.selectionChanged = true; + }); + } + }, 20); + }; + ContentEditableInput.prototype.showMultipleSelections = function (info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); + }; + ContentEditableInput.prototype.rememberSelection = function () { + var sel = window.getSelection(); + this.lastAnchorNode = sel.anchorNode; + this.lastAnchorOffset = sel.anchorOffset; + this.lastFocusNode = sel.focusNode; + this.lastFocusOffset = sel.focusOffset; + }; + ContentEditableInput.prototype.selectionInEditor = function () { + var sel = window.getSelection(); + if (!sel.rangeCount) { + return false; + } + var node = sel.getRangeAt(0).commonAncestorContainer; + return contains(this.div, node); + }; + ContentEditableInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor") { + if (!this.selectionInEditor()) { + this.showSelection(this.prepareSelection(), true); + } + this.div.focus(); + } + }; + ContentEditableInput.prototype.blur = function () { + this.div.blur(); + }; + ContentEditableInput.prototype.getField = function () { + return this.div; + }; + ContentEditableInput.prototype.supportsTouch = function () { + return true; + }; + ContentEditableInput.prototype.receivedFocus = function () { + var input = this; + if (this.selectionInEditor()) { + this.pollSelection(); + } else { + runInOp(this.cm, function () { + return input.cm.curOp.selectionChanged = true; + }); + } + function poll() { + if (input.cm.state.focused) { + input.pollSelection(); + input.polling.set(input.cm.options.pollInterval, poll); + } + } + this.polling.set(this.cm.options.pollInterval, poll); + }; + ContentEditableInput.prototype.selectionChanged = function () { + var sel = window.getSelection(); + return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; + }; + ContentEditableInput.prototype.pollSelection = function () { + if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { + return; + } + var sel = window.getSelection(), + cm = this.cm; + // On Android Chrome (version 56, at least), backspacing into an + // uneditable block element will put the cursor in that element, + // and then, because it's not editable, hide the virtual keyboard. + // Because Android doesn't allow us to actually detect backspace + // presses in a sane way, this code checks for when that happens + // and simulates a backspace press in this case. + if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) { + this.cm.triggerOnKeyDown({ + type: "keydown", + keyCode: 8, + preventDefault: Math.abs + }); + this.blur(); + this.focus(); + return; + } + if (this.composing) { + return; + } + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); + if (anchor && head) { + runInOp(cm, function () { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); + if (anchor.bad || head.bad) { + cm.curOp.selectionChanged = true; + } + }); + } + }; + ContentEditableInput.prototype.pollContent = function () { + if (this.readDOMTimeout != null) { + clearTimeout(this.readDOMTimeout); + this.readDOMTimeout = null; + } + var cm = this.cm, + display = cm.display, + sel = cm.doc.sel.primary(); + var from = sel.from(), + to = sel.to(); + if (from.ch == 0 && from.line > cm.firstLine()) { + from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); + } + if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) { + to = Pos(to.line + 1, 0); + } + if (from.line < display.viewFrom || to.line > display.viewTo - 1) { + return false; + } + var fromIndex, fromLine, fromNode; + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + fromLine = lineNo(display.view[0].line); + fromNode = display.view[0].node; + } else { + fromLine = lineNo(display.view[fromIndex].line); + fromNode = display.view[fromIndex - 1].node.nextSibling; + } + var toIndex = findViewIndex(cm, to.line); + var toLine, toNode; + if (toIndex == display.view.length - 1) { + toLine = display.viewTo - 1; + toNode = display.lineDiv.lastChild; + } else { + toLine = lineNo(display.view[toIndex + 1].line) - 1; + toNode = display.view[toIndex + 1].node.previousSibling; + } + if (!fromNode) { + return false; + } + var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { + newText.pop(); + oldText.pop(); + toLine--; + } else if (newText[0] == oldText[0]) { + newText.shift(); + oldText.shift(); + fromLine++; + } else { + break; + } + } + var cutFront = 0, + cutEnd = 0; + var newTop = newText[0], + oldTop = oldText[0], + maxCutFront = Math.min(newTop.length, oldTop.length); + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) { + ++cutFront; + } + var newBot = lst(newText), + oldBot = lst(oldText); + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), oldBot.length - (oldText.length == 1 ? cutFront : 0)); + while (cutEnd < maxCutEnd && newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { + ++cutEnd; + } + // Try to move start of change to start of selection if ambiguous + if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { + while (cutFront && cutFront > from.ch && newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { + cutFront--; + cutEnd++; + } + } + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, ""); + newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, ""); + var chFrom = Pos(fromLine, cutFront); + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input"); + return true; + } + }; + ContentEditableInput.prototype.ensurePolled = function () { + this.forceCompositionEnd(); + }; + ContentEditableInput.prototype.reset = function () { + this.forceCompositionEnd(); + }; + ContentEditableInput.prototype.forceCompositionEnd = function () { + if (!this.composing) { + return; + } + clearTimeout(this.readDOMTimeout); + this.composing = null; + this.updateFromDOM(); + this.div.blur(); + this.div.focus(); + }; + ContentEditableInput.prototype.readFromDOMSoon = function () { + var this$1 = this; + if (this.readDOMTimeout != null) { + return; + } + this.readDOMTimeout = setTimeout(function () { + this$1.readDOMTimeout = null; + if (this$1.composing) { + if (this$1.composing.done) { + this$1.composing = null; + } else { + return; + } + } + this$1.updateFromDOM(); + }, 80); + }; + ContentEditableInput.prototype.updateFromDOM = function () { + var this$1 = this; + if (this.cm.isReadOnly() || !this.pollContent()) { + runInOp(this.cm, function () { + return regChange(this$1.cm); + }); + } + }; + ContentEditableInput.prototype.setUneditable = function (node) { + node.contentEditable = "false"; + }; + ContentEditableInput.prototype.onKeyPress = function (e) { + if (e.charCode == 0) { + return; + } + e.preventDefault(); + if (!this.cm.isReadOnly()) { + operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); + } + }; + ContentEditableInput.prototype.readOnlyChanged = function (val) { + this.div.contentEditable = String(val != "nocursor"); + }; + ContentEditableInput.prototype.onContextMenu = function () {}; + ContentEditableInput.prototype.resetPosition = function () {}; + ContentEditableInput.prototype.needsContentAttribute = true; + function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line); + if (!view || view.hidden) { + return null; + } + var line = getLine(cm.doc, pos.line); + var info = mapFromLineView(view, line, pos.line); + var order = getOrder(line, cm.doc.direction), + side = "left"; + if (order) { + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); + result.offset = result.collapse == "right" ? result.end : result.start; + return result; + } + function isInGutter(node) { + for (var scan = node; scan; scan = scan.parentNode) { + if (/CodeMirror-gutter-wrapper/.test(scan.className)) { + return true; + } + } + return false; + } + function badPos(pos, bad) { + if (bad) { + pos.bad = true; + } + return pos; + } + function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", + closing = false, + lineSep = cm.doc.lineSeparator(); + function recognizeMarker(id) { + return function (marker) { + return marker.id == id; + }; + } + function close() { + if (closing) { + text += lineSep; + closing = false; + } + } + function addText(str) { + if (str) { + close(); + text += str; + } + } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text"); + if (cmText != null) { + addText(cmText || node.textContent.replace(/\u200b/g, "")); + return; + } + var markerID = node.getAttribute("cm-marker"), + range; + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); + if (found.length && (range = found[0].find())) { + addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); + } + return; + } + if (node.getAttribute("contenteditable") == "false") { + return; + } + var isBlock = /^(pre|div|p)$/i.test(node.nodeName); + if (isBlock) { + close(); + } + for (var i = 0; i < node.childNodes.length; i++) { + walk(node.childNodes[i]); + } + if (isBlock) { + closing = true; + } + } else if (node.nodeType == 3) { + addText(node.nodeValue); + } + } + for (;;) { + walk(from); + if (from == to) { + break; + } + from = from.nextSibling; + } + return text; + } + function domToPos(cm, node, offset) { + var lineNode; + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset]; + if (!lineNode) { + return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true); + } + node = null; + offset = 0; + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) { + return null; + } + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { + break; + } + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i]; + if (lineView.node == lineNode) { + return locateNodeInLineView(lineView, node, offset); + } + } + } + function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, + bad = false; + if (!node || !contains(wrapper, node)) { + return badPos(Pos(lineNo(lineView.line), 0), true); + } + if (node == wrapper) { + bad = true; + node = wrapper.childNodes[offset]; + offset = 0; + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line; + return badPos(Pos(lineNo(line), line.text.length), bad); + } + } + var textNode = node.nodeType == 3 ? node : null, + topNode = node; + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild; + if (offset) { + offset = textNode.nodeValue.length; + } + } + while (topNode.parentNode != wrapper) { + topNode = topNode.parentNode; + } + var measure = lineView.measure, + maps = measure.maps; + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map = i < 0 ? measure.map : maps[i]; + for (var j = 0; j < map.length; j += 3) { + var curNode = map[j + 2]; + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); + var ch = map[j] + offset; + if (offset < 0 || curNode != textNode) { + ch = map[j + (offset ? 1 : 0)]; + } + return Pos(line, ch); + } + } + } + } + var found = find(textNode, topNode, offset); + if (found) { + return badPos(found, bad); + } + + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0); + if (found) { + return badPos(Pos(found.line, found.ch - dist), bad); + } else { + dist += after.textContent.length; + } + } + for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1); + if (found) { + return badPos(Pos(found.line, found.ch + dist$1), bad); + } else { + dist$1 += before.textContent.length; + } + } + } + + // TEXTAREA INPUT STYLE + + var TextareaInput = function (cm) { + this.cm = cm; + // See input.poll and input.reset + this.prevInput = ""; + + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false; + // Self-resetting timeout for the poller + this.polling = new Delayed(); + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false; + this.composing = null; + }; + TextareaInput.prototype.init = function (display) { + var this$1 = this; + var input = this, + cm = this.cm; + + // Wraps and hides input textarea + var div = this.wrapper = hiddenTextarea(); + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + var te = this.textarea = div.firstChild; + display.wrapper.insertBefore(div, display.wrapper.firstChild); + + // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) + if (ios) { + te.style.width = "0px"; + } + on(te, "input", function () { + if (ie && ie_version >= 9 && this$1.hasSelection) { + this$1.hasSelection = null; + } + input.poll(); + }); + on(te, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { + return; + } + cm.state.pasteIncoming = true; + input.fastPoll(); + }); + function prepareCopyCut(e) { + if (signalDOMEvent(cm, e)) { + return; + } + if (cm.somethingSelected()) { + setLastCopied({ + lineWise: false, + text: cm.getSelections() + }); + } else if (!cm.options.lineWiseCopyCut) { + return; + } else { + var ranges = copyableRanges(cm); + setLastCopied({ + lineWise: true, + text: ranges.text + }); + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll); + } else { + input.prevInput = ""; + te.value = ranges.text.join("\n"); + selectInput(te); + } + } + if (e.type == "cut") { + cm.state.cutIncoming = true; + } + } + on(te, "cut", prepareCopyCut); + on(te, "copy", prepareCopyCut); + on(display.scroller, "paste", function (e) { + if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { + return; + } + cm.state.pasteIncoming = true; + input.focus(); + }); + + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function (e) { + if (!eventInWidget(display, e)) { + e_preventDefault(e); + } + }); + on(te, "compositionstart", function () { + var start = cm.getCursor("from"); + if (input.composing) { + input.composing.range.clear(); + } + input.composing = { + start: start, + range: cm.markText(start, cm.getCursor("to"), { + className: "CodeMirror-composing" + }) + }; + }); + on(te, "compositionend", function () { + if (input.composing) { + input.poll(); + input.composing.range.clear(); + input.composing = null; + } + }); + }; + TextareaInput.prototype.prepareSelection = function () { + // Redraw the selection and/or cursor + var cm = this.cm, + display = cm.display, + doc = cm.doc; + var result = prepareSelection(cm); + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), + lineOff = display.lineDiv.getBoundingClientRect(); + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, headPos.top + lineOff.top - wrapOff.top)); + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, headPos.left + lineOff.left - wrapOff.left)); + } + return result; + }; + TextareaInput.prototype.showSelection = function (drawn) { + var cm = this.cm, + display = cm.display; + removeChildrenAndAdd(display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(display.selectionDiv, drawn.selection); + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px"; + this.wrapper.style.left = drawn.teLeft + "px"; + } + }; + + // Reset the input to correspond to the selection (or to be empty, + // when not typing and nothing is selected) + TextareaInput.prototype.reset = function (typing) { + if (this.contextMenuPending || this.composing) { + return; + } + var cm = this.cm; + if (cm.somethingSelected()) { + this.prevInput = ""; + var content = cm.getSelection(); + this.textarea.value = content; + if (cm.state.focused) { + selectInput(this.textarea); + } + if (ie && ie_version >= 9) { + this.hasSelection = content; + } + } else if (!typing) { + this.prevInput = this.textarea.value = ""; + if (ie && ie_version >= 9) { + this.hasSelection = null; + } + } + }; + TextareaInput.prototype.getField = function () { + return this.textarea; + }; + TextareaInput.prototype.supportsTouch = function () { + return false; + }; + TextareaInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { + try { + this.textarea.focus(); + } catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } + }; + TextareaInput.prototype.blur = function () { + this.textarea.blur(); + }; + TextareaInput.prototype.resetPosition = function () { + this.wrapper.style.top = this.wrapper.style.left = 0; + }; + TextareaInput.prototype.receivedFocus = function () { + this.slowPoll(); + }; + + // Poll for input changes, using the normal rate of polling. This + // runs as long as the editor is focused. + TextareaInput.prototype.slowPoll = function () { + var this$1 = this; + if (this.pollingFast) { + return; + } + this.polling.set(this.cm.options.pollInterval, function () { + this$1.poll(); + if (this$1.cm.state.focused) { + this$1.slowPoll(); + } + }); + }; + + // When an event has just come in that is likely to add or change + // something in the input textarea, we poll faster, to ensure that + // the change appears on the screen quickly. + TextareaInput.prototype.fastPoll = function () { + var missed = false, + input = this; + input.pollingFast = true; + function p() { + var changed = input.poll(); + if (!changed && !missed) { + missed = true; + input.polling.set(60, p); + } else { + input.pollingFast = false; + input.slowPoll(); + } + } + input.polling.set(20, p); + }; + + // Read input from the textarea, and update the document to match. + // When something is selected, it is present in the textarea, and + // selected (unless it is huge, in which case a placeholder is + // used). When nothing is selected, the cursor sits after previously + // seen text (can be empty), which is stored in prevInput (we must + // not reset the textarea when typing, because that breaks IME). + TextareaInput.prototype.poll = function () { + var this$1 = this; + var cm = this.cm, + input = this.textarea, + prevInput = this.prevInput; + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (this.contextMenuPending || !cm.state.focused || hasSelection(input) && !prevInput && !this.composing || cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) { + return false; + } + var text = input.value; + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) { + return false; + } + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset(); + return false; + } + if (cm.doc.sel == cm.display.selForContextMenu) { + var first = text.charCodeAt(0); + if (first == 0x200b && !prevInput) { + prevInput = "\u200b"; + } + if (first == 0x21da) { + this.reset(); + return this.cm.execCommand("undo"); + } + } + // Find the part of the input that is actually new + var same = 0, + l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { + ++same; + } + runInOp(cm, function () { + applyTextInput(cm, text.slice(same), prevInput.length - same, null, this$1.composing ? "*compose" : null); + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) { + input.value = this$1.prevInput = ""; + } else { + this$1.prevInput = text; + } + if (this$1.composing) { + this$1.composing.range.clear(); + this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), { + className: "CodeMirror-composing" + }); + } + }); + return true; + }; + TextareaInput.prototype.ensurePolled = function () { + if (this.pollingFast && this.poll()) { + this.pollingFast = false; + } + }; + TextareaInput.prototype.onKeyPress = function () { + if (ie && ie_version >= 9) { + this.hasSelection = null; + } + this.fastPoll(); + }; + TextareaInput.prototype.onContextMenu = function (e) { + var input = this, + cm = input.cm, + display = cm.display, + te = input.textarea; + var pos = posFromMouse(cm, e), + scrollPos = display.scroller.scrollTop; + if (!pos || presto) { + return; + } // Opera is difficult. + + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu; + if (reset && cm.doc.sel.contains(pos) == -1) { + operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); + } + var oldCSS = te.style.cssText, + oldWrapperCSS = input.wrapper.style.cssText; + input.wrapper.style.cssText = "position: absolute"; + var wrapperBox = input.wrapper.getBoundingClientRect(); + te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + var oldScrollY; + if (webkit) { + oldScrollY = window.scrollY; + } // Work around Chrome issue (#2712) + display.input.focus(); + if (webkit) { + window.scrollTo(null, oldScrollY); + } + display.input.reset(); + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) { + te.value = input.prevInput = " "; + } + input.contextMenuPending = true; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected(); + var extval = "\u200b" + (selected ? te.value : ""); + te.value = "\u21da"; // Used to catch context-menu undo + te.value = extval; + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; + te.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel; + } + } + function rehide() { + input.contextMenuPending = false; + input.wrapper.style.cssText = oldWrapperCSS; + te.style.cssText = oldCSS; + if (ie && ie_version < 9) { + display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); + } + + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || ie && ie_version < 9) { + prepareSelectAllHack(); + } + var i = 0, + poll = function () { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && te.selectionEnd > 0 && input.prevInput == "\u200b") { + operation(cm, selectAll)(cm); + } else if (i++ < 10) { + display.detectingSelectAll = setTimeout(poll, 500); + } else { + display.selForContextMenu = null; + display.input.reset(); + } + }; + display.detectingSelectAll = setTimeout(poll, 200); + } + } + if (ie && ie_version >= 9) { + prepareSelectAllHack(); + } + if (captureRightClick) { + e_stop(e); + var mouseup = function () { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); + } else { + setTimeout(rehide, 50); + } + }; + TextareaInput.prototype.readOnlyChanged = function (val) { + if (!val) { + this.reset(); + } + this.textarea.disabled = val == "nocursor"; + }; + TextareaInput.prototype.setUneditable = function () {}; + TextareaInput.prototype.needsContentAttribute = false; + function fromTextArea(textarea, options) { + options = options ? copyObj(options) : {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabIndex) { + options.tabindex = textarea.tabIndex; + } + if (!options.placeholder && textarea.placeholder) { + options.placeholder = textarea.placeholder; + } + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt(); + options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + function save() { + textarea.value = cm.getValue(); + } + var realSubmit; + if (textarea.form) { + on(textarea.form, "submit", save); + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form; + realSubmit = form.submit; + try { + var wrappedSubmit = form.submit = function () { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch (e) {} + } + } + options.finishInit = function (cm) { + cm.save = save; + cm.getTextArea = function () { + return textarea; + }; + cm.toTextArea = function () { + cm.toTextArea = isNaN; // Prevent this from being ran twice + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (typeof textarea.form.submit == "function") { + textarea.form.submit = realSubmit; + } + } + }; + }; + textarea.style.display = "none"; + var cm = CodeMirror(function (node) { + return textarea.parentNode.insertBefore(node, textarea.nextSibling); + }, options); + return cm; + } + function addLegacyProps(CodeMirror) { + CodeMirror.off = off; + CodeMirror.on = on; + CodeMirror.wheelEventPixels = wheelEventPixels; + CodeMirror.Doc = Doc; + CodeMirror.splitLines = splitLinesAuto; + CodeMirror.countColumn = countColumn; + CodeMirror.findColumn = findColumn; + CodeMirror.isWordChar = isWordCharBasic; + CodeMirror.Pass = Pass; + CodeMirror.signal = signal; + CodeMirror.Line = Line; + CodeMirror.changeEnd = changeEnd; + CodeMirror.scrollbarModel = scrollbarModel; + CodeMirror.Pos = Pos; + CodeMirror.cmpPos = cmp; + CodeMirror.modes = modes; + CodeMirror.mimeModes = mimeModes; + CodeMirror.resolveMode = resolveMode; + CodeMirror.getMode = getMode; + CodeMirror.modeExtensions = modeExtensions; + CodeMirror.extendMode = extendMode; + CodeMirror.copyState = copyState; + CodeMirror.startState = startState; + CodeMirror.innerMode = innerMode; + CodeMirror.commands = commands; + CodeMirror.keyMap = keyMap; + CodeMirror.keyName = keyName; + CodeMirror.isModifierKey = isModifierKey; + CodeMirror.lookupKey = lookupKey; + CodeMirror.normalizeKeyMap = normalizeKeyMap; + CodeMirror.StringStream = StringStream; + CodeMirror.SharedTextMarker = SharedTextMarker; + CodeMirror.TextMarker = TextMarker; + CodeMirror.LineWidget = LineWidget; + CodeMirror.e_preventDefault = e_preventDefault; + CodeMirror.e_stopPropagation = e_stopPropagation; + CodeMirror.e_stop = e_stop; + CodeMirror.addClass = addClass; + CodeMirror.contains = contains; + CodeMirror.rmClass = rmClass; + CodeMirror.keyNames = keyNames; + } + + // EDITOR CONSTRUCTOR + + defineOptions(CodeMirror); + addEditorMethods(CodeMirror); + + // Set up methods on CodeMirror's prototype to redirect to the editor's document. + var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); + for (var prop in Doc.prototype) { + if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) { + CodeMirror.prototype[prop] = function (method) { + return function () { + return method.apply(this.doc, arguments); + }; + }(Doc.prototype[prop]); + } + } + eventMixin(Doc); + + // INPUT HANDLING + + CodeMirror.inputStyles = { + "textarea": TextareaInput, + "contenteditable": ContentEditableInput + }; + + // MODE DEFINITION AND QUERYING + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + CodeMirror.defineMode = function (name /*, mode, …*/) { + if (!CodeMirror.defaults.mode && name != "null") { + CodeMirror.defaults.mode = name; + } + defineMode.apply(this, arguments); + }; + CodeMirror.defineMIME = defineMIME; + + // Minimal default mode. + CodeMirror.defineMode("null", function () { + return { + token: function (stream) { + return stream.skipToEnd(); + } + }; + }); + CodeMirror.defineMIME("text/plain", "null"); + + // EXTENSIONS + + CodeMirror.defineExtension = function (name, func) { + CodeMirror.prototype[name] = func; + }; + CodeMirror.defineDocExtension = function (name, func) { + Doc.prototype[name] = func; + }; + CodeMirror.fromTextArea = fromTextArea; + addLegacyProps(CodeMirror); + CodeMirror.version = "5.28.0"; + return CodeMirror; + }); + + /*! + * clipboard.js v1.7.1 + * https://zenorocha.github.io/clipboard.js + * + * Licensed MIT © Zeno Rocha + */ + (function (f) { + if (typeof exports === "object" && typeof module !== "undefined") { + module.exports = f(); + } else if (typeof define === "function" && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== "undefined") { + g = window; + } else if (typeof global !== "undefined") { + g = global; + } else if (typeof self !== "undefined") { + g = self; + } else { + g = this; + } + g.Clipboard = f(); + } + })(function () { + return function e(t, n, r) { + function s(o, u) { + if (!n[o]) { + if (!t[o]) { + var a = typeof require == "function" && require; + if (!u && a) return a(o, !0); + if (i) return i(o, !0); + var f = new Error("Cannot find module '" + o + "'"); + throw f.code = "MODULE_NOT_FOUND", f; + } + var l = n[o] = { + exports: {} + }; + t[o][0].call(l.exports, function (e) { + var n = t[o][1][e]; + return s(n ? n : e); + }, l, l.exports, e, t, n, r); + } + return n[o].exports; + } + var i = typeof require == "function" && require; + for (var o = 0; o < r.length; o++) s(r[o]); + return s; + }({ + 1: [function (require, module, exports) { + var DOCUMENT_NODE_TYPE = 9; + + /** + * A polyfill for Element.matches() + */ + if (typeof Element !== 'undefined' && !Element.prototype.matches) { + var proto = Element.prototype; + proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector; + } + + /** + * Finds the closest parent that matches a selector. + * + * @param {Element} element + * @param {String} selector + * @return {Function} + */ + function closest(element, selector) { + while (element && element.nodeType !== DOCUMENT_NODE_TYPE) { + if (typeof element.matches === 'function' && element.matches(selector)) { + return element; + } + element = element.parentNode; + } + } + module.exports = closest; + }, {}], + 2: [function (require, module, exports) { + var closest = require('./closest'); + + /** + * Delegates event to a selector. + * + * @param {Element} element + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @param {Boolean} useCapture + * @return {Object} + */ + function delegate(element, selector, type, callback, useCapture) { + var listenerFn = listener.apply(this, arguments); + element.addEventListener(type, listenerFn, useCapture); + return { + destroy: function () { + element.removeEventListener(type, listenerFn, useCapture); + } + }; + } + + /** + * Finds closest match and invokes callback. + * + * @param {Element} element + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @return {Function} + */ + function listener(element, selector, type, callback) { + return function (e) { + e.delegateTarget = closest(e.target, selector); + if (e.delegateTarget) { + callback.call(element, e); + } + }; + } + module.exports = delegate; + }, { + "./closest": 1 + }], + 3: [function (require, module, exports) { + /** + * Check if argument is a HTML element. + * + * @param {Object} value + * @return {Boolean} + */ + exports.node = function (value) { + return value !== undefined && (value instanceof HTMLElement || value instanceof SVGElement) && value.nodeType === 1; + }; + + /** + * Check if argument is a list of HTML elements. + * + * @param {Object} value + * @return {Boolean} + */ + exports.nodeList = function (value) { + var type = Object.prototype.toString.call(value); + return value !== undefined && (type === '[object NodeList]' || type === '[object HTMLCollection]') && 'length' in value && (value.length === 0 || exports.node(value[0])); + }; + + /** + * Check if argument is a string. + * + * @param {Object} value + * @return {Boolean} + */ + exports.string = function (value) { + return typeof value === 'string' || value instanceof String; + }; + + /** + * Check if argument is a function. + * + * @param {Object} value + * @return {Boolean} + */ + exports.fn = function (value) { + var type = Object.prototype.toString.call(value); + return type === '[object Function]'; + }; + }, {}], + 4: [function (require, module, exports) { + var is = require('./is'); + var delegate = require('delegate'); + + /** + * Validates all params and calls the right + * listener function based on its target type. + * + * @param {String|HTMLElement|HTMLCollection|NodeList} target + * @param {String} type + * @param {Function} callback + * @return {Object} + */ + function listen(target, type, callback) { + if (!target && !type && !callback) { + throw new Error('Missing required arguments'); + } + if (!is.string(type)) { + throw new TypeError('Second argument must be a String'); + } + if (!is.fn(callback)) { + throw new TypeError('Third argument must be a Function'); + } + if (is.node(target)) { + return listenNode(target, type, callback); + } else if (is.nodeList(target)) { + return listenNodeList(target, type, callback); + } else if (is.string(target)) { + return listenSelector(target, type, callback); + } else { + throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList'); + } + } + + /** + * Adds an event listener to a HTML element + * and returns a remove listener function. + * + * @param {HTMLElement} node + * @param {String} type + * @param {Function} callback + * @return {Object} + */ + function listenNode(node, type, callback) { + node.addEventListener(type, callback); + return { + destroy: function () { + node.removeEventListener(type, callback); + } + }; + } + + /** + * Add an event listener to a list of HTML elements + * and returns a remove listener function. + * + * @param {NodeList|HTMLCollection} nodeList + * @param {String} type + * @param {Function} callback + * @return {Object} + */ + function listenNodeList(nodeList, type, callback) { + Array.prototype.forEach.call(nodeList, function (node) { + node.addEventListener(type, callback); + }); + return { + destroy: function () { + Array.prototype.forEach.call(nodeList, function (node) { + node.removeEventListener(type, callback); + }); + } + }; + } + + /** + * Add an event listener to a selector + * and returns a remove listener function. + * + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @return {Object} + */ + function listenSelector(selector, type, callback) { + return delegate(document.body, selector, type, callback); + } + module.exports = listen; + }, { + "./is": 3, + "delegate": 2 + }], + 5: [function (require, module, exports) { + function select(element) { + var selectedText; + if (element.nodeName === 'SELECT') { + element.focus(); + selectedText = element.value; + } else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') { + var isReadOnly = element.hasAttribute('readonly'); + if (!isReadOnly) { + element.setAttribute('readonly', ''); + } + element.select(); + element.setSelectionRange(0, element.value.length); + if (!isReadOnly) { + element.removeAttribute('readonly'); + } + selectedText = element.value; + } else { + if (element.hasAttribute('contenteditable')) { + element.focus(); + } + var selection = window.getSelection(); + var range = document.createRange(); + range.selectNodeContents(element); + selection.removeAllRanges(); + selection.addRange(range); + selectedText = selection.toString(); + } + return selectedText; + } + module.exports = select; + }, {}], + 6: [function (require, module, exports) { + function E() { + // Keep this empty so it's easier to inherit from + // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3) + } + E.prototype = { + on: function (name, callback, ctx) { + var e = this.e || (this.e = {}); + (e[name] || (e[name] = [])).push({ + fn: callback, + ctx: ctx + }); + return this; + }, + once: function (name, callback, ctx) { + var self = this; + function listener() { + self.off(name, listener); + callback.apply(ctx, arguments); + } + listener._ = callback; + return this.on(name, listener, ctx); + }, + emit: function (name) { + var data = [].slice.call(arguments, 1); + var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); + var i = 0; + var len = evtArr.length; + for (i; i < len; i++) { + evtArr[i].fn.apply(evtArr[i].ctx, data); + } + return this; + }, + off: function (name, callback) { + var e = this.e || (this.e = {}); + var evts = e[name]; + var liveEvents = []; + if (evts && callback) { + for (var i = 0, len = evts.length; i < len; i++) { + if (evts[i].fn !== callback && evts[i].fn._ !== callback) liveEvents.push(evts[i]); + } + } + + // Remove event from queue to prevent memory leak + // Suggested by https://github.com/lazd + // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910 + + liveEvents.length ? e[name] = liveEvents : delete e[name]; + return this; + } + }; + module.exports = E; + }, {}], + 7: [function (require, module, exports) { + (function (global, factory) { + if (typeof exports !== "undefined") { + factory(module, require('select')); + } else { + var mod = { + exports: {} + }; + factory(mod, global.select); + global.clipboardAction = mod.exports; + } + })(this, function (module, _select) { + + var _select2 = _interopRequireDefault(_select); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + var ClipboardAction = function () { + /** + * @param {Object} options + */ + function ClipboardAction(options) { + _classCallCheck(this, ClipboardAction); + this.resolveOptions(options); + this.initSelection(); + } + + /** + * Defines base properties passed from constructor. + * @param {Object} options + */ + + _createClass(ClipboardAction, [{ + key: 'resolveOptions', + value: function resolveOptions() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + this.action = options.action; + this.container = options.container; + this.emitter = options.emitter; + this.target = options.target; + this.text = options.text; + this.trigger = options.trigger; + this.selectedText = ''; + } + }, { + key: 'initSelection', + value: function initSelection() { + if (this.text) { + this.selectFake(); + } else if (this.target) { + this.selectTarget(); + } + } + }, { + key: 'selectFake', + value: function selectFake() { + var _this = this; + var isRTL = document.documentElement.getAttribute('dir') == 'rtl'; + this.removeFake(); + this.fakeHandlerCallback = function () { + return _this.removeFake(); + }; + this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true; + this.fakeElem = document.createElement('textarea'); + // Prevent zooming on iOS + this.fakeElem.style.fontSize = '12pt'; + // Reset box model + this.fakeElem.style.border = '0'; + this.fakeElem.style.padding = '0'; + this.fakeElem.style.margin = '0'; + // Move element out of screen horizontally + this.fakeElem.style.position = 'absolute'; + this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px'; + // Move element to the same position vertically + var yPosition = window.pageYOffset || document.documentElement.scrollTop; + this.fakeElem.style.top = yPosition + 'px'; + this.fakeElem.setAttribute('readonly', ''); + this.fakeElem.value = this.text; + this.container.appendChild(this.fakeElem); + this.selectedText = (0, _select2.default)(this.fakeElem); + this.copyText(); + } + }, { + key: 'removeFake', + value: function removeFake() { + if (this.fakeHandler) { + this.container.removeEventListener('click', this.fakeHandlerCallback); + this.fakeHandler = null; + this.fakeHandlerCallback = null; + } + if (this.fakeElem) { + this.container.removeChild(this.fakeElem); + this.fakeElem = null; + } + } + }, { + key: 'selectTarget', + value: function selectTarget() { + this.selectedText = (0, _select2.default)(this.target); + this.copyText(); + } + }, { + key: 'copyText', + value: function copyText() { + var succeeded = void 0; + try { + succeeded = document.execCommand(this.action); + } catch (err) { + succeeded = false; + } + this.handleResult(succeeded); + } + }, { + key: 'handleResult', + value: function handleResult(succeeded) { + this.emitter.emit(succeeded ? 'success' : 'error', { + action: this.action, + text: this.selectedText, + trigger: this.trigger, + clearSelection: this.clearSelection.bind(this) + }); + } + }, { + key: 'clearSelection', + value: function clearSelection() { + if (this.trigger) { + this.trigger.focus(); + } + window.getSelection().removeAllRanges(); + } + }, { + key: 'destroy', + value: function destroy() { + this.removeFake(); + } + }, { + key: 'action', + set: function set() { + var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy'; + this._action = action; + if (this._action !== 'copy' && this._action !== 'cut') { + throw new Error('Invalid "action" value, use either "copy" or "cut"'); + } + }, + get: function get() { + return this._action; + } + }, { + key: 'target', + set: function set(target) { + if (target !== undefined) { + if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) { + if (this.action === 'copy' && target.hasAttribute('disabled')) { + throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); + } + if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { + throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); + } + this._target = target; + } else { + throw new Error('Invalid "target" value, use a valid Element'); + } + } + }, + get: function get() { + return this._target; + } + }]); + return ClipboardAction; + }(); + module.exports = ClipboardAction; + }); + }, { + "select": 5 + }], + 8: [function (require, module, exports) { + (function (global, factory) { + if (typeof exports !== "undefined") { + factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener')); + } else { + var mod = { + exports: {} + }; + factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener); + global.clipboard = mod.exports; + } + })(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) { + + var _clipboardAction2 = _interopRequireDefault(_clipboardAction); + var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter); + var _goodListener2 = _interopRequireDefault(_goodListener); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var Clipboard = function (_Emitter) { + _inherits(Clipboard, _Emitter); + + /** + * @param {String|HTMLElement|HTMLCollection|NodeList} trigger + * @param {Object} options + */ + function Clipboard(trigger, options) { + _classCallCheck(this, Clipboard); + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this)); + _this.resolveOptions(options); + _this.listenClick(trigger); + return _this; + } + + /** + * Defines if attributes would be resolved using internal setter functions + * or custom functions that were passed in the constructor. + * @param {Object} options + */ + + _createClass(Clipboard, [{ + key: 'resolveOptions', + value: function resolveOptions() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + this.action = typeof options.action === 'function' ? options.action : this.defaultAction; + this.target = typeof options.target === 'function' ? options.target : this.defaultTarget; + this.text = typeof options.text === 'function' ? options.text : this.defaultText; + this.container = _typeof(options.container) === 'object' ? options.container : document.body; + } + }, { + key: 'listenClick', + value: function listenClick(trigger) { + var _this2 = this; + this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) { + return _this2.onClick(e); + }); + } + }, { + key: 'onClick', + value: function onClick(e) { + var trigger = e.delegateTarget || e.currentTarget; + if (this.clipboardAction) { + this.clipboardAction = null; + } + this.clipboardAction = new _clipboardAction2.default({ + action: this.action(trigger), + target: this.target(trigger), + text: this.text(trigger), + container: this.container, + trigger: trigger, + emitter: this + }); + } + }, { + key: 'defaultAction', + value: function defaultAction(trigger) { + return getAttributeValue('action', trigger); + } + }, { + key: 'defaultTarget', + value: function defaultTarget(trigger) { + var selector = getAttributeValue('target', trigger); + if (selector) { + return document.querySelector(selector); + } + } + }, { + key: 'defaultText', + value: function defaultText(trigger) { + return getAttributeValue('text', trigger); + } + }, { + key: 'destroy', + value: function destroy() { + this.listener.destroy(); + if (this.clipboardAction) { + this.clipboardAction.destroy(); + this.clipboardAction = null; + } + } + }], [{ + key: 'isSupported', + value: function isSupported() { + var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; + var actions = typeof action === 'string' ? [action] : action; + var support = !!document.queryCommandSupported; + actions.forEach(function (action) { + support = support && !!document.queryCommandSupported(action); + }); + return support; + } + }]); + return Clipboard; + }(_tinyEmitter2.default); + + /** + * Helper function to retrieve attribute value. + * @param {String} suffix + * @param {Element} element + */ + function getAttributeValue(suffix, element) { + var attribute = 'data-clipboard-' + suffix; + if (!element.hasAttribute(attribute)) { + return; + } + return element.getAttribute(attribute); + } + module.exports = Clipboard; + }); + }, { + "./clipboard-action": 7, + "good-listener": 4, + "tiny-emitter": 6 + }] + }, {}, [8])(8); + }); + + window._native = function () { + var _options = {}; + var _construct = function _construct(e) { + var defaultOptions = { + carbonZoneKey: '', + fallback: '', + ignore: 'false', + placement: '', + prefix: 'native', + targetClass: 'native-ad' + }; + if (typeof e === 'undefined') return defaultOptions; + Object.keys(defaultOptions).forEach(function (key, index) { + if (typeof e[key] === 'undefined') { + e[key] = defaultOptions[key]; + } + }); + return e; + }; + var init = function init(zone, options) { + _options = _construct(options); + var jsonUrl = 'https://srv.buysellads.com/ads/' + zone + '.json?callback=_native_go'; + if (_options['placement'] !== '') { + jsonUrl += '&segment=placement:' + _options['placement']; + } + if (_options['ignore'] === 'true') { + jsonUrl += '&ignore=yes'; + } + var srv = document.createElement('script'); + srv.src = jsonUrl; + document.getElementsByTagName('head')[0].appendChild(srv); + }; + var carbon = function carbon(e) { + var srv = document.createElement('script'); + srv.src = '//cdn.carbonads.com/carbon.js?serve=' + e['carbonZoneKey'] + '&placement=' + e['placement']; + srv.id = '_carbonads_js'; + return srv; + }; + var sanitize = function sanitize(ads) { + return ads.filter(function (ad) { + return Object.keys(ad).length > 0; + }).filter(function (ad) { + return ad.hasOwnProperty('statlink'); + }); + }; + var pixel = function pixel(p, timestamp) { + var c = ''; + if (p) { + p.split('||').forEach(function (pixel, index) { + c += ''; + }); + } + return c; + }; + var options = function options() { + return _options; + }; + return { + carbon: carbon, + init: init, + options: options, + pixel: pixel, + sanitize: sanitize + }; + }(); + window._native_go = function (json) { + var options = _native.options(); + var ads = _native.sanitize(json['ads']); + var selectedClass = document.querySelectorAll('.' + options['targetClass']); + if (ads.length < 1) { + selectedClass.forEach(function (className, index) { + var selectedTarget = document.getElementsByClassName(options['targetClass'])[index]; + if (options['fallback'] !== '' || options['carbonZoneKey'] !== '') selectedTarget.setAttribute('data-state', 'visible'); + selectedTarget.innerHTML = options['fallback']; + if (options['carbonZoneKey'] !== '') selectedTarget.appendChild(_native.carbon(options)); + }); + + // End at this line if no ads are found, avoiding unnecessary steps + return; + } + selectedClass.forEach(function (className, index) { + var selectedTarget = document.getElementsByClassName(options['targetClass'])[index]; + var adElement = selectedTarget.innerHTML || ""; + var prefix = options['prefix']; + var ad = ads[index]; + if (ad && className) { + var adInnerHtml = adElement.replace(new RegExp('#' + prefix + '_bg_color#', 'g'), ad['backgroundColor']).replace(new RegExp('#' + prefix + '_bg_color_hover#', 'g'), ad['backgroundHoverColor']).replace(new RegExp('#' + prefix + '_company#', 'g'), ad['company']).replace(new RegExp('#' + prefix + '_cta#', 'g'), ad['callToAction']).replace(new RegExp('#' + prefix + '_cta_bg_color#', 'g'), ad['ctaBackgroundColor']).replace(new RegExp('#' + prefix + '_cta_bg_color_hover#', 'g'), ad['ctaBackgroundHoverColor']).replace(new RegExp('#' + prefix + '_cta_color#', 'g'), ad['ctaTextColor']).replace(new RegExp('#' + prefix + '_cta_color_hover#', 'g'), ad['ctaTextColorHover']).replace(new RegExp('#' + prefix + '_desc#', 'g'), ad['description']).replace(new RegExp('#' + prefix + '_index#', 'g'), prefix + '-' + ad['i']).replace(new RegExp('#' + prefix + '_img#', 'g'), ad['image']).replace(new RegExp('#' + prefix + '_small_img#', 'g'), ad['smallImage']).replace(new RegExp('#' + prefix + '_link#', 'g'), ad['statlink']).replace(new RegExp('#' + prefix + '_logo#', 'g'), ad['logo']).replace(new RegExp('#' + prefix + '_color#', 'g'), ad['textColor']).replace(new RegExp('#' + prefix + '_color_hover#', 'g'), ad['textColorHover']).replace(new RegExp('#' + prefix + '_title#', 'g'), ad['title']); + selectedTarget.innerHTML = adInnerHtml + _native.pixel(ad['pixel'], ad['timestamp']); + selectedTarget.setAttribute('data-state', 'visible'); + } else { + selectedTarget.innerHTML = ""; + } + }); + }; + + /* + * Event + * Visit http://createjs.com/ for documentation, updates and examples. + * + * Copyright (c) 2010 gskinner.com, inc. + * + * 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. + */ + + /** + * A collection of Classes that are shared across all the CreateJS libraries. The classes are included in the minified + * files of each library and are available on the createjs namespace directly. + * + *

    Example

    + * + * myObject.addEventListener("change", createjs.proxy(myMethod, scope)); + * + * @module CreateJS + * @main CreateJS + */ + + /** + * Contains properties and methods shared by all events for use with + * {{#crossLink "EventDispatcher"}}{{/crossLink}}. + * + * Note that Event objects are often reused, so you should never + * rely on an event object's state outside of the call stack it was received in. + * @class Event + * @param {String} type The event type. + * @param {Boolean} bubbles Indicates whether the event will bubble through the display list. + * @param {Boolean} cancelable Indicates whether the default behaviour of this event can be cancelled. + * @constructor + **/ + class Event { + constructor(type, bubbles, cancelable) { + // public properties: + /** + * The type of event. + * @property type + * @type String + **/ + this.type = type; + + /** + * The object that generated an event. + * @property target + * @type Object + * @default null + * @readonly + */ + this.target = null; + + /** + * The current target that a bubbling event is being dispatched from. For non-bubbling events, this will + * always be the same as target. For example, if childObj.parent = parentObj, and a bubbling event + * is generated from childObj, then a listener on parentObj would receive the event with + * target=childObj (the original target) and currentTarget=parentObj (where the listener was added). + * @property currentTarget + * @type Object + * @default null + * @readonly + */ + this.currentTarget = null; + + /** + * For bubbling events, this indicates the current event phase:
      + *
    1. capture phase: starting from the top parent to the target
    2. + *
    3. at target phase: currently being dispatched from the target
    4. + *
    5. bubbling phase: from the target to the top parent
    6. + *
    + * @property eventPhase + * @type Number + * @default 0 + * @readonly + */ + this.eventPhase = 0; + + /** + * Indicates whether the event will bubble through the display list. + * @property bubbles + * @type Boolean + * @default false + * @readonly + */ + this.bubbles = !!bubbles; + + /** + * Indicates whether the default behaviour of this event can be cancelled via + * {{#crossLink "Event/preventDefault"}}{{/crossLink}}. This is set via the Event constructor. + * @property cancelable + * @type Boolean + * @default false + * @readonly + */ + this.cancelable = !!cancelable; + + /** + * The epoch time at which this event was created. + * @property timeStamp + * @type Number + * @default 0 + * @readonly + */ + this.timeStamp = new Date().getTime(); + + /** + * Indicates if {{#crossLink "Event/preventDefault"}}{{/crossLink}} has been called + * on this event. + * @property defaultPrevented + * @type Boolean + * @default false + * @readonly + */ + this.defaultPrevented = false; + + /** + * Indicates if {{#crossLink "Event/stopPropagation"}}{{/crossLink}} or + * {{#crossLink "Event/stopImmediatePropagation"}}{{/crossLink}} has been called on this event. + * @property propagationStopped + * @type Boolean + * @default false + * @readonly + */ + this.propagationStopped = false; + + /** + * Indicates if {{#crossLink "Event/stopImmediatePropagation"}}{{/crossLink}} has been called + * on this event. + * @property immediatePropagationStopped + * @type Boolean + * @default false + * @readonly + */ + this.immediatePropagationStopped = false; + + /** + * Indicates if {{#crossLink "Event/remove"}}{{/crossLink}} has been called on this event. + * @property removed + * @type Boolean + * @default false + * @readonly + */ + this.removed = false; + } + + // public methods: + /** + * Sets {{#crossLink "Event/defaultPrevented"}}{{/crossLink}} to true if the event is cancelable. + * Mirrors the DOM level 2 event standard. In general, cancelable events that have `preventDefault()` called will + * cancel the default behaviour associated with the event. + * @method preventDefault + **/ + preventDefault() { + this.defaultPrevented = this.cancelable && true; + } + /** + * Sets {{#crossLink "Event/propagationStopped"}}{{/crossLink}} to true. + * Mirrors the DOM event standard. + * @method stopPropagation + **/ + stopPropagation() { + this.propagationStopped = true; + } + /** + * Sets {{#crossLink "Event/propagationStopped"}}{{/crossLink}} and + * {{#crossLink "Event/immediatePropagationStopped"}}{{/crossLink}} to true. + * Mirrors the DOM event standard. + * @method stopImmediatePropagation + **/ + stopImmediatePropagation() { + this.immediatePropagationStopped = this.propagationStopped = true; + } + /** + * Causes the active listener to be removed via removeEventListener(); + * + * myBtn.addEventListener("click", function(evt) { + * // do stuff... + * evt.remove(); // removes this listener. + * }); + * + * @method remove + **/ + remove() { + this.removed = true; + } + /** + * Returns a clone of the Event instance. + * @method clone + * @return {Event} a clone of the Event instance. + **/ + clone() { + return new Event(this.type, this.bubbles, this.cancelable); + } + /** + * Provides a chainable shortcut method for setting a number of properties on the instance. + * + * @method set + * @param {Object} props A generic object containing properties to copy to the instance. + * @return {Event} Returns the instance the method is called on (useful for chaining calls.) + * @chainable + */ + set(props) { + for (let n in props) { + this[n] = props[n]; + } + return this; + } + /** + * Returns a string representation of this object. + * @method toString + * @return {String} a string representation of the instance. + **/ + toString() { + return "[Event (type=" + this.type + ")]"; + } + } + + /* + * EventDispatcher + * Visit http://createjs.com/ for documentation, updates and examples. + * + * Copyright (c) 2010 gskinner.com, inc. + * + * 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. + */ + class EventDispatcher { + constructor() { + // private properties: + /** + * @protected + * @property _listeners + * @type Object + **/ + this._listeners = null; + + /** + * @protected + * @property _captureListeners + * @type Object + **/ + this._captureListeners = null; + + /** + * A shortcut to the removeEventListener method, with the same parameters and return value. This is a companion to the + * .on method. + * + * IMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener. See + * {{#crossLink "EventDispatcher/on"}}{{/crossLink}} for an example. + * + * @method off + * @param {String} type The string type of the event. + * @param {Function | Object} listener The listener function or object. + * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + **/ + this.off = this.removeEventListener; + } + + // static public methods: + /** + * Static initializer to mix EventDispatcher methods into a target object or prototype. + * + * EventDispatcher.initialize(MyClass.prototype); // add to the prototype of the class + * EventDispatcher.initialize(myObject); // add to a specific instance + * + * @method initialize + * @static + * @param {Object} target The target object to inject EventDispatcher methods into. This can be an instance or a + * prototype. + **/ + static EventDispatcher(target) { + target.addEventListener = p.addEventListener; + target.on = p.on; + target.removeEventListener = target.off = p.removeEventListener; + target.removeAllEventListeners = p.removeAllEventListeners; + target.hasEventListener = p.hasEventListener; + target.dispatchEvent = p.dispatchEvent; + target._dispatchEvent = p._dispatchEvent; + target.willTrigger = p.willTrigger; + } + // public methods: + /** + * Adds the specified event listener. Note that adding multiple listeners to the same function will result in + * multiple callbacks getting fired. + * + *

    Example

    + * + * displayObject.addEventListener("click", handleClick); + * function handleClick(event) { + * // Click happened. + * } + * + * @method addEventListener + * @param {String} type The string type of the event. + * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when + * the event is dispatched. + * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + * @return {Function | Object} Returns the listener for chaining or assignment. + **/ + addEventListener(type, listener, useCapture) { + let listeners; + if (useCapture) { + listeners = this._captureListeners = this._captureListeners || {}; + } else { + listeners = this._listeners = this._listeners || {}; + } + let arr = listeners[type]; + if (arr) { + this.removeEventListener(type, listener, useCapture); + } + arr = listeners[type]; // remove may have deleted the array + if (!arr) { + listeners[type] = [listener]; + } else { + arr.push(listener); + } + return listener; + } + /** + * A shortcut method for using addEventListener that makes it easier to specify an execution scope, have a listener + * only run once, associate arbitrary data with the listener, and remove the listener. + * + * This method works by creating an anonymous wrapper function and subscribing it with addEventListener. + * The wrapper function is returned for use with `removeEventListener` (or `off`). + * + * IMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener, or use + * {{#crossLink "Event/remove"}}{{/crossLink}}. Likewise, each time you call `on` a NEW wrapper function is subscribed, so multiple calls + * to `on` with the same params will create multiple listeners. + * + *

    Example

    + * + * var listener = myBtn.on("click", handleClick, null, false, {count:3}); + * function handleClick(evt, data) { + * data.count -= 1; + * console.log(this == myBtn); // true - scope defaults to the dispatcher + * if (data.count == 0) { + * alert("clicked 3 times!"); + * myBtn.off("click", listener); + * // alternately: evt.remove(); + * } + * } + * + * @method on + * @param {String} type The string type of the event. + * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when + * the event is dispatched. + * @param {Object} [scope] The scope to execute the listener in. Defaults to the dispatcher/currentTarget for function listeners, and to the listener itself for object listeners (ie. using handleEvent). + * @param {Boolean} [once=false] If true, the listener will remove itself after the first time it is triggered. + * @param {*} [data] Arbitrary data that will be included as the second parameter when the listener is called. + * @param {Boolean} [useCapture=false] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + * @return {Function} Returns the anonymous function that was created and assigned as the listener. This is needed to remove the listener later using .removeEventListener. + **/ + on(type, listener, scope, once, data, useCapture) { + if (listener.handleEvent) { + scope = scope || listener; + listener = listener.handleEvent; + } + scope = scope || this; + return this.addEventListener(type, function (evt) { + listener.call(scope, evt, data); + once && evt.remove(); + }, useCapture); + } + /** + * Removes the specified event listener. + * + * Important Note: that you must pass the exact function reference used when the event was added. If a proxy + * function, or function closure is used as the callback, the proxy/closure reference must be used - a new proxy or + * closure will not work. + * + *

    Example

    + * + * displayObject.removeEventListener("click", handleClick); + * + * @method removeEventListener + * @param {String} type The string type of the event. + * @param {Function | Object} listener The listener function or object. + * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + **/ + removeEventListener(type, listener, useCapture) { + let listeners = useCapture ? this._captureListeners : this._listeners; + if (!listeners) { + return; + } + let arr = listeners[type]; + if (!arr) { + return; + } + for (let i = 0, l = arr.length; i < l; i++) { + if (arr[i] === listener) { + if (l == 1) { + delete listeners[type]; + } // allows for faster checks. + else { + arr.splice(i, 1); + } + break; + } + } + } + /** + * Removes all listeners for the specified type, or all listeners of all types. + * + *

    Example

    + * + * // Remove all listeners + * displayObject.removeAllEventListeners(); + * + * // Remove all click listeners + * displayObject.removeAllEventListeners("click"); + * + * @method removeAllEventListeners + * @param {String} [type] The string type of the event. If omitted, all listeners for all types will be removed. + **/ + removeAllEventListeners(type) { + if (!type) { + this._listeners = this._captureListeners = null; + } else { + if (this._listeners) { + delete this._listeners[type]; + } + if (this._captureListeners) { + delete this._captureListeners[type]; + } + } + } + /** + * Dispatches the specified event to all listeners. + * + *

    Example

    + * + * // Use a string event + * this.dispatchEvent("complete"); + * + * // Use an Event instance + * var event = new Event("progress"); + * this.dispatchEvent(event); + * + * @method dispatchEvent + * @param {Object | String | Event} eventObj An object with a "type" property, or a string type. + * While a generic object will work, it is recommended to use a CreateJS Event instance. If a string is used, + * dispatchEvent will construct an Event instance if necessary with the specified type. This latter approach can + * be used to avoid event object instantiation for non-bubbling events that may not have any listeners. + * @param {Boolean} [bubbles] Specifies the `bubbles` value when a string was passed to eventObj. + * @param {Boolean} [cancelable] Specifies the `cancelable` value when a string was passed to eventObj. + * @return {Boolean} Returns false if `preventDefault()` was called on a cancelable event, true otherwise. + **/ + dispatchEvent(eventObj, bubbles, cancelable) { + if (typeof eventObj == "string") { + // skip everything if there's no listeners and it doesn't bubble: + let listeners = this._listeners; + if (!bubbles && (!listeners || !listeners[eventObj])) { + return true; + } + eventObj = new Event(eventObj, bubbles, cancelable); + } else if (eventObj.target && eventObj.clone) { + // redispatching an active event object, so clone it: + eventObj = eventObj.clone(); + } + + // TODO: it would be nice to eliminate this. Maybe in favour of evtObj instanceof Event? Or !!evtObj.createEvent + try { + eventObj.target = this; + } catch (e) {} // try/catch allows redispatching of native events + + if (!eventObj.bubbles || !this.parent) { + this._dispatchEvent(eventObj, 2); + } else { + let top = this, + list = [top]; + while (top.parent) { + list.push(top = top.parent); + } + let i, + l = list.length; + + // capture & atTarget + for (i = l - 1; i >= 0 && !eventObj.propagationStopped; i--) { + list[i]._dispatchEvent(eventObj, 1 + (i == 0)); + } + // bubbling + for (i = 1; i < l && !eventObj.propagationStopped; i++) { + list[i]._dispatchEvent(eventObj, 3); + } + } + return !eventObj.defaultPrevented; + } + /** + * Indicates whether there is at least one listener for the specified event type. + * @method hasEventListener + * @param {String} type The string type of the event. + * @return {Boolean} Returns true if there is at least one listener for the specified event. + **/ + hasEventListener(type) { + let listeners = this._listeners, + captureListeners = this._captureListeners; + return !!(listeners && listeners[type] || captureListeners && captureListeners[type]); + } + /** + * Indicates whether there is at least one listener for the specified event type on this object or any of its + * ancestors (parent, parent's parent, etc). A return value of true indicates that if a bubbling event of the + * specified type is dispatched from this object, it will trigger at least one listener. + * + * This is similar to {{#crossLink "EventDispatcher/hasEventListener"}}{{/crossLink}}, but it searches the entire + * event flow for a listener, not just this object. + * @method willTrigger + * @param {String} type The string type of the event. + * @return {Boolean} Returns `true` if there is at least one listener for the specified event. + **/ + willTrigger(type) { + let o = this; + while (o) { + if (o.hasEventListener(type)) { + return true; + } + o = o.parent; + } + return false; + } + /** + * @method toString + * @return {String} a string representation of the instance. + **/ + toString() { + return "[EventDispatcher]"; + } + // private methods: + /** + * @method _dispatchEvent + * @param {Object | Event} eventObj + * @param {Object} eventPhase + * @protected + **/ + _dispatchEvent(eventObj, eventPhase) { + let l, + arr, + listeners = eventPhase <= 2 ? this._captureListeners : this._listeners; + if (eventObj && listeners && (arr = listeners[eventObj.type]) && (l = arr.length)) { + try { + eventObj.currentTarget = this; + } catch (e) {} + try { + eventObj.eventPhase = eventPhase | 0; + } catch (e) {} + eventObj.removed = false; + arr = arr.slice(); // to avoid issues with items being removed or added during the dispatch + for (let i = 0; i < l && !eventObj.immediatePropagationStopped; i++) { + let o = arr[i]; + if (o.handleEvent) { + o.handleEvent(eventObj); + } else { + o(eventObj); + } + if (eventObj.removed) { + this.off(eventObj.type, o, eventPhase == 1); + eventObj.removed = false; + } + } + } + if (eventPhase === 2) { + this._dispatchEvent(eventObj, 2.1); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + let DOMUtils = {}, + $ = DOMUtils; + $.query = function (query, element = document.body) { + return query[0] === ">" ? $._childQuery(query, element, $.query) : element.querySelector(query); + }; + $.queryAll = function (query, element = document.body) { + return query[0] === ">" ? $._childQuery(query, element, $.queryAll) : element.querySelectorAll(query); + }; + $.removeClass = function (element, className) { + if ($._runOnNodeList($.removeClass, element, className)) { + return element; + } + if (className instanceof RegExp) { + let arr = (element.getAttribute("class") || "").split(" "), + re = className; + element.setAttribute("class", arr.filter(s => !re.test(s)).join(" ")); + } else { + let list = element.classList; + list.remove.apply(list, className.split(" ")); + } + return element; + }; + $.addClass = function (element, className) { + if ($._runOnNodeList($.addClass, element, className)) { + return element; + } + $.removeClass(element, className); + let names = className.split(" "); + for (let i = 0; i < names.length; i++) { + element.classList.add(names[i]); + } + return element; + }; + $.toggleClass = function (element, className, value) { + if ($._runOnNodeList($.toggleClass, element, className, value)) { + return element; + } + let curValue = $.hasClass(element, className); + if (value == null) { + value = !curValue; + } else if (value === curValue) { + return; + } + if (value) { + $.addClass(element, className); + } else { + $.removeClass(element, className); + } + }; + $.hasClass = function (element, className) { + return !!(element.getAttribute("class") || "").match(new RegExp("\\b\\s?" + className + "\\b", "g")); + }; + $.swapClass = function (element, oldClass, newClass) { + $.removeClass(element, oldClass); + $.addClass(element, newClass); + return element; + }; + $.remove = function (element) { + if ($._runOnNodeList($.remove, element)) { + return element; + } + if (element.remove) { + element.remove(); + } else if (element.parentNode) { + element.parentNode.removeChild(element); + } + return element; + }; + $.on = function (element, event, listener) { + if ($._runOnNodeList($.on, element, event, listener)) { + return element; + } + element.addEventListener(event, listener); + }; + $.off = function (element, event, listener) { + if ($._runOnNodeList($.off, element, event, listener)) { + return element; + } + element.removeEventListener(event, listener); + }; + + /* + Remove all children from an element. + When using .innerHTML = ""; IE fails when adding new dom elements via appendChild(); + */ + $.empty = function (element) { + if ($._runOnNodeList($.empty, element)) { + return element; + } + while (element.firstChild) { + element.removeChild(element.firstChild); + } + return element; + }; + $.create = function (type, className, content, parent) { + let element = document.createElement(type || "div"); + if (className) { + element.className = className; + } + if (content) { + if (content instanceof HTMLElement) { + element.appendChild(content); + } else { + element.innerHTML = content; + } + } + if (parent) { + parent.appendChild(element); + } + return element; + }; + $.getEl = function (query, scope) { + if (query instanceof HTMLElement || !query) { + return query; + } + return $.query(query, scope); + }; + $.togglePanel = function (element, openEl, closedEl, open) { + let el1 = $.getEl(openEl, element), + el2 = $.getEl(closedEl, element), + tmp, + isOpen = !$.hasClass(element, "closed"); + if (open === undefined) { + open = !isOpen; + } else { + open = !!open; + } + if (open === isOpen) { + return; + } + if (open) { + $.removeClass(element, "closed"); + tmp = el2; + el2 = el1; + el1 = tmp; + } else { + $.addClass(element, "closed"); + } + el1 && (el1.style.display = "none"); + if (el2) { + let f = function (evt) { + if (evt.target !== element) { + return; + } + el2.style.display = "flex"; + element.removeEventListener("transitionend", f); + }; + element.addEventListener("transitionend", f); + } + }; + $.transition = function (target, className, then) { + let f = evt => { + if (evt.target !== target) { + return; + } + target.removeEventListener("transition", f); + then(); + }; + target.addEventListener("transitionend", f); + $.addClass(target, className); + }; + $.template = function (strings, ...keys) { + return o => { + let result = strings[0]; + for (let i = 0, l = keys.length; i < l; i++) { + result += o[keys[i]] + strings[i + 1]; + } + return result; + }; + }; + + // TODO: evaluate whether this belongs here. Feels awkward given its specific DOM dependencies. + $.getCSSValue = function (name, prop) { + let el = $.create("div", name); + el.style.display = "none"; + el.id = "export"; + document.body.appendChild(el); + let val = window.getComputedStyle(el).getPropertyValue(prop); + $.remove(el); + return val; + }; + $._runOnNodeList = function (f, nodelist, ...rest) { + if (!nodelist) { + return true; + } + if (nodelist.length === undefined) { + return false; + } + for (let i = 0, l = nodelist.length; i < l; i++) { + f.call(DOMUtils, nodelist[i], ...rest); + } + return true; + }; + $._childQuery = function (query, el, f) { + if (!el.id) { + el.id = "___tmp_id"; + } + let result = f("#" + el.id + " " + query, el.parentNode); + if (el.id === "___tmp_id") { + el.id = ""; + } + return result; + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + let Utils = {}; + Utils.prepMenuContent = function (content, idMap) { + if (!idMap.__next_id) { + idMap.__next_id = 1; + } + let kids = content.kids; + for (let i = 0, l = kids.length; i < l; i++) { + let o = kids[i]; + // current list implementation requires everything to have an id: + if (!o.id) { + o.id = "__id_" + idMap.__next_id++; + } + idMap[o.id] = o; + o.parent = content; + if (o.kids) { + Utils.prepMenuContent(o, idMap); + } + } + return content; + }; + Utils.find = function (arr, f) { + for (let i = 0, l = arr.length; i < l; i++) { + if (f(arr[i])) { + return arr[i]; + } + } + }; + Utils.findIndex = function (arr, f) { + for (let i = 0, l = arr.length; i < l; i++) { + if (f(arr[i])) { + return i; + } + } + return -1; + }; + Utils.copy = function (target, source) { + for (let n in source) { + target[n] = source[n]; + } + return target; + }; + Utils.clone = function (o) { + // this seems hacky, but it's the fastest, easiest approach for now: + return JSON.parse(JSON.stringify(o)); + }; + Utils.searchRank = function (o, search) { + let test = Utils.searchTest; + search = search.toLowerCase(); + if (o.access) { + // pattern (My Favorites). + // text? pattern? + return test((o.keywords || "") + " " + (o.name || ""), search, 16) + test((o.description || "") + " " + (o.author || ""), search, 8); + } else { + // reference. + return test(o.token, search, 16) + test((o.id || "") + " " + (o.label || ""), search, 8) + test((o.desc || "") + " " + (o.ext || ""), search, 4); + } + }; + Utils.searchTest = function (str, search, weight = 1) { + return str && str.toLowerCase().indexOf(search) !== -1 ? weight : 0; + }; + Utils.htmlSafe = function (str) { + return str == null ? "" : ("" + str).replace(/&/g, "&").replace(/ 0 && str.length > length; + if (b) { + str = str.substr(0, length - 1); + } + if (htmlSafe) { + str = Utils.htmlSafe(str); + } + return !b ? str : str + (tag && "<" + tag + ">") + "\u2026" + (tag && ""); + }; + Utils.unescSubstStr = function (str) { + if (!str) { + return ""; + } + return str.replace(Utils.SUBST_ESC_RE, (a, b, c) => Utils.SUBST_ESC_CHARS[b] || String.fromCharCode(parseInt(c, 16))); + }; + Utils.getRegExp = function (str) { + // returns a JS RegExp object. + let match = str.match(/^\/(.+)\/([a-z]+)?$/), + regex = null; + try { + regex = match ? new RegExp(match[1], match[2] || "") : new RegExp(str, "g"); + } catch (e) {} + return regex; + }; + Utils.decomposeRegEx = function (str, delim = "/") { + let re = new RegExp("^" + delim + "(.*)" + delim + "([igmsuUxy]*)$"); + let match = re.exec(str); + if (match) { + return { + source: match[1], + flags: match[2] + }; + } else { + return { + source: str, + flags: "g" + }; + } + }; + Utils.isMac = function () { + return !!navigator.userAgent.match(/Mac\sOS/i); + }; + Utils.getCtrlKey = function () { + return Utils.isMac() ? "cmd" : "ctrl"; + }; + Utils.now = function () { + return window.performance ? performance.now() : Date.now(); + }; + Utils.getUrlParams = function () { + let match, + re = /([^&=]+)=?([^&]*)/g, + params = {}; + let url = window.location.search.substr(1).replace(/\+/g, " "); + while (match = re.exec(url)) { + params[decodeURIComponent(match[1])] = decodeURIComponent(match[2]); + } + return params; + }; + let deferIds = {}; + Utils.defer = function (f, id, t = 1) { + clearTimeout(deferIds[id]); + if (f === null) { + delete deferIds[id]; + return; + } + deferIds[id] = setTimeout(() => { + delete deferIds[id]; + f(); + }, t); + }; + Utils.getHashCode = function (s) { + let hash = 0, + l = s.length, + i; + for (i = 0; i < l; i++) { + hash = (hash << 5) - hash + s.charCodeAt(i) | 0; + } + return hash; + }; + Utils.getPatternURL = function (pattern) { + let a = Utils.isLocal ? "?id=" : "/"; + let url = window.location.origin, + id = pattern && pattern.id || ""; + return url + a + id; + }; + Utils.isLocal = window.location.hostname === "localhost"; + Utils.getPatternURLStr = function (pattern) { + if (!pattern || !pattern.id) { + return null; + } + let a = Utils.isLocal ? "?id=" : "/"; + let url = window.location.host, + id = pattern.id; + return url + a + id; + }; + Utils.getForkName = function (name) { + let res = / ?\(fork ?(\d*)\)$/.exec(name); + if (res) { + let num = (res[1] || 1) * 1 + 1; + return name.substr(0, res.index) + " (fork " + num + ")"; + } + return name + " (fork)"; + }; + Utils.SUBST_ESC_CHARS = { + // this is just the list supported in Replace. Others: b, f, ", etc. + n: "\n", + r: "\r", + t: "\t", + "\\": "\\" + }; + Utils.SUBST_ESC_RE = /\\([nrt\\]|u([A-Z0-9]{4}))/ig; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Tooltip { + constructor(el, transition = false) { + this.el = DOMUtils.remove(el); + this.transition = transition; + this.contentEl = DOMUtils.query(".content", el); + this.tipEl = DOMUtils.query(".tip", el); + this.hideF = evt => Date.now() > this._showT && this.handleBodyClick(evt); + this.curId = null; + } + toggle(id, content, x, y, autohide, th) { + if (id === this.curId) { + return this.hide(id); + } + this.show(id, content, x, y, autohide, th); + } + toggleOn(id, content, el, autohide, th) { + if (id === this.curId) { + return this.hide(id); + } + this.showOn(id, content, el, autohide, th); + this.toggleEl = el; + DOMUtils.addClass(el, "selected"); + } + hide(id) { + if (id && this.curId !== id) { + return; + } + let el = this.el, + elStyle = el.style; + DOMUtils.empty(DOMUtils.query(".content", DOMUtils.remove(el))); + DOMUtils.removeClass(el, "flipped"); + document.body.removeEventListener("mousedown", this.hideF); + if (this.toggleEl) { + DOMUtils.removeClass(this.toggleEl, "selected"); + this.toggleEl = null; + } + + // reset position and width so that content wrapping resolves properly: + elStyle.left = elStyle.top = "0"; + elStyle.width = ""; + if (this.transition) { + elStyle.opacity = 0; + elStyle.marginTop = "-0.25em"; + } + this.curId = null; + } + show(id, content, x, y, autohide = false, th = 0) { + this.hide(); + if (!content) { + return; + } + let el = this.el, + elStyle = el.style, + contentEl = this.contentEl, + body = document.body, + pad = 8; + if (content instanceof HTMLElement) { + contentEl.appendChild(content); + } else { + contentEl.innerHTML = content; + } + if (autohide) { + this._showT = Date.now() + 30; // ignore double clicks and events in the current stack. + body.addEventListener("mousedown", this.hideF); + } + body.appendChild(el); + let wh = window.innerHeight, + ww = window.innerWidth; + let rect = el.getBoundingClientRect(), + w = rect.right - rect.left, + h = rect.bottom - rect.top, + off = 0; + if (y + h > wh - pad) { + DOMUtils.addClass(el, "flipped"); + y -= th; + } + if (x - w / 2 < pad) { + off = pad - x + w / 2; + } else if (x + w / 2 > ww - pad) { + off = ww - pad - x - w / 2; + } + this.tipEl.style.marginRight = Math.max(-w / 2 + 10, Math.min(w / 2 - 10, off)) * 2 + "px"; + elStyle.width = Math.ceil(w / 2) * 2 + "px"; + elStyle.top = Math.round(y) + "px"; + elStyle.left = Math.round(x + off) + "px"; + if (this.transition) { + elStyle.opacity = 1; + elStyle.marginTop = 0; + } + this.curId = id; + } + showOn(id, content, el, autohide, th = 0) { + let rect = el.getBoundingClientRect(); + let x = Math.round((rect.left + rect.right) / 2); + let y = rect.bottom + th; + let h = rect.bottom - rect.top; + this.show(id, content, x, y, autohide, h); + } + handleBodyClick(evt) { + let id = this.curId; + if (this.el.contains(evt.target) || this.toggleEl && this.toggleEl.contains(evt.target)) { + return; + } + this.hide(id); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Server { + // regex: + static solve(req) { + return Server._getRequest("regex/solve", { + data: JSON.stringify(req) + }); + } + static version(flavor) { + return Server._getRequest("regex/version", { + flavor: flavor + }); + } + + // patterns: + static communitySearch(str) { + return Server._getRequest("patterns/search", { + query: str || "", + startIndex: 0, + limit: 100 + }, data => { + this._processPatternList(data); + }); + } + static load(id) { + return Server._getRequest("patterns/load", { + patternId: id + }, data => this._processPattern(data)); + } + static save(pattern, fork, community) { + // clone and prep the pattern object: + let o = this._prepPattern(pattern, fork, community); + return Server._getRequest("patterns/save", o, data => this._processPattern(data)); + } + static rate(id, rating) { + return Server._getRequest("patterns/rate", { + patternId: id, + userRating: rating + }, data => data.rating = Number(data.rating)); + } + static delete(id) { + return Server._getRequest("patterns/delete", { + patternId: id + }); + } + static favorite(id, value) { + return Server._getRequest("patterns/favorite", { + patternId: id, + favorite: !!value + }); + } + static private(id, value) { + return Server.setAccess(id, value ? "private" : "protected"); + } + static setAccess(id, value) { + return Server._getRequest("patterns/setAccess", { + patternId: id, + access: value + }); + } + static multiFavorite(ids) { + return Server._getRequest("patterns/multiFavorite", { + patternIds: JSON.stringify(ids) + }); + } + + // account: + static login(service) { + window.location = Server.url + "?action=account/login&type=" + service; + } + static logout() { + return Server._getRequest("account/logout", {}); + } + static verify() { + return Server._getRequest("account/verify", {}); + } + static patterns() { + return Server._getRequest("account/patterns", {}, data => { + this._processPatternList(data); + data.results.sort((a, b) => { + return b.favorite - a.favorite || b.dateAdded - a.dateAdded || 1 - 2 * (a.id > b.id); + }); + }); + } + + // helpers: + static _processPatternList(data) { + data.results.forEach(this._processPattern); + } + static _processPattern(o) { + // parse values: + o.rating = Number(o.rating); + o.userRating = Number(o.userRating); + o.flavor = o.flavor || "js"; + o.mode = o.mode || "text"; + o.text = o.text || null; + if (o.tool && o.tool.id) { + o.tool.id = o.tool.id.toLowerCase(); + } + } + static _prepPattern(o, fork, community) { + o = Utils.clone(o); + if (fork) { + o.parentId = o.id; + delete o.id; + if (!community) { + o.name = Utils.getForkName(o.name); + } + } + // clear null values: + if (!o.id) { + delete o.id; + } + if (!o.parentId) { + delete o.parentId; + } + delete o.userId; // this gets added by the server + o.tool = o.tool && JSON.stringify(o.tool); + o.tests = o.tests && JSON.stringify(o.tests); + return o; + } + + // private methods: + static _getRequest(action, data = {}, postprocess) { + let req = new XMLHttpRequest(), + p = new ServerPromise(req, postprocess), + params = []; + req.open("POST", Server.url); + req.setRequestHeader("Content-type", "application/x-www-form-urlencoded", true); + req.timeout = 30 * 1000; + data.action = action; + if (Server.isLocal && Server.useBeta) { + data.userId = 111; + } + for (let n in data) { + params.push(n + "=" + encodeURIComponent(data[n])); + } + if (Server.isLocal) { + console.log(data); + } + req.send(params.join("&")); + return p; + } + } + class ServerPromise { + constructor(req, postprocess) { + this._req = req; + this._postprocess = postprocess; + req.addEventListener("load", () => this._load()); + req.addEventListener("timeout", evt => this._error("servercomm")); + req.addEventListener("error", evt => this._error("servercomm")); + } + then(f, cf, ff) { + this._loadF = f; + if (cf) { + this.catch(cf); + } + if (this._data) { + f(this._data); + } + if (ff) { + this.finally(ff); + } + return this; + } + catch(f) { + this._errorF = f; + if (this._err) { + f(this._err); + } + return this; + } + finally(f) { + this._finallyF = f; + if (this._complete) { + f(); + } + return this; + } + abort() { + if (this._complete) { + return; + } + this._complete = true; + this._req.abort(); + this._finallyF && this._finallyF(); + this._loadF = this._errorF = this._finallyF = null; // just to make sure. + } + _load() { + let json; + this._complete = true; + if (Server.isLocal) { + console.log(this._req.response || this._req.responseText); + } + try { + json = JSON.parse(this._req.response || this._req.responseText); + } catch (e) { + return this._error(e); + } + if (!json.success) { + return this._error(json.data); + } + this._postprocess && this._postprocess(json.data); + this._data = json.data; + this._loadF && this._loadF(this._data); + this._finallyF && this._finallyF(); + } + _error(e) { + this._err = e.data && e.data.error || e.message || e.detail || e.type || String(e); + this._errorF && this._errorF(this._err); + this._finallyF && this._finallyF(); + } + } + Server.isLocal = Utils.isLocal; + Server.useBeta = Server.isLocal || window.location.hostname === "beta.regexr.com"; + Server.host = "https://" + (Server.useBeta ? "beta." : "") + "regexr.com"; + Server.url = Server.host + "/server/api.php"; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + let CMUtils = {}; + CMUtils.create = function (target, opts = {}, width = "100%", height = "100%") { + let keys = {}, + ctrlKey = Utils.getCtrlKey(); + //keys[ctrlKey + "-Z"] = keys[ctrlKey + "-Y"] = keys["Shift-" + ctrlKey + "-Z"] = () => false; // block CM handling + + let o = Utils.copy({ + lineNumbers: false, + tabSize: 3, + indentWithTabs: true, + extraKeys: keys, + specialChars: /[ \u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/, + specialCharPlaceholder: ch => DOMUtils.create("span", ch === " " ? "cm-space" : "cm-special", " ") // needs to be a space so wrapping works + }, opts); + let cm = CodeMirror(target, o); + cm.setSize(width, height); + if (cm.getOption("maxLength")) { + cm.on("beforeChange", CMUtils.enforceMaxLength); + } + if (cm.getOption("singleLine")) { + cm.on("beforeChange", CMUtils.enforceSingleLine); + } + return cm; + }; + CMUtils.getCharIndexAt = function (cm, winX, winY) { + let pos = cm.coordsChar({ + left: winX, + top: winY + }, "page"); + // test current and prev character, since CM seems to use the center of each character for coordsChar: + for (let i = 0; i <= 1; i++) { + let rect = cm.charCoords(pos, "page"); + if (winX >= rect.left && winX <= rect.right && winY >= rect.top && winY <= rect.bottom) { + return cm.indexFromPos(pos); + } + if (pos.ch-- <= 0) { + break; + } + } + return null; + }; + /* + // unused? + CMUtils.getEOLPos = function (cm, pos) { + if (!isNaN(pos)) { + pos = cm.posFromIndex(pos); + } + let rect = cm.charCoords(pos, "local"), w = cm.getScrollInfo().width; + return cm.coordsChar({left: w - 1, top: rect.top}, "local"); + }; + */ + CMUtils.getCharRect = function (cm, index) { + if (index == null) { + return null; + } + let pos = cm.posFromIndex(index), + rect = cm.charCoords(pos); + rect.x = rect.left; + rect.y = rect.top; + rect.width = rect.right - rect.left; + rect.height = rect.bottom - rect.top; + return rect; + }; + CMUtils.enforceMaxLength = function (cm, change) { + let maxLength = cm.getOption("maxLength"); + if (maxLength && change.update) { + let str = change.text.join("\n"); + let delta = str.length - (cm.indexFromPos(change.to) - cm.indexFromPos(change.from)); + if (delta <= 0) { + return true; + } + delta = cm.getValue().length + delta - maxLength; + if (delta > 0) { + str = str.substr(0, str.length - delta); + change.update(change.from, change.to, str.split("\n")); + } + } + return true; + }; + CMUtils.enforceSingleLine = function (cm, change) { + if (change.update) { + let str = change.text.join("").replace(/(\n|\r)/g, ""); + change.update(change.from, change.to, [str]); + } + return true; + }; + CMUtils.selectAll = function (cm) { + cm.focus(); + cm.setSelection({ + ch: 0, + line: 0 + }, { + ch: 0, + line: cm.lineCount() + }); + }; + CMUtils.calcRangePos = function (cm, i, l = 0, o = {}) { + let doc = cm.getDoc(); + o.startPos = doc.posFromIndex(i); + o.endPos = doc.posFromIndex(i + l); + return o; + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + let Track = {}; + Track.GA_ID = "UA-3579542-6"; + Track.page = function (path) { + gtag("config", Track.GA_ID, { + "page_path": "/" + path + }); + }; + + // https://developers.google.com/analytics/devguides/collection/gtagjs/events + Track.event = function (name, category, label) { + let o = {}; + if (category) { + o.event_category = category; + } + if (label) { + o.event_label = label; + } + gtag("event", name, o); + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class List extends EventDispatcher { + constructor(el, opts) { + super(); + this.el = el; + this.multi = opts.multi; + this.template = opts.template; + this.data = opts.data; + if (opts.selected) { + this.selected = opts.selected; + } + } + set data(data) { + DOMUtils.empty(this.el); + this._data = data; + if (!data || !data.length) { + return; + } + for (let i = 0, l = data.length; i < l; i++) { + this.addItem(data[i]); + } + } + get data() { + return this._data; + } + set selected(ids) { + DOMUtils.removeClass(DOMUtils.queryAll(".selected", this.el), "selected"); + if (!(ids instanceof Array)) { + ids = [ids]; + } + ids.forEach(id => DOMUtils.addClass(DOMUtils.query("[data-id='" + id + "']", this.el), "selected")); + if (!this.multi) { + this.scrollTo(ids[0]); + } + } + get selected() { + let els = DOMUtils.queryAll("li.selected", this.el); + if (!els[0]) { + return null; + } + if (!this.multi) { + return els[0].dataset.id; + } + let ids = []; + for (let i = 0, l = els.length; i < l; i++) { + ids.push(els[i].dataset.id); + } + return ids; + } + set selectedIndex(index) { + let data = this.data; + this.selected = data && data[index] && data[index].id; + } + get selectedIndex() { + let el = this.selectedEl, + id = el && el.dataset.id; + return id === null ? -1 : this.data.findIndex(o => o.id === id); + } + get selectedItem() { + let el = this.selectedEl; + return el && el.item; + } + get selectedEl() { + return DOMUtils.query("li.selected", this.el); + } + refresh() { + let sel = this.selected; + this.data = this._data; + this.selected = sel; + } + addItem(o, selected = null) { + let label, id, sel; + let f = evt => this.handleClick(evt), + template = this.template; + if (typeof o === "string") { + id = o; + label = template ? template(o) : o; + } else { + if (o.hide) { + return; + } + id = o.id || o.label; + label = template ? template(o) : o.label; + if (selected === null) { + sel = o.selected; + } + } + let item = DOMUtils.create("li", sel ? "selected" : null, label, this.el); + item.dataset.id = id; + item.item = o; + item.addEventListener("click", f); + item.addEventListener("dblclick", f); + if (selected) { + this.selected = o.id; + } + } + removeItem(id) { + let el = DOMUtils.query("[data-id='" + id + "']", this.el); + el && el.remove(); + } + handleClick(evt) { + let id = evt.currentTarget.dataset.id, + old = this.selected; + if (!this.getEl(id)) { + return; + } + if (evt.type === "dblclick") { + if (id != null) { + this.dispatchEvent("dblclick"); + } + return; + } else if (this.multi) { + DOMUtils.toggleClass(evt.currentTarget, "selected"); + } else if (old === id) { + if (id != null) { + this.dispatchEvent("selclick"); + } + return; + } else { + this.selected = id; + } + if (!this.dispatchEvent("change", false, true)) { + this.selected = old; + } + } + scrollTo(id = this.selected) { + let el = this.getEl(id); + if (!el) { + return; + } + //el.scrollIntoView(); // this is too jumpy, but would handle horizontal. + + let scrollEl = this.scrollEl || this.el; + let top = el.offsetTop - scrollEl.offsetTop; + if (top + el.offsetHeight > scrollEl.scrollTop + scrollEl.offsetHeight) { + scrollEl.scrollTop = top + el.offsetHeight - scrollEl.offsetHeight + 10; + } else if (top < scrollEl.scrollTop) { + scrollEl.scrollTop = top - 10; + } + } + getEl(id) { + return DOMUtils.query("[data-id='" + id + "']", this.el); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class ExpressionLexer { + constructor() { + this.profile = null; + } + set profile(profile) { + this._profile = profile; + this.string = this.token = this.errors = this.captureGroups = this.namedGroups = null; + } + parse(str) { + if (!this._profile) { + return null; + } + if (str === this.string) { + return this.token; + } + this.token = null; + this._modes = {}; + this.string = str; + this.errors = []; + let capgroups = this.captureGroups = []; + let namedgroups = this.namedGroups = {}; + let brgroups = this.branchResetGroups = []; + let groups = [], + refs = [], + i = 0, + l = str.length; + let o, + c, + token, + charset = null; + // previous is the previous token, prv is the previous "active" token (!ignore) + let prev = null, + prv = null; + let profile = this._profile, + unquantifiable = profile.unquantifiable; + let charTypes = profile.charTypes; + let closeIndex = str.lastIndexOf("/"); + for (let i = closeIndex + 1; i < l; i++) { + this._modes[str[i]] = true; + } + while (i < l) { + c = str[i]; + token = { + i: i, + l: 1, + prev: prev, + prv: prv, + modes: this._modes + }; + if (prev) { + prev.next = token; + } else { + this.token = token; + } + if (i === 0 || i >= closeIndex) { + this.parseFlag(str, token); + } else if (c === "(" && !charset) { + this.parseParen(str, token); + if (token.close === null) { + token.depth = groups.length; + groups.push(token); + } + if (token.capture) { + this.addCaptureGroup(token, groups); + } + } else if (c === ")" && !charset) { + token.type = "groupclose"; + if (groups.length) { + o = token.open = groups.pop(); + o.close = token; + if (o.type === "branchreset") { + brgroups.pop(); + } + } else { + token.error = { + id: "groupclose" + }; + } + } else if (c === "[") { + charset = this.parseSquareBracket(str, token, charset); + } else if (c === "]" && charset) { + token.type = "setclose"; + token.open = charset; + charset.close = token; + charset = null; + } else if (c === "+" && prv && prv.clss === "quant" && profile.tokens.possessive) { + token.type = "possessive"; + token.related = [prv]; + } else if ((c === "+" || c === "*") && !charset) { + token.type = charTypes[c]; + token.clss = "quant"; + token.min = c === "+" ? 1 : 0; + token.max = -1; + } else if (c === "{" && !charset && str.substr(i).search(/^{\d+,?\d*}/) !== -1) { + this.parseQuant(str, token); + } else if (c === "\\") { + this.parseBackSlash(str, token, charset, closeIndex); + } else if (c === "?" && !charset) { + if (!prv || prv.clss !== "quant") { + token.type = charTypes[c]; + token.clss = "quant"; + token.min = 0; + token.max = 1; + } else { + token.type = "lazy"; + token.related = [prv]; + } + } else if (c === "-" && charset && prv.code !== undefined && prv.prv && prv.prv.type !== "range") { + // this may be the start of a range, but we'll need to validate after the next token. + token.type = "range"; + } else { + this.parseChar(str, token, charset); + if (!charset && this._modes.x && /\s/.test(c)) { + token.ignore = true; + token.type = "ignorews"; + } + } + + // post process token: + // quantifier: + if (token.clss === "quant") { + if (!prv || prv.close !== undefined || unquantifiable[prv.type] || prv.open && unquantifiable[prv.open.type]) { + token.error = { + id: "quanttarg" + }; + } else { + token.related = [prv.open || prv]; + } + } + + // reference: + if (token.group === true) { + refs.push(token); + } + + // conditional: + let curGroup = groups.length ? groups[groups.length - 1] : null; + if (curGroup && (curGroup.type === "conditional" || curGroup.type === "conditionalgroup") && token.type === "alt") { + if (!curGroup.alt) { + curGroup.alt = token; + } else { + token.error = { + id: "extraelse" + }; + } + token.related = [curGroup]; + token.type = "conditionalelse"; + token.clss = "special"; + } else if (curGroup && curGroup.type === "branchreset") { + // reset group + curGroup.curGroupNum = curGroup.inGroupNum; + } + + // range: + if (prv && prv.type === "range" && prv.l === 1) { + this.validateRange(str, token); + } + + // js warnings: + // TODO: this isn't ideal, but I'm hesitant to write a more robust solution for a couple of edge cases. + if (profile.id === "js") { + this.addJSWarnings(token); + } + + // general: + if (token.open && !token.clss) { + token.clss = token.open.clss; + } + if (token.error) { + this.addError(token); + } + i += token.l; + prev = token; + if (!token.ignore) { + prv = token; + } + } + + // post processing: + while (groups.length) { + this.addError(groups.pop(), { + id: "groupopen" + }); + } + this.matchRefs(refs, capgroups, namedgroups); + if (charset) { + this.addError(charset, { + id: "setopen" + }); + } + return this.token; + } + addError(token, error = token.error) { + token.error = error; + this.errors.push(token); + } + addJSWarnings(token) { + if (token.error) { + return; + } + if (token.type === "neglookbehind" || token.type === "poslookbehind" || token.type === "sticky" || token.type === "unicode" || token.type == "dotall" || token.type === "unicodecat" || token.type === "unicodescript" || token.type === "namedgroup") { + token.error = { + id: "jsfuture", + warning: true + }; + } + } + addCaptureGroup(token, groups) { + // it would be nice to make branch reset groups actually highlight all of the groups that share the same number + // that would require switching to arrays of groups for each group num - requires rearchitecture throughout the app. + let capgroups = this.captureGroups, + brgroups = this.branchResetGroups, + namedgroups = this.namedGroups; + let curGroup = groups.length ? groups[groups.length - 1] : null; + if (brgroups.length) { + let brgroup = brgroups[brgroups.length - 1]; + token.num = ++brgroup.curGroupNum; + } else { + token.num = capgroups.length + 1; + } + if (!capgroups[token.num - 1]) { + capgroups.push(token); + } + if (token.name && !token.error) { + if (/\d/.test(token.name[0])) { + token.error = { + id: "badname" + }; + } else if (namedgroups[token.name]) { + token.error = { + id: "dupname" + }; + token.related = [namedgroups[token.name]]; + } else { + namedgroups[token.name] = token; + } + } + } + getRef(token, str) { + token.clss = "ref"; + token.group = true; + token.relIndex = this.captureGroups.length; + token.name = str; + } + matchRefs(refs, indexes, names) { + while (refs.length) { + let token = refs.pop(), + name = token.name, + group = names[name]; + if (!group && !isNaN(name)) { + let sign = name[0], + index = parseInt(name) + (sign === "+" || sign === "-" ? token.relIndex : 0); + if (sign === "-") { + index++; + } + group = indexes[index - 1]; + } + if (group) { + token.group = group; + token.related = [group]; + token.dir = token.i < group.i ? 1 : !group.close || token.i < group.close.i ? 0 : -1; + } else { + delete token.group; + delete token.relIndex; + this.refToOctal(token); + if (token.error) { + this.errors.push(token.error); + } + } + } + } + refToOctal(token) { + // PCRE: \# unmatched, \0 \00 \## = octal + // JS: \# \0 \00 \## = octal + // PCRE matches \8 \9 to "8" "9" + // JS: without the u flag \8 \9 match "8" "9" in IE, FF & Chrome, and "\8" "\9" in Safari. We support the former. + // JS: with the u flag, Chrome & FF throw an esc error, Safari does not. + + // TODO: handle \0 for PCRE? Would need more testing. + // TODO: this doesn't handle two digit refs with 8/9 in them. Ex. \18 - not even sure what this is interpreted as. + let name = token.name, + profile = this._profile; + if (token.type !== "numref") { + // not a simple \4 style reference, so can't decompose into an octal. + token.error = { + id: "unmatchedref" + }; + } else if (/^[0-7]{2}$/.test(name) || profile.config.reftooctalalways && /^[0-7]$/.test(name)) { + // octal + let next = token.next, + char = String.fromCharCode(next.code); + if (next.type === "char" && char >= "0" && char <= "7" && parseInt(name + char, 8) <= 255) { + name += char; + this.mergeNext(token); + } + token.code = parseInt(name, 8); + token.clss = "esc"; + token.type = "escoctal"; + delete token.name; + } else if (name === "8" || name === "9") { + this.parseEscChar(token, name); + delete token.name; + } else { + token.error = { + id: "unmatchedref" + }; + } + } + mergeNext(token) { + let next = token.next; + token.next = next.next; + token.next.prev = token; + token.l++; + } + parseFlag(str, token) { + // note that this doesn't deal with misformed patterns or incorrect flags. + let i = token.i, + c = str[i]; + if (str[i] === "/") { + token.type = i === 0 ? "open" : "close"; + if (i !== 0) { + token.related = [this.token]; + this.token.related = [token]; + } + } else { + token.type = this._profile.flags[c]; + } + //token.clear = true; + } + parseChar(str, token, charset) { + let c = str[token.i]; + token.type = !charset && this._profile.charTypes[c] || "char"; + if (!charset && c === "/") { + token.error = { + id: "fwdslash" + }; + } + if (token.type === "char") { + token.code = c.charCodeAt(0); + } else if (ExpressionLexer.ANCHOR_TYPES[token.type]) { + token.clss = "anchor"; + } else if (token.type === "dot") { + token.clss = "charclass"; + } + return token; + } + parseSquareBracket(str, token, charset) { + let match; + if (this._profile.tokens.posixcharclass && (match = str.substr(token.i).match(/^\[(:|\.)([^\]]*?)\1]/))) { + // posixcharclass: [:alpha:] + // posixcollseq: [.ch.] + // currently neither flavor supports posixcollseq, but PCRE does flag as an error: + // TODO: the expression above currently does not catch [.\].] + token.l = match[0].length; + token.value = match[2]; + token.clss = "charclass"; + if (match[1] === ":") { + token.type = "posixcharclass"; + if (!this._profile.posixCharClasses[match[2]]) { + token.error = { + id: "posixcharclassbad" + }; + } else if (!charset) { + token.error = { + id: "posixcharclassnoset" + }; + } + } else { + token.type = "posixcollseq"; + // TODO: can this be generalized? Right now, no, because we assign ids that aren't in the profile. + token.error = { + id: "notsupported" + }; + } + } else if (!charset) { + // set [a-z] [aeiou] + // setnot [^a-z] + token.type = token.clss = "set"; + if (str[token.i + 1] === "^") { + token.l++; + token.type += "not"; + } + charset = token; + } else { + // [[] (square bracket inside a set) + this.parseChar(str, token, charset); + } + return charset; + } + parseParen(str, token) { + /* + core: + . group: + . lookahead: ?= ?! + . noncap: ?: + PCRE: + . lookbehind: ?<= ? ?'name' ? + . namedref: ?P=name Also: \g'name' \k'name' etc + . comment: ?# + . atomic: ?> + . recursion: ?0 ?R Also: \g<0> + . define: ?(DEFINE) + . subroutine: ?1 ?-1 ?&name ?P>name + conditionalgroup: ?(1)a|b ?(-1)a|b ?(name)a|b + conditional: ?(?=if)then|else + mode: ?c-i + branchreset: ?| + */ + + token.clss = token.type = "group"; + if (str[token.i + 1] !== "?") { + token.close = null; // indicates that it needs a close token. + token.capture = true; + return token; + } + let sub = str.substr(token.i + 2), + match, + s = sub[0]; + if (s === ":") { + // (?:foo) + token.type = "noncapgroup"; + token.close = null; + token.l = 3; + } else if (s === ">") { + // (?>foo) + token.type = "atomic"; + token.close = null; + token.l = 3; + } else if (s === "|") { + // (?|(a)|(b)) + token.type = "branchreset"; + token.close = null; + token.l = 3; + token.inGroupNum = token.curGroupNum = this.captureGroups.length; + this.branchResetGroups.push(token); + } else if (s === "#" && (match = sub.match(/[^)]*\)/))) { + // (?#foo) + token.clss = token.type = "comment"; + token.ignore = true; + token.l = 2 + match[0].length; + } else if (/^(R|0)\)/.test(sub)) { + // (?R) (?0) + token.clss = "ref"; + token.type = "recursion"; + token.l = 4; + } else if (match = sub.match(/^P=(\w+)\)/i)) { + // (?P=name) + token.type = "namedref"; + this.getRef(token, match[1]); + token.l = match[0].length + 2; + } else if (/^\(DEFINE\)/.test(sub)) { + // (?(DEFINE)foo) + token.type = "define"; + token.close = null; + token.l = 10; + } else if (match = sub.match(/^/)) || this._profile.config.namedgroupalt && ((match = sub.match(/^'(\w+)'/)) || (match = sub.match(/^P<(\w+)>/)))) { + // (?foo) (?'name'foo) (?Pfoo) + token.type = "namedgroup"; + token.close = null; + token.name = match[1]; + token.capture = true; + token.l = match[0].length + 2; + } else if ((match = sub.match(/^([-+]?\d\d?)\)/)) || (match = sub.match(/^(?:&|P>)(\w+)\)/))) { + // (?1) (?-1) (?&name) (?P>name) + token.type = (isNaN(match[1]) ? "named" : "num") + "subroutine"; + this.getRef(token, match[1]); + token.l = match[0].length + 2; + } else if ((match = sub.match(/^\(([-+]?\d\d?)\)/)) || (match = sub.match(/^\((\w+)\)/))) { + // (?(1)a|b) (?(-1)a|b) (?(name)a|b) + this.getRef(token, match[1]); + token.clss = "special"; + token.type = "conditionalgroup"; + token.close = null; + token.l = match[0].length + 2; + } else if (/^\(\?255). In theory it should allow 4? + if (isNaN(val) || val > 255 || /[^\da-f]/i.test(match[1])) { + token.error = { + id: "esccharbad" + }; + } else { + token.code = val; + } + } else if (match = sub.match(/^x([\da-fA-F]{0,2})/)) { + // hex ascii: \xFF + token.type = "eschexadecimal"; + token.l += match[0].length; + token.code = parseInt(match[1] || 0, 16); + } else if (match = sub.match(/^c([a-zA-Z])?/)) { + // control char: \cA \cz + // also handles: \c + // not supported in JS strings + token.type = "esccontrolchar"; + if (match[1]) { + token.code = match[1].toUpperCase().charCodeAt(0) - 64; // A=65 + token.l += 2; + } else if (profile.config.ctrlcodeerr) { + token.l++; + token.error = { + id: "esccharbad" + }; + } else { + return this.parseChar(str, token, charset); // this builds the "/" token + } + } else if (match = sub.match(/^[0-7]{1,3}/)) { + // octal ascii: \011 + token.type = "escoctal"; + sub = match[0]; + if (parseInt(sub, 8) > 255) { + sub = sub.substr(0, 2); + } + token.l += sub.length; + token.code = parseInt(sub, 8); + } else if (profile.tokens.escoctalo && (match = sub.match(/^o\{(.*?)}/i))) { + // \o{377} + token.type = "escoctal"; + token.l += match[0].length; + val = parseInt(match[1], 8); + if (isNaN(val) || val > 255 || /[^0-7]/.test(match[1])) { + token.error = { + id: "esccharbad" + }; + } else { + token.code = val; + } + } else { + // single char + if (token.type = profile.escCharTypes[c]) { + token.l++; + token.clss = ExpressionLexer.ANCHOR_TYPES[token.type] ? "anchor" : "charclass"; + return token; + } + token.code = profile.escCharCodes[c]; + if (token.code === undefined || token.code === false) { + // unrecognized. + return this.parseEscChar(token, c); + } + + // update SubstLexer if this changes: + token.l++; + token.type = "esc_" + token.code; + } + token.clss = "esc"; + return token; + } + parseEscChar(token, c) { + // unrecognized escchar: \u \a \8, etc + // JS: allowed except if u flag set, Safari still allows \8 \9 + // PCRE: allows \8 \9 but not others // TODO: support? + let profile = this._profile; + token.l = 2; + if (!profile.badEscChars[c] && profile.tokens.escchar && !this._modes.u || profile.escChars[c]) { + token.type = "escchar"; + token.code = c.charCodeAt(0); + token.clss = "esc"; + } else { + token.error = { + id: "esccharbad" + }; + } + } + parseRef(token, sub) { + // namedref: \k \k'name' \k{name} \g{name} + // namedsubroutine: \g \g'name' + // numref: \g1 \g+2 \g{2} + // numsubroutine: \g<-1> \g'1' + // recursion: \g<0> \g'0' + let c = sub[0], + s = "", + match; + if (match = sub.match(/^[gk](?:'\w*'|<\w*>|{\w*})/)) { + s = match[0].substr(2, match[0].length - 3); + if (c === "k" && !isNaN(s)) { + s = ""; + } // TODO: specific error for numeric \k? + } else if (match = sub.match(/^g(?:({[-+]?\d+}|<[-+]?\d+>|'[-+]?\d+')|([-+]?\d+))/)) { + s = match[2] !== undefined ? match[2] : match[1].substr(1, match[1].length - 2); + } + let isRef = c === "k" || !(sub[1] === "'" || sub[1] === "<"); + if (!isRef && s == 0) { + token.type = "recursion"; + token.clss = "ref"; + } else { + // namedref, extnumref, namedsubroutine, numsubroutine + token.type = (isNaN(s) ? "named" : (isRef ? "ext" : "") + "num") + (isRef ? "ref" : "subroutine"); + this.getRef(token, s); + } + token.l += match ? match[0].length : 1; + } + parseUnicode(token, sub) { + // unicodescript: \p{Cherokee} + // unicodecat: \p{Ll} \pL + // not: \P{Ll} \p{^Lu} + let match = sub.match(/p\{\^?([^}]*)}/i), + val = match && match[1], + not = sub[0] === "P"; + if (!match && (match = sub.match(/[pP]([LMZSNPC])/))) { + val = match[1]; + } else { + not = not !== (sub[2] === "^"); + } + token.l += match ? match[0].length : 1; + token.type = "unicodecat"; + if (this._profile.unicodeScripts[val]) { + token.type = "unicodescript"; + } else if (!this._profile.unicodeCategories[val]) { + val = null; + } + if (not) { + token.type = "not" + token.type; + } + if (!this._profile.config.unicodenegated && sub[2] === "^" || !val) { + token.error = { + id: "unicodebad" + }; + } + token.value = val; + token.clss = "charclass"; + return token; + } + parseMode(token, sub) { + // (?i-x) + // supported modes in PCRE: i-caseinsens, x-freespacing, s-dotall, m-multiline, U-switchlazy, [J-samename] + let match = sub.match(/^[-a-z]+\)/i); + if (!match) { + return; + } + let supModes = this._profile.modes; + let modes = Utils.copy({}, this._modes), + bad = false, + not = false, + s = match[0], + c; + token.on = token.off = ""; + for (let i = 0, l = s.length - 1; i < l; i++) { + c = s[i]; + if (c === "-") { + not = true; + continue; + } + if (!supModes[c]) { + bad = true; + break; + } + modes[c] = !not; + token.on = token.on.replace(c, ""); + if (not) { + token.off = token.off.replace(c, ""); + token.off += c; + } else { + token.on += c; + } + } + token.clss = "special"; + token.type = "mode"; + token.l = match[0].length + 2; + if (bad) { + token.error = { + id: "modebad" + }; + token.errmode = c; + } else { + this._modes = modes; + } + return token; + } + parseQuant(str, token) { + // quantifier: {0,3} {3} {1,} + token.type = token.clss = "quant"; + let i = token.i; + let end = str.indexOf("}", i + 1); + token.l += end - i; + let arr = str.substring(i + 1, end).split(","); + token.min = parseInt(arr[0]); + token.max = arr[1] === undefined ? token.min : arr[1] === "" ? -1 : parseInt(arr[1]); + if (token.max !== -1 && token.min > token.max) { + token.error = { + id: "quantrev" + }; + } + return token; + } + validateRange(str, end) { + // char range: [a-z] [\11-\n] + let next = end, + token = end.prv, + prv = token.prv; + if (prv.code === undefined || next.code === undefined) { + // not a range, rewrite as a char: + this.parseChar(str, token); + } else { + token.clss = "set"; + if (prv.code > next.code) { + // this gets added here because parse has already moved to the next token: + this.errors.push(token.error = { + id: "rangerev" + }); + } + // preserve as separate tokens, but treat as one in the UI: + next.proxy = prv.proxy = token; + token.set = [prv, token, next]; + } + } + } + ExpressionLexer.ANCHOR_TYPES = { + "bof": true, + "eof": true, + "bos": true, + "eos": true, + "abseos": true, + "wordboundary": true, + "notwordboundary": true, + "prevmatchend": true + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class ExpressionHighlighter extends EventDispatcher { + constructor(cm) { + super(); + this.cm = cm; + this._activeMarks = []; + this._hoverMarks = []; + this._hoverToken = null; + } + clear() { + this.cm.operation(() => { + let marks = this._activeMarks; + for (var i = 0, l = marks.length; i < l; i++) { + marks[i].clear(); + } + marks.length = 0; + }); + } + draw(token) { + let cm = this.cm, + pre = ExpressionHighlighter.CSS_PREFIX; + this.clear(); + cm.operation(() => { + let groupClasses = ExpressionHighlighter.GROUP_CLASS_BY_TYPE; + let doc = cm.getDoc(), + endToken, + marks = this._activeMarks; + while (token) { + if (token.clear) { + token = token.next; + continue; + } + token = this._calcTokenPos(token); + var className = pre + (token.clss || token.type); + if (token.error) { + className += " " + pre + (token.error.warning ? "warning" : "error"); + } + if (className) { + marks.push(doc.markText(token.startPos, token.endPos, { + className: className + })); + } + if (token.close) { + endToken = this._calcTokenPos(token.close); + className = groupClasses[token.clss || token.type]; + if (className) { + className = className.replace("%depth%", token.depth); + marks.push(doc.markText(token.startPos, endToken.endPos, { + className: className + })); + } + } + token = token.next; + } + }); + } + set hoverToken(token) { + if (token === this._hoverToken) { + return; + } + if (token && token.set && token.set.indexOf(this._hoverToken) !== -1) { + return; + } + while (this._hoverMarks.length) { + this._hoverMarks.pop().clear(); + } + this._hoverToken = token; + if (token) { + if (token.open) { + this._drawSelect(token.open); + } else { + this._drawSelect(token); + } + if (token.related) { + for (let i = 0, l = token.related.length; i < l; i++) { + this._drawSelect(token.related[i], ExpressionHighlighter.CSS_PREFIX + "related"); + } + } + } + this.dispatchEvent("hover"); + } + get hoverToken() { + return this._hoverToken; + } + + // private methods: + _drawSelect(token, style = ExpressionHighlighter.CSS_PREFIX + "selected") { + let doc = this.cm.getDoc(), + endToken = token.close || token; + if (token.set) { + endToken = token.set[token.set.length - 1]; + token = token.set[0]; + } + this._calcTokenPos(endToken); + this._calcTokenPos(token); + this._hoverMarks.push(doc.markText(token.startPos, endToken.endPos, { + className: style, + startStyle: style + "-left", + endStyle: style + "-right" + })); + } + _calcTokenPos(token) { + if (token.startPos || token == null) { + return token; + } + CMUtils.calcRangePos(this.cm, token.i, token.l, token); + return token; + } + } + ExpressionHighlighter.CSS_PREFIX = "exp-"; + ExpressionHighlighter.GROUP_CLASS_BY_TYPE = { + set: ExpressionHighlighter.CSS_PREFIX + "group-set", + setnot: ExpressionHighlighter.CSS_PREFIX + "group-set", + group: ExpressionHighlighter.CSS_PREFIX + "group-%depth%", + lookaround: ExpressionHighlighter.CSS_PREFIX + "group-%depth%" + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class ExpressionHover { + constructor(editor, highlighter) { + this.editor = editor; + this.highlighter = highlighter; + this.isMouseDown = false; + this.token = null; + let o = editor.display.lineDiv; + o.addEventListener("mousemove", evt => this._handleMouseMove(evt)); + o.addEventListener("mouseout", evt => this._handleMouseOut(evt)); + o.addEventListener("mousedown", evt => this._handleMouseDown(evt)); + } + + // private methods: + _handleMouseMove(evt) { + if (this.isMouseDown) { + return; + } + let index, + editor = this.editor, + token = this.token, + target = null; + if (evt && token && (index = CMUtils.getCharIndexAt(editor, evt.clientX, evt.clientY + window.pageYOffset)) != null) { + while (token) { + if (index >= token.i && index < token.i + token.l) { + target = token; + break; + } + token = token.next; + } + } + while (target) { + if (target.open) { + target = target.open; + } else if (target.proxy) { + target = target.proxy; + } else { + break; + } + } + this.highlighter.hoverToken = target; + let rect = index != null && CMUtils.getCharRect(editor, index); + if (rect) { + rect.right = rect.left = evt.clientX; + } + app.tooltip.hover.show("ExpressionHover", app.reference.tipForToken(target), evt.clientX, rect.bottom, true, 0); + } + _handleMouseOut(evt) { + this.highlighter.hoverToken = null; + app.tooltip.hover.hide("ExpressionHover"); + } + _handleMouseDown(evt) { + // TODO: Should this also be in TextHover? + if (evt.which !== 1 && evt.button !== 1) { + return; + } + this.isMouseDown = true; + let f, + t = window.addEventListener ? window : document; + t.addEventListener("mouseup", f = () => { + t.removeEventListener("mouseup", f); + this.isMouseDown = false; + }); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + /* + The core profile essentially defines every feature we support, and is then pared down by other profiles. All values should be y (true). + + It also acts in part as pseudo documentation for all of the "type" values. + */ + let y = true, + n = false; + let core = { + id: "core", + flags: { + "g": "global", + // note that this is not a real flag in some flavors, but a different method call + "i": "caseinsensitive", + "m": "multiline", + "s": "dotall", + "u": "unicode", + "y": "sticky", + "x": "extended", + "U": "ungreedy" + }, + // reserved characters that need to be escaped: + escChars: "+*?^$\\.[]{}()|/".split("").reduce((o, c) => { + o[c] = y; + return o; + }, {}), + // escape chars that are specifically not supported by the flavor: + badEscChars: n, + escCharCodes: { + "0": 0, + // null + "a": 7, + // bell + "t": 9, + // tab + "n": 10, + // lf + "v": 11, + // vertical tab + "f": 12, + // form feed + "r": 13, + // cr + "e": 27 // escape + }, + escCharTypes: { + "A": "bos", + "b": "wordboundary", + "B": "notwordboundary", + "d": "digit", + "D": "notdigit", + "G": "prevmatchend", + "h": "hwhitespace", + "H": "nothwhitespace", + "K": "keepout", + "N": "notlinebreak", + "R": "linebreak", + "s": "whitespace", + "S": "notwhitespace", + "v": "vwhitespace", + "V": "notvwhitespace", + "w": "word", + "W": "notword", + "X": "unicodegrapheme", + "Z": "eos", + "z": "abseos" + }, + charTypes: { + ".": "dot", + "|": "alt", + "$": "eof", + "^": "bof", + "?": "opt", + // also: "lazy" + "+": "plus", + // also: "possessive" + "*": "star" + }, + unquantifiable: { + // all group/set open tokens are unquantifiable by default (ie. tokens with a .close value) + "quant": y, + "plus": y, + "star": y, + "opt": y, + "lazy": y, + "possessive": y, + "eof": y, + "bof": y, + "eos": y, + "abseos": y, + "alt": y, + "open": y, + "mode": y, + "comment": y, + // TODO: this should actually be ignored by quantifiers. + "condition": y + }, + unicodeScripts: { + // from: http://www.pcre.org/original/doc/html/pcrepattern.html + "Arabic": y, + "Armenian": y, + "Avestan": y, + "Balinese": y, + "Bamum": y, + "Bassa_Vah": y, + "Batak": y, + "Bengali": y, + "Bopomofo": y, + "Brahmi": y, + "Braille": y, + "Buginese": y, + "Buhid": y, + "Canadian_Aboriginal": y, + "Carian": y, + "Caucasian_Albanian": y, + "Chakma": y, + "Cham": y, + "Cherokee": y, + "Common": y, + "Coptic": y, + "Cuneiform": y, + "Cypriot": y, + "Cyrillic": y, + "Deseret": y, + "Devanagari": y, + "Duployan": y, + "Egyptian_Hieroglyphs": y, + "Elbasan": y, + "Ethiopic": y, + "Georgian": y, + "Glagolitic": y, + "Gothic": y, + "Grantha": y, + "Greek": y, + "Gujarati": y, + "Gurmukhi": y, + "Han": y, + "Hangul": y, + "Hanunoo": y, + "Hebrew": y, + "Hiragana": y, + "Imperial_Aramaic": y, + "Inherited": y, + "Inscriptional_Pahlavi": y, + "Inscriptional_Parthian": y, + "Javanese": y, + "Kaithi": y, + "Kannada": y, + "Katakana": y, + "Kayah_Li": y, + "Kharoshthi": y, + "Khmer": y, + "Khojki": y, + "Khudawadi": y, + "Lao": y, + "Latin": y, + "Lepcha": y, + "Limbu": y, + "Linear_A": y, + "Linear_B": y, + "Lisu": y, + "Lycian": y, + "Lydian": y, + "Mahajani": y, + "Malayalam": y, + "Mandaic": y, + "Manichaean": y, + "Meetei_Mayek": y, + "Mende_Kikakui": y, + "Meroitic_Cursive": y, + "Meroitic_Hieroglyphs": y, + "Miao": y, + "Modi": y, + "Mongolian": y, + "Mro": y, + "Myanmar": y, + "Nabataean": y, + "New_Tai_Lue": y, + "Nko": y, + "Ogham": y, + "Ol_Chiki": y, + "Old_Italic": y, + "Old_North_Arabian": y, + "Old_Permic": y, + "Old_Persian": y, + "Old_South_Arabian": y, + "Old_Turkic": y, + "Oriya": y, + "Osmanya": y, + "Pahawh_Hmong": y, + "Palmyrene": y, + "Pau_Cin_Hau": y, + "Phags_Pa": y, + "Phoenician": y, + "Psalter_Pahlavi": y, + "Rejang": y, + "Runic": y, + "Samaritan": y, + "Saurashtra": y, + "Sharada": y, + "Shavian": y, + "Siddham": y, + "Sinhala": y, + "Sora_Sompeng": y, + "Sundanese": y, + "Syloti_Nagri": y, + "Syriac": y, + "Tagalog": y, + "Tagbanwa": y, + "Tai_Le": y, + "Tai_Tham": y, + "Tai_Viet": y, + "Takri": y, + "Tamil": y, + "Telugu": y, + "Thaana": y, + "Thai": y, + "Tibetan": y, + "Tifinagh": y, + "Tirhuta": y, + "Ugaritic": y, + "Vai": y, + "Warang_Citi": y, + "Yi": y + }, + unicodeCategories: { + // from: http://www.pcre.org/original/doc/html/pcrepattern.html + "C": y, + // Other + "Cc": y, + // Control + "Cf": y, + // Format + "Cn": y, + // Unassigned + "Co": y, + // Private use + "Cs": y, + // Surrogate + "L": y, + // Letter + "L&": y, + // Any letter + "Ll": y, + // Lower case letter + "Lm": y, + // Modifier letter + "Lo": y, + // Other letter + "Lt": y, + // Title case letter + "Lu": y, + // Upper case letter + "M": y, + // Mark + "Mc": y, + // Spacing mark + "Me": y, + // Enclosing mark + "Mn": y, + // Non-spacing mark + "N": y, + // Number + "Nd": y, + // Decimal number + "Nl": y, + // Letter number + "No": y, + // Other number + "P": y, + // Punctuation + "Pc": y, + // Connector punctuation + "Pd": y, + // Dash punctuation + "Pe": y, + // Close punctuation + "Pf": y, + // Final punctuation + "Pi": y, + // Initial punctuation + "Po": y, + // Other punctuation + "Ps": y, + // Open punctuation + "S": y, + // Symbol + "Sc": y, + // Currency symbol + "Sk": y, + // Modifier symbol + "Sm": y, + // Mathematical symbol + "So": y, + // Other symbol + "Z": y, + // Separator + "Zl": y, + // Line separator + "Zp": y, + // Paragraph separator + "Zs": y // Space separator + }, + posixCharClasses: { + // from: http://www.pcre.org/original/doc/html/pcrepattern.html + "alnum": y, + // letters and digits + "alpha": y, + // letters + "ascii": y, + // character codes 0 - 127 + "blank": y, + // space or tab only + "cntrl": y, + // control characters + "digit": y, + // decimal digits (same as \d) + "graph": y, + // printing characters, excluding space + "lower": y, + // lower case letters + "print": y, + // printing characters, including space + "punct": y, + // printing characters, excluding letters and digits and space + "space": y, + // white space (the same as \s from PCRE 8.34) + "upper": y, + // upper case letters + "word": y, + // "word" characters (same as \w) + "xdigit": y // hexadecimal digits + }, + modes: { + "i": "caseinsensitive", + "s": "dotall", + "m": "multiline", + "x": "freespacing", + "J": "samename", + "U": "switchlazy" + }, + tokens: { + // note that not all of these are actively used in the lexer, but are included for completeness. + "open": y, + // opening / + "close": y, + // closing / + "char": y, + // abc + + // classes: + // also in escCharTypes and charTypes + "set": y, + // [a-z] + "setnot": y, + // [^a-z] + "setclose": y, + // ] + "range": y, + // [a-z] + "unicodecat": y, + // \p{Ll} \P{^Ll} \pL + "notunicodecat": y, + // \P{Ll} \p{^Ll} \PL + "unicodescript": y, + // \p{Cherokee} \P{^Cherokee} + "notunicodescript": y, + // \P{Cherokee} \p{^Cherokee} + "posixcharclass": y, + // [[:alpha:]] + // not in supported flavors: "posixcollseq": y, // [[.foo.]] // this is recognized by the lexer, currently returns "notsupported" error + // not in supported flavors: "unicodeblock": y, // \p{InThai} \p{IsThai} and NOT \P + // not in supported flavors: "subtract": y, // [base-[subtract]] + // not in supported flavors: "intersect": y, // [base&&[intersect]] + + // esc: + // also in escCharCodes and escCharTypes + "escoctal": y, + // \11 + "escunicodeu": y, + // \uFFFF + "escunicodeub": y, + // \u{00A9} + "escunicodexb": y, + // \x{00A9} + "escsequence": y, + // \Q...\E + "eschexadecimal": y, + // \xFF + "esccontrolchar": y, + // \cA + "escoctalo": y, + // \o{377} // resolved to escoctal in lexer, no docs required + "escchar": y, + // \m (unrecognized escapes) // no reference documentation required + + // group: + "group": y, + // (foo) + "groupclose": y, + // ) + "noncapgroup": y, + // (?:foo) + "namedgroup": y, + // (?Pfoo) (?foo) (?'name'foo) + "atomic": y, + // (?>foo|bar) + "define": y, + // (?(DEFINE)foo) + "branchreset": y, + // (?|(a)|(b)) + + // lookaround: + "poslookbehind": y, + // (?<=foo) + "neglookbehind": y, + // (? \k'name' \k{name} (?P=name) \g{name} + "numref": y, + // \1 + "extnumref": y, + // \g{-1} \g{+1} \g{1} \g1 \g-1 + "recursion": y, + // (?R) (?0) \g<0> \g'0' + "numsubroutine": y, + // \g<1> \g'-1' (?1) (?-1) + "namedsubroutine": y, + // \g \g'name' (?&name) (?P>name) + + // quantifiers: + // also in specialChars + "quant": y, + // {1,2} + "possessive": y, + // ++ + "lazy": y, + // ? + + // special: + "conditional": y, + // (?(?=if)then|else) + "condition": y, + // (?=if) any lookaround + "conditionalelse": y, + // | + "conditionalgroup": y, + // (?(1)a|b) (?(-1)a|b) (?(name)a|b) + "mode": y, + // (?i-x) see modes above + "comment": y, + // (?#comment) + + // meta: + "matchanyset": y // [\s\S] + }, + substTokens: { + // named references aren't supported in JS or PCRE / PHP + "subst_$esc": y, + // $$ + "subst_$&match": y, + // $& + "subst_$before": y, + // $` + "subst_$after": y, + // $' + "subst_$group": y, + // $1 $99 // resolved to subst_group in lexer, no docs required + "subst_$bgroup": y, + // ${1} ${99} // resolved to subst_group in lexer, no docs required + "subst_bsgroup": y, + // \1 \99 // resolved to subst_group in lexer, no docs required + "subst_group": y, + // $1 \1 \{1} // combined in docs, not used by lexer + "subst_0match": y, + // $0 \0 \{0} + + // this isn't a feature of the engine, but of RegExr: + "subst_esc": y // \n \r \u1234 + }, + config: { + "forwardref": y, + // \1(a) + "nestedref": y, + // (\1a|b)+ + "ctrlcodeerr": y, + // does \c error? (vs decompose) + "reftooctalalways": y, + // does a single digit reference \1 become an octal? (vs remain an unmatched ref) + "substdecomposeref": y, + // will a subst reference decompose? (ex. \3 becomes "\" & "3" if < 3 groups) + "looseesc": y, + // should unrecognized escape sequences match the character (ex. \u could match "u") // disabled when `u` flag is set + "unicodenegated": y, + // \p{^etc}" + "namedgroupalt": y // if false, only support (?foo) + }, + docs: { + // for example: + //possessive: {desc: "+This will be appended to the existing entry." }, + //namedgroup: {tip: "This will overwrite the existing entry." } + } + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + /* + The PCRE profile is almost a straight copy of the core profile. + */ + let y$1 = true, + n$1 = false; + let pcre = { + id: "pcre", + label: "PCRE", + browser: false, + flags: { + "u": n$1, + "y": n$1 + }, + badEscChars: "uUlLN".split("").reduce((o, c) => { + o[c] = y$1; + return o; + }, {}), + escCharCodes: { + "v": n$1 // vertical tab // PCRE support \v as vertical whitespace + }, + tokens: { + "escunicodeu": n$1, + // \uFFFF + "escunicodeub": n$1 // \u{00A9} + // octalo PCRE 8.34+ + }, + substTokens: { + "subst_$esc": n$1, + // $$ + "subst_$&match": n$1, + // $& + "subst_$before": n$1, + // $` + "subst_$after": n$1 // $' + }, + config: { + "reftooctalalways": n$1, + // does a single digit reference \1 become an octal? (vs remain an unmatched ref) + "substdecomposeref": n$1, + // will a subst reference decompose? (ex. \3 becomes "\" & "3" if < 3 groups) + "looseesc": n$1 // should unrecognized escape sequences match the character (ex. \u could match "u") // disabled when `u` flag is set + }, + docs: { + "escoctal": { + ext: "+

    The syntax \\o{FFF} is also supported.

    " + }, + "numref": { + ext: "

    There are multiple syntaxes for this feature: \\1 \\g1 \\g{1}.

    " + "

    The latter syntaxes support relative values preceded by + or -. For example \\g-1 would match the group preceding the reference.

    " + }, + "lazy": { + ext: "+

    This behaviour is reversed by the ungreedy (U) flag/modifier.

    " + } + } + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + /* + The javascript profile disables a large number of features. + + Note that JS warnings are currently added in addJSWarnings in the ExpresssionLexer. + */ + + let n$2 = false; + function test(expr, flag) { + try { + return new RegExp(expr, flag) && undefined; + } catch (e) { + return n$2; + } + } + function testFlag(flag) { + return test(".", flag); + } + let unicodeFlag = testFlag("u"); + let stickyFlag = testFlag("y"); + let dotallFlag = testFlag("s"); + let lookbehind = test("(?<=A)"); + let namedgroup = test("(?B)"); + let unicodecat = test("\\p{Ll}", "u"); // disabled when `u` flag is not set + + let javascript = { + id: "js", + label: "JavaScript", + browser: true, + flags: { + "s": dotallFlag, + // warning + "x": n$2, + "u": unicodeFlag, + // warning + "y": stickyFlag, + // warning + "U": n$2 + }, + escCharCodes: { + "a": n$2, + // bell + "e": n$2 // escape + }, + escCharTypes: { + "A": n$2, + // bos + "G": n$2, + // prevmatchend + "h": n$2, + // hwhitespace + "H": n$2, + // nothwhitespace + "K": n$2, + // keepout + "N": n$2, + // notlinebreak + "R": n$2, + // newline + "v": n$2, + // vwhitespace + "V": n$2, + // notvwhitespace + "X": n$2, + // unicodegrapheme + "Z": n$2, + // eos + "z": n$2 // abseos + }, + unicodeScripts: unicodecat, + unicodeCategories: unicodecat, + posixCharClasses: n$2, + modes: n$2, + tokens: { + // classes: + // also in escCharSpecials and specialChars + "unicodecat": unicodecat, + // \p{Ll} \P{^Ll} \pL + "notunicodecat": unicodecat, + // \P{Ll} \p{^Ll} \PL + "unicodescript": unicodecat, + // \p{Cherokee} \P{^Cherokee} + "notunicodescript": unicodecat, + // \P{Cherokee} \p{^Cherokee} + "posixcharclass": n$2, + // [[:alpha:]] + + // esc: + // also in escCharCodes and escCharSpecials + "escunicodeub": unicodeFlag, + // \u{00A9} + "escunicodexb": n$2, + // \x{00A9} + "escsequence": n$2, + // \Q...\E + "escoctalo": n$2, + // \o{377} + + // group: + "namedgroup": namedgroup, + // (?Pfoo) (?foo) (?'name'foo) + "atomic": n$2, + // (?>foo|bar) + "define": n$2, + // (?(DEFINE)foo) + "branchreset": n$2, + // (?|(a)|(b)) + + // lookaround: + "poslookbehind": lookbehind, + // (?<=foo) // warning + "neglookbehind": lookbehind, + // (? \k'name' \k{name} (?P=name) \g{name} + "extnumref": n$2, + // \g{-1} \g{+1} \g{1} \g1 \g-1 + "recursion": n$2, + // (?R) (?0) \g<0> \g'0' + "numsubroutine": n$2, + // \g<1> \g'-1' (?1) (?-1) + "namedsubroutine": n$2, + // \g \g'name' (?&name) (?P>name) + + // quantifiers: + // also in specialChars + "possessive": n$2, + // special: + "conditional": n$2, + // (?(?=if)then|else) + "conditionalif": n$2, + // (?=if) any lookaround + "conditionalelse": n$2, + // | + "conditionalgroup": n$2, + // (?(1)a|b) (?(-1)a|b) (?(name)a|b) + "mode": n$2, + // (?i-x) see modes above + "comment": n$2 // (?#comment) + }, + config: { + "forwardref": n$2, + // \1(a) + "nestedref": n$2, + // (\1a|b)+ + "ctrlcodeerr": n$2, + // does \c error, or decompose? + "unicodenegated": n$2, + // \p{^etc} + "namedgroupalt": n$2 // if false, only support (?foo) + }, + substTokens: { + "subst_0match": n$2, + // $0 \0 \{0} + "subst_$bgroup": n$2, + // ${1} ${99} + "subst_bsgroup": n$2 // \1 \99 + }, + docs: { + "subst_group": { + ext: "" + }, + // remove other syntaxes. + "namedgroup": { + ext: "" + }, + // remove other syntaxes. + "unicodecat": { + ext: "

    Requires the u flag.

    " + "

    For a list of values, see this MDN page.

    " + } + // notunicodecat, unicodescript, notunicodescript are copied from unicodecat below. + } + }; + javascript.docs.notunicodecat = javascript.docs.unicodescript = javascript.docs.notunicodescript = javascript.docs.unicodecat; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + let profiles = { + core + }; + profiles.pcre = merge(core, pcre); + profiles.js = merge(core, javascript); + function merge(p1, p2) { + // merges p1 into p2, essentially just a simple deep copy without array support. + for (let n in p1) { + if (p2[n] === false) { + continue; + } else if (typeof p1[n] === "object") { + p2[n] = merge(p1[n], p2[n] || {}); + } else if (p2[n] === undefined) { + p2[n] = p1[n]; + } + } + return p2; + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Expression extends EventDispatcher { + constructor(el) { + super(); + this.el = el; + this.delim = "/"; + this.lexer = new ExpressionLexer(); + this._initUI(el); + app.flavor.on("change", () => this._onFlavorChange()); + this._onFlavorChange(); + } + set value(expression) { + let regex = Utils.decomposeRegEx(expression || Expression.DEFAULT_EXPRESSION, this.delim); + this.pattern = regex.source; + this.flags = regex.flags; + } + get value() { + return this.editor.getValue(); + } + set pattern(pattern) { + let index = this.editor.getValue().lastIndexOf(this.delim); + this.editor.replaceRange(pattern, { + line: 0, + ch: 1 + }, { + line: 0, + ch: index + }); + this._deferUpdate(); + } + get pattern() { + return Utils.decomposeRegEx(this.editor.getValue(), this.delim).source; + } + set flags(flags) { + flags = app.flavor.validateFlagsStr(flags); + let str = this.editor.getValue(), + index = str.lastIndexOf(this.delim); + this.editor.replaceRange(flags, { + line: 0, + ch: index + 1 + }, { + line: 0, + ch: str.length + }); // this doesn't work if readOnly is false. + } + get flags() { + return Utils.decomposeRegEx(this.editor.getValue(), this.delim).flags; + } + get token() { + return this.lexer.token; + } + showFlags() { + this.flagsList.selected = this.flags.split(""); + app.tooltip.toggle.toggleOn("flags", this.flagsEl, this.flagsBtn, true, -2); + } + toggleFlag(s) { + let flags = this.flags, + i = flags.indexOf(s); + this.flags = i >= 0 ? flags.replace(s, "") : flags + s; + } + showFlavors() { + app.tooltip.toggle.toggleOn("flavor", this.flavorEl, this.flavorBtn, true, -2); + } + insert(str) { + this.editor.replaceSelection(str, "end"); + } + selectAll() { + CMUtils.selectAll(this.editor); + } + + // private methods: + _initUI(el) { + this.editorEl = DOMUtils.query("> .editor", el); + let editor = this.editor = CMUtils.create(this.editorEl, { + autofocus: true, + maxLength: 2500, + singleLine: true + }, "100%", "100%"); + editor.on("mousedown", (cm, evt) => this._onEditorMouseDown(cm, evt)); + editor.on("change", (cm, evt) => this._onEditorChange(cm, evt)); + editor.on("keydown", (cm, evt) => this._onEditorKeyDown(cm, evt)); + // hacky method to disable overwrite mode on expressions to avoid overwriting flags: + editor.toggleOverwrite = () => {}; + this.errorEl = DOMUtils.query(".icon.alert", this.editorEl); + this.errorEl.addEventListener("mouseenter", evt => this._onMouseError(evt)); + this.errorEl.addEventListener("mouseleave", evt => this._onMouseError(evt)); + this.highlighter = new ExpressionHighlighter(editor); + this.hover = new ExpressionHover(editor, this.highlighter); + this._setInitialExpression(); + this._initTooltips(el); + this.value = Expression.DEFAULT_EXPRESSION; + } + _setInitialExpression() { + let editor = this.editor; + editor.setValue("/./g"); + + // leading / + editor.getDoc().markText({ + line: 0, + ch: 0 + }, { + line: 0, + ch: 1 + }, { + className: "exp-decorator", + readOnly: true, + atomic: true, + inclusiveLeft: true + }); + + // trailing /g + editor.getDoc().markText({ + line: 0, + ch: 2 + }, { + line: 0, + ch: 4 + }, { + className: "exp-decorator", + readOnly: false, + atomic: true, + inclusiveRight: true + }); + this._deferUpdate(); + } + _deferUpdate() { + Utils.defer(() => this._update(), "Expression._update"); + } + _update() { + let expr = this.editor.getValue(); + this.lexer.profile = app.flavor.profile; + let token = this.lexer.parse(expr); + DOMUtils.toggleClass(this.editorEl, "error", !!this.lexer.errors.length); + this.hover.token = token; + this.highlighter.draw(token); + this.dispatchEvent("change"); + } + _initTooltips(el) { + const template = DOMUtils.template` ${"label"}`; + let flavorData = app.flavor.profiles.map(o => ({ + id: o.id, + label: o.label + " (" + (o.browser ? "Browser" : "Server") + ")" + })); + this.flavorBtn = DOMUtils.query("section.expression .button.flavor", el); + this.flavorEl = DOMUtils.query("#library #tooltip-flavor"); + this.flavorList = new List(DOMUtils.query("ul.list", this.flavorEl), { + data: flavorData, + template + }); + this.flavorList.on("change", () => this._onFlavorListChange()); + this.flavorBtn.addEventListener("click", evt => this.showFlavors()); + DOMUtils.query(".icon.help", this.flavorEl).addEventListener("click", () => app.sidebar.goto("engine")); + this.flagsBtn = DOMUtils.query("section.expression .button.flags", el); + this.flagsEl = DOMUtils.query("#library #tooltip-flags"); + this.flagsList = new List(DOMUtils.query("ul.list", this.flagsEl), { + data: [], + multi: true, + template + }); + this.flagsList.on("change", () => this._onFlagListChange()); + this.flagsBtn.addEventListener("click", evt => this.showFlags()); + DOMUtils.query(".icon.help", this.flagsEl).addEventListener("click", () => app.sidebar.goto("flags")); + } + + // event handlers: + _onFlavorListChange() { + app.tooltip.toggle.hide("flavor"); + app.flavor.value = this.flavorList.selected; + Track.page("flavor/" + this.flavorList.selected); + } + _onFlagListChange() { + let sel = this.flagsList.selected; + this.flags = sel ? sel.join("") : ""; + Track.event("set_flags", "engagement", this.flags); + } + _onFlavorChange() { + let flavor = app.flavor, + profile = flavor.profile; + this.flavorList.selected = profile.id; + DOMUtils.query("> .label", this.flavorBtn).innerText = profile.label; + let supported = Expression.FLAGS.split("").filter(n => !!profile.flags[n]); + let labels = Expression.FLAG_LABELS; + this.flagsList.data = supported.map(n => ({ + id: n, + label: labels[n] + })); + this.flags = this.flags.split("").filter(n => !!profile.flags[n]).join(""); + } + _onEditorMouseDown(cm, evt) { + // offset by half a character to make accidental clicks less likely: + let index = CMUtils.getCharIndexAt(cm, evt.clientX - cm.defaultCharWidth() * 0.6, evt.clientY); + if (index >= cm.getValue().lastIndexOf(this.delim)) { + this.showFlags(); + } + } + _onEditorChange(cm, evt) { + // catches pasting full expressions in. + // TODO: will need to be updated to work with other delimeters + this._deferUpdate(); + let str = evt.text[0]; + if (str.length < 3 || !str.match(/^\/.+[^\\]\/[a-z]*$/ig) || evt.from.ch !== 1 || evt.to.ch != 1 + evt.removed[0].length) { + // not pasting a full expression. + return; + } + this.value = str; + } + _onEditorKeyDown(cm, evt) { + // Ctrl or Command + D by default, will delete the expression and the flags field, Re: https://github.com/gskinner/regexr/issues/74 + // So we just manually reset to nothing here. + if ((evt.ctrlKey || evt.metaKey) && evt.keyCode == 68) { + evt.preventDefault(); + this.pattern = ""; + } + } + _onMouseError(evt) { + let tt = app.tooltip.hover, + errs = this.lexer.errors; + if (evt.type === "mouseleave") { + return tt.hide("error"); + } + if (errs.length === 0) { + return; + } + let err = errs.length === 1 && errs[0].error; + let str = err ? app.reference.getError(err, errs[0]) : "Problems in the Expression are underlined in red. Roll over them for details."; + let label = err && err.warning ? "WARNING" : "PARSE ERROR"; + tt.showOn("error", "" + label + ": " + str, this.errorEl); + } + } + Expression.DEFAULT_EXPRESSION = "/(Erst|Zweit)versuch/g"; + Expression.FLAGS = "gimsuxyU"; // for flag order + Expression.FLAG_LABELS = { + "g": "global", + "i": "case insensitive", + "m": "multiline", + "s": "single line (dotall)", + "u": "unicode", + "x": "extended", + "y": "sticky", + "U": "Ungreedy" + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + let UID = { + _next: 0, + get id() { + return Date.now() + "_" + this._next++; + }, + assign(list, force = false) { + list.forEach(o => o.id = o.id == null || force ? this.id : o.id); + } + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class TextHighlighter { + constructor(editor, canvas, fill = "#6CF", stroke = "#888") { + this.lineSpacing = 2; + this.capWidth = 4; + this.lastBottom = -1; + this.lastRight = -1; + this.editor = editor; + this.canvas = canvas; + this.fill = fill; + this.stroke = stroke; + } + set matches(val) { + this._matches = val; + this._deferUpdate(); + } + set hoverMatch(val) { + this._hoverMatch = val; + this._deferUpdate(); + } + set selectedMatch(val) { + this._selectedMatch = val; + this._deferUpdate(); + } + redraw() { + this._update(); + } + _deferUpdate() { + Utils.defer(() => this._update(), "TextHighlighter._update"); + } + _update() { + this.clear(); + let matches = this._matches, + hoverMatch = this._hoverMatch, + selectedMatch = this._selectedMatch; + if (!matches || !matches.length) { + return; + } + let cm = this.editor, + doc = cm.getDoc(); + let ctx = this.canvas.getContext("2d"); + ctx.fillStyle = this.fill; + ctx.strokeStyle = this.stroke; + ctx.lineWidth = 2; + + // find the range of the visible text: + let scroll = cm.getScrollInfo(); + let top = cm.indexFromPos(cm.coordsChar({ + left: 0, + top: scroll.top + }, "local")); + let bottom = cm.indexFromPos(cm.coordsChar({ + left: scroll.clientWidth, + top: scroll.top + scroll.clientHeight + }, "local")); + for (let i = 0, l = matches.length; i < l; i++) { + let match = matches[i], + start = match.i, + end = match.i + match.l - 1; + if (start > bottom) { + break; + } // all done. + if (end < top || end < start) { + continue; + } // not visible, so don't mark. + let startPos = match.startPos || (match.startPos = doc.posFromIndex(start)); + let endPos = match.endPos || (match.endPos = doc.posFromIndex(end)); + let emphasis = match === hoverMatch || match === selectedMatch; + let startRect = cm.charCoords(startPos, "local"), + endRect = cm.charCoords(endPos, "local"); + if (startRect.bottom === endRect.bottom) { + this.drawHighlight(ctx, startRect.left, startRect.top, endRect.right, endRect.bottom, scroll.top, false, false, emphasis); + } else { + let lw = cm.getScrollInfo().width, + lh = cm.defaultTextHeight(); + // render first line: + this.drawHighlight(ctx, startRect.left, startRect.top, lw - 2, startRect.bottom, scroll.top, false, true, emphasis); // startRect.top+lh + // render lines in between: + let y = startRect.top; + while ((y += lh) < endRect.top - 1) { + // the -1 is due to fractional issues on FF + this.drawHighlight(ctx, 0, y, lw - 2, y + startRect.bottom - startRect.top, scroll.top, true, true, emphasis); // lh + } + // render last line: + this.drawHighlight(ctx, 0, endRect.top, endRect.right, endRect.bottom, scroll.top, true, false, emphasis); + // CMUtils.getEOLPos(this.sourceCM, startPos); + } + } + } + drawHighlight(ctx, left, top, right, bottom, scrollY, startCap, endCap, emphasis) { + let capW = this.capWidth; + if (right < 0 || left + 1 >= right) { + return; + } // weird bug in CodeMirror occasionally returns negative values + left = left + 0.5 | 0; + right = right + 0.5 | 0; + top = (top + 0.5 | 0) + this.lineSpacing; + bottom = bottom + 0.5 | 0; + if (top + 1 > this.lastBottom) { + this.lastBottom = bottom; + } else if (left < this.lastRight) { + left = this.lastRight; + } + this.lastRight = right; + let a = ctx.globalAlpha; + if (startCap) { + ctx.globalAlpha = a * 0.5; + ctx.fillRect(left + 1 | 0, top - scrollY, capW + 1, bottom - top); + left += capW; + } + if (endCap) { + ctx.globalAlpha = a * 0.5; + ctx.fillRect(right - capW - 1 | 0, top - scrollY, capW + 1, bottom - top); + right -= capW; + } + ctx.globalAlpha = a; + ctx.fillRect(left + 1, top - scrollY, right - left - 1, bottom - top); + if (emphasis) { + ctx.strokeRect(left + 1, top - scrollY, right - left - 1, bottom - top); + } + } + clear() { + this.canvas.width = this.canvas.width; + this.lastBottom = -1; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class TextHover { + constructor(editor, highlighter) { + this.editor = editor; + this.highlighter = highlighter; + this._matches = this._x = null; + let o = editor.display.lineDiv; + o.addEventListener("mousemove", evt => this._handleMouseMove(evt)); + o.addEventListener("mouseout", evt => this._handleMouseOut(evt)); + } + set matches(val) { + this._matches = val; + this._update(); + } + + // private methods: + _handleMouseMove(evt) { + this._x = evt.clientX; + this._y = evt.clientY + window.pageYOffset; + this._update(); + } + _handleMouseOut(evt) { + this._x = null; + this._update(); + } + _update() { + if (this._x === null) { + this.highlighter.hoverMatch = null; + app.tooltip.hover.hide("TextHover"); + return; + } + let index, + cm = this.editor, + match, + matches = this._matches, + x = this._x, + y = this._y; + if (matches && matches.length && (index = CMUtils.getCharIndexAt(cm, x, y)) != null) { + match = this.highlighter.hoverMatch = app.text.getMatchAt(index); + } + let rect = index != null && CMUtils.getCharRect(cm, index); + if (rect) { + rect.right = rect.left = x; + } + let tip = app.reference.tipForMatch(match, cm.getValue()); + if (tip) { + let div = DOMUtils.create("div", "texthover", tip); + app.tooltip.hover.show("TextHover", div, x, rect.bottom, true, 0); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Text extends EventDispatcher { + constructor(el) { + super(); + this.el = el; + this._initUI(el); + this._initTestUI(el); + app.on("result", () => this._setResult(app.result)); + app.theme.on("change", () => this._handleThemeChange()); + } + set value(val) { + this.editor.setValue(val || this.defaultText); + } + get value() { + return this.editor.getValue(); + } + set tests(val) { + if (!(val instanceof Array)) { + val = []; + DOMUtils.removeClass(this.testsEl, "tests-added"); + } + this._tests = this.testList.data = val; + this._testMatches = null; + this._reselectTest(); + } + get tests() { + return this._tests; + } + set mode(val) { + if (val === this.mode) { + return; + } + this.modeList.selected = val || "text"; + this._handleModeChange(); + } + get mode() { + return this.modeList.selected; + } + get selectedMatch() { + let cm = this.editor; + return this.getMatchAt(cm.indexFromPos(cm.getCursor()), true); + } + getMatchValue(match) { + // this also works for groups. + return match ? this.value.substr(match.i, match.l) : null; + } + getMatchAt(index, inclusive) { + // also used by TextHover + let match, + offset = inclusive ? -1 : 0, + matches = this._result && this._result.matches; + if (!matches) { + return null; + } + for (let i = 0, l = matches.length; i < l; i++) { + match = matches[i]; + if (match.l + match.i - 1 < index + offset) { + continue; + } + if (match.i > index) { + break; + } + return match; + } + return null; + } + getEmptyTest() { + return { + id: UID.id, + name: "", + text: "Enter your test text here.", + type: "any" + }; + } + + // private methods: + _initUI(el) { + this.resultEl = DOMUtils.query("> header .result", el); + this.resultEl.addEventListener("mouseenter", evt => this._mouseResult(evt)); + this.resultEl.addEventListener("mouseleave", evt => this._mouseResult(evt)); + this.modeListEl = DOMUtils.query("> header .modelist", el); + let data = ["Text"].map(val => ({ + label: val, + id: val.toLowerCase() + })); + this.modeList = new List(this.modeListEl, { + data + }); + this.modeList.on("change", () => this._handleModeChange()); + this.modeList.selected = "text"; + let textEl = DOMUtils.query(".editor > .pad", el); + this.defaultText = DOMUtils.query("textarea", textEl).value; + let editor = this.editor = CMUtils.create(DOMUtils.empty(textEl), { + lineWrapping: true + }, "100%", "100%"); + editor.setValue(this.defaultText); + editor.on("change", () => this._change()); + editor.on("scroll", () => this._update()); + editor.on("cursorActivity", () => this._updateSelected()); + let detector = DOMUtils.create("iframe", "resizedetector", null, textEl), + win = detector.contentWindow; + let canvas = this.canvas = DOMUtils.create("canvas", "highlights", null, textEl); + textEl.appendChild(editor.display.wrapper); // move the editor on top of the iframe & canvas. + + win.onresize = () => { + let w = win.innerWidth | 0, + h = win.innerHeight | 0; + this._startResize(); + Utils.defer(() => this._handleResize(w, h), "text_resize", 250); + }; + win.onresize(); + this.highlighter = new TextHighlighter(editor, canvas, DOMUtils.getCSSValue("match", "color"), DOMUtils.getCSSValue("selected-stroke", "color")); + this.hover = new TextHover(editor, this.highlighter); + } + _handleThemeChange() { + this.highlighter.fill = DOMUtils.getCSSValue("match", "color"); + this.highlighter.stroke = DOMUtils.getCSSValue("selected-stroke", "color"); + this.highlighter.redraw(); + } + _handleModeChange(evt) { + this.dispatchEvent("modechange"); + if (this.mode === "text") { + this.editor.refresh(); + } else { + DOMUtils.addClass(this.el, "tests-viewed"); + } + Track.page("mode/" + this.mode); + } + _setResult(val) { + this._result = val; + this._testMatches = null; + if (this.mode !== val.mode) { + return; + } + if (val.mode === "tests") { + this._updateTests(); + } else { + // mode === "text" + this._updateEmptyCount(); + this._updateResult(); + this._updateSelected(); + this._deferUpdate(); + } + } + _deferUpdate() { + Utils.defer(() => this._update(), "Text._update"); + } + _update() { + let result = this._result, + matches = result && result.matches; + if (result && result.mode === "tests") { + this._updateTests(); + } else { + // mode === "text" + this.hover.matches = this.highlighter.matches = matches; + } + } + _updateResult() { + let result = this._result, + matches = result && result.matches, + l = matches && matches.length, + text; + if (l && result && !result.error) { + text = l + " match" + (l > 1 ? "es" : "") + (this._emptyCount ? "*" : ""); + } else if (!result || !result.error) { + text = "No match"; + } + this._showResult(text); + } + _showResult(text, clss) { + let result = this._result, + el = this.resultEl; + DOMUtils.removeClass(el, "error warning matches pass fail"); + if (result && result.error) { + if (!text) { + text = result.error.warning ? "WARNING" : "ERROR"; + } + DOMUtils.addClass(el, "error"); + if (result.error.warning) { + DOMUtils.addClass(el, "warning"); + } + } + if (clss) { + DOMUtils.addClass(el, clss); + } + el.innerHTML = text; + if (result.time != null) { + el.innerHTML += " (" + parseFloat(result.time).toFixed(1) + "ms)"; + } + } + _updateSelected() { + let match = this.selectedMatch; + if (this.highlighter.selectedMatch === match) { + return; + } + this.highlighter.selectedMatch = match; + this.dispatchEvent("select"); + } + _change() { + this.dispatchEvent("change"); + } + _startResize() { + let canvas = this.canvas, + style = canvas.style; + style.visibility = "hidden"; + style.opacity = 0; + // keeps it from causing scrollbars: + canvas.width = canvas.height = 1; + } + _mouseResult(evt) { + let tt = app.tooltip.hover, + res = this._result, + err = res && res.error, + str = ""; + if (evt.type === "mouseleave") { + return tt.hide("result"); + } + if (err && !err.warning) { + str = "EXEC ERROR: " + this._errorText(err); + } else { + if (err && err.warning) { + str = "WARNING: " + this._errorText(err) + "
    "; + } + let l = this._tests.length; + if (this.mode === "tests") { + if (this._tests.length === 0) { + str += "Use the 'Add Test' button to create a new test."; + } else if (this._testFails) { + str += this._testFails + " out of " + l + " tests failed."; + } else { + str += "All " + l + " tests passed."; + } + } else { + str += (l || "No") + " match" + (l > 1 ? "es" : "") + " found in " + this.value.length + " characters"; + str += this._emptyCount ? ", including " + this._emptyCount + " empty matches (* not displayed)." : "."; + let cm = this.editor, + sel = cm.listSelections()[0], + pos = sel.head; + let i0 = cm.indexFromPos(pos), + i1 = cm.indexFromPos(sel.anchor), + range = Math.abs(i0 - i1); + str += "
    Insertion point: line " + pos.line + ", col " + pos.ch + ", index " + i0; + str += range > 0 ? " (" + range + " character" + (range === 1 ? "" : "s") + " selected)" : ""; + } + } + tt.showOn("result", str, this.resultEl, false, -2); + } + _updateEmptyCount() { + let result = this._result, + matches = result && result.matches; + this._emptyCount = matches ? matches.reduce((v, o) => v + (o.l ? 0 : 1), 0) : 0; + } + _errorText(err) { + return err.message || app.reference.getError(err); + } + _handleResize(w, h) { + let canvas = this.canvas, + style = canvas.style; + style.visibility = style.opacity = ""; + canvas.width = w; + canvas.height = h; + this.editor.refresh(); + this._deferUpdate(); + } + + // Test mode: + _initTestUI(el) { + const types = [{ + id: "all", + label: "Match Full" + }, { + id: "any", + label: "Match Any" + }, + // {id:"start", label:"Match Start"}, + { + id: "none", + label: "Match None" + }]; + this.typeLabels = types.reduce((o, t) => { + o[t.id] = t.label; + return o; + }, {}); + this.testsEl = DOMUtils.query(".tests", el); + this.testItemEl = DOMUtils.query("#library > #tests_item"); + this.testListEl = DOMUtils.query(".list", this.testsEl); + this.testList = new List(this.testListEl, { + template: o => this._testItemTemplate(o) + }); + this.testList.scrollEl = this.testsEl; + this.testList.on("change", evt => this._handleTestChange(evt)); + DOMUtils.on(DOMUtils.queryAll(".button.add", el), "click", () => this._addTest()); + const template = DOMUtils.template` ${"label"}`; + this.typesEl = DOMUtils.query("#library #tooltip-testtypes"); + this.typesList = new List(DOMUtils.query("ul.list", this.typesEl), { + data: types, + template + }); + this.typesList.on("change", () => this._handleTypesChange()); + this.tests = null; + } + _updateTests() { + let result = this._result; + if (result.error) { + return this._showResult(); + } + let data = this._tests, + l = data.length; + if (!data || !l) { + return this._showResult("No tests."); + } + let matches = result.matches.reduce((o, t) => { + o[t.id] = t; + return o; + }, {}), + fails = 0; + for (let i = 0; i < l; i++) { + let test = data[i], + match = matches[test.id], + pass = false, + el = this.testList.getEl(test.id); + if (test.type === "none") { + pass = match.i == null; + } else if (test.type === "all") { + pass = match.l === test.text.length; + } else if (test.type === "start") { + pass = match.i === 0; + } else { + // any + pass = match.i != null; + } + DOMUtils.toggleClass(el, "fail", !pass); + if (!pass) { + fails++; + } + } + this._testFails = fails; + this._testMatches = matches; + if (fails) { + this._showResult(fails + " FAILED", "fail"); + } else { + this._showResult("PASSED", "pass"); + } + this._updateSelTest(); + } + _updateSelTest() { + if (this._testMark) { + this._testMark.clear(); + } + let matches = this._testMatches, + el = this.testList.selectedEl; + if (!el || !matches) { + return; + } + let match = matches[this.testList.selected], + cm = this.testEditor; + if (match && match.i != null) { + let pos = CMUtils.calcRangePos(cm, match.i, match.l); + this._testMark = this.testEditor.getDoc().markText(pos.startPos, pos.endPos, { + className: "match" + }); + } + } + _testItemTemplate(o) { + let el = this.testItemEl.cloneNode(true); + let typeBtn = DOMUtils.query("header .button.type", el); + typeBtn.addEventListener("click", evt => this._showTypes(typeBtn, o)); + let delBtn = DOMUtils.query("header .delete", el); + delBtn.addEventListener("click", evt => this._deleteTest(o)); + let nameFld = DOMUtils.query("header .name", el); + nameFld.addEventListener("input", () => this._handleTestNameChange(nameFld, o)); + this._updateTestHeader(o, el, false); + return el; + } + _updateTestHeader(o, el, edit) { + let nameFld = DOMUtils.query("header .name", el); + nameFld.value = o.name || ""; + nameFld.placeholder = o.text && !edit ? o.text.substr(0, 100) : "Untitled Test"; + let typeLbl = DOMUtils.query("header .button.type .label", el); + typeLbl.innerText = this.typeLabels[o.type]; + } + _addTest() { + const o = this.getEmptyTest(); + this._tests.push(o); + this.testList.addItem(o, true); + this._handleTestChange(); + this.testEditor.execCommand("selectAll"); + DOMUtils.addClass(this.testsEl, "tests-added"); + this._change(); + } + _reselectTest() { + if (this._selTest) { + this.testList.selected = this._selTest.id; + } + if (!this._selTest || this.testList.selected == null) { + this.testList.selectedIndex = 0; + } + this._selTest = null; + this._handleTestChange(); + } + _handleTestChange() { + let el, o; + if (this._selTest) { + o = this._selTest; + el = this.testList.getEl(o.id); + this._updateTestHeader(o, el, false); + } + el = this.testList.selectedEl; + o = this._selTest = this.testList.selectedItem; + if (!o) { + return; + } + this._getTestEditor(DOMUtils.query("article .editor .pad", el), o); + this._updateTestHeader(o, el, true); + this._updateSelTest(); + this.testEditor.focus(); + this.testEditor.setCursor(this.testEditor.lineCount(), 0); + } + _handleTestNameChange(fld, o) { + o.name = fld.value; + this._change(); + } + _handleTypesChange() { + let el = this.testList.selectedEl, + o = this.testList.selectedItem; + o.type = this.typesList.selectedItem.id; + app.tooltip.toggle.hide("testtypes"); + this._updateTestHeader(o, el, true); + this._change(); + } + _handleTestTextChange(change) { + this._selTest.text = this.testEditor.getValue(); + if (change.origin !== "setValue") { + this._change(); + } + } + _showTypes(el, o) { + this.typesList.selected = o.type; + app.tooltip.toggle.toggleOn("testtypes", this.typesEl, el, true, -2); + } + _deleteTest(o) { + let data = this._tests; + let i = data.indexOf(o); + data.splice(i, 1); + this._selTest = null; + this.testList.removeItem(o.id); + if (data.length) { + this.testList.selected = data[Math.min(i, data.length - 1)].id; + } + this._updateTests(); + this._handleTestChange(); + this._change(); + } + _getTestEditor(el, o) { + let cm = this.testEditor; + if (!cm) { + cm = this.testEditor = CMUtils.create(DOMUtils.empty(el), { + lineWrapping: true + }, "100%", "100%"); + cm.on("change", (a, b) => this._handleTestTextChange(b)); + } else { + el.appendChild(cm.getWrapperElement()); + } + cm.setValue(o.text); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Explain { + constructor(el) { + this.el = el; + DOMUtils.addClass(el, "explain"); + this._update(); + this._bound_handleEvent = evt => this._handleEvent(evt); + app.expression.addEventListener("change", this._bound_handleEvent); + app.expression.highlighter.addEventListener("hover", this._bound_handleEvent); + } + cleanup() { + DOMUtils.empty(this.el); + DOMUtils.removeClass(this.el, "explain"); + app.expression.removeEventListener("change", this._bound_handleEvent); + app.expression.highlighter.removeEventListener("hover", this._bound_handleEvent); + } + + // private methods: + _update() { + let el = DOMUtils.empty(this.el), + token = app.expression.token, + expr = app.expression.value; + this._divs = []; + if (!token || token.next.type === "close") { + el.innerHTML = "Enter an Expression above and it will be explained here."; + return; + } + el.innerHTML = "Roll-over elements below to highlight in the Expression above. Click to open in Reference."; + while ((token = token.next) && token.type !== "close") { + if (token.proxy || token.open && token.open.proxy) { + continue; + } + let groupClasses = ExpressionHighlighter.GROUP_CLASS_BY_TYPE, + pre = ExpressionHighlighter.CSS_PREFIX; + let i = token.i, + end = token.i + token.l, + content = expr.substring(i, end).replace("<", "<"); + if (token.set) { + let set0 = token.set[0], + set2 = token.set[2]; + content = "" + expr.substring(set0.i, set0.i + set0.l) + ""; + content += expr.substring(i, end); + content += "" + expr.substring(set2.i, set2.i + set2.l) + ""; + } + let className = pre + (token.clss || token.type); + content = "" + content + " "; + if (!token.open) { + content += app.reference.tipForToken(token); + } else { + content += " "; + } + let div = DOMUtils.create("div", null, content, el); + if (token.close) { + className = groupClasses[token.clss || token.type]; + if (className) { + className = className.replace("%depth%", Math.min(4, token.depth)); + DOMUtils.addClass(div, className); + } + if (token.depth > 3) { + div.innerHTML = "So... you wanted to see what would happen if you just kept nesting groups, eh? Well, this is it." + " I was going to reward your curiosity with a RegEx joke, but a quick search on google reveals that not even" + " the collective wisdom of the internet can make regular expressions funny. Well, except the whole 'now you've got two problems'" + " shtick, but you've probably heard that one already. Wasn't really worth the effort, was it?"; + token = token.close.prv; + this._divs.push(div); + el = div; + continue; + } + el = div; + } + div.token = token; + if (token.open) { + DOMUtils.addClass(div, "close"); + div.proxy = el; + el = el.parentNode; + } + if (token.error) { + DOMUtils.addClass(div, "error"); + if (token.error.warning) { + DOMUtils.addClass(div, "warning"); + } + } + if (!token.open) { + div.addEventListener("mouseover", this._handleMouseEvent); + div.addEventListener("mouseout", this._handleMouseEvent); + div.addEventListener("click", this._handleMouseEvent); + } + if (token.clss === "quant" || token.type === "lazy" || token.type === "possessive") { + this._insertApplied(div); + } else { + this._divs.push(div); + } + } + } + _insertApplied(div) { + let divs = this._divs, + prv = div.token.prv, + d, + i = divs.length; + while ((d = divs[--i]) && d.token !== prv) {} // search backwards for efficiency + d = d.proxy || d; + divs.splice(i, 0, div); + d.insertAdjacentElement("afterend", div); + DOMUtils.addClass(div, "applied"); + } + _handleHoverChange() { + let token = app.expression.highlighter.hoverToken; + DOMUtils.removeClass(DOMUtils.queryAll("div.selected", this.el), "selected"); + DOMUtils.removeClass(DOMUtils.queryAll("div.related", this.el), "related"); + if (!token) { + return; + } + let div = this._findDiv(token); + DOMUtils.addClass(div, "selected"); + if (token.related) { + for (let i = 0, l = token.related.length; i < l; i++) { + DOMUtils.addClass(this._findDiv(token.related[i]), "related"); + } + } + } + _findDiv(token) { + return Utils.find(this._divs, div => div.token === token); + } + _handleMouseEvent(evt) { + let type = evt.type, + token = evt.currentTarget.token; + if (type == "click") { + app.sidebar.showToken(token); + } else { + app.expression.highlighter.hoverToken = type === "mouseout" ? null : token; + } + evt.stopPropagation(); + } + _handleEvent(evt) { + if (evt.type === "change") { + this._update(); + } else if (evt.type === "hover") { + this._handleHoverChange(); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Details { + constructor(el) { + this.el = el; + DOMUtils.addClass(el, "details"); + this._update(); + this._bound_handleEvent = evt => this._handleEvent(evt); + app.addEventListener("result", this._bound_handleEvent); + app.text.addEventListener("select", this._bound_handleEvent); + } + cleanup() { + DOMUtils.empty(this.el); + DOMUtils.removeClass(this.el, "details"); + app.removeEventListener("result", this._bound_handleEvent); + app.text.removeEventListener("select", this._bound_handleEvent); + Utils.defer(null, "Details._update"); + } + + // private methods: + _update() { + DOMUtils.empty(this.el); + DOMUtils.create("div", "desc", "Click a match above to display match & group details. Mouse over a Group row to highlight it in the Expression.", this.el); + this._addMatch(app.text.selectedMatch, app.text.value); + } + _addMatch(match, textVal) { + if (!match) { + return; + } + let groups = match.groups, + l = groups && groups.length, + ext = l && groups[0].i != null, + matchVal = this._getMatchVal(match, textVal), + extStr = "", + me = match.i + match.l; + let groupTokens = app.expression.lexer.captureGroups; + let tableEl = DOMUtils.create("table", null, null, this.el); + let matchEl = DOMUtils.create("tr", "match", "Match " + match.num + "" + this._getRangeStr(match) + "", tableEl); + if (l) { + let inGroups = [], + lastIndex = match.i; + for (let i = 0; i <= l; i++) { + let group = groups[i], + index = group ? group.i : me, + num = i + 1, + token = groupTokens[i]; + if (ext) { + for (let j = inGroups.length - 1; j >= 0; j--) { + let inGroup = inGroups[j], + ge = inGroup.i + inGroup.l; + if (ge > index) { + break; + } + inGroups.pop(); + extStr += Utils.htmlSafe(textVal.substring(lastIndex, ge)) + ""; + lastIndex = ge; + } + } + if (!group) { + break; + } + if (group.l) { + extStr += Utils.htmlSafe(textVal.substring(lastIndex, index)) + ""; + inGroups.push(group); + lastIndex = index; + } + let val = "" + this._getMatchVal(group, textVal) + ""; + let label = token.name ? "'" + token.name + "'" : "Group " + num; + let tr = DOMUtils.create("tr", "group", "" + label + "" + this._getRangeStr(group) + "" + val + "", tableEl); + tr.token = token; + tr.addEventListener("mouseover", this._handleMouseEvent); + tr.addEventListener("mouseout", this._handleMouseEvent); + } + if (ext) { + extStr += Utils.htmlSafe(textVal.substring(lastIndex, me)); + } + } else { + DOMUtils.create("tr", "nogroup", "No groups.", tableEl); + } + DOMUtils.query("td:last-child", matchEl).innerHTML = extStr || matchVal; + } + _getMatchVal(match, str) { + let val = match.s || (match.i === undefined ? "" : str.substr(match.i, match.l)); + return val ? Utils.htmlSafe(val) : "<empty>"; + } + _getRangeStr(match) { + // we could check for match.l>0 to catch empty matches, but having a weird range might be more accurate. + return match.i != null ? match.i + "-" + (match.i + match.l - 1) : "n/a"; + } + _handleEvent(evt) { + Utils.defer(() => this._update(), "Details._update"); + } + _handleMouseEvent(evt) { + let type = evt.type, + token = evt.currentTarget.token; + app.expression.highlighter.hoverToken = type === "mouseout" ? null : token; + if (type === "mouseover") { + DOMUtils.addClass(DOMUtils.query("span.num-" + token.num, this.el), "hover"); + } else { + DOMUtils.removeClass(DOMUtils.query("span.hover", this.el), "hover"); + } + evt.stopPropagation(); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Replace { + constructor(el, cm) { + this.el = el; + this.editor = cm; + this._bound_handleEvent = evt => this._handleEvent(evt); + app.addEventListener("result", this._bound_handleEvent); + this._initUI(); + this._update(); + } + cleanup() { + DOMUtils.empty(this.el); + this.output.value = ""; + DOMUtils.removeClass(this.el, "details"); + app.removeEventListener("result", this._bound_handleEvent); + Utils.defer(null, "Replace._update"); + } + + // private methods: + _initUI() { + this.output = DOMUtils.create("textarea", null, null, this.el); + this.output.readOnly = true; + } + _update() { + let o = app.result && app.result.tool, + result = o && o.result; + this.output.value = result || "no result"; + } + _handleEvent(evt) { + Utils.defer(() => this._update(), "Replace._update"); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class SubstLexer { + constructor() { + this.profile = null; + } + set profile(profile) { + this._profile = profile; + this.string = this.token = this.errors = null; + } + parse(str) { + if (!this._profile) { + return null; + } + this.token = null; + this.string = str; + this.errors = []; + + // TODO: should this be passed in from Tools? + let capGroups = app.expression.lexer.captureGroups; + let prev = null, + token, + c; + for (let i = 0, l = str.length; i < l; i += token.l) { + c = str[i]; + token = { + prev: prev, + i: i, + l: 1, + subst: true + }; + if (c === "$" && i + 1 < l) { + this.parseDollar(str, token, capGroups); + } else if (c == "\\" && i + 1 < l) { + this.parseBackSlash(str, token, capGroups); + } + if (!token.type) { + token.type = "char"; + token.code = c.charCodeAt(0); + } + if (prev) { + prev.next = token; + } + if (!this.token) { + this.token = token; + } + if (token.error) { + // SubstLexer currently doesn't generate any errors. + this.errors.push(token.error); + } + prev = token; + } + return this.token; + } + parseBackSlash(str, token, capGroups) { + let match, + sub = str.substr(token.i), + profile = this._profile; + if (profile.substTokens.subst_bsgroup && (match = sub.match(/^\\(\d\d?)/))) { + this._getRef(match[1], token, capGroups, "subst_bsgroup"); + } else if (match = sub.match(SubstLexer.SUBST_ESC_RE)) { + if (match[1][0] === "u") { + token.type = "escunicode"; + token.code = parseInt(match[2], 16); + } else { + token.code = profile.escCharCodes[match[1]]; + token.type = "esc_" + token.code; + } + if (token.type) { + token.clss = "esc"; + token.l += match[1].length; + } + } + } + parseDollar(str, token, capGroups) { + // Note: Named groups are not supported in PCRE or JS. + let match = str.substr(token.i + 1).match(/^([$&`']|\d\d?|{\d\d?})/); + if (!match) { + return; + } + let d = match[1], + type = SubstLexer.$_TYPES[d], + profile = this._profile; + if (type) { + if (!profile.substTokens[type]) { + return; + } + token.type = type; + token.clss = "subst"; + token.l += d.length; + } else { + this._getRef(d, token, capGroups, d[0] === "{" ? "subst_$bgroup" : "subst_$group"); + } + } + _getRef(numStr, token, capGroups, type) { + if (!this._profile.substTokens[type]) { + return; + } + let num = parseInt(numStr.match(/\d\d?/)[0]), + l = 0; + if (!this._profile.config.substdecomposeref || capGroups[num - 1]) { + l = numStr.length; + } else if (num >= 10 && capGroups[(num = num / 10 | 0) - 1]) { + l = numStr.length - 1; + } + if (l) { + token.l += l; + // we don't assign the original type, because the docs combine them all into one id: + token.type = num > 0 ? "subst_group" : "subst_0match"; + token.clss = "subst"; + if (num > 0) { + token.group = capGroups[num - 1]; + } + } + } + } + SubstLexer.$_TYPES = { + "$": "subst_$esc", + "&": "subst_$&match", + "`": "subst_$before", + "'": "subst_$after", + "0": "subst_0match" + }; + SubstLexer.SUBST_ESC_RE = new RegExp("^" + Utils.SUBST_ESC_RE.source, "i"); + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Tools extends EventDispatcher { + constructor(el) { + super(); + this.el = el; + this._initUI(); + this.value = null; + DOMUtils.togglePanel(this.el, 'article'); + } + set value(o) { + if (!o) { + this.show("explain"); + this._toolValues = Utils.copy({}, Tools.DEFAULT_VALUES); + } else { + this.show(o.id); + if (o.input != null) { + this.editor.setValue(o.input); + } + } + } + get value() { + return { + id: this._toolId, + input: this.input + }; + } + get input() { + return this.hasInput ? this.editor.getValue() : null; + } + get hasInput() { + let id = this._toolId; + return id === "replace" || id === "list"; + } + show(id) { + if (!id || id === this._toolId) { + return; + } + this.toolList.selected = this._toolId = id; + let input = id === "replace" || id === "list"; + if (this._tool) { + this._tool.cleanup(); + } + DOMUtils.toggleClass(DOMUtils.query("> article", this.el), "showinput", input); + if (input) { + this.editor.setValue(this._toolValues[id]); + this.editor.refresh(); + this.editor.focus(); + } + if (id === "explain") { + this._tool = new Explain(this.contentEl); + } else if (id === "details") { + this._tool = new Details(this.contentEl); + } else if (id === "replace" || id === "list") { + this._tool = new Replace(this.resultEl, this.editor); + } + this._toolId = id; + this._updateHighlights(); + } + _initUI() { + let el = this.el; + this.headerEl = DOMUtils.query("header", this.el); + this.headerEl.addEventListener("click", evt => this._handleHeaderClick(evt)); + this.contentEl = DOMUtils.query("> article > .content", el); + this.resultEl = DOMUtils.query("> article > .inputtool > .result", el); + this.toolListEl = DOMUtils.query(".toollist", this.headerEl); + let data = ["List", "Explain"].map(val => ({ + label: val, + id: val.toLowerCase() + })); + this.toolList = new List(this.toolListEl, { + data + }); + this.toolList.on("change", () => this._handleListChange()); + let editor = this.editor = CMUtils.create(DOMUtils.query(".inputtool .editor", el), { + maxLength: 2500, + singleLine: true + }, "100%", "100%"); + DOMUtils.query(".help.icon", el).addEventListener("click", () => app.sidebar.goto(this._toolId)); + + // TODO: evaluate this living here or in Replace: + editor.on("change", () => this._handleEditorChange()); + app.flavor.on("change", () => this._updateHighlights()); + app.expression.on("change", () => this._updateHighlights()); + this.lexer = new SubstLexer(); + this.highlighter = new ExpressionHighlighter(editor); + this.hover = new ExpressionHover(editor, this.highlighter); + } + _handleEditorChange() { + this._updateHighlights(); + this._toolValues[this._toolId] = this.editor.getValue(); + this.dispatchEvent("change"); + } + _updateHighlights() { + if (!this.hasInput) { + return; + } // only for Replace & List + this.lexer.profile = app.flavor.profile; + let token = this.lexer.parse(this.editor.getValue()); + this.highlighter.draw(token); + this.hover.token = token; + } + _handleListChange() { + this.show(this.toolList.selected); + Track.page("tool/" + this.toolList.selected); + } + _handleHeaderClick(evt) { + if (DOMUtils.hasClass(this.el, "closed") || !this.toolListEl.contains(evt.target)) { + DOMUtils.togglePanel(this.el, 'article'); + } + } + } + Tools.DEFAULT_VALUES = { + replace: "<< $& >>", + list: "$&\\n" + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + let home = {}; + home.id = "home"; + home.label = "Menu"; + home.desc = "[from HTML]"; + home.kids = [{ + label: "Pattern Settings", + id: "share", + el: "#share_main", + list: false, + kids: [{ + label: "Save to my Favorites", + id: "share_favorites", + el: "#share_favorites" + }, { + label: "Share with the Community", + id: "share_community", + el: "#share_community" + }] + }, { + label: "My Patterns", + id: "favorites", + desc: "The list above will display any patterns that you create or favorite." + "

    To edit a pattern you created, click its URL or double-click it in the list to load it, then open Save / Share to edit and save.

    ", + search: true, + kids: [] + }, { + label: "Cheatsheet", + id: "cheatsheet", + el: "#cheatsheet" + }, { + // injected from Reference + id: "reference" + }, { + label: "Community Patterns", + id: "community", + desc: "Welcome to Community Patterns, a searchable database of patterns submitted by users like you." + "

    After selecting a pattern, click its URL or double-click it in the list to load the full pattern. Or use the right arrow icon to load just the expression or text.

    " + "

    Help make the Community better by rating patterns, and submitting your own via Search & Share in the menu.

    ", + search: true, + kids: [] + }, { + label: "Help", + id: "help", + desc: "Help for the RegExr application. See the RegEx Reference for help with Regular Expressions.", + kids: [{ + label: "About", + desc: "RegExr v3.8.0 (May 10, 2024)." + "

    Created by Grant Skinner and the gskinner team, using the CreateJS & CodeMirror libraries.

    " + "

    You can provide feedback or log bugs on GitHub.

    " + }, { + label: "Getting started", + desc: "RegExr provides real-time visual results, syntax highlighting, tooltips, and undo/redo ({{getCtrlKey()}}-Z / Y) so it's easy and fun to explore Regular Expressions." + "

    Browse through the RegEx Reference and test different tokens to see what they do, then check out Community Patterns to see examples.

    " + "

    You can also Save your patterns for later reference, or to share with others. Sign In to ensure you don't lose your patterns.

    " + "

    Modify your pattern's details, share it with the Community, or make it private, or delete it in Pattern Settings

    ", + kids: [{ + label: "Expression panel", + desc: "This is where you enter a regular expression to test. The results in the Text and Tools panel will update as you type." + "Roll over the expression for information on each token." + "

    The buttons to the right allow you to switch RegEx engines, or edit the expression flags.

    " + }, { + label: "Text panel", + desc: "This is where you enter text to test your expression against. Drag & drop a text file to load its contents." + "

    Matches will be highlighted as you type. Roll over a match for information on the match and its capture groups. The match count and execution time are shown in the title bar.

    " + "

    Lighter colored caps at the start or end of a line indicate the match continues between lines.

    " + }, { + label: "Tests panel", + desc: "This allows you to create a suite of tests that you can use to validate your Expression in real time." + "

    A test can check if the pattern matches anything, matches everything, or matches nothing in the test text.

    " + "

    Access this panel with the toggle at the top of the Text panel. When you save, both your Text and Tests will be saved.

    " + }, { + label: "Tools panel", + desc: "Click the Tools title bar below the Text panel to show or hide the Tools panel." + "

    Tools provide different ways of working with or exploring your results.

    ", + kids: [{ + label: "Replace", + id: "replace", + desc: "The Replace tool replaces matches with a specified string or pattern." + "

    Matches in the Text panel are replaced by the substitution string & displayed as you type.

    " + "

    Substitution tokens and escaped characters are supported, such as \\n, \\t & \\u0009.

    " + "

    Roll over tokens for information, and check out the RegEx Reference for more information.

    " + }, { + label: "List", + id: "list", + desc: "The List tool lists all found matches." + "

    You can specify either a simple delimiter (ex. , or \\n), or use substitution tokens to generate more advanced reports. For example, $1\\n would list all group 1 results (in the JavaScript engine).

    " + "

    Escaped characters are supported, such as \\n, \\t & \\u0009.

    " + "

    Roll over tokens for information.

    " + }, { + label: "Details", + id: "details", + desc: "The Details tool displays the full text of a match and its capture groups." + "

    Click on a highlighted match in the Text panel to display the details for that match.

    " + "

    Roll over a group row to highlight that group in your Expression.

    " + }, { + label: "Explain", + id: "explain", + desc: "The Explain tool displays a detailed breakdown of the Expression." + "

    Mouse over the explanation to highlight the related tokens in the Expression panel and vice versa.

    " + "

    Click an item in the explanation to show more info in the RegEx Reference.

    " + }] + }, { + label: "Menu", + desc: "The Menu (this panel) includes Help, a full RegEx Reference, a Cheatsheet, and Pattern Settings features." + "

    Double-click a selected item in the RegEx Reference to insert it into your Expression. Click the arrow beside an example to load it.

    " + "

    The menu also includes searchable Community Patterns, and patterns you've created or favorited in My Patterns.

    " + }] + }, { + label: "Signing in", + id: "signin", + desc: "Before you sign in, RegExr creates a temporary account which relies on a browser cookie. This means you can't access your patterns on other computers, and that you could lose your patterns if your cookies are deleted or expire." + "

    Signing in creates a permanent account, so you can access your patterns anywhere, anytime.

    " + "

    Your existing patterns & favorites will automatically be assigned to the new account.

    " + "

    We don't use your info for anything other than signing you into your RegExr account.

    " + }, { + id: "engine", + label: "RegEx engines", + desc: "While the core feature set of regular expressions is fairly consistent, different implementations (ex. Perl vs Java) may have different features or behaviours." + "

    RegExr currently supports JavaScript RegExp executed in your browser and PCRE via PHP.

    " + "

    You can switch engines using the dropdown in Expression.

    ", + kids: [{ + label: "JavaScript", + desc: "Your browser's JavaScript engine is used to execute RegEx in an asynchronous worker using RegExp.exec()." + "

    Note that while implementations are mostly consistent, there are small variations between browsers. Here is a short list of known differences:

      " + "
    • Older browsers don't support the u or y flags
    • " + "
    • Differences in handling of certain ambiguous escapes: \\8 \\9
    • " + "
    • Chrome handles \\x & \\u escapes slightly differently than other browsers
    • " + "
    • Chrome supports lookbehind, but it isn't yet in the JS spec
    • " + "
    • Safari ignores leading zeros in octal escapes (ex. \\00020)
    • " + "

    " + }, { + label: "PCRE (PHP)", + desc: "PHP {{getPHPVersion()}} and PCRE {{getPCREVersion()}} are used to execute your pattern on our server." + }] + }, { + label: "Query string support", + desc: "In addition to the built in Save mechanism which creates a shareable link, RegExr also supports the ability to pre-populate a pattern via the query string." + "

    The following query string params are recognized:

      " + "
    • engine - the RegEx engine to use (js or pcre)
    • " + "
    • expression - populates the Expression area. It is recommended to pass a full expression with flags (/.*/ig) not just the pattern (.*)
    • " + "
    • text - populates the Text area
    • " + "
    • tool - sets the tool (replace, list, details, or explain)
    • " + "
    • input - populates the tool input field
    • " + "

    " + "Ex. regexr.com/?expression=/./g&text=test" + }] + }]; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class LinkRow { + constructor(el) { + this.el = el; + this._initUI(); + this.url = null; + } + set pattern(val) { + let url = Utils.getPatternURLStr(val); + this._pattern = val; + DOMUtils.query(".url", this.el).innerText = url || ""; + DOMUtils.toggleClass(this.el, "disabled", !url); + DOMUtils.toggleClass(this.el, "active", !!url); + } + showMessage(message) { + // for some reason this displays one line too low if it's synchronous: + setTimeout(() => app.tooltip.toggle.showOn("linkrow", message, DOMUtils.query(".copy.icon", this.el), true, 0), 1); + } + _initUI() { + this.el.onclick = evt => this._onClick(evt); + let fld = DOMUtils.query(".url", this.el), + copyBtn = DOMUtils.query(".copy", this.el); + let clipboard = new Clipboard(copyBtn, { + target: () => fld + }); + clipboard.on("success", () => app.tooltip.toggle.toggleOn("copy", "Copied to clipboard.", copyBtn, true, 3)); + clipboard.on("error", e => app.tooltip.toggle.toggleOn("copy", Utils.getCtrlKey() + "-C to copy.", copyBtn, true, 3)); // TODO: cmd/ctrl + } + _onClick(evt) { + if (DOMUtils.query(".copy", this.el).contains(evt.target)) { + return; + } + if (evt.which === 2 || evt.metaKey || evt.ctrlKey) { + window.open(Utils.getPatternURL(this._pattern)); + } else { + app.load(this._pattern); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Example { + constructor(title, ex) { + this.el = DOMUtils.create("div", "example"); + this.title = title; + this.example = ex; + } + set example(ex) { + if (ex === this._example) { + return; + } + this._example = ex; + let str = "", + txt, + exp, + regex; + if (ex) { + exp = ex[0]; + txt = ex[1]; + regex = Utils.getRegExp(exp, "g"); + if (this.title) { + str += "

    " + this.title + "


    "; + } + str += "Load expression" + Utils.htmlSafe(exp) + ""; + if (txt && regex) { + let over = Math.max(0, txt.length - 160), + s = txt; + if (over) { + s = Utils.htmlSafe(s.substr(0, 159)); + } + if (regex) { + s = s.replace(regex, "$&"); + } + // TODO: this won't match on html elements: + str += "
    Load text" + s + (over ? "\u2026" : "") + ""; + } + } + this.el.innerHTML = str; + if (exp) { + DOMUtils.query("code.expression > .load", this.el).addEventListener("click", () => { + // TODO: this will need to be updated when we support other delimiters: + app.expression.value = exp[0] === "/" ? exp : "/" + exp + "/g"; + }); + } + if (txt) { + DOMUtils.query("code.text > .load", this.el).addEventListener("click", () => app.text.value = txt); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + // also used for My Patterns. + class CommunityContent { + constructor(el) { + this.el = el; + this.example = new Example(); + el.appendChild(this.example.el); + DOMUtils.query(".icon.thumbup", el).addEventListener("click", () => this._rate(1)); + DOMUtils.query(".icon.thumbdown", el).addEventListener("click", () => this._rate(-1)); + DOMUtils.query(".icon.favorites", el).addEventListener("click", () => this._favorite()); + this.linkRow = new LinkRow(DOMUtils.query(".row.link", el)); + DOMUtils.query(".icon.share", el).addEventListener("click", () => this._share()); + } + set item(o) { + let el = this.el; + this._pattern = o; + DOMUtils.query(".author", el).innerText = o.author ? "by " + o.author : ""; + DOMUtils.query(".name.label", el).innerText = o.name; + DOMUtils.query(".desc", el).innerText = o.description || "No description available."; + this._updateRating(); + this._updateFavorite(); + this.example.example = [o.expression, o.text]; + this.linkRow.pattern = o; + } + + // private methods: + _updateRating() { + let o = this._pattern, + el = this.el; + DOMUtils.query(".rating", el).innerText = o.rating.toFixed(1); + DOMUtils.removeClass(DOMUtils.query(".icon.rate.selected", el), "selected"); + if (o.userRating === 1) { + DOMUtils.addClass(DOMUtils.query(".icon.thumbup", el), "selected"); + } else if (o.userRating === -1) { + DOMUtils.addClass(DOMUtils.query(".icon.thumbdown", el), "selected"); + } + } + _updateFavorite() { + let o = this._pattern, + el = this.el; + DOMUtils.toggleClass(DOMUtils.query(".icon.favorites", el), "selected", !!o.favorite); + } + _rate(val) { + let o = this._pattern; + o.userRating = val === o.userRating ? 0 : val; + this._updateRating(); + Server.rate(o.id, o.userRating).then(data => this._handleRate(data)); + } + _share() { + app.load(this._pattern); + app.share.show(); + } + _handleRate(data) { + if (data.id === this._pattern.id) { + this._pattern.rating = data.rating; + this._updateRating(); + } + } + _favorite() { + let o = this._pattern; + Server.favorite(o.id, !o.favorite).then(data => this._handleFavorite(data)); + } + _handleFavorite(data) { + if (data.id === this._pattern.id) { + this._pattern.favorite = data.favorite; + this._updateFavorite(); + } + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Status { + constructor(el) { + if (!el) { + el = document.createElement("div"); + } + this.el = el; + DOMUtils.addClass(el, "status"); + el.addEventListener("mouseover", () => this._showTooltip()); + el.addEventListener("mouseout", () => this._hideTooltip()); + } + distract() { + this.el.innerHTML = ''; + this._show(); + return this; + } + hide(t = 0) { + this._clearTimeout(); + if (t) { + this._timeoutId = setTimeout(() => this._hide(), t * 1000); + } else { + this._hide(); + } + return this; + } + success() { + this.el.innerHTML = ''; + this._show(); + return this; + } + error(msg) { + let el = this.el; + el.innerHTML = ''; + this._show(); + this._ttMsg = msg; + return this; + } + _showTooltip() { + if (!this._ttMsg) { + return; + } + app.tooltip.hover.showOn("status", this._ttMsg, this.el, true, 0); + } + _hideTooltip() { + app.tooltip.hover.hide("status"); + } + _show() { + this.el.style.display = null; + this._ttMsg = null; + this._hideTooltip(); + this._clearTimeout(); + } + _hide() { + this.el.style.display = "none"; + this._hideTooltip(); + this._clearTimeout(); + } + _clearTimeout() { + if (this._timeoutId == null) { + return; + } + clearTimeout(this._timeoutId); + this._timeoutId = null; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Account extends EventDispatcher { + constructor() { + super(); + this._value = {}; + this._initUI(); + } + get value() { + return this._value; + } + set value(val = {}) { + this._value = val; + this._updateUI(); + this.dispatchEvent("change"); + } + get userId() { + return this._value.userId; + } + get author() { + return this._value.author || this._value.username || ""; + } + get username() { + return this._value.username || ""; + } + get authenticated() { + return !!this._value.username; + } // this._value.authenticated; + get type() { + return this._value.type; + } + showTooltip() { + app.tooltip.toggle.toggleOn("signin", this.tooltipEl, this.signinBtn, true, 20); + } + + // private methods: + _initUI() { + let template = o => '' + o; + this.signinBtn = DOMUtils.query(".header .signin"); + this.tooltipEl = DOMUtils.query("#library > #tooltip-signin"); + this.signinEl = DOMUtils.query(".signin", this.tooltipEl); + this.signoutEl = DOMUtils.query(".signout", this.tooltipEl); + DOMUtils.query(".signoutbtn", this.signoutEl).addEventListener("click", evt => this._doSignout()); + this.signinBtn.addEventListener("click", evt => this.showTooltip()); + DOMUtils.query(".icon.help", this.signinEl).addEventListener("click", () => app.sidebar.goto("signin")); + this.signinList = new List(DOMUtils.query("ul.list", this.signinEl), { + data: ["GitHub", "Google"], + template + }); + this.signinList.on("change", () => this._signinListChange()); + } + _updateUI() { + let auth = this.authenticated; + DOMUtils.toggleClass(this.tooltipEl, "authenticated", auth); + DOMUtils.query(".label", this.signinBtn).innerText = auth ? "Sign Out" : "Sign In"; + if (auth) { + DOMUtils.query(".username", this.signoutEl).innerText = this.username; + DOMUtils.query(".type", this.signoutEl).innerText = this.type; + } + } + _doSignout() { + DOMUtils.addClass(this.tooltipEl, "wait"); + Server.logout().then(data => { + this._handleSignout(data); + }).finally(() => this._cleanSignout()); + } + _handleSignout(data) { + this.value = data; + } + _cleanSignout(err) { + DOMUtils.removeClass(this.tooltipEl, "wait"); + } + _signinListChange() { + let service = this.signinList.selected.toLowerCase(); + DOMUtils.addClass(this.tooltipEl, "wait"); + Track.event("login", "access", service); + setTimeout(() => Server.login(service), 100); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Share extends EventDispatcher { + constructor(el) { + super(); + this.el = el; + this._pattern = false; + this._initUI(); + app.on("change", () => this._handleAppChange()); + app.on("load", () => this._handleAppLoad()); + app.account.on("change", () => this._handleAccountChange()); + } + + // public methods: + get value() { + return { + id: this._pattern ? this._pattern.id : null, + name: this.name, + author: this.author, + description: this.description, + keywords: this.keywords + }; + } + set pattern(o) { + this._pattern = o; + this.name = o.name; + this.description = o.description; + this.keywords = o.keywords; + this._updateUI(); + this._pushHistory(o); + } + get name() { + return this.nameFld.value; + } + set name(val) { + this.nameFld.value = val || ""; + this.hNameFld.innerText = val || "Untitled Pattern"; + } + get author() { + return this.authorFld.value; + } + set author(val) { + this.authorFld.value = val || ""; + } + get description() { + return this.descriptionFld.value; + } + set description(val) { + this.descriptionFld.value = val || ""; + } + get keywords() { + return this.keywordsFld.value; + } + set keywords(val) { + this.keywordsFld.value = val || ""; + } + show() { + app.sidebar.goto("share"); + } + + // private methods: + _initUI() { + let el = this.el; + let mainEl = this.mainEl = DOMUtils.query("> #share_main", el); + let comEl = this.communityEl = DOMUtils.query("> #share_community", el); + + // set up header: + let hEl = DOMUtils.query(".header"); + this.hNewBtn = DOMUtils.query(".new", hEl); + this.hForkBtn = DOMUtils.query(".fork", hEl); + this.hSaveBtn = DOMUtils.query(".save", hEl); + this.hNameFld = DOMUtils.query(".name", hEl); + DOMUtils.query(".settings", hEl).addEventListener("click", () => this.show()); + DOMUtils.query(".savekey", this.hSaveBtn).innerText = "(" + Utils.getCtrlKey() + "-s)"; + this.hSaveBtn.addEventListener("click", () => this._doSave()); + this.hNewBtn.addEventListener("click", () => this._doNew()); + this._defaultName = this.hNameFld.innerText; + + // set up main: + this._privateRow = DOMUtils.query(".row.private", this.mainEl); + this._privateRow.addEventListener("click", () => this._doPrivate()); + this._privateStatus = new Status(DOMUtils.query(".status", this._privateRow)); + this._favoritesRow = DOMUtils.query(".row.favorites", this.mainEl); + this._favoritesRow.addEventListener("click", () => this._doFavorite()); + this._favoritesStatus = new Status(DOMUtils.query(".status", this._favoritesRow)); + this._communityRow = DOMUtils.query(".row.community", this.mainEl); + this._communityRow.addEventListener("click", () => this._showCommunity()); + this._deleteRow = DOMUtils.query(".row.delete", this.mainEl); + this._deleteRow.addEventListener("click", () => this._doDelete()); + this._deleteStatus = new Status(DOMUtils.query(".status", this._deleteRow)); + DOMUtils.query(".row.signin a", this.mainEl).addEventListener("click", () => this._doSignin()); + + // set up link row: + this._linkRow = new LinkRow(DOMUtils.query(".link.row", mainEl)); + + // set up save buttons: + let saveEl = this.saveEl = DOMUtils.query("> .save", mainEl); + this.saveBtn = DOMUtils.query(".button.save", saveEl); + this.forkBtn = DOMUtils.query(".button.fork", saveEl); + this.saveBtn.addEventListener("click", () => this._doSave()); + this.forkBtn.addEventListener("click", () => this._doSave(true)); + this.saveStatus = new Status(DOMUtils.query(".status", saveEl)); + this.saveMessage = DOMUtils.query(".message", saveEl); + + // set up input fields: + let infoEl = this.infoEl = DOMUtils.query("> .info", mainEl); + this.nameFld = DOMUtils.query(".name", infoEl); + this.authorFld = DOMUtils.query(".author", infoEl); + this.descriptionFld = DOMUtils.query(".description", infoEl); + this.keywordsFld = DOMUtils.query(".keywords", infoEl); + + // listen for changes: + this.nameFld.addEventListener("input", () => this._handleChange()); + this.authorFld.addEventListener("input", () => this._handleChange()); + this.descriptionFld.addEventListener("input", () => this._handleChange()); + this.keywordsFld.addEventListener("input", () => this._handleChange()); + + /// set up community: + let comInputsEl = DOMUtils.query(".inputs", comEl); + DOMUtils.query(".button.cancel", comEl).addEventListener("click", () => app.sidebar.goto("share")); + DOMUtils.query(".button.share", comEl).addEventListener("click", () => this._doComSave()); + this.comSaveStatus = new Status(DOMUtils.query(".status", comEl)); + this._comNameFld = DOMUtils.query(".name", comInputsEl); + this._comAuthorFld = DOMUtils.query(".author", comInputsEl); + this._comDescriptionFld = DOMUtils.query(".description", comInputsEl); + this._comKeywordsFld = DOMUtils.query(".keywords", comInputsEl); + + // set up cmd-s listener: + window.document.addEventListener("keydown", evt => this._handleKey(evt)); + } + _updateUI() { + let o = this._pattern, + text; + let isChanged = this._isChanged(), + isNew = this._isNew(), + isOwned = this._isOwned(); + DOMUtils.toggleClass([this.forkBtn, this.hForkBtn], "disabled", !this._canFork()); + DOMUtils.toggleClass(this.saveBtn, "disabled", !this._canSave()); + DOMUtils.toggleClass(this.hSaveBtn, "disabled", !this._canSave() && isOwned); + DOMUtils.query(".action", this.hSaveBtn).innerText = isOwned ? "Save" : "Fork"; + if (!isOwned) { + text = "This pattern was created by '" + (o.author || "[anonymous]") + "'."; + } else if (!isChanged) { + text = "No unsaved changes."; + } else if (isNew) { + text = "Save will create a shareable public link."; + } else { + text = "Save will update the current link."; + } + if (!isOwned && !isChanged) { + text += " Fork to create your own copy."; + } else if (!isNew) { + text += " Fork will create a new copy" + (isChanged ? " with your changes." : "."); + } + this._setSaveText(text); + this._linkRow.pattern = this._pattern.id && this._pattern; + DOMUtils.toggleClass(this._privateRow, "disabled", isNew || !isOwned); + DOMUtils.toggleClass(this._favoritesRow, "disabled", isNew || !isOwned); + DOMUtils.toggleClass(this._communityRow, "disabled", isNew || !isOwned); + DOMUtils.toggleClass(this._deleteRow, "disabled", isNew || !isOwned); + DOMUtils.toggleClass(this._privateRow, "active", o.access === "private"); + DOMUtils.toggleClass(this._favoritesRow, "active", !!o.favorite); + } + _isNew() { + return !this._pattern.id; + } + _isOwned() { + let o = this._pattern; + return this._isNew() || o.userId === app.account.userId; + } + _isChanged() { + return app.unsaved; + } + _canSave() { + return this._isChanged() && this._isOwned(); + } + _canFork() { + return !this._isNew(); + } + _pushHistory(pattern) { + let history = window.history, + url = Utils.getPatternURL(pattern); + let title = "RegExr: " + (pattern.name || "Learn, Build, & Test RegEx"); + if (history.state && pattern.id === history.state.id) { + history.replaceState(pattern, title, url); + } else { + history.pushState(pattern, title, url); + } + window.document.title = title; + } + _handleKey(evt) { + let mac = Utils.isMac(); + if (evt.key === "s" && (mac && evt.metaKey || !mac && evt.ctrlKey)) { + this._doSave(false); + evt.preventDefault(); + } + } + _doSave(fork) { + // if we can't save for some reason, then show the panel. + if (!fork && !this._canSave()) { + app.sidebar.goto("share"); + return; + } + if (fork && !this._canFork()) { + return; + } + let o = app.state; + DOMUtils.addClass(DOMUtils.query(".buttons", this.saveEl), "wait"); + this.saveStatus.distract(); + Server.save(o, fork).then(data => this._handleSave(data)).catch(err => this._handleSaveErr(err)); + } + _handleSave(data) { + let isNew = this._pattern.id == null, + isFork = !isNew && data.id !== this._pattern.id; + DOMUtils.removeClass(DOMUtils.query(".buttons", this.saveEl), "wait"); + this.saveStatus.hide(); + app.state = data; + if (isFork || isNew) { + this.show(); + if (isFork || !this.name) { + this.nameFld.focus(); + this.nameFld.select(); + } + this._linkRow.showMessage("Saved. New share link created. Click to copy to clipboard."); + } + } + _handleSaveErr(err) { + DOMUtils.removeClass(DOMUtils.query(".buttons", this.saveEl), "wait"); + this.saveStatus.error(this._getErrMsg(err)); + } + _doNew() { + app.newDoc(); + } + _doPrivate() { + let o = this._pattern; + this._privateStatus.distract(); + Server.private(o.id, o.access !== "private").then(data => this._handlePrivate(data)).catch(err => this._handleErr(err, this._privateStatus)); + } + _handlePrivate(data) { + if (data.id === this._pattern.id) { + this._pattern.access = data.access; + this._privateStatus.hide(); + this._updateUI(); + } + } + _doFavorite() { + let o = this._pattern; + this._favoritesStatus.distract(); + Server.favorite(o.id, !o.favorite).then(data => this._handleFavorite(data)).catch(err => this._handleErr(err, this._favoritesStatus)); + } + _handleFavorite(data) { + if (data.id === this._pattern.id) { + this._pattern.favorite = data.favorite; + this._favoritesStatus.hide(); + this._updateUI(); + } + } + _doDelete() { + let o = this._pattern; + if (!confirm("Are you sure you want to permanently delete this pattern?")) { + return; + } + this._deleteStatus.distract(); + Server.delete(o.id).then(data => this._handleDelete(data)).catch(err => this._handleErr(err, this._deleteStatus)); + } + _handleDelete(data) { + this._deleteStatus.hide(); + app.state = { + flavor: app.flavor.value + }; + setTimeout(() => app.tooltip.toggle.showOn("delete", "Pattern was permanently deleted.", this._deleteRow, true, 0), 1); + } + _handleErr(err, status) { + status.error(this._getErrMsg(err)).hide(6); + } + _showCommunity() { + app.sidebar.goto("share_community"); + this._comNameFld.value = this.name; + this._comAuthorFld.value = this.author; + this._comDescriptionFld.value = this.description; + this._comKeywordsFld.value = this.keywords; + } + _doComSave() { + if (!this._comNameFld.value) { + this._comNameFld.focus(); + return; + } + let o = app.state; + this.name = o.name = this._comNameFld.value; + this.author = o.author = this._comAuthorFld.value; + this.description = o.description = this._comDescriptionFld.value; + this.keywords = o.keywords = this._comKeywordsFld.value; + o.access = "public"; + DOMUtils.addClass(DOMUtils.query(".buttons", this.communityEl), "wait"); + this.comSaveStatus.distract(); + Server.save(o, true, true).then(data => this._handleComSave(data)).catch(err => this._handleComSaveErr(err)); + } + _handleComSave(data) { + DOMUtils.removeClass(DOMUtils.query(".buttons", this.communityEl), "wait"); + this.comSaveStatus.hide(); + this.show(); + } + _handleComSaveErr(err) { + DOMUtils.removeClass(DOMUtils.query(".buttons", this.communityEl), "wait"); + this.comSaveStatus.error(this._getErrMsg(err)); + } + _handleChange() { + this.dispatchEvent("change"); + } + _handleAppChange() { + this._updateUI(); + } + _handleAccountChange() { + let acc = app.account, + rowEl = DOMUtils.query(".signin.row", this.mainEl); + if (!this.authorFld.value) { + this.authorFld.value = acc.author || acc.username; + } + DOMUtils.toggleClass(rowEl, "authenticated", acc.authenticated); + DOMUtils.query(".username", rowEl).innerText = acc.username; + } + _handleAppLoad() { + DOMUtils.toggleClass(DOMUtils.query(".save .actions", this.mainEl), "disabled"); + } + _doSignin() { + app.account.showTooltip(); + } + _setSaveText(str) { + this.saveMessage.innerText = str; + } + _getErrMsg(err) { + return "ERROR: " + app.reference.getError("servercomm"); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Sidebar { + constructor(el) { + this.el = el; + this.itemEl = null; + this.openReq = null; + this._initUI(el); + this._content = this._prepContent(home); + this.minList.data = [{ + id: "menu", + label: "Menu" + }].concat(home.kids); + app.flavor.on("change", () => this._onFlavorChange()); + let id = app.prefs.read("side"); + if (!id || !this._idMap[id] || id === "share") { + id = "home"; + } + this.goto(id); + this.minimize(true, false); + } + minimize(val = true, track = true) { + if (val === this._minimized) { + return; + } + if (val && track) { + Track.event("minimize_menu", "engagement"); + } + DOMUtils.togglePanel(this.el, '.full', '.min', !val); + this._minimized = val; + this._updateUI(); + } + goto(id) { + this.show(this._idMap[id]); + } + showToken(token) { + this.goto(app.reference.idForToken(token)); + } + show(item) { + if (!item) { + return; + } + if (item.hide) { + return this.show(item.parent); + } + if (!item || item.id === "menu") { + return; + } // expand button on the min menu + this.minimize(false); + if (item.id) { + if (item.id === "home" || item.parent && item.parent.id === "home" || this._isInReference(item)) { + app.prefs.write("side", item.id); + } + } + if (!item.el && !item.kids) { + if (this.searchMode || !item.parent || item.parent === this.curItem) { + // in a search, community / favorites, of selecting a leaf child from a list. + this.selItem = item; + this.menuList.selected = item.id; + return this._showContent(item); + } else if (item.parent !== this.curItem) { + // trying to jump to a leaf child without previously showing parent. + this.show(item.parent); + return this.show(item); + } + } + this._resetFull(); + this.curItem = item; + DOMUtils.query("h1", this.titleEl).innerText = item.label; + DOMUtils.query("svg.back.icon use", this.titleEl).setAttribute("xlink:href", "#" + (item.parent ? "arrowleft" : "menu")); + if (item.el) { + this._showEl(DOMUtils.query("#library " + item.el)); + } else { + this._showContent(item); + } + if (item.kids && item.list !== false) { + DOMUtils.removeClass(this.fullEl, "no-list"); + this.menuList.data = item.kids || item.parent.kids; + } + if (item.search) { + DOMUtils.removeClass(this.fullEl, "no-search"); + } + + // special handling: + if (item.id === "community") { + this.menuList.template = this.communityListTemplate; + this._onSearchSubmit(); + } else if (item.id === "favorites") { + this.menuList.template = this.communityListTemplate; + this._loadFavorites(); + } + } + back() { + if (this.curItem.parent) { + this.show(this.curItem.parent); + } else { + this.minimize(true); + } + } + menuListTemplate(o) { + return (o.parent && o.parent.id === "home" ? '' : "") + '' + (o.label || o.id) + "" + (o.token ? '' + o.token.replace("<", "<") + '' : "") + (o.kids || o.el ? '' : ""); + } + communityListTemplate(o) { + return '' + Utils.htmlSafe(o.name) + "" + '' + (o.favorite ? '' : '') + '' + o.rating.toFixed(1) + ''; + } + + // private methods: + _initUI(el) { + // set up full width content: + this.fullEl = DOMUtils.query("> .full", el); + + // title bar: + this.titleEl = DOMUtils.query("> header", this.fullEl); + DOMUtils.query("> .close.icon", this.titleEl).addEventListener("click", () => this.minimize(true)); + DOMUtils.query("> .backrow", this.titleEl).addEventListener("click", () => this.back()); + + // search: + this.searchEl = DOMUtils.query("> .search", this.fullEl); + this.searchFld = DOMUtils.query("> .search > input", this.fullEl); + this.searchFld.addEventListener("input", () => this._onSearchChange()); + this.searchFld.addEventListener("keyup", evt => evt.keyCode === 13 && this._onSearchSubmit()); + let searchBtn = DOMUtils.query("> svg.icon.search", this.searchEl); + searchBtn.addEventListener("click", () => this._onSearchSubmit()); + + // list & content: + this.listEl = DOMUtils.query("> .list", this.fullEl); + this.menuList = new List(this.listEl, { + data: home.kids, + template: this.menuListTemplate + }); + this.menuList.on("change", () => { + const lastId = this.curItem.id; + this.show(this.menuList.selectedItem); + if (lastId !== this.curItem.id) { + Track.page("sidebar/" + this.curItem.id); + } + }); + this.menuList.on("dblclick", () => this._onDblClick(this.menuList.selectedItem)); + this.contentEl = DOMUtils.query("> .content", this.fullEl); + + // set up minimized sidebar: + this.minEl = DOMUtils.query("> .min", el); + this.minEl.addEventListener("click", () => this.minimize(false)); + let template = DOMUtils.template``; + this.minList = new List(DOMUtils.query("> .list", this.minEl), { + template + }); + this.minList.on("change", evt => { + this.show(this.minList.selectedItem); + evt.preventDefault(); + Track.page("sidebar/" + this.curItem.id); + }); + + // set up special content: + this.community = new CommunityContent(DOMUtils.query("#library > #community")); + this.share = new Share(DOMUtils.query("#library > #share")); + this._prepCheatsheet(); // TODO: switch to a Cheatsheet class. + + DOMUtils.query(".doc > .blocker").addEventListener("mousedown", evt => { + this.minimize(true); + }); + } + _updateUI() { + // TODO: this is cheating a bit: + let doc = DOMUtils.query(".doc"); + DOMUtils.toggleClass(doc, "fadeback", !this._minimized); + } + _resetFull() { + if (this.itemEl) { + DOMUtils.query("#library").appendChild(this.itemEl); + this.itemEl = null; + } + this._abortReq(); + DOMUtils.addClass(this.fullEl, "no-search no-list"); + this.searchFld.value = ""; + this.searchMode = false; + this.menuList.template = this.menuListTemplate; + DOMUtils.removeClass(this.searchEl, "wait"); + } + _showContent(o) { + if ((this.curItem.id === "community" || this.curItem.id === "favorites") && o !== this.curItem) { + this._showEl(this.community.el); + this.community.item = o; + } else { + let ref = app.reference; + this.contentEl.innerHTML = this._isInReference(o) ? ref.getContent(o.id) : ref.fillTags((o.desc || "") + (o.ext || ""), o, ref); + if (o.example) { + this.contentEl.appendChild(new Example("Example", o.example).el); + } + } + } + _isInReference(o) { + return this._isIn(o, "reference"); + } + _isIn(o, id) { + do { + if (o.id === id) { + return true; + } + } while (o = o.parent); + return false; + } + _onDblClick(o) { + if (o.token) { + let expr = app.expression; + if (o.parent.id === "flags") { + expr.toggleFlag(o.token); + } else { + expr.insert(o.token); + } + } else if (this.curItem.id === "community" || this.curItem.id === "favorites") { + app.load(o); + } + } + _showEl(el) { + if (this.itemEl === el) { + return; + } + this.itemEl = el; + DOMUtils.empty(this.contentEl).appendChild(el); + } + _prepContent(content) { + // inject reference: + let i = Utils.findIndex(content.kids, o => o.id === "reference"); + content.kids.splice(i, 1, app.reference.content); + // grab home content from HTML: + content.desc = this.contentEl.innerHTML; + // build idMap: + this._idMap = { + home: content + }; + return Utils.prepMenuContent(content, this._idMap); + } + _prepCheatsheet() { + let els = DOMUtils.queryAll("#cheatsheet *[data-id]"); + let f = evt => this.goto(evt.target.dataset.id); + for (let i = 0, l = els.length; i < l; i++) { + els[i].addEventListener("click", f); + } + els = DOMUtils.queryAll("#cheatsheet tr td:first-child"); + f = evt => app.expression.insert(evt.target.innerText); + for (let i = 0, l = els.length; i < l; i++) { + let el = els[i], + tokens = el.innerText.split(" "); + DOMUtils.empty(el); + for (let j = 0; j < tokens.length; j++) { + let span = DOMUtils.create("a", null, tokens[j], el); + span.addEventListener("click", f); + } + } + } + _onSearchChange() { + let id = this.curItem.id, + search = this.searchFld.value; + if (id === "reference") { + this._searchReference(search); + } else if (id === "favorites") { + this._searchFavorites(search); + } else { + return; + } + // TODO: this is a hacky way to reset the content: + this.contentEl.innerHTML = this.curItem.desc; + this.itemEl = null; + } + _searchReference(search) { + let result = app.reference.search(search); + this.searchMode = !!search; + this.menuList.data = search ? result : this.curItem.kids; + // TODO: would be nice to show a "no match" message, but difficult to do with `hide=true` entries + } + _searchFavorites(search) { + let data = this.menuList.data, + rank = Utils.searchRank; + data.forEach(o => o.hide = !rank(o, search)); + this.menuList.data = data; + } + _onFlavorChange() { + let item = this.selItem || this.curItem; + if (!this._isInReference(item)) { + return; + } + this.selItem = this.curItem = null; + this.show(item); + } + _onSearchSubmit() { + this._abortReq(); + let val = this.searchFld.value; + if (this.curItem.id === "community") { + if (val) { + Track.event("search", "engagement", { + search_term: val, + target: "community" + }); + } + DOMUtils.addClass(this.searchEl, "wait"); + this._showListMsg(); + this.openReq = Server.communitySearch(val).then(data => this._showServerResults(data)).catch(msg => this._showListMsg(msg)).finally(() => this._reqCleanup()); + } + this.searchFld.select(); + } + _loadFavorites() { + this._abortReq(); + let val = this.searchFld.value; + this.openReq = Server.patterns().then(data => this._showServerResults(data)).catch(msg => this._showListMsg(msg)).finally(() => this._reqCleanup()); + this._showListMsg(); + } + _showListMsg(msg = "Loading...") { + this.listEl.innerHTML = "
  • " + msg + "
  • "; + } + _abortReq() { + if (this.openReq) { + this.openReq.abort(); + } + this.openReq = null; + } + _showServerResults(data) { + this.menuList.data = data.results; + if (data.results.length === 0) { + this._showListMsg(this.curItem.id === "community" ? "No matches." : "No patterns created or favorited."); + } + } + _reqCleanup(msg) { + DOMUtils.removeClass(this.searchEl, "wait"); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Theme extends EventDispatcher { + constructor(el) { + super(); + this.el = el; + this.urlTemplate = "./assets/themes/%name%.css"; + this.targetNode = this._node = null; + this._dark = false; + this._initUI(); + this.dark = !!app.prefs.read("dark"); + } + set dark(val) { + val = !!val; + if (this._dark === val) { + return; + } + this._dark = val; + this._load(val ? "dark" : null); + DOMUtils.toggleClass(this.themeBtn, "selected", val); + app.prefs.write("dark", val); + } + get dark() { + return this._dark; + } + _initUI() { + this.themeBtn = DOMUtils.query(".header .button.theme", this.el); + this.themeBtn.addEventListener("click", evt => this._toggleTheme()); + } + _load(id) { + if (id === this._id) { + return; + } + this._id = id; + if (this._node) { + this._node.remove(); + } + if (!id) { + this._change(); + return; + } + let tmpl = this.urlTemplate, + n = DOMUtils.create("link"); + n.addEventListener("load", () => this._change()); + n.rel = "stylesheet"; + n.type = "text/css"; + n.href = tmpl ? tmpl.replace(/%name%/g, id) : id; + this._node = (this.targetNode || document.head).appendChild(n); + } + _change() { + this.dispatchEvent("change"); + } + _toggleTheme() { + this.dark = !this.dark; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Reference { + constructor(content, flavor, config) { + this._config = config; + this._flavor = flavor; + this._flavor.on("change", () => this._flavorChange()); + this._injectEscChars(content); + this._idMap = { + reference: content + }; + this._content = Utils.prepMenuContent(content, this._idMap); + this._misc = Utils.prepMenuContent(content.misc, this._idMap); + this._flavorChange(); + } + get content() { + return this._content; + } + search(searchStr) { + function srch(kids, results) { + for (let i = 0, l = kids.length; i < l; i++) { + let kid = kids[i], + points = 0; + if (kid.kids) { + srch(kid.kids, results); + continue; + } + if (points = Utils.searchRank(kid, searchStr)) { + kid.__searchPoints = points; + results.push(kid); + } + } + return results; + } + return srch(this.content.kids, []).sort((a, b) => b.__searchPoints - a.__searchPoints); + } + idForToken(token) { + let errId = token.error && token.error.id; + if (this._idMap[errId]) { + return errId; + } + if (this._idMap[token.type]) { + return token.type; + } + if (this._idMap[token.clss]) { + return token.clss; + } + return errId || token.type || token.clss; + } + + // methods used in fillTags: + getChar(token) { + let chr = Reference.NONPRINTING_CHARS[token.code]; + return chr ? chr : "\"" + String.fromCharCode(token.code) + "\""; + } + getQuant(token) { + let min = token.min, + max = token.max; + return min === max ? min : max === -1 ? min + " or more" : "between " + min + " and " + max; + } + getUniCat(token) { + return Reference.UNICODE_CATEGORIES[token.value] || "[Unrecognized]"; + } + getModes(token) { + let str = token.on ? " Enable \"" + token.on + "\"." : ""; + if (token.off) { + str += " Disable \"" + token.off + "\"."; + } + return str; + } + getInsensitive(token) { + if (token.code) { + let chr = String.fromCharCode(token.code); + if (chr.toLowerCase() === chr.toUpperCase()) { + return ""; + } + } + return token.modes ? `Case ${token.modes.i ? "in" : ""}sensitive.` : ""; + } + getDotAll(token) { + return (token.modes.s ? "including" : "except") + " line breaks"; + } + getLabel(token) { + let node = this.getNodeForToken(token); + return node ? node.label || node.id || "" : token.type; + } + getDesc(token) { + return this.getVal(this.getNodeForToken(token), "desc"); + } + getLazy(token) { + return token.modes.U ? "greedy" : "lazy"; + } + getLazyFew(token) { + return token.modes.U ? "many" : "few"; + } + getPHPVersion() { + return this._config.PHPVersion; + } + getPCREVersion() { + return this._config.PCREVersion; + } + getCtrlKey() { + return Utils.getCtrlKey(); + } + getEscChars() { + let o = this._flavor.profile.escChars, + str = ""; + for (let n in o) { + str += n; + } + return str; + } + + /* + Searches for tags in the string in the format: + `{{prop.prop}}` or `{{method(prop.prop)}}` + + The first format will inject the specified property of the data object. + For example, `{{a.b}}` would inject the value of `data.a.b`. + + The second will inject the results of calling the specified function on the functs object with a property of the data object as it's parameter (or the data object itself if empty). + For example, `{{myMethod(a.b)}}` would inject the return value of `functs.myMethod(data.a.b)`. + + Currently only supports a single param. + */ + fillTags(str, data, functs, maxLength = 20, htmlSafe = true) { + let match; + while (match = str.match(/{{~?[\w.()]+}}/)) { + let val, + f, + safe = false; + val = match[0].substring(2, match[0].length - 2); + if (val[0] === "~") { + val = val.substr(1); + safe = true; + } + let match2 = val.match(/\([\w.]*\)/); + if (match2) { + f = val.substr(0, match2.index); + val = match2[0].substring(1, match2[0].length - 1); + } else { + f = null; + } + let o = data, + arr = val.split("."); + for (let i = 0; i < arr.length; i++) { + let prop = arr[i]; + if (prop && o) { + o = o[prop]; + } + } + val = o; + if (f) { + if (functs[f]) { + val = functs[f](val); + } else { + val = " [" + f + "] "; + } + } + if (!safe && (maxLength || htmlSafe)) { + val = Utils.shorten(val, maxLength, htmlSafe, "i"); + } + str = str.replace(match[0], val); + } + return str; + } + + // returns doc props from the profile or reference as appropriate (ex. tip, desc, ext) + getVal(node, prop) { + if (!node) { + return ""; + } + let pDocs = this._flavor.getDocs(node.id), + pRef = pDocs && pDocs[prop]; + if (pRef != null && pRef[0] !== "+") { + return pRef; + } + let ref = node && node[prop] || ""; + return pRef != null ? ref + pRef.substr(1) : ref; + } + getNodeForToken(token) { + let id = this.idForToken(token), + clss = token.clss; + + // Special cases: + if (clss === "quant") { + id = clss; + } + if (clss === "esc" && token.type !== "escsequence") { + id = "escchar"; + } + return this.getNode(id); + } + getNode(id) { + let map = this._idMap, + node = map[id]; + while (node && node.proxy) { + node = map[node.proxy]; + } + return node; + } + getError(error, token) { + let errId = error && error.id; + let str = this._content.errors[errId] || "no docs for error='" + errId + "'"; + if (token) { + str = this.fillTags(str, token, this, 20); + } + return str; + } + tipForToken(token) { + if (!token) { + return null; + } + let node = this.getNodeForToken(token), + label, + tip; + if (token.error && !token.error.warning) { + label = "ERROR: "; + tip = this.getError(token.error, token); + } else { + label = node ? node.label || node.id || "" : token.type; + tip = this.getVal(node, "tip") || this.getVal(node, "desc"); + tip = this.fillTags(tip, token, this, 20); + if (token.type === "group") { + label += " #" + token.num; + } + label = "" + label[0].toUpperCase() + label.substr(1) + ". "; + if (token.error) { + tip += "WARNING: " + this.getError(token.error, token) + ""; + } + } + return tip ? label + tip : "no docs for id='" + this.idForToken(token) + "'"; + } + getContent(id) { + let node = this.getNode(id); + return this.fillTags(this.getVal(node, "desc") + this.getVal(node, "ext"), node, this); + } + + // TODO: this isn't necessarily the most ideal place for this method (has nothing to do with Reference). Maybe move into Text? + tipForMatch(match, text) { + if (!match) { + return null; + } + let more = match.l > 150; + let str = "match: " + Utils.shorten(text.substr(match.i, match.l), 150, true, "i") + "
    range: " + match.i + "-" + (match.i + match.l - 1) + ""; + let groups = match.groups, + l = groups && groups.length; + for (let i = 0; i < l; i++) { + if (i > 3 && l > 5) { + more = false; + str += "
    see Details for " + (l - i) + " more"; + break; + } + let group = groups[i], + s; + s = group.i !== undefined ? text.substr(group.i, group.l) : group.s; + more = more || s && s.length > 50; + str += i > 0 ? "
    " : "
    "; + str += "group #" + (i + 1) + ": " + Utils.shorten(s, 50, true, "i"); + } + if (more) { + str += "
    see Details for full matches"; + } + return str; + } + // private methods: + _flavorChange() { + this._updateHide(this.content); + } + _updateHide(o, list) { + // the list param is for debugging, it is populated with the ids of all nodes that were hidden. + // parent nodes aren't hidden unless all their children are. + let kids = o.kids, + hide = true; + if (kids) { + for (let i = 0, l = kids.length; i < l; i++) { + hide = this._updateHide(kids[i], list) && hide; + } + } else { + hide = o.show === false || o.show !== true && o.id && !this._flavor.isTokenSupported(o.id); + } + if (list && hide) { + list.push(o.id); + } + return o.hide = hide; + } + _injectEscChars(content) { + let kids = Utils.find(content.kids, o => o.id === "escchars").kids; + let template = Utils.find(content.misc.kids, o => o.id === "escchar").tip; + // \x07 - bell, \x1b - esc + let chars = "\t\n\v\f\r\0\x07\x1b", + tokens = "tnvfr0ae"; // .\\+*?^$[]{}()|/ + for (let i = 0, l = chars.length; i < l; i++) { + kids.push(this._getEscCharDocs(chars[i], tokens[i], template)); + } + } + _getEscCharDocs(c, t, template) { + let code = c.charCodeAt(0), + chr = Reference.NONPRINTING_CHARS[code] || c; + return { + id: "esc_" + code, + token: "\\" + (t || c), + label: chr.toLowerCase(), + desc: this.fillTags(template, { + code: code + }, this) + }; + } + } + Reference.NONPRINTING_CHARS = { + "0": "NULL", + "1": "SOH", + "2": "STX", + "3": "ETX", + "4": "EOT", + "5": "ENQ", + "6": "ACK", + "7": "BELL", + "8": "BS", + "9": "TAB", + // + "10": "LINE FEED", + // + "11": "VERTICAL TAB", + "12": "FORM FEED", + "13": "CARRIAGE RETURN", + // + "14": "SO", + "15": "SI", + "16": "DLE", + "17": "DC1", + "18": "DC2", + "19": "DC3", + "20": "DC4", + "21": "NAK", + "22": "SYN", + "23": "ETB", + "24": "CAN", + "25": "EM", + "26": "SUB", + "27": "ESC", + "28": "FS", + "29": "GS", + "30": "RS", + "31": "US", + "32": "SPACE", + // + "127": "DEL" + }; + Reference.UNICODE_CATEGORIES = { + // from: http://www.pcre.org/original/doc/html/pcrepattern.html + "C": "Other", + "Cc": "Control", + "Cf": "Format", + "Cn": "Unassigned", + "Co": "Private use", + "Cs": "Surrogate", + "L": "Letter", + "L&": "Any letter ", + "Ll": "Lower case letter", + "Lm": "Modifier letter", + "Lo": "Other letter", + "Lt": "Title case letter", + "Lu": "Upper case letter", + "M": "Mark", + "Mc": "Spacing mark", + "Me": "Enclosing mark", + "Mn": "Non-spacing mark", + "N": "Number", + "Nd": "Decimal number", + "Nl": "Letter number", + "No": "Other number", + "P": "Punctuation", + "Pc": "Connector punctuation", + "Pd": "Dash punctuation", + "Pe": "Close punctuation", + "Pf": "Final punctuation", + "Pi": "Initial punctuation", + "Po": "Other punctuation", + "Ps": "Open punctuation", + "S": "Symbol", + "Sc": "Currency symbol", + "Sk": "Modifier symbol", + "Sm": "Mathematical symbol", + "So": "Other symbol", + "Z": "Separator", + "Zl": "Line separator", + "Zp": "Paragraph separator", + "Zs": "Space separator" + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + // this is just raw content for the Reference. + // right now all examples are executed in-browser, so they need to be compatible. Maybe swap to XRegExp at some point. + // TODO: rewrite to use multiline template literals? + + let reference_content = {}, + o = reference_content; + o.label = "RegEx Reference"; + o.id = "reference"; + o.search = true, o.desc = `Information on all of the tokens available to create regular expressions. +

    Double-click an item in the list to insert it into your Expression.

    +

    Click the arrow beside an example to load it.

    `; + o.kids = [{ + label: "Character classes", + id: "charclasses", + desc: "Character classes match a character from a specific set. There are a number of predefined character classes and you can also define your own sets.", + kids: [{ + id: "set", + label: "character set", + desc: "Match any character in the set.", + example: ["[aeiou]", "glib jocks vex dwarves!"], + token: "[ABC]" + }, { + id: "setnot", + label: "negated set", + desc: "Match any character that is not in the set.", + example: ["[^aeiou]", "glib jocks vex dwarves!"], + token: "[^ABC]" + }, { + id: "range", + tip: "Matches a character in the range {{getChar(prev)}} to {{getChar(next)}} (char code {{prev.code}} to {{next.code}}). {{getInsensitive()}}", + example: ["[g-s]", "abcdefghijklmnopqrstuvwxyz"], + desc: "Matches a character having a character code between the two specified characters inclusive.", + token: "[A-Z]" + }, { + id: "posixcharclass", + tip: "Matches any character in the '{{value}}' POSIX class.", + label: "POSIX class", + desc: "Matches any character in the specified POSIX class. Must be in a character set. For example, [[:alnum:]$] will match alphanumeric characters and $.", + ext: "

    For a list of classes, see the PCRE spec.

    ", + token: "[:alnum:]" + }, { + id: "dot", + tip: "Matches any character {{getDotAll()}}.", + desc: "Matches any character except linebreaks.", + ext: " Equivalent to [^\\n\\r].", + example: [".", "glib jocks vex dwarves!"], + token: "." + }, { + id: "matchanyset", + label: "match any", + desc: "A character set that can be used to match any character, including line breaks, without the dotall flag (s)." + "

    An alternative is [^], but it is not supported in all browsers.

    ", + example: ["[\\s\\S]", "glib jocks vex dwarves!"], + token: "[\\s\\S]" + }, { + id: "unicodegrapheme", + label: "unicode grapheme", + desc: "Matches any single unicode grapheme (ie. character).", + ext: " This includes line breaks (regardless of the dotall mode) and graphemes encoded as multiple code points.", + token: "\\X" + }, { + id: "word", + desc: "Matches any word character (alphanumeric & underscore).", + ext: " Only matches low-ascii characters (no accented or non-roman characters). Equivalent to [A-Za-z0-9_]", + example: ["\\w", "bonjour, mon fr\u00E8re"], + token: "\\w" + }, { + id: "notword", + label: "not word", + desc: "Matches any character that is not a word character (alphanumeric & underscore).", + ext: " Equivalent to [^A-Za-z0-9_]", + example: ["\\W", "bonjour, mon fr\u00E8re"], + token: "\\W" + }, { + id: "digit", + desc: "Matches any digit character (0-9).", + ext: " Equivalent to [0-9].", + example: ["\\d", "+1-(444)-555-1234"], + token: "\\d" + }, { + id: "notdigit", + label: "not digit", + desc: "Matches any character that is not a digit character (0-9).", + ext: " Equivalent to [^0-9].", + example: ["\\D", "+1-(444)-555-1234"], + token: "\\D" + }, { + id: "whitespace", + desc: "Matches any whitespace character (spaces, tabs, line breaks).", + example: ["\\s", "glib jocks vex dwarves!"], + token: "\\s" + }, { + id: "notwhitespace", + label: "not whitespace", + desc: "Matches any character that is not a whitespace character (spaces, tabs, line breaks).", + example: ["\\S", "glib jocks vex dwarves!"], + token: "\\S" + }, { + id: "hwhitespace", + label: "horizontal whitespace", + desc: "Matches any horizontal whitespace character (spaces, tabs).", + token: "\\h" + }, { + id: "nothwhitespace", + label: "not horizontal whitespace", + desc: "Matches any character that is not a horizontal whitespace character (spaces, tabs).", + token: "\\H" + }, { + id: "vwhitespace", + label: "vertical whitespace", + desc: "Matches any vertical whitespace character (line breaks).", + token: "\\v" + }, { + id: "notvwhitespace", + label: "not vertical whitespace", + desc: "Matches any character that is not a vertical whitespace character (line breaks).", + token: "\\V" + }, { + id: "linebreak", + label: "line break", + desc: "Matches any line break character, including the CRLF pair, and CR / LF individually.", + token: "\\R" + }, { + id: "notlinebreak", + label: "not line break", + desc: "Matches any character that is not a line break.", + ext: " Similar to dot (.) but is unaffected by the dotall flag (s).", + token: "\\N" + }, { + id: "unicodecat", + tip: "Matches any character in the '{{getUniCat()}}' unicode category.", + label: "unicode category", + desc: "Matches a character in the specified unicode category. For example, \\p{Ll} will match any lowercase letter.", + ext: "

    For a list of categories, see the PCRE spec.

    " + "

    There are multiple syntaxes for this feature:

    \\p{L} \\pL

    ", + token: "\\p{L}" + }, { + id: "notunicodecat", + tip: "Matches any character that is not in the '{{getUniCat()}}' unicode category.", + label: "not unicode category", + desc: "Matches any character that is not in the specified unicode category.", + ext: "

    For a list of categories, see the PCRE spec.

    " + "

    There are multiple syntaxes for this feature:

    \\P{L} \\p{^L} \\PL

    ", + token: "\\P{L}" + }, { + id: "unicodescript", + tip: "Matches any character in the '{{value}}' unicode script.", + label: "unicode script", + desc: "Matches any character in the specified unicode script. For example, \\p{Arabic} will match characters in the Arabic script.", + ext: "

    For a list of scripts, see the PCRE spec.

    ", + token: "\\p{Han}" + }, { + id: "notunicodescript", + tip: "Matches any character that is not in the '{{value}}' unicode script.", + label: "not unicode script", + desc: "Matches any character that is not in the specified unicode script.", + ext: "

    For a list of scripts, see the PCRE spec.

    " + "

    There are multiple syntaxes for this feature:

    \\P{Han} \\p{^Han}", + token: "\\P{Han}" + }] + }, { + label: "Anchors", + id: "anchors", + desc: "Anchors are unique in that they match a position within a string, not a character.", + kids: [{ + id: "bos", + label: "beginning of string", + desc: "Matches the beginning of the string.", + ext: " Unlike ^, this is unaffected by the multiline flag (m). This matches a position, not a character.", + token: "\\A" + }, { + id: "eos", + label: "end of string", + desc: "Matches the end of the string.", + ext: " Unlike $, this is unaffected by the multiline flag (m). This matches a position, not a character.", + token: "\\Z" + }, { + id: "abseos", + label: "strict end of string", + desc: "Matches the end of the string. Unlike $ or \\Z, it does not allow for a trailing newline.", + ext: " This is unaffected by the multiline flag (m). This matches a position, not a character.", + token: "\\z" + }, { + id: "bof", + label: "beginning", + desc: "Matches the beginning of the string, or the beginning of a line if the multiline flag (m) is enabled.", + ext: " This matches a position, not a character.", + example: ["^\\w+", "she sells seashells"], + token: "^" + }, { + id: "eof", + label: "end", + desc: "Matches the end of the string, or the end of a line if the multiline flag (m) is enabled.", + ext: " This matches a position, not a character.", + example: ["\\w+$", "she sells seashells"], + token: "$" + }, { + id: "wordboundary", + label: "word boundary", + desc: "Matches a word boundary position between a word character and non-word character or position (start / end of string).", + ext: " See the word character class (\w) for more info.", + example: ["s\\b", "she sells seashells"], + token: "\\b" + }, { + id: "notwordboundary", + label: "not word boundary", + desc: "Matches any position that is not a word boundary.", + ext: " This matches a position, not a character.", + example: ["s\\B", "she sells seashells"], + token: "\\B" + }, { + id: "prevmatchend", + label: "previous match end", + desc: "Matches the end position of the previous match.", + ext: " This matches a position, not a character.", + token: "\\G" + }] + }, { + label: "Escaped characters", + id: "escchars", + desc: "Escape sequences can be used to insert reserved, special, and unicode characters. All escaped characters begin with the \\ character.", + kids: [{ + id: "reservedchar", + label: "reserved characters", + desc: "The following character have special meaning, and should be preceded by a \\ (backslash) to represent a literal character:" + "

    {{getEscChars()}}

    " + "

    Within a character set, only \\, -, and ] need to be escaped.

    ", + example: ["\\+", "1 + 1 = 2"], + token: "\\+", + show: true + }, { + id: "escoctal", + label: "octal escape", + desc: "Octal escaped character in the form \\000.", + ext: " Value must be less than 255 (\\377).", + // PCRE profile adds to ext. + example: ["\\251", "RegExr is \u00A92014"], + token: "\\000" + }, { + id: "eschexadecimal", + label: "hexadecimal escape", + desc: "Hexadecimal escaped character in the form \\xFF.", + example: ["\\xA9", "RegExr is \u00A92014"], + token: "\\xFF" + }, { + id: "escunicodeu", + label: "unicode escape", + desc: "Unicode escaped character in the form \\uFFFF", + example: ["\\u00A9", "RegExr is \u00A92014"], + token: "\\uFFFF" + }, { + id: "escunicodeub", + label: "extended unicode escape", + desc: "Unicode escaped character in the form \\u{FFFF}.", + ext: " Supports a full range of unicode point escapes with any number of hex digits.

    Requires the unicode flag (u).

    ", + token: "\\u{FFFF}" + }, { + id: "escunicodexb", + label: "unicode escape", + desc: "Unicode escaped character in the form \\x{FF}.", + token: "\\x{FF}" + }, { + id: "esccontrolchar", + label: "control character escape", + desc: "Escaped control character in the form \\cZ.", + ext: " This can range from \\cA (SOH, char code 1) to \\cZ (SUB, char code 26).

    Example:

    \\cI matches TAB (char code 9).", + token: "\\cI" + }, { + id: "escsequence", + label: "escape sequence", + tip: "Matches the literal string '{{value}}'.", + desc: "All characters between the \\Q and the \\E are interpreted as a literal string. If \\E is omitted, it continues to the end of the expression.", + ext: " For example, the expression /\\Q(?.)\\E/ will match the string (?.).", + token: "\\Q...\\E" + }] + }, { + label: "Groups & References", + id: "groups", + desc: "Groups allow you to combine a sequence of tokens to operate on them together. Capture groups can be referenced by a backreference and accessed separately in the results.", + kids: [{ + id: "group", + label: "capturing group", + desc: "Groups multiple tokens together and creates a capture group for extracting a substring or using a backreference.", + example: ["(ha)+", "hahaha haa hah!"], + token: "(ABC)" + }, { + id: "namedgroup", + label: "named capturing group", + tip: "Creates a capturing group named '{{name}}'.", + desc: "Creates a capturing group that can be referenced via the specified name.", + ext: "

    There are multiple syntaxes for this feature:

    (?'name'ABC) (?P<name>ABC) (?<name>ABC)

    ", + token: "(?ABC)" + }, { + id: "namedref", + label: "named reference", + tip: "Matches the results of the capture group named '{{group.name}}'.", + desc: "Matches the results of a named capture group.", + ext: "

    There are multiple syntaxes for this feature:

    \\k'name' \\k<name> \\k{name} \\g{name} (?P=name)

    ", + token: "\\k'name'" + }, { + id: "numref", + label: "numeric reference", + tip: "Matches the results of capture group #{{group.num}}.", + desc: "Matches the results of a capture group. For example \\1 matches the results of the first capture group & \\3 matches the third.", + // PCRE adds relative and alternate syntaxes in ext + example: ["(\\w)a\\1", "hah dad bad dab gag gab"], + token: "\\1" + }, { + id: "branchreset", + label: "branch reset group", + desc: "Define alternative groups that share the same group numbers.", + ext: "

    For example, in (?|(a)|(b)) both groups (a and b) would be counted as group #1.", + token: "(?|(a)|(b))" + }, { + id: "noncapgroup", + label: "non-capturing group", + desc: "Groups multiple tokens together without creating a capture group.", + example: ["(?:ha)+", "hahaha haa hah!"], + token: "(?:ABC)" + }, { + id: "atomic", + label: "atomic group", + desc: "Non-capturing group that discards backtracking positions once matched.", + ext: "

    For example, /(?>ab|a)b/ will match abb but not ab because once the ab option has matched, the atomic group prevents backtracking to retry with the a option.

    ", + token: "(?>ABC)" + }, { + id: "define", + desc: "Used to define named groups for use as subroutines without including them in the match.", + ext: "

    For example, /A(?(DEFINE)(?'foo'Z))B\\g'foo'/ will match ABZ, because the define group is ignored in the match except to define the foo subroutine that is referenced later with \\g'foo'.

    ", + token: "(?(DEFINE)(?'foo'ABC))" + }, { + id: "numsubroutine", + label: "numeric subroutine", + tip: "Matches the expression in capture group #{{group.num}}.", + desc: "Matches the expression in a capture group. Compare this to a reference, that matches the result." + " For example /(a|b)\\g'1'/ can match ab, because the expression a|b is evaluated again.", + ext: "

    There are multiple syntaxes for this feature: \\g<1> \\g'1' (?1).

    " + "

    Relative values preceded by + or - are also supported. For example \\g<-1> would match the group preceding the reference.

    ", + token: "\\g'1'" + }, { + id: "namedsubroutine", + label: "named subroutine", + tip: "Matches the expression in the capture group named '{{group.name}}'.", + desc: "Matches the expression in a capture group. Compare this to a reference, that matches the result.", + ext: "

    There are multiple syntaxes for this feature: \\g<name> \\g'name' (?&name) (?P>name).

    ", + token: "\\g'name'" + }] + }, { + label: "Lookaround", + id: "lookaround", + desc: "Lookaround lets you match a group before (lookbehind) or after (lookahead) your main pattern without including it in the result." + "

    Negative lookarounds specify a group that can NOT match before or after the pattern.

    ", + kids: [{ + id: "poslookahead", + label: "positive lookahead", + desc: "Matches a group after the main expression without including it in the result.", + example: ["\\d(?=px)", "1pt 2px 3em 4px"], + token: "(?=ABC)" + }, { + id: "neglookahead", + label: "negative lookahead", + desc: "Specifies a group that can not match after the main expression (if it matches, the result is discarded).", + example: ["\\d(?!px)", "1pt 2px 3em 4px"], + token: "(?!ABC)" + }, { + id: "poslookbehind", + label: "positive lookbehind", + desc: "Matches a group before the main expression without including it in the result.", + token: "(?<=ABC)" + }, { + id: "neglookbehind", + label: "negative lookbehind", + desc: "Specifies a group that can not match before the main expression (if it matches, the result is discarded).", + token: "(?/o\\Kbar/ will match bar within the string foobar", + token: "\\K" + }] + }, { + label: "Quantifiers & Alternation", + id: "quants", + desc: "Quantifiers indicate that the preceding token must be matched a certain number of times. By default, quantifiers are greedy, and will match as many characters as possible." + "
    Alternation acts like a boolean OR, matching one sequence or another.", + kids: [{ + id: "plus", + desc: "Matches 1 or more of the preceding token.", + example: ["b\\w+", "b be bee beer beers"], + token: "+" + }, { + id: "star", + desc: "Matches 0 or more of the preceding token.", + example: ["b\\w*", "b be bee beer beers"], + token: "*" + }, { + id: "quant", + label: "quantifier", + tip: "Match {{getQuant()}} of the preceding token.", + desc: "Matches the specified quantity of the previous token. " + "{1,3} will match 1 to 3. " + "{3} will match exactly 3. " + "{3,} will match 3 or more. ", + example: ["b\\w{2,3}", "b be bee beer beers"], + token: "{1,3}" + }, { + id: "opt", + label: "optional", + desc: "Matches 0 or 1 of the preceding token, effectively making it optional.", + example: ["colou?r", "color colour"], + token: "?" + }, { + id: "lazy", + tip: "Makes the preceding quantifier {{getLazy()}}, causing it to match as {{getLazyFew()}} characters as possible.", + desc: "Makes the preceding quantifier lazy, causing it to match as few characters as possible.", + ext: " By default, quantifiers are greedy, and will match as many characters as possible.", + example: ["b\\w+?", "b be bee beer beers"], + token: "?" + }, { + id: "possessive", + desc: "Makes the preceding quantifier possessive. It will match as many characters as possible, and will not release them to match subsequent tokens.", + ext: "

    For example /.*a/ would match aaa, but /.*+a/ would not, because the repeating dot would match and not release the last character to match a.

    ", + token: "+" + }, { + id: "alt", + label: "alternation", + desc: "Acts like a boolean OR. Matches the expression before or after the |.", + ext: "

    It can operate within a group, or on a whole expression. The patterns will be tested in order.

    ", + example: ["b(a|e|i)d", "bad bud bod bed bid"], + token: "|" + }] + }, { + label: "Special", + id: "other", + desc: "Tokens that don't quite fit anywhere else.", + kids: [{ + id: "comment", + desc: "Allows you to insert a comment into your expression that is ignored when finding a match.", + token: "(?#foo)" + }, { + id: "conditional", + desc: "Conditionally matches one of two options based on whether a lookaround is matched.", + ext: "

    For example, /(?(?=a)ab|..)/ will match ab and zx but not ax, because if the first character matches the condition a then it evaluates the pattern ab.

    " + "

    Any lookaround can be used as the condition. A lookahead will start the subsequent match at the start of the condition, a lookbehind will start it after.

    ", + token: "(?(?=A)B|C)" + }, { + id: "conditionalgroup", + label: "group conditional", + desc: "Conditionally matches one of two options based on whether group '{{name}}' matched.", + ext: "

    For example, /(z)?(?(1)a|b)/ will match za because the first capture group matches z successfully, which causes the conditional to match the first option a.

    " + "

    The same pattern will also match b on its own, because group 1 doesn't match, so it instead tries to match the second option b.

    " + "

    You can reference a group by name, number, or relative position (ex. -1).

    ", + token: "(?(1)B|C)" + }, { + id: "recursion", + desc: "Attempts to match the full expression again at the current position.", + ext: "

    For example, /a(?R)?b/ will match any number of a followed by the same number of z: the full text of az or aaaazzzz, but not azzz.

    " + "

    There are multiple syntaxes for this feature:

    (?R) (?0) \\g<0> \\g'0'

    ", + token: "(?R)" + }, { + id: "mode", + label: "mode modifier", + tip: "{{~getDesc()}}{{~getModes()}}", + desc: "Enables or disables modes for the remainder of the expression.", + ext: "Matching modes generally map to expression flags. For example (?i) would enable case insensitivity for the remainder of the expression." + "

    Multiple modifiers can be specified, and any modifiers that follow - are disabled. For example (?im-s) would enable case insensitivity & multiline modes, and disable dotall.

    " + "

    Supported modifiers are: i - case insensitive, s - dotall, m - multiline, x - free spacing, J - allow duplicate names, U - ungreedy.

    ", + token: "(?i)" + }] + }, { + label: "Substitution", + desc: "These tokens are used in a substitution string to insert different parts of the match.", + target: "subst", + id: "subst", + kids: [{ + id: "subst_$&match", + label: "match", + desc: "Inserts the matched text.", + token: "$&" + }, { + id: "subst_0match", + label: "match", + desc: "Inserts the matched text.", + ext: "

    There are multiple syntaxes for this feature:

    $0 \\0 \\{0}

    ", + token: "$0" + }, { + id: "subst_group", + label: "capture group", + tip: "Inserts the results of capture group #{{group.num}}.", + desc: "Inserts the results of the specified capture group. For example, $3 would insert the third capture group.", + // NOTE: javascript profile overrides this: + ext: "

    There are multiple syntaxes for this feature:

    $1 \\1 \\{1}

    ", + token: "$1" + }, { + id: "subst_$before", + label: "before match", + desc: "Inserts the portion of the source string that precedes the match.", + token: "$`" + }, { + id: "subst_$after", + label: "after match", + desc: "Inserts the portion of the source string that follows the match.", + token: "$'" + }, { + id: "subst_$esc", + label: "escaped $", + desc: "Inserts a dollar sign character ($).", + token: "$$" + }, { + id: "subst_esc", + label: "escaped characters", + token: "\\n", + desc: "For convenience, these escaped characters are supported in the Replace string in RegExr: \\n, \\r, \\t, \\\\, and unicode escapes \\uFFFF. This may vary in your deploy environment." + }] + }, { + id: "flags", + label: "Flags", + tooltip: "Expression flags change how the expression is interpreted. Click to edit.", + desc: "Expression flags change how the expression is interpreted. Flags follow the closing forward slash of the expression (ex. /.+/igm ).", + target: "flags", + kids: [{ + id: "caseinsensitive", + label: "ignore case", + desc: "Makes the whole expression case-insensitive.", + ext: " For example, /aBc/i would match AbC.", + token: "i" + }, { + id: "global", + label: "global search", + tip: "Retain the index of the last match, allowing iterative searches.", + desc: "Retain the index of the last match, allowing subsequent searches to start from the end of the previous match." + "

    Without the global flag, subsequent searches will return the same match.


    " + "RegExr only searches for a single match when the global flag is disabled to avoid infinite match errors.", + token: "g" + }, { + id: "multiline", + tip: "Beginning/end anchors (^/$) will match the start/end of a line.", + desc: "When the multiline flag is enabled, beginning and end anchors (^ and $) will match the start and end of a line, instead of the start and end of the whole string." + "

    Note that patterns such as /^[\\s\\S]+$/m may return matches that span multiple lines because the anchors will match the start/end of any line.

    ", + token: "m" + }, { + id: "unicode", + tip: "Enables \\x{FFFFF} unicode escapes.", + desc: "When the unicode flag is enabled, you can use extended unicode escapes in the form \\x{FFFFF}." + "

    It also makes other escapes stricter, causing unrecognized escapes (ex. \\j) to throw an error.

    ", + token: "u" + }, { + id: "sticky", + desc: "The expression will only match from its lastIndex position and ignores the global (g) flag if set.", + ext: " Because each search in RegExr is discrete, this flag has no further impact on the displayed results.", + token: "y" + }, { + id: "dotall", + desc: "Dot (.) will match any character, including newline.", + token: "s" + }, { + id: "extended", + desc: "Literal whitespace characters are ignored, except in character sets.", + token: "x" + }, { + id: "ungreedy", + tip: "Makes quantifiers ungreedy (lazy) by default.", + desc: "Makes quantifiers ungreedy (lazy) by default. Quantifiers followed by ? will become greedy.", + token: "U" + }] + }]; + + // content that isn't included in the Reference menu item: + o.misc = { + kids: [{ + id: "ignorews", + label: "ignored whitespace", + tip: "Whitespace character ignored due to the extended flag or mode." + }, { + id: "extnumref", + // alternative syntaxes. + proxy: "numref" + }, { + id: "char", + label: "character", + tip: "Matches a {{getChar()}} character (char code {{code}}). {{getInsensitive()}}" + }, { + id: "escchar", + label: "escaped character", + tip: "Matches a {{getChar()}} character (char code {{code}})." + }, { + id: "open", + tip: "Indicates the start of a regular expression." + }, { + id: "close", + tip: "Indicates the end of a regular expression and the start of expression flags." + }, { + id: "condition", + tip: "The lookaround to match in resolving the enclosing conditional statement. See 'conditional' in the Reference for info." + }, { + id: "conditionalelse", + label: "conditional else", + tip: "Delimits the 'else' portion of the conditional." + }, { + id: "ERROR", + tip: "Errors in the expression are underlined in red. Roll over errors for more info." + }, { + id: "PREG_INTERNAL_ERROR", + tip: "Internal PCRE error" + }, { + id: "PREG_BACKTRACK_LIMIT_ERROR", + tip: "Backtrack limit was exhausted." + }, { + id: "PREG_RECURSION_LIMIT_ERROR", + tip: "Recursion limit was exhausted" + }, { + id: "PREG_BAD_UTF8_ERROR", + tip: "Malformed UTF-8 data" + }, { + id: "PREG_BAD_UTF8_OFFSET_ERROR", + tip: "Malformed UTF-8 data" + }] + }; + o.errors = { + groupopen: "Unmatched opening parenthesis.", + groupclose: "Unmatched closing parenthesis.", + setopen: "Unmatched opening square bracket.", + rangerev: "Range values reversed. Start char code is greater than end char code.", + quanttarg: "Invalid target for quantifier.", + quantrev: "Quantifier minimum is greater than maximum.", + esccharopen: "Dangling backslash.", + esccharbad: "Unrecognized or malformed escape character.", + unicodebad: "Unrecognized unicode category or script.", + posixcharclassbad: "Unrecognized POSIX character class.", + posixcharclassnoset: "POSIX character class must be in a character set.", + notsupported: "The \"{{~getLabel()}}\" feature is not supported in this flavor of RegEx.", + fwdslash: "Unescaped forward slash. This may cause issues if copying/pasting this expression into code.", + esccharbad: "Invalid escape sequence.", + servercomm: "An error occurred while communicating with the server.", + extraelse: "Extra else in conditional group.", + unmatchedref: "Reference to non-existent group \"{{name}}\".", + modebad: "Unrecognized mode flag \"{{errmode}}\".", + badname: "Group name can not start with a digit.", + dupname: "Duplicate group name.", + branchreseterr: "Branch Reset. Results will be ok, but RegExr's parser does not number branch reset groups correctly. Coming soon!", + timeout: "The expression took longer than 250ms to execute.", + // TODO: can we couple this to the help content somehow? + + // warnings: + jsfuture: "The \"{{~getLabel()}}\" feature may not be supported in all browsers.", + infinite: "The expression can return empty matches, and may match infinitely in some use cases." // TODO: can we couple this to the help content somehow? + }; + + /* + classes: + quant + set + special + ref + esc + anchor + charclass + group + comment + */ + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class BrowserSolver { + constructor() { + const workerBlob = new Blob([document.querySelector('#regexWorker').textContent], { + type: "text/javascript" + }); + this._workerObjectURL = URL.createObjectURL(workerBlob); + } + solve(o, callback) { + this._callback = callback; + this._req = o; + let regex, + text = o.text, + tests = o.tests, + mode = o.mode; + try { + this._regex = regex = new RegExp(o.pattern, o.flags); + } catch (e) { + return this._onRegExComplete({ + id: "regexparse", + name: e.name, + message: e.message + }, null, mode); + } + if (window.Worker) { + const worker = new Worker(this._workerObjectURL); + worker.onmessage = evt => { + if (evt.data === "onload") { + this._startTime = Utils.now(); + this._timeoutId = setTimeout(() => { + worker.terminate(); + this._onRegExComplete({ + id: "timeout" + }, null, mode); // TODO: make this a warning, and return all results so far. + }, 250); + } else { + clearTimeout(this._timeoutId); + worker.terminate(); + this._onRegExComplete(evt.data.error, evt.data.matches, evt.data.mode); + } + }; + + // we need to pass the pattern and flags as text, because Safari strips the unicode flag when passing a RegExp to a Worker + worker.postMessage({ + pattern: o.pattern, + flags: o.flags, + text, + tests, + mode + }); + } else { + this._startTime = Utils.now(); + + // shared between BrowserSolver & RegExWorker + var matches = [], + match, + index, + error; + if (mode === "tests") { + for (var i = 0, l = tests.length; i < l; i++) { + let test = tests[i]; + text = test.text; + regex.lastIndex = 0; + match = regex.exec(text); + matches[i] = match ? { + i: match.index, + l: match[0].length, + id: test.id + } : { + id: test.id + }; + } + } else { + while (match = regex.exec(text)) { + if (index === regex.lastIndex) { + error = { + id: "infinite", + warning: true + }; + ++regex.lastIndex; + } + index = regex.lastIndex; + var groups = match.reduce(function (arr, s, i) { + return (i === 0 || arr.push({ + s: s + })) && arr; + }, []); + matches.push({ + i: match.index, + l: match[0].length, + groups: groups + }); + if (!regex.global) { + break; + } // or it will become infinite. + } + } + // end share + + this._onRegExComplete(error, matches, mode); + } + } + _onRegExComplete(error, matches, mode) { + let result = { + time: error ? null : Utils.now() - this._startTime, + error, + mode, + matches + }; + let tool = this._req.tool; + if (tool) { + result.tool = { + id: tool.id + }; + if (!error || error.warning && tool.input != null) { + let str = Utils.unescSubstStr(tool.input); + result.tool.result = tool.id === "replace" ? this._getReplace(str) : this._getList(str); + } + } + this._callback(result); + } + _getReplace(str) { + return this._req.text.replace(this._regex, str); + } + _getList(str) { + // TODO: should we move this into a worker? + let source = this._req.text, + result = "", + repl, + ref, + trimR = 0, + regex; + + // build a RegExp without the global flag: + try { + regex = new RegExp(this._req.pattern, this._req.flags.replace("g", "")); + } catch (e) { + return null; + } + if (str.search(/\$[&1-9`']/) === -1) { + trimR = str.length; + str = "$&" + str; + } + do { + ref = source.replace(regex, "\b"); // bell char - just a placeholder to find + let index = ref.indexOf("\b"), + empty = ref.length > source.length; + if (index === -1) { + break; + } + repl = source.replace(regex, str); + result += repl.substr(index, repl.length - ref.length + 1); + source = ref.substr(index + (empty ? 2 : 1)); + } while (source.length); + if (trimR) { + result = result.substr(0, result.length - trimR); + } + return result; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class ServerSolver { + solve(o, callback) { + // unescape tool input: + if (o.tool && o.tool.input != null) { + o.tool.input = Utils.unescSubstStr(o.tool.input); + } + if (this._serverPromise) { + this._serverPromise.abort(); + } + Utils.defer(() => this._solve(o, callback), "ServerSolver._solve", 250); + } + _solve(o, callback) { + this._callback = callback; + this._serverPromise = Server.solve(o).then(o => this._onLoad(o)).catch(o => this._onError(o)); + } + _onLoad(data) { + this._callback(data); + } + _onError(msg) { + this._callback({ + error: { + id: msg + } + }); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class Flavor extends EventDispatcher { + constructor(flavor) { + super(); + this.value = app.prefs.read("flavor"); + this._browserSolver = new BrowserSolver(); + this._serverSolver = new ServerSolver(); + } + set value(id) { + let profile = profiles[id && id.toLowerCase() || "js"]; + if (!profile || profile === this._profile) { + return; + } + this._profile = profile; + this._buildSupportMap(profile); + app.prefs.write("flavor", id); + this.dispatchEvent("change"); + } + get value() { + return this._profile.id; + } + get profile() { + return this._profile; + } + get profiles() { + return [profiles.js, profiles.pcre]; + } + get solver() { + return this._profile.browser ? this._browserSolver : this._serverSolver; + } + isTokenSupported(id) { + return !!this._profile._supportMap[id]; + } + getDocs(id) { + return this._profile.docs[id]; + } + validateFlags(list) { + let flags = this._profile.flags, + dupes = {}; + return list.filter(id => !!flags[id] && !dupes[id] && (dupes[id] = true)); + } + validateFlagsStr(str) { + return this.validateFlags(str.split("")).join(""); + } + isFlagSupported(id) { + return !!this._profile.flags[id]; + } + _buildSupportMap(profile) { + if (profile._supportMap) { + return; + } + let map = profile._supportMap = {}, + props = Flavor.SUPPORT_MAP_PROPS, + n; + for (n in props) { + this._addToSupportMap(map, profile[n], !!props[n]); + } + let o = profile.escCharCodes, + esc = profile.escChars; + for (n in o) { + map["esc_" + o[n]] = true; + } + for (n in esc) { + map["esc_" + esc[n]] = true; + } + } + _addToSupportMap(map, o, rev) { + if (rev) { + for (let n in o) { + map[o[n]] = true; + } + } else { + for (let n in o) { + map[n] = o[n]; + } + } + } + } + Flavor.SUPPORT_MAP_PROPS = { + // 1 = reverse, 0 - normal + flags: 1, + // escape is handled separately + // escCharCodes is handled separately + escCharTypes: 1, + charTypes: 1, + // unquantifiables not included + // unicodeScripts not included + // unicodeCategories not included + // posixCharClasses not included + // modes not included + tokens: 0, + substTokens: 0 + // config not included + // docs not included + }; + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class RefCoverage { + constructor() { + app.flavor._buildSupportMap(core); + let ref = app.reference._idMap, + undoc = [], + unused = [], + all = core._supportMap; + let ignore = { + "escchar": true, + // literal char + "groupclose": true, + "setclose": true, + "condition": true, + // proxies to conditional + "conditionalelse": true, + // proxies to conditional + subst_$group: true, + // resolved to subst_group + subst_$bgroup: true, + // resolved to subst_group + subst_bsgroup: true, + // resolved to subst_group + escoctalo: true // resolved to escoctal + }; + for (let n in all) { + if (!ref[n] && !ignore[n]) { + undoc.push(n); + } + } + for (let n in ref) { + if (!all[n] && !ref[n].kids) { + unused.push(n); + } + } + console.log("--- UNDOCUMENTED IDS ---\n" + undoc.join("\n") + "\n\n--- UNUSED DOCS? ---\n" + unused.join("\n")); + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + class Prefs { + constructor(el) { + this._load(); + } + read(key) { + return this._data[key]; + } + write(key, value) { + if (this._data[key] === value) { + return; + } + this._data[key] = value; + this._save(); + } + clear(key) { + delete this._data[key]; + this._save(); + } + _load() { + let match = /(?:^|;\s*)prefs=\s*([^;]*)/.exec(document.cookie); + if (match && match[1]) { + try { + this._data = JSON.parse(unescape(match[1])); + return; + } catch (e) {} + } + this._data = {}; + } + _save() { + let str = escape(JSON.stringify(this._data)); + document.cookie = "prefs=" + str + "; expires=Fri, 31 Dec 9999 23:59:59 GMT;"; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + class RegExr extends EventDispatcher { + constructor() { + super(); + } + init(state, account, config = {}) { + this.prefs = new Prefs(); + this.flavor = new Flavor(); + this.reference = new Reference(reference_content, this.flavor, config); + this._migrateFavorites(); + this._initUI(); + this.account.value = account; + if (state === false) { + this._localInit(); + } else if (this.account.authenticated && !state) { + this.newDoc(false); + } else { + this.state = state; + } + this._savedHash = null; + let params = Utils.getUrlParams(); + if (Utils.isLocal && params.id) { + Server.load(params.id).then(o => this.state = o); + params = {}; + } + if (params.engine) { + this.flavor.value = params.engine; + } + if (params.expression) { + this.expression.value = params.expression; + } + if (params.text) { + this.text.value = params.text; + } + if (params.tool) { + this.tools.value = { + id: params.tool, + input: params.input + }; + } + window.onbeforeunload = e => this.unsaved ? "You have unsaved changes." : null; + this.resetUnsaved(); + setTimeout(() => this._initAds(), 100); + } + _initAds() { + _native && _native.init("CK7D65QM", { + // "CK7D65QM" use "CK7D4KQE" to test Carbon ads + carbonZoneKey: 'CK7DPKQU', + targetClass: 'native-js' + }); + } + _localInit() { + console.log("local init"); + //Server.verify().then((data) => this.account.value = data); + new RefCoverage(); + } + + // getter / setters: + get state() { + console.log(this.text.mode); + let o = { + expression: this.expression.value, + text: this.text.value, + tests: this.text.tests, + flavor: this.flavor.value, + tool: this.tools.value, + mode: this.text.mode + }; + // copy share values onto the pattern object: + return Utils.copy(this.share.value, o); + } + set state(o) { + if (!o) { + return; + } + this.flavor.value = o.flavor; + this.expression.value = o.expression; + this.text.value = o.text; + this.text.tests = o.tests; + this.text.mode = o.mode; + this.tools.value = o.tool; + this.share.pattern = o; + this.resetUnsaved(); + } + get hash() { + let share = this.share; + return Utils.getHashCode(this.expression.value + "\t" + this.text.value + "\t" + this.flavor.value + "\t" + share.author + "\t" + share.name + "\t" + share.description + "\t" + share.keywords + "\t" + JSON.stringify(this.text.tests) + "\t" + //+ this.tools.value.input+"\t" + //+ this.tools.value.id+"\t" + ); + } + get unsaved() { + return this.hash !== this._savedHash; + } + get isNarrow() { + return this._matchList.matches; + } + + // public methods: + resetUnsaved() { + this._savedHash = this.hash; + } + newDoc(warn = true) { + this.load({ + flavor: this.flavor.value, + expression: ".", + text: "Text" + }, warn); + this.expression.selectAll(); + } + load(state, warn = true) { + if (warn === true) { + warn = "You have unsaved changes. Continue without saving?"; + } + if (warn && this.unsaved && !confirm(warn)) { + return; + } + this.state = Utils.clone(state); + } + + // private methods: + _initUI() { + // TODO: break into own Device class? Rename mobile.scss too? + // mobile setup + // keep synced with "mobile.scss": + if (screen.width < 500) { + document.getElementById("viewport").setAttribute("content", "width=500, user-scalable=0"); + } + this._matchList = window.matchMedia("(max-width: 900px)"); + this._matchList.addListener(q => this.dispatchEvent("narrow")); // currently unused. + + // UI: + this.el = DOMUtils.query(".container"); + this.tooltip = { + hover: new Tooltip(DOMUtils.query("#library #tooltip").cloneNode(true)), + toggle: new Tooltip(DOMUtils.query("#library #tooltip"), true) + }; + this.theme = new Theme(this.el); + let el = this.docEl = DOMUtils.query(".app > .doc", this.el); + this.expression = new Expression(DOMUtils.query("> section.expression", el)); + this.text = new Text(DOMUtils.query("> section.text", el)); + this.tools = new Tools(DOMUtils.query("> section.tools", el)); + this.account = new Account(); + this.sidebar = new Sidebar(DOMUtils.query(".app > .sidebar", this.el)); + this.share = this.sidebar.share; + this.expression.on("change", () => this._change()); + this.text.on("change", () => this._change()); + this.text.on("modechange", () => this._modeChange()); + this.flavor.on("change", () => this._change()); + this.tools.on("change", () => this._change()); + this.share.on("change", () => this._change()); + } + _migrateFavorites() { + let ls = window.localStorage, + l = ls.length; + if (!l || ls.getItem("f_v3") >= "1") { + return; + } + let ids = []; + for (let i = 0; i < l; i++) { + let key = ls.key(i), + val = ls.getItem(key); + if (key[0] === "f" && val === "1") { + ids.push(key.substr(1)); + } + } + if (!ids.length) { + ls.setItem("f_v3", "1"); + return; + } + Server.multiFavorite(ids).then(() => ls.setItem("f_v3", "1")); + } + _change() { + this.dispatchEvent("change"); + let solver = this.flavor.solver, + exp = this.expression; + let o = { + pattern: exp.pattern, + flags: exp.flags, + mode: this.text.mode + }; + if (o.mode === "tests") { + o.tests = this.text.tests; + } else { + o.text = this.text.value; + o.tool = this.tools.value; + } + solver.solve(o, result => this._handleResult(result)); + } + _modeChange() { + DOMUtils.toggleClass(this.docEl, "tests-mode", this.text.mode === "tests"); + this._change(); + } + _handleResult(result) { + this.result = this._processResult(result); + this.dispatchEvent("result"); + } + _processResult(result) { + if (result.mode === "text") { + result.matches && result.matches.forEach((o, i) => o.num = i); + } + return result; + } + } + + /* + RegExr: Learn, Build, & Test RegEx + Copyright (C) 2017 gskinner.com, inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + let app = new RegExr(); + + return app; + +}()); +//# sourceMappingURL=regexr.js.map diff --git a/deploy/en/regexr.js.map b/deploy/en/regexr.js.map new file mode 100644 index 0000000..819f3d6 --- /dev/null +++ b/deploy/en/regexr.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexr.js","sources":["../dev/lib/codemirror.js","../dev/lib/clipboard.js","../dev/lib/native.js","../dev/src/events/Event.js","../dev/src/events/EventDispatcher.js","../dev/src/utils/DOMUtils.js","../dev/src/utils/Utils.js","../dev/src/controls/Tooltip.js","../dev/src/net/Server.js","../dev/src/utils/CMUtils.js","../dev/src/utils/Track.js","../dev/src/controls/List.js","../dev/src/ExpressionLexer.js","../dev/src/views/ExpressionHighlighter.js","../dev/src/views/ExpressionHover.js","../dev/src/profiles/core.js","../dev/src/profiles/pcre.js","../dev/src/profiles/javascript.js","../dev/src/profiles/profiles.js","../dev/src/views/Expression.js","../dev/src/utils/UID.js","../dev/src/views/TextHighlighter.js","../dev/src/views/TextHover.js","../dev/src/views/Text.js","../dev/src/views/tools/Explain.js","../dev/src/views/tools/Details.js","../dev/src/views/tools/Replace.js","../dev/src/SubstLexer.js","../dev/src/views/Tools.js","../dev/src/docs/sidebar_content.js","../dev/src/controls/LinkRow.js","../dev/src/views/Example.js","../dev/src/views/Community.js","../dev/src/controls/Status.js","../dev/src/views/Account.js","../dev/src/views/Share.js","../dev/src/views/Sidebar.js","../dev/src/views/Theme.js","../dev/src/docs/Reference.js","../dev/src/docs/reference_content.js","../dev/src/helpers/BrowserSolver.js","../dev/src/helpers/ServerSolver.js","../dev/src/Flavor.js","../dev/src/RefCoverage.js","../dev/src/helpers/Prefs.js","../dev/src/RegExr.js","../dev/src/app.js"],"sourcesContent":["// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n// This is CodeMirror (http://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n// Kludges for bugs and behavior differences that can't be feature\n// detected are enabled based on userAgent etc sniffing.\nvar userAgent = navigator.userAgent\nvar platform = navigator.platform\n\nvar gecko = /gecko\\/\\d/i.test(userAgent)\nvar ie_upto10 = /MSIE \\d/.test(userAgent)\nvar ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent)\nvar edge = /Edge\\/(\\d+)/.exec(userAgent)\nvar ie = ie_upto10 || ie_11up || edge\nvar ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1])\nvar webkit = !edge && /WebKit\\//.test(userAgent)\nvar qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent)\nvar chrome = !edge && /Chrome\\//.test(userAgent)\nvar presto = /Opera\\//.test(userAgent)\nvar safari = /Apple Computer/.test(navigator.vendor)\nvar mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent)\nvar phantom = /PhantomJS/.test(userAgent)\n\nvar ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent)\nvar android = /Android/.test(userAgent)\n// This is woefully incomplete. Suggestions for alternative methods welcome.\nvar mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)\nvar mac = ios || /Mac/.test(platform)\nvar chromeOS = /\\bCrOS\\b/.test(userAgent)\nvar windows = /win/i.test(platform)\n\nvar presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/)\nif (presto_version) { presto_version = Number(presto_version[1]) }\nif (presto_version && presto_version >= 15) { presto = false; webkit = true }\n// Some browsers use the wrong event properties to signal cmd/ctrl on OS X\nvar flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11))\nvar captureRightClick = gecko || (ie && ie_version >= 9)\n\nfunction classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\nvar rmClass = function(node, cls) {\n var current = node.className\n var match = classTest(cls).exec(current)\n if (match) {\n var after = current.slice(match.index + match[0].length)\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\")\n }\n}\n\nfunction removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild) }\n return e\n}\n\nfunction removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n}\n\nfunction elt(tag, content, className, style) {\n var e = document.createElement(tag)\n if (className) { e.className = className }\n if (style) { e.style.cssText = style }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)) }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } }\n return e\n}\n// wrapper for elt, which removes the elt from the accessibility tree\nfunction eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style)\n e.setAttribute(\"role\", \"presentation\")\n return e\n}\n\nvar range\nif (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange()\n r.setEnd(endNode || node, end)\n r.setStart(node, start)\n return r\n} }\nelse { range = function(node, start, end) {\n var r = document.body.createTextRange()\n try { r.moveToElementText(node.parentNode) }\n catch(e) { return r }\n r.collapse(true)\n r.moveEnd(\"character\", end)\n r.moveStart(\"character\", start)\n return r\n} }\n\nfunction contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n}\n\nfunction activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement\n try {\n activeElement = document.activeElement\n } catch(e) {\n activeElement = document.body || null\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement }\n return activeElement\n}\n\nfunction addClass(node, cls) {\n var current = node.className\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls }\n}\nfunction joinClasses(a, b) {\n var as = a.split(\" \")\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i] } }\n return b\n}\n\nvar selectInput = function(node) { node.select() }\nif (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } }\nelse if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select() } catch(_e) {} } }\n\nfunction bind(f) {\n var args = Array.prototype.slice.call(arguments, 1)\n return function(){return f.apply(null, args)}\n}\n\nfunction copyObj(obj, target, overwrite) {\n if (!target) { target = {} }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop] } }\n return target\n}\n\n// Counts the column offset in a string, taking tabs into account.\n// Used mostly to find indentation.\nfunction countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/)\n if (end == -1) { end = string.length }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i)\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i\n n += tabSize - (n % tabSize)\n i = nextTab + 1\n }\n}\n\nvar Delayed = function() {this.id = null};\nDelayed.prototype.set = function (ms, f) {\n clearTimeout(this.id)\n this.id = setTimeout(f, ms)\n};\n\nfunction indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n}\n\n// Number of pixels added to scroller and sizer to hide scrollbar\nvar scrollerGap = 30\n\n// Returned or thrown by various protocols to signal 'I'm not\n// handling this'.\nvar Pass = {toString: function(){return \"CodeMirror.Pass\"}}\n\n// Reused option objects for setSelection & friends\nvar sel_dontScroll = {scroll: false};\nvar sel_mouse = {origin: \"*mouse\"};\nvar sel_move = {origin: \"+move\"};\n// The inverse of countColumn -- find the offset that corresponds to\n// a particular column.\nfunction findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos)\n if (nextTab == -1) { nextTab = string.length }\n var skipped = nextTab - pos\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos\n col += tabSize - (col % tabSize)\n pos = nextTab + 1\n if (col >= goal) { return pos }\n }\n}\n\nvar spaceStrs = [\"\"]\nfunction spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \") }\n return spaceStrs[n]\n}\n\nfunction lst(arr) { return arr[arr.length-1] }\n\nfunction map(array, f) {\n var out = []\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) }\n return out\n}\n\nfunction insertSorted(array, value, score) {\n var pos = 0, priority = score(value)\n while (pos < array.length && score(array[pos]) <= priority) { pos++ }\n array.splice(pos, 0, value)\n}\n\nfunction nothing() {}\n\nfunction createObj(base, props) {\n var inst\n if (Object.create) {\n inst = Object.create(base)\n } else {\n nothing.prototype = base\n inst = new nothing()\n }\n if (props) { copyObj(props, inst) }\n return inst\n}\n\nvar nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/\nfunction isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n}\nfunction isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n}\n\nfunction isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n}\n\n// Extending unicode characters. A series of a non-extending char +\n// any number of extending chars is treated as a single unit as far\n// as editing and measuring is concerned. This is not fully correct,\n// since some scripts/fonts/browsers also treat other configurations\n// of code points as a group.\nvar extendingChars = /[\\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]/\nfunction isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n// Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\nfunction skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir }\n return pos\n}\n\n// Returns the value from the range [`from`; `to`] that satisfies\n// `pred` and is closest to `from`. Assumes that at least `to` satisfies `pred`.\nfunction findFirst(pred, from, to) {\n for (;;) {\n if (Math.abs(from - to) <= 1) { return pred(from) ? from : to }\n var mid = Math.floor((from + to) / 2)\n if (pred(mid)) { to = mid }\n else { from = mid }\n }\n}\n\n// The display handles the DOM integration, both for input reading\n// and content drawing. It holds references to DOM nodes and\n// display-related state.\n\nfunction Display(place, doc, input) {\n var d = this\n this.input = input\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\")\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\")\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\")\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\")\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\")\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\")\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\")\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\")\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\")\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\")\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\")\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\")\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\")\n d.sizerWidth = null\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\")\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\")\n d.lineGutter = null\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\")\n d.scroller.setAttribute(\"tabIndex\", \"-1\")\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\")\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper) }\n else { place(d.wrapper) }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first\n d.reportedViewFrom = d.reportedViewTo = doc.first\n // Information about the rendered lines.\n d.view = []\n d.renderedView = null\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null\n // Empty space (in pixels) above the view\n d.viewOffset = 0\n d.lastWrapHeight = d.lastWrapWidth = 0\n d.updateLineNumbers = null\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0\n d.scrollbarsClipped = false\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null\n d.maxLineLength = 0\n d.maxLineChanged = false\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null\n\n // True when shift is held down.\n d.shift = false\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null\n\n d.activeTouch = null\n\n input.init(d)\n}\n\n// Find the line object corresponding to the given line number.\nfunction getLine(doc, n) {\n n -= doc.first\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize()\n if (n < sz) { chunk = child; break }\n n -= sz\n }\n }\n return chunk.lines[n]\n}\n\n// Get the part of a document between two positions, as an array of\n// strings.\nfunction getBetween(doc, start, end) {\n var out = [], n = start.line\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text\n if (n == end.line) { text = text.slice(0, end.ch) }\n if (n == start.line) { text = text.slice(start.ch) }\n out.push(text)\n ++n\n })\n return out\n}\n// Get the lines between from and to, as array of strings.\nfunction getLines(doc, from, to) {\n var out = []\n doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value\n return out\n}\n\n// Update the height of a line, propagating the height change\n// upwards to parent nodes.\nfunction updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}\n\n// Given a line object, find its line number by walking up through\n// its parent links.\nfunction lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line)\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize()\n }\n }\n return no + cur.first\n}\n\n// Find the line at the given vertical position, using the height\n// information in the document tree.\nfunction lineAtHeight(chunk, h) {\n var n = chunk.first\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height\n if (h < ch) { chunk = child; continue outer }\n h -= ch\n n += child.chunkSize()\n }\n return n\n } while (!chunk.lines)\n var i = 0\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height\n if (h < lh) { break }\n h -= lh\n }\n return n + i\n}\n\nfunction isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\nfunction lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n}\n\n// A Pos instance represents a position within the text.\nfunction Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line\n this.ch = ch\n this.sticky = sticky\n}\n\n// Compare two positions, return 0 if they are the same, a negative\n// number when a is less, and a positive number otherwise.\nfunction cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\nfunction equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\nfunction copyPos(x) {return Pos(x.line, x.ch)}\nfunction maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\nfunction minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n// Most of the external API clips given positions to make sure they\n// actually exist within the document.\nfunction clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\nfunction clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n}\nfunction clipToLen(pos, linelen) {\n var ch = pos.ch\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n}\nfunction clipPosArray(doc, array) {\n var out = []\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) }\n return out\n}\n\n// Optimize some code when these features are not used.\nvar sawReadOnlySpans = false;\nvar sawCollapsedSpans = false;\nfunction seeReadOnlySpans() {\n sawReadOnlySpans = true\n}\n\nfunction seeCollapsedSpans() {\n sawCollapsedSpans = true\n}\n\n// TEXTMARKER SPANS\n\nfunction MarkedSpan(marker, from, to) {\n this.marker = marker\n this.from = from; this.to = to\n}\n\n// Search an array of spans for a span matching the given marker.\nfunction getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.marker == marker) { return span }\n } }\n}\n// Remove a span from an array, returning undefined if no spans are\n// left (we don't store arrays for lines without spans).\nfunction removeMarkedSpan(spans, span) {\n var r\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }\n return r\n}\n// Add a span to a line.\nfunction addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n}\n\n// Used for the algorithm that adjusts markers for a change in the\n// document. These functions cut an array of spans at a given\n// character position, returning an array of remaining chunks (or\n// undefined if nothing remains).\nfunction markedSpansBefore(old, startCh, isInsert) {\n var nw\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh)\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to))\n }\n } }\n return nw\n}\nfunction markedSpansAfter(old, endCh, isInsert) {\n var nw\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh)\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh))\n }\n } }\n return nw\n}\n\n// Given a change object, compute the new set of marker spans that\n// cover the line in which the change took place. Removes spans\n// entirely within the change, reconnects spans belonging to the\n// same marker that appear on both sides of the change, and cuts off\n// spans partially within the change. Returns an array of span\n// arrays with one element for each line in (after) the change.\nfunction stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert)\n var last = markedSpansAfter(oldLast, endCh, isInsert)\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i]\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker)\n if (!found) { span.to = startCh }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1]\n if (span$1.to != null) { span$1.to += offset }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker)\n if (!found$1) {\n span$1.from = offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n } else {\n span$1.from += offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first) }\n if (last && last != first) { last = clearEmptySpans(last) }\n\n var newMarkers = [first]\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers) }\n newMarkers.push(last)\n }\n return newMarkers\n}\n\n// Remove spans that are empty and don't have a clearWhenEmpty\n// option of false.\nfunction clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1) }\n }\n if (!spans.length) { return null }\n return spans\n}\n\n// Used to 'clip' out readOnly ranges when making a change.\nfunction removeReadOnlyRanges(doc, from, to) {\n var markers = null\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark) }\n } }\n })\n if (!markers) { return null }\n var parts = [{from: from, to: to}]\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0)\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j]\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}) }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}) }\n parts.splice.apply(parts, newParts)\n j += newParts.length - 3\n }\n }\n return parts\n}\n\n// Connect or disconnect spans from a line.\nfunction detachMarkedSpans(line) {\n var spans = line.markedSpans\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line) }\n line.markedSpans = null\n}\nfunction attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line) }\n line.markedSpans = spans\n}\n\n// Helpers used when computing which overlapping collapsed span\n// counts as the larger one.\nfunction extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\nfunction extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n// Returns a number indicating which of two overlapping collapsed\n// spans is larger (and thus includes the other). Falls back to\n// comparing ids when the spans cover exactly the same range.\nfunction compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find()\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)\n if (toCmp) { return toCmp }\n return b.id - a.id\n}\n\n// Find out whether a line ends or starts in a collapsed span. If\n// so, return the marker for that span.\nfunction collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker }\n } }\n return found\n}\nfunction collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\nfunction collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n// Test whether there exists a collapsed span that partially\n// overlaps (covers the start or end, but not both) of a new span.\n// Such overlap is not allowed.\nfunction conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo)\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0)\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}\n\n// A visual line is a line as drawn on the screen. Folding, for\n// example, can cause multiple logical lines to appear on the same\n// visual line. This finds the start of the visual line that the\n// given line is part of (usually that is the line itself).\nfunction visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}\n\nfunction visualLineEnd(line) {\n var merged\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line }\n return line\n}\n\n// Returns an array of logical lines that continue the visual line\n// started by the argument, or undefined if there are no such lines.\nfunction visualLineContinued(line) {\n var merged, lines\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line)\n }\n return lines\n}\n\n// Get the line number of the start of the visual line that the\n// given line number is part of.\nfunction visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}\n\n// Get the line number of the start of the next visual line after\n// the given line.\nfunction visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line }\n return lineNo(line) + 1\n}\n\n// Compute whether a line is hidden. Lines count as hidden when they\n// are part of a visual line that starts with another line, or when\n// they are entirely covered by collapsed, non-widget span.\nfunction lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}\nfunction lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true)\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i]\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n}\n\n// Find the height above the given line.\nfunction heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}\n\n// Compute the character length of a line, taking into account\n// collapsed ranges (see markText) that might hide parts, and join\n// other lines onto it.\nfunction lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true)\n cur = found.from.line\n len += found.from.ch - found.to.ch\n }\n cur = line\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true)\n len -= cur.text.length - found$1.from.ch\n cur = found$1.to.line\n len += cur.text.length - found$1.to.ch\n }\n return len\n}\n\n// Find the longest line in the document.\nfunction findMaxLine(cm) {\n var d = cm.display, doc = cm.doc\n d.maxLine = getLine(doc, doc.first)\n d.maxLineLength = lineLength(d.maxLine)\n d.maxLineChanged = true\n doc.iter(function (line) {\n var len = lineLength(line)\n if (len > d.maxLineLength) {\n d.maxLineLength = len\n d.maxLine = line\n }\n })\n}\n\n// BIDI HELPERS\n\nfunction iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\") }\n var found = false\n for (var i = 0; i < order.length; ++i) {\n var part = order[i]\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\")\n found = true\n }\n }\n if (!found) { f(from, to, \"ltr\") }\n}\n\nvar bidiOther = null\nfunction getBidiPartAt(order, ch, sticky) {\n var found\n bidiOther = null\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i]\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i }\n else { bidiOther = i }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i }\n else { bidiOther = i }\n }\n }\n return found != null ? found : bidiOther\n}\n\n// Bidirectional ordering algorithm\n// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n// that this (partially) implements.\n\n// One-char codes used for character types:\n// L (L): Left-to-Right\n// R (R): Right-to-Left\n// r (AL): Right-to-Left Arabic\n// 1 (EN): European Number\n// + (ES): European Number Separator\n// % (ET): European Number Terminator\n// n (AN): Arabic Number\n// , (CS): Common Number Separator\n// m (NSM): Non-Spacing Mark\n// b (BN): Boundary Neutral\n// s (B): Paragraph Separator\n// t (S): Segment Separator\n// w (WS): Whitespace\n// N (ON): Other Neutrals\n\n// Returns null if characters are ordered as they appear\n// (left-to-right), or an array of sections ({from, to, level}\n// objects) in the order in which they occur visually.\nvar bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\"\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\"\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/\n\n function BidiSpan(level, from, to) {\n this.level = level\n this.from = from; this.to = to\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\"\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = []\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))) }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1]\n if (type == \"m\") { types[i$1] = prev }\n else { prev = type }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2]\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\" }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\" } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3]\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\" }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1 }\n prev$1 = type$2\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4]\n if (type$3 == \",\") { types[i$4] = \"N\" }\n else if (type$3 == \"%\") {\n var end = (void 0)\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\"\n for (var j = i$4; j < end; ++j) { types[j] = replace }\n i$4 = end - 1\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5]\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\" }\n else if (isStrong.test(type$4)) { cur$1 = type$4 }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0)\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\"\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\"\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 }\n i$6 = end$1 - 1\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7))\n } else {\n var pos = i$7, at = order.length\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) }\n var nstart = j$2\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2))\n pos = j$2\n } else { ++j$2 }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) }\n }\n }\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length\n order.unshift(new BidiSpan(0, 0, m[0].length))\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length\n order.push(new BidiSpan(0, len - m[0].length, len))\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n})()\n\n// Get the bidi ordering for the given line (and cache it). Returns\n// false for lines that are fully left-to-right, and an array of\n// BidiSpan objects otherwise.\nfunction getOrder(line, direction) {\n var order = line.order\n if (order == null) { order = line.order = bidiOrdering(line.text, direction) }\n return order\n}\n\nfunction moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir)\n return target < 0 || target > line.text.length ? null : target\n}\n\nfunction moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir)\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n}\n\nfunction endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction)\n if (order) {\n var part = dir < 0 ? lst(order) : order[0]\n var moveInStorageOrder = (dir < 0) == (part.level == 1)\n var sticky = moveInStorageOrder ? \"after\" : \"before\"\n var ch\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0) {\n var prep = prepareMeasureForLine(cm, lineObj)\n ch = dir < 0 ? lineObj.text.length - 1 : 0\n var targetTop = measureCharPrepared(cm, prep, ch).top\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch)\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1) }\n } else { ch = dir < 0 ? part.to : part.from }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n}\n\nfunction moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction)\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length\n start.sticky = \"before\"\n } else if (start.ch <= 0) {\n start.ch = 0\n start.sticky = \"after\"\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }\n var prep\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line)\n return wrappedLineExtentChar(cm, line, prep, ch)\n }\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch)\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0)\n var ch = mv(start, moveInStorageOrder ? 1 : -1)\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\"\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); }\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos]\n var moveInStorageOrder = (dir > 0) == (part.level != 1)\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1)\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1)\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n }\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent)\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1)\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh))\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n}\n\n// EVENT HANDLING\n\n// Lightweight event framework. on/off also work on DOM nodes,\n// registering native DOM handlers.\n\nvar noHandlers = []\n\nvar on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false)\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f)\n } else {\n var map = emitter._handlers || (emitter._handlers = {})\n map[type] = (map[type] || noHandlers).concat(f)\n }\n}\n\nfunction getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n}\n\nfunction off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false)\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f)\n } else {\n var map = emitter._handlers, arr = map && map[type]\n if (arr) {\n var index = indexOf(arr, f)\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) }\n }\n }\n}\n\nfunction signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type)\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2)\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) }\n}\n\n// The DOM events that CodeMirror handles can be overridden by\n// registering a (non-DOM) handler on the editor for the event name,\n// and preventDefault-ing the event in that handler.\nfunction signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }\n signal(cm, override || e.type, cm, e)\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}\n\nfunction signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = [])\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]) } }\n}\n\nfunction hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n}\n\n// Add on and off methods to a constructor's prototype, to make\n// registering events on such objects more convenient.\nfunction eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f)}\n ctor.prototype.off = function(type, f) {off(this, type, f)}\n}\n\n// Due to the fact that we still support jurassic IE versions, some\n// compatibility wrappers are needed.\n\nfunction e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault() }\n else { e.returnValue = false }\n}\nfunction e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation() }\n else { e.cancelBubble = true }\n}\nfunction e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n}\nfunction e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}\n\nfunction e_target(e) {return e.target || e.srcElement}\nfunction e_button(e) {\n var b = e.which\n if (b == null) {\n if (e.button & 1) { b = 1 }\n else if (e.button & 2) { b = 3 }\n else if (e.button & 4) { b = 2 }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3 }\n return b\n}\n\n// Detect drag-and-drop\nvar dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div')\n return \"draggable\" in div || \"dragDrop\" in div\n}()\n\nvar zwspSupported\nfunction zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\")\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]))\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\")\n node.setAttribute(\"cm-text\", \"\")\n return node\n}\n\n// Feature-detect IE's crummy client rect reporting for bidi text\nvar badBidiRects\nfunction hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"))\n var r0 = range(txt, 0, 1).getBoundingClientRect()\n var r1 = range(txt, 1, 2).getBoundingClientRect()\n removeChildren(measure)\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n}\n\n// See if \"\".split is the broken IE version, if so, provide an\n// alternative way to split lines.\nvar splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos)\n if (nl == -1) { nl = string.length }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl)\n var rt = line.indexOf(\"\\r\")\n if (rt != -1) {\n result.push(line.slice(0, rt))\n pos += rt + 1\n } else {\n result.push(line)\n pos = nl + 1\n }\n }\n return result\n} : function (string) { return string.split(/\\r\\n?|\\n/); }\n\nvar hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n} : function (te) {\n var range\n try {range = te.ownerDocument.selection.createRange()}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n}\n\nvar hasCopyEvent = (function () {\n var e = elt(\"div\")\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\")\n return typeof e.oncopy == \"function\"\n})()\n\nvar badZoomedRects = null\nfunction hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"))\n var normal = node.getBoundingClientRect()\n var fromRange = range(node, 0, 1).getBoundingClientRect()\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n}\n\nvar modes = {};\nvar mimeModes = {};\n// Extra arguments are stored as the mode's dependencies, which is\n// used by (legacy) mechanisms like loadmode.js to automatically\n// load a mode. (Preferred mechanism is the require/define calls.)\nfunction defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2) }\n modes[name] = mode\n}\n\nfunction defineMIME(mime, spec) {\n mimeModes[mime] = spec\n}\n\n// Given a MIME type, a {name, ...options} config object, or a name\n// string, return a mode config object.\nfunction resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec]\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name]\n if (typeof found == \"string\") { found = {name: found} }\n spec = createObj(found, spec)\n spec.name = found.name\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n}\n\n// Given a mode spec (anything that resolveMode accepts), find and\n// initialize an actual mode object.\nfunction getMode(options, spec) {\n spec = resolveMode(spec)\n var mfactory = modes[spec.name]\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec)\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name]\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop] }\n modeObj[prop] = exts[prop]\n }\n }\n modeObj.name = spec.name\n if (spec.helperType) { modeObj.helperType = spec.helperType }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1] } }\n\n return modeObj\n}\n\n// This can be used to attach properties to mode objects from\n// outside the actual mode definition.\nvar modeExtensions = {}\nfunction extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {})\n copyObj(properties, exts)\n}\n\nfunction copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {}\n for (var n in state) {\n var val = state[n]\n if (val instanceof Array) { val = val.concat([]) }\n nstate[n] = val\n }\n return nstate\n}\n\n// Given a mode and a state (for that mode), find the inner mode and\n// state at the position that the state refers to.\nfunction innerMode(mode, state) {\n var info\n while (mode.innerMode) {\n info = mode.innerMode(state)\n if (!info || info.mode == mode) { break }\n state = info.state\n mode = info.mode\n }\n return info || {mode: mode, state: state}\n}\n\nfunction startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n}\n\n// STRING STREAM\n\n// Fed to the mode parsers, provides helper functions to make\n// parsers more succinct.\n\nvar StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0\n this.string = string\n this.tabSize = tabSize || 8\n this.lastColumnPos = this.lastColumnValue = 0\n this.lineStart = 0\n this.lineOracle = lineOracle\n};\n\nStringStream.prototype.eol = function () {return this.pos >= this.string.length};\nStringStream.prototype.sol = function () {return this.pos == this.lineStart};\nStringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\nStringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n};\nStringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos)\n var ok\n if (typeof match == \"string\") { ok = ch == match }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)) }\n if (ok) {++this.pos; return ch}\n};\nStringStream.prototype.eatWhile = function (match) {\n var start = this.pos\n while (this.eat(match)){}\n return this.pos > start\n};\nStringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos }\n return this.pos > start\n};\nStringStream.prototype.skipToEnd = function () {this.pos = this.string.length};\nStringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos)\n if (found > -1) {this.pos = found; return true}\n};\nStringStream.prototype.backUp = function (n) {this.pos -= n};\nStringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue)\n this.lastColumnPos = this.start\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n};\nStringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n};\nStringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }\n var substr = this.string.substr(this.pos, pattern.length)\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern)\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length }\n return match\n }\n};\nStringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\nStringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n\n try { return inner() }\n finally { this.lineStart -= n }\n};\nStringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle\n return oracle && oracle.lookAhead(n)\n};\n\nvar SavedContext = function(state, lookAhead) {\n this.state = state\n this.lookAhead = lookAhead\n};\n\nvar Context = function(doc, state, line, lookAhead) {\n this.state = state\n this.doc = doc\n this.line = line\n this.maxLookAhead = lookAhead || 0\n};\n\nContext.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n)\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n }\n return line\n};\n\nContext.prototype.nextLine = function () {\n this.line++\n if (this.maxLookAhead > 0) { this.maxLookAhead-- }\n};\n\nContext.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n};\n\nContext.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n};\n\n\n// Compute a style array (an array starting with a mode generation\n// -- for invalidation -- followed by pairs of end positions and\n// style strings), which is used to highlight the tokens on the\n// line.\nfunction highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {}\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd)\n var state = context.state\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0\n context.state = true\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i]\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end) }\n i += 2\n at = Math.min(end, i_end)\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style)\n i = start + 2\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1]\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style\n }\n }\n }, lineClasses)\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n context.state = state\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}\n\nfunction getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line))\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state)\n var result = highlightLine(cm, line, context)\n if (resetState) { context.state = resetState }\n line.stateAfter = context.save(!resetState)\n line.styles = result.styles\n if (result.classes) { line.styleClasses = result.classes }\n else if (line.styleClasses) { line.styleClasses = null }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier) }\n }\n return line.styles\n}\n\nfunction getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise)\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start)\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context)\n var pos = context.line\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null\n context.nextLine()\n })\n if (precise) { doc.modeFrontier = context.line }\n return context\n}\n\n// Lightweight form of highlight -- proceed over this line and\n// update state, but don't save a style array. Used for lines that\n// aren't currently visible.\nfunction processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode\n var stream = new StringStream(text, cm.options.tabSize, context)\n stream.start = stream.pos = startAt || 0\n if (text == \"\") { callBlankLine(mode, context.state) }\n while (!stream.eol()) {\n readToken(mode, stream, context.state)\n stream.start = stream.pos\n }\n}\n\nfunction callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state)\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n}\n\nfunction readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode }\n var style = mode.token(stream, state)\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n}\n\nvar Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos\n this.string = stream.current()\n this.type = type || null\n this.state = state\n};\n\n// Utility for getTokenAt and getLineTokens\nfunction takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style\n pos = clipPos(doc, pos)\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise)\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens\n if (asArray) { tokens = [] }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos\n style = readToken(mode, stream, context.state)\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))) }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}\n\nfunction extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/)\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length)\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\"\n if (output[prop] == null)\n { output[prop] = lineClass[2] }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2] }\n } }\n return type\n}\n\n// Run the given mode's parser over a line, calling f for each token.\nfunction runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }\n var curStart = 0, curStyle = null\n var stream = new StringStream(text, cm.options.tabSize, context), style\n var inner = cm.options.addModeClass && [null]\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses) }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false\n if (forceToEnd) { processLine(cm, text, context, stream.pos) }\n stream.pos = text.length\n style = null\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses)\n }\n if (inner) {\n var mName = inner[0].name\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName) }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000)\n f(curStart, curStyle)\n }\n curStyle = style\n }\n stream.start = stream.pos\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000)\n f(pos, curStyle)\n curStart = pos\n }\n}\n\n// Finds the line to start with when starting a parse. Tries to\n// find a line with a stateAfter, so that it can start with a\n// valid state. If that fails, it returns the line with the\n// smallest indentation, which tends to need the least context to\n// parse correctly.\nfunction findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize)\n if (minline == null || minindent > indented) {\n minline = search - 1\n minindent = indented\n }\n }\n return minline\n}\n\nfunction retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n)\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start)\n}\n\n// LINE DATA STRUCTURE\n\n// Line objects. These hold state related to a line, including\n// highlighting info (the styles array).\nvar Line = function(text, markedSpans, estimateHeight) {\n this.text = text\n attachMarkedSpans(this, markedSpans)\n this.height = estimateHeight ? estimateHeight(this) : 1\n};\n\nLine.prototype.lineNo = function () { return lineNo(this) };\neventMixin(Line)\n\n// Change the content (text, markers) of a line. Automatically\n// invalidates cached information and tries to re-estimate the\n// line's height.\nfunction updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text\n if (line.stateAfter) { line.stateAfter = null }\n if (line.styles) { line.styles = null }\n if (line.order != null) { line.order = null }\n detachMarkedSpans(line)\n attachMarkedSpans(line, markedSpans)\n var estHeight = estimateHeight ? estimateHeight(line) : 1\n if (estHeight != line.height) { updateLineHeight(line, estHeight) }\n}\n\n// Detach a line from the document tree and its markers.\nfunction cleanUpLine(line) {\n line.parent = null\n detachMarkedSpans(line)\n}\n\n// Convert a style as returned by a mode (either null, or a string\n// containing one or more styles) to a CSS style. This is cached,\n// and also looks for line-wide styles.\nvar styleToClassCache = {};\nvar styleToClassCacheWithMode = {};\nfunction interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n}\n\n// Render the DOM representation of the text of a line. Also builds\n// up a 'line map', which points at the DOM nodes that represent\n// specific stretches of text, and is used by the measuring code.\n// The returned object contains the DOM node, this map, and\n// information about line-wide styles that were set by the mode.\nfunction buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}\n\nfunction defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\")\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16)\n token.setAttribute(\"aria-label\", token.title)\n return token\n}\n\n// Build up the DOM representation for a single token, and add it to\n// the line map. Takes care to render special characters separately.\nfunction buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text\n var special = builder.cm.state.specialChars, mustWrap = false\n var content\n if (!special.test(text)) {\n builder.col += text.length\n content = document.createTextNode(displayText)\n builder.map.push(builder.pos, builder.pos + text.length, content)\n if (ie && ie_version < 9) { mustWrap = true }\n builder.pos += text.length\n } else {\n content = document.createDocumentFragment()\n var pos = 0\n while (true) {\n special.lastIndex = pos\n var m = special.exec(text)\n var skipped = m ? m.index - pos : text.length - pos\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped))\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])) }\n else { content.appendChild(txt) }\n builder.map.push(builder.pos, builder.pos + skipped, txt)\n builder.col += skipped\n builder.pos += skipped\n }\n if (!m) { break }\n pos += skipped + 1\n var txt$1 = (void 0)\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"))\n txt$1.setAttribute(\"role\", \"presentation\")\n txt$1.setAttribute(\"cm-text\", \"\\t\")\n builder.col += tabWidth\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"))\n txt$1.setAttribute(\"cm-text\", m[0])\n builder.col += 1\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0])\n txt$1.setAttribute(\"cm-text\", m[0])\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])) }\n else { content.appendChild(txt$1) }\n builder.col += 1\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1)\n builder.pos++\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\"\n if (startStyle) { fullStyle += startStyle }\n if (endStyle) { fullStyle += endStyle }\n var token = elt(\"span\", [content], fullStyle, css)\n if (title) { token.title = title }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content)\n}\n\nfunction splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\"\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i)\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\" }\n result += ch\n spaceBefore = ch == \" \"\n }\n return result\n}\n\n// Work around nonsense dimensions being reported for stretches of\n// right-to-left text.\nfunction buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, title, css) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\"\n var start = builder.pos, end = start + text.length\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0)\n for (var i = 0; i < order.length; i++) {\n part = order[i]\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css)\n startStyle = null\n text = text.slice(part.to - start)\n start = part.to\n }\n }\n}\n\nfunction buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")) }\n widget.setAttribute(\"cm-marker\", marker.id)\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget)\n builder.content.appendChild(widget)\n }\n builder.pos += size\n builder.trailingSpace = false\n}\n\n// Outputs a number of spans to make up a line, taking highlighting\n// and marked text into account.\nfunction insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}\n\n\n// These objects are used to represent the visible (currently drawn)\n// part of the document. A LineView may correspond to multiple\n// logical lines, if those are connected by collapsed ranges.\nfunction LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}\n\n// Create a range of LineView objects for the given lines.\nfunction buildViewArray(cm, from, to) {\n var array = [], nextPos\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)\n nextPos = pos + view.size\n array.push(view)\n }\n return array\n}\n\nvar operationGroup = null\n\nfunction pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op)\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n }\n }\n}\n\nfunction fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null) }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j]\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } }\n }\n } while (i < callbacks.length)\n}\n\nfunction finishOperation(op, endCb) {\n var group = op.ownsGroup\n if (!group) { return }\n\n try { fireCallbacksForOps(group) }\n finally {\n operationGroup = null\n endCb(group)\n }\n}\n\nvar orphanDelayedCallbacks = null\n\n// Often, we want to signal events at a point where we are in the\n// middle of some work, but don't want the handler to start calling\n// other methods on the editor, which might be in an inconsistent\n// state or simply not expect any other events to happen.\n// signalLater looks whether there are any handlers, and schedules\n// them to be executed when the last operation ends, or, if no\n// operation is active, when a timeout fires.\nfunction signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type)\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list\n if (operationGroup) {\n list = operationGroup.delayedCallbacks\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks\n } else {\n list = orphanDelayedCallbacks = []\n setTimeout(fireOrphanDelayed, 0)\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); })\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}\n\nfunction fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks\n orphanDelayedCallbacks = null\n for (var i = 0; i < delayed.length; ++i) { delayed[i]() }\n}\n\n// When an aspect of a line changes, a string is added to\n// lineView.changes. This updates the relevant part of the line's\n// DOM structure.\nfunction updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j]\n if (type == \"text\") { updateLineText(cm, lineView) }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims) }\n else if (type == \"class\") { updateLineClasses(cm, lineView) }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims) }\n }\n lineView.changes = null\n}\n\n// Lines with gutter elements, widgets or a background class need to\n// be wrapped, and have the extra elements added to the wrapper div\nfunction ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\")\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) }\n lineView.node.appendChild(lineView.text)\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 }\n }\n return lineView.node\n}\n\nfunction updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass\n if (cls) { cls += \" CodeMirror-linebackground\" }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView)\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild)\n cm.display.input.setUneditable(lineView.background)\n }\n}\n\n// Wrapper around buildLineContent which will reuse the structure\n// in display.externalMeasured when possible.\nfunction getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}\n\n// Redraw the line's text. Interacts with the background and text\n// classes because the mode may output tokens that influence these\n// classes.\nfunction updateLineText(cm, lineView) {\n var cls = lineView.text.className\n var built = getLineContent(cm, lineView)\n if (lineView.text == lineView.node) { lineView.node = built.pre }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text)\n lineView.text = built.pre\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass\n lineView.textClass = built.textClass\n updateLineClasses(cm, lineView)\n } else if (cls) {\n lineView.text.className = cls\n }\n}\n\nfunction updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView)\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\" }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass\n lineView.text.className = textClass || \"\"\n}\n\nfunction updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter)\n lineView.gutter = null\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground)\n lineView.gutterBackground = null\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView)\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"))\n cm.display.input.setUneditable(lineView.gutterBackground)\n wrap.insertBefore(lineView.gutterBackground, lineView.text)\n }\n var markers = lineView.line.gutterMarkers\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView)\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"))\n cm.display.input.setUneditable(gutterWrap)\n wrap$1.insertBefore(gutterWrap, lineView.text)\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))) }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))) }\n } }\n }\n}\n\nfunction updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node) }\n }\n insertLineWidgets(cm, lineView, dims)\n}\n\n// Build a line's DOM representation from scratch\nfunction buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(cm, lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}\n\n// A lineView may contain multiple logical lines (when merged by\n// collapsed spans). The widgets for all of them need to be drawn.\nfunction insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }\n}\n\nfunction insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView)\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\")\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\") }\n positionLineWidget(widget, node, lineView, dims)\n cm.display.input.setUneditable(node)\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text) }\n else\n { wrap.appendChild(node) }\n signalLater(widget, \"redraw\")\n }\n}\n\nfunction positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n ;(lineView.alignable || (lineView.alignable = [])).push(node)\n var width = dims.wrapperWidth\n node.style.left = dims.fixedPos + \"px\"\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\"\n }\n node.style.width = width + \"px\"\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5\n node.style.position = \"relative\"\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\" }\n }\n}\n\nfunction widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\"\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\" }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\" }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle))\n }\n return widget.height = widget.node.parentNode.offsetHeight\n}\n\n// Return true when the given mouse event happened in a widget\nfunction eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}\n\n// POSITION MEASUREMENT\n\nfunction paddingTop(display) {return display.lineSpace.offsetTop}\nfunction paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\nfunction paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"))\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data }\n return data\n}\n\nfunction scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\nfunction displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n}\nfunction displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n}\n\n// Ensure the lineView.wrapping.heights array is populated. This is\n// an array of bottom offsets for the lines that make up a drawn\n// line. When lineWrapping is on, there might be more than one\n// height.\nfunction ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping\n var curWidth = wrapping && displayWidth(cm)\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = []\n if (wrapping) {\n lineView.measure.width = curWidth\n var rects = lineView.text.firstChild.getClientRects()\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1]\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top) }\n }\n }\n heights.push(rect.bottom - rect.top)\n }\n}\n\n// Find a line map (mapping character offsets to text nodes) and a\n// measurement cache for the given line number. (A line view might\n// contain multiple lines when collapsed ranges are present.)\nfunction mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}\n\n// Render a line into the hidden node display.externalMeasured. Used\n// when measurement is needed for a line that's not in the viewport.\nfunction updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}\n\n// Get a {top, bottom, left, right} box (in line-local coordinates)\n// for a given character.\nfunction measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n}\n\n// Find a line view that corresponds to the given line number.\nfunction findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}\n\n// Measurement can be split in two steps, the set-up work that\n// applies to the whole line, and the measurement of the actual\n// character. Functions like coordsChar, that need to do a lot of\n// measurements in a row, can thus ensure that the set-up work is\n// only done once.\nfunction prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line)\n var view = findViewForLine(cm, lineN)\n if (view && !view.text) {\n view = null\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm))\n cm.curOp.forceUpdate = true\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line) }\n\n var info = mapFromLineView(view, line, lineN)\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}\n\n// Given a prepared measurement object, measures the position of an\n// actual character (or fetches it from the cache).\nfunction measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1 }\n var key = ch + (bias || \"\"), found\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key]\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect() }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect)\n prepared.hasHeights = true\n }\n found = measureCharInner(cm, prepared, ch, bias)\n if (!found.bogus) { prepared.cache[key] = found }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}\n\nvar nullRect = {left: 0, right: 0, top: 0, bottom: 0}\n\nfunction nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i]\n mEnd = map[i + 1]\n if (ch < mStart) {\n start = 0; end = 1\n collapse = \"left\"\n } else if (ch < mEnd) {\n start = ch - mStart\n end = start + 1\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart\n start = end - 1\n if (ch >= mEnd) { collapse = \"right\" }\n }\n if (start != null) {\n node = map[i + 2]\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2]\n collapse = \"left\"\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2]\n collapse = \"right\"\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n}\n\nfunction getUsefulRect(rects, bias) {\n var rect = nullRect\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n}\n\nfunction measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias)\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse\n\n var rect\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect() }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias) }\n if (rect.left || rect.right || start == 0) { break }\n end = start\n start = start - 1\n collapse = \"right\"\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\" }\n var rects\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0] }\n else\n { rect = node.getBoundingClientRect() }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0]\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} }\n else\n { rect = nullRect }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top\n var mid = (rtop + rbot) / 2\n var heights = prepared.view.measure.heights\n var i = 0\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i]\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot}\n if (!rect.left && !rect.right) { result.bogus = true }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot }\n\n return result\n}\n\n// Work around problem with bounding client rects on ranges being\n// returned incorrectly when zoomed on IE10 and below.\nfunction maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI\n var scaleY = screen.logicalYDPI / screen.deviceYDPI\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n}\n\nfunction clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {}\n lineView.measure.heights = null\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {} } }\n }\n}\n\nfunction clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null\n removeChildren(cm.display.lineMeasure)\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]) }\n}\n\nfunction clearCaches(cm) {\n clearLineMeasurementCache(cm)\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true }\n cm.display.lineNumChars = null\n}\n\nfunction pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n}\nfunction pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n}\n\n// Converts a {top, bottom, left, right} box from line-local\n// coordinates into another coordinate system. Context may be one of\n// \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n// or \"page\".\nfunction intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets && lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i])\n rect.top += size; rect.bottom += size\n } } }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\" }\n var yOff = heightAtLine(lineObj)\n if (context == \"local\") { yOff += paddingTop(cm.display) }\n else { yOff -= cm.display.viewOffset }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect()\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY())\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX())\n rect.left += xOff; rect.right += xOff\n }\n rect.top += yOff; rect.bottom += yOff\n return rect\n}\n\n// Coverts a box from \"div\" coords to another coordinate system.\n// Context may be \"window\", \"page\", \"div\", or \"local\"./null.\nfunction fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX()\n top -= pageScrollY()\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect()\n left += localBox.left\n top += localBox.top\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect()\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}\n\nfunction charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line) }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n}\n\n// Returns a box for a given cursor position, which may have an\n// 'other' property containing the position of the secondary cursor\n// on a bidi boundary.\n// A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n// and after `char - 1` in writing order of `char - 1`\n// A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n// and before `char` in writing order of `char`\n// Examples (upper-case letters are RTL, lower-case are LTR):\n// Pos(0, 1, ...)\n// before after\n// ab a|b a|b\n// aB a|B aB|\n// Ab |Ab A|b\n// AB B|A B|A\n// Every position after the last character on a line is considered to stick\n// to the last character on the line.\nfunction cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line)\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight)\n if (right) { m.left = m.right; } else { m.right = m.left }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length\n sticky = \"before\"\n } else if (ch <= 0) {\n ch = 0\n sticky = \"after\"\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = (part.level % 2) != 0\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky)\n var other = bidiOther\n var val = getBidi(ch, partPos, sticky == \"before\")\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\") }\n return val\n}\n\n// Used to cheaply estimate the coordinates for a position. Used for\n// intermediate scroll updates.\nfunction estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}\n\n// Positions returned by coordsChar contain some extra information.\n// xRel is the relative x position of the input coordinates compared\n// to the found position (so xRel > 0 means the coordinates are to\n// the right of the character position, for example). When outside\n// is true, that means the coordinates lie outside the line's\n// vertical range.\nfunction PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky)\n pos.xRel = xRel\n if (outside) { pos.outside = true }\n return pos\n}\n\n// Compute the character position closest to the given coordinates.\n// Input must be lineSpace-local (\"div\" coordinate system).\nfunction coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}\n\nfunction wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n var measure = function (ch) { return intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), \"line\"); }\n var end = lineObj.text.length\n var begin = findFirst(function (ch) { return measure(ch - 1).bottom <= y; }, end, 0)\n end = findFirst(function (ch) { return measure(ch).top > y; }, begin, end)\n return {begin: begin, end: end}\n}\n\nfunction wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n}\n\nfunction coordsCharInner(cm, lineObj, lineNo, x, y) {\n y -= heightAtLine(lineObj)\n var begin = 0, end = lineObj.text.length\n var preparedMeasure = prepareMeasureForLine(cm, lineObj)\n var pos\n var order = getOrder(lineObj, cm.doc.direction)\n if (order) {\n if (cm.options.lineWrapping) {\n ;var assign;\n ((assign = wrappedLineExtent(cm, lineObj, preparedMeasure, y), begin = assign.begin, end = assign.end, assign))\n }\n pos = new Pos(lineNo, Math.floor(begin + (end - begin) / 2))\n var beginLeft = cursorCoords(cm, pos, \"line\", lineObj, preparedMeasure).left\n var dir = beginLeft < x ? 1 : -1\n var prevDiff, diff = beginLeft - x, prevPos\n var steps = Math.ceil((end - begin) / 4)\n outer: do {\n prevDiff = diff\n prevPos = pos\n var i = 0\n for (; i < steps; ++i) {\n var prevPos$1 = pos\n pos = moveVisually(cm, lineObj, pos, dir)\n if (pos == null || pos.ch < begin || end <= (pos.sticky == \"before\" ? pos.ch - 1 : pos.ch)) {\n pos = prevPos$1\n break outer\n }\n }\n diff = cursorCoords(cm, pos, \"line\", lineObj, preparedMeasure).left - x\n if (steps > 1) {\n var diff_change_per_step = Math.abs(diff - prevDiff) / steps\n steps = Math.min(steps, Math.ceil(Math.abs(diff) / diff_change_per_step))\n dir = diff < 0 ? 1 : -1\n }\n } while (diff != 0 && (steps > 1 || ((dir < 0) != (diff < 0) && (Math.abs(diff) <= Math.abs(prevDiff)))))\n if (Math.abs(diff) > Math.abs(prevDiff)) {\n if ((diff < 0) == (prevDiff < 0)) { throw new Error(\"Broke out of infinite loop in coordsCharInner\") }\n pos = prevPos\n }\n } else {\n var ch = findFirst(function (ch) {\n var box = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), \"line\")\n if (box.top > y) {\n // For the cursor stickiness\n end = Math.min(ch, end)\n return true\n }\n else if (box.bottom <= y) { return false }\n else if (box.left > x) { return true }\n else if (box.right < x) { return false }\n else { return (x - box.left < box.right - x) }\n }, begin, end)\n ch = skipExtendingChars(lineObj.text, ch, 1)\n pos = new Pos(lineNo, ch, ch == end ? \"before\" : \"after\")\n }\n var coords = cursorCoords(cm, pos, \"line\", lineObj, preparedMeasure)\n if (y < coords.top || coords.bottom < y) { pos.outside = true }\n pos.xRel = x < coords.left ? -1 : (x > coords.right ? 1 : 0)\n return pos\n}\n\nvar measureText\n// Compute the default text height.\nfunction textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\")\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"))\n measureText.appendChild(elt(\"br\"))\n }\n measureText.appendChild(document.createTextNode(\"x\"))\n }\n removeChildrenAndAdd(display.measure, measureText)\n var height = measureText.offsetHeight / 50\n if (height > 3) { display.cachedTextHeight = height }\n removeChildren(display.measure)\n return height || 1\n}\n\n// Compute the default character width.\nfunction charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\")\n var pre = elt(\"pre\", [anchor])\n removeChildrenAndAdd(display.measure, pre)\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n if (width > 2) { display.cachedCharWidth = width }\n return width || 10\n}\n\n// Do a bulk-read of the DOM positions and sizes needed to draw the\n// view, so that we don't interleave reading and writing to the DOM.\nfunction getDimensions(cm) {\n var d = cm.display, left = {}, width = {}\n var gutterLeft = d.gutters.clientLeft\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft\n width[cm.options.gutters[i]] = n.clientWidth\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n}\n\n// Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n// but using getBoundingClientRect to get a sub-pixel-accurate\n// result.\nfunction compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}\n\n// Returns a function that estimates the height of a line, to use as\n// first approximation until the line becomes visible (and is thus\n// properly measurable).\nfunction estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3)\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}\n\nfunction estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm)\n doc.iter(function (line) {\n var estHeight = est(line)\n if (estHeight != line.height) { updateLineHeight(line, estHeight) }\n })\n}\n\n// Given a mouse event, find the corresponding position. If liberal\n// is false, it checks whether a gutter or scrollbar was clicked,\n// and returns null if it was. forRect is used by rectangular\n// selections, and tries to estimate a character position even for\n// coordinates beyond the right of the text.\nfunction posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect()\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))\n }\n return coords\n}\n\n// Find the view element corresponding to a given line. Return null\n// when the line isn't visible.\nfunction findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom\n if (n < 0) { return null }\n var view = cm.display.view\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size\n if (n < 0) { return i }\n }\n}\n\nfunction updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection())\n}\n\nfunction prepareSelection(cm, primary) {\n var doc = cm.doc, result = {}\n var curFragment = result.cursors = document.createDocumentFragment()\n var selFragment = result.selection = document.createDocumentFragment()\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (primary === false && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i]\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty()\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range.head, curFragment) }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment) }\n }\n return result\n}\n\n// Draws a cursor for the given range\nfunction drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine)\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"))\n cursor.style.left = pos.left + \"px\"\n cursor.style.top = pos.top + \"px\"\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\"\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"))\n otherCursor.style.display = \"\"\n otherCursor.style.left = pos.other.left + \"px\"\n otherCursor.style.top = pos.other.top + \"px\"\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\"\n }\n}\n\n// Draws the given range as a highlighted selection\nfunction drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc\n var fragment = document.createDocumentFragment()\n var padding = paddingH(cm.display), leftSide = padding.left\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0 }\n top = Math.round(top)\n bottom = Math.round(bottom)\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")))\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line)\n var lineLen = lineObj.text.length\n var start, end\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right\n if (from == to) {\n rightPos = leftPos\n left = right = leftPos.left\n } else {\n rightPos = coords(to - 1, \"right\")\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }\n left = leftPos.left\n right = rightPos.right\n }\n if (fromArg == null && from == 0) { left = leftSide }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom)\n left = leftSide\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }\n }\n if (toArg == null && to == lineLen) { right = rightSide }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos }\n if (left < leftSide + 1) { left = leftSide }\n add(left, rightPos.top, right - left, rightPos.bottom)\n })\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to()\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch)\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)\n var singleVLine = visualLine(fromLine) == visualLine(toLine)\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top) }\n }\n\n output.appendChild(fragment)\n}\n\n// Cursor-blinking\nfunction restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display\n clearInterval(display.blinker)\n var on = true\n display.cursorDiv.style.visibility = \"\"\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate) }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\" }\n}\n\nfunction ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) }\n}\n\nfunction delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false\n onBlur(cm)\n } }, 100)\n}\n\nfunction onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e)\n cm.state.focused = true\n addClass(cm.display.wrapper, \"CodeMirror-focused\")\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset()\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730\n }\n cm.display.input.receivedFocus()\n }\n restartBlink(cm)\n}\nfunction onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e)\n cm.state.focused = false\n rmClass(cm.display.wrapper, \"CodeMirror-focused\")\n }\n clearInterval(cm.display.blinker)\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150)\n}\n\n// Read the actual heights of the rendered lines, and update their\n// stored heights to match.\nfunction updateHeightsInViewport(cm) {\n var display = cm.display\n var prevBottom = display.lineDiv.offsetTop\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0)\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight\n height = bot - prevBottom\n prevBottom = bot\n } else {\n var box = cur.node.getBoundingClientRect()\n height = box.bottom - box.top\n }\n var diff = cur.line.height - height\n if (height < 2) { height = textHeight(display) }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height)\n updateWidgetHeight(cur.line)\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]) } }\n }\n }\n}\n\n// Read and store the height of line widgets associated with the\n// given line.\nfunction updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}\n\n// Compute the lines that are visible in a given viewport (defaults\n// the the current scroll position). viewport may contain top,\n// height, and ensure (see op.scrollToPos) properties.\nfunction visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}\n\n// Re-align line numbers and gutter marks to compensate for\n// horizontal scrolling.\nfunction alignHorizontally(cm) {\n var display = cm.display, view = display.view\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\"\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left }\n }\n var align = view[i].alignable\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\" }\n}\n\n// Used to ensure that the line number gutter is still the right\n// size for the current document size. Returns true when an update\n// is needed.\nfunction maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"))\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW\n display.lineGutter.style.width = \"\"\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1\n display.lineNumWidth = display.lineNumInnerWidth + padding\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1\n display.lineGutter.style.width = display.lineNumWidth + \"px\"\n updateGutterSpace(cm)\n return true\n }\n return false\n}\n\n// SCROLLING THINGS INTO VIEW\n\n// If an editor sits on the top or bottom of the window, partially\n// scrolled out of view, this ensures that the cursor is visible.\nfunction maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null\n if (rect.top + box.top < 0) { doScroll = true }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"))\n cm.display.lineSpace.appendChild(scrollNode)\n scrollNode.scrollIntoView(doScroll)\n cm.display.lineSpace.removeChild(scrollNode)\n }\n}\n\n// Scroll a given position into view (immediately), verifying that\n// it actually became visible (as line heights are accurately\n// measured, the position of something may 'drift' during drawing).\nfunction scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0 }\n var rect\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false\n var coords = cursorCoords(cm, pos)\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin}\n var scrollPos = calculateScrollPos(cm, rect)\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop)\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft)\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }\n }\n if (!changed) { break }\n }\n return rect\n}\n\n// Scroll a given set of coordinates into view (immediately).\nfunction scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect)\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop) }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }\n}\n\n// Calculate a new scroll position needed to scroll the given\n// rectangle into view. Returns an object with scrollTop and\n// scrollLeft properties. When these are undefined, the\n// vertical/horizontal position does not need to be adjusted.\nfunction calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display)\n if (rect.top < 0) { rect.top = 0 }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop\n var screen = displayHeight(cm), result = {}\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen }\n var docBottom = cm.doc.height + paddingVert(display)\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen)\n if (newTop != screentop) { result.scrollTop = newTop }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)\n var tooWide = rect.right - rect.left > screenw\n if (tooWide) { rect.right = rect.left + screenw }\n if (rect.left < 10)\n { result.scrollLeft = 0 }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)) }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw }\n return result\n}\n\n// Store a relative adjustment to the scroll position in the current\n// operation (to be applied when the operation finishes).\nfunction addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top\n}\n\n// Make sure that at the end of the operation the current cursor is\n// shown.\nfunction ensureCursorVisible(cm) {\n resolveScrollToPos(cm)\n var cur = cm.getCursor()\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}\n}\n\nfunction scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm) }\n if (x != null) { cm.curOp.scrollLeft = x }\n if (y != null) { cm.curOp.scrollTop = y }\n}\n\nfunction scrollToRange(cm, range) {\n resolveScrollToPos(cm)\n cm.curOp.scrollToPos = range\n}\n\n// When an operation has its scrollToPos property set, and another\n// scroll action is applied before the end of the operation, this\n// 'simulates' scrolling that position into view in a cheap way, so\n// that the effect of intermediate scroll commands is not ignored.\nfunction resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos\n if (range) {\n cm.curOp.scrollToPos = null\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)\n scrollToCoordsRange(cm, from, to, range.margin)\n }\n}\n\nfunction scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n })\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop)\n}\n\n// Sync the scrollable area and scrollbars, ensure the viewport\n// covers the visible area.\nfunction updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}) }\n setScrollTop(cm, val, true)\n if (gecko) { updateDisplaySimple(cm) }\n startWorker(cm, 100)\n}\n\nfunction setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val\n cm.display.scrollbars.setScrollTop(val)\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val }\n}\n\n// Sync scroller and scrollbar, ensure the gutter elements are\n// aligned.\nfunction setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val\n alignHorizontally(cm)\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val }\n cm.display.scrollbars.setScrollLeft(val)\n}\n\n// SCROLLBARS\n\n// Prepare DOM reads needed to update the scrollbars. Done in one\n// shot to minimize update/measure roundtrips.\nfunction measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth\n var docH = Math.round(cm.doc.height + paddingVert(cm.display))\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n}\n\nvar NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\")\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\")\n place(vert); place(horiz)\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\") }\n })\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\") }\n })\n\n this.checkedZeroWidth = false\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\" }\n};\n\nNativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1\n var needsV = measure.scrollHeight > measure.clientHeight + 1\n var sWidth = measure.nativeBarWidth\n\n if (needsV) {\n this.vert.style.display = \"block\"\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\"\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0)\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\"\n } else {\n this.vert.style.display = \"\"\n this.vert.firstChild.style.height = \"0\"\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\"\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\"\n this.horiz.style.left = measure.barLeft + \"px\"\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0)\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\"\n } else {\n this.horiz.style.display = \"\"\n this.horiz.firstChild.style.width = \"0\"\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack() }\n this.checkedZeroWidth = true\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n};\n\nNativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\") }\n};\n\nNativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\") }\n};\n\nNativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\"\n this.horiz.style.height = this.vert.style.width = w\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\"\n this.disableHoriz = new Delayed\n this.disableVert = new Delayed\n};\n\nNativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\"\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect()\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1)\n if (elt != bar) { bar.style.pointerEvents = \"none\" }\n else { delay.set(1000, maybeDisable) }\n }\n delay.set(1000, maybeDisable)\n};\n\nNativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode\n parent.removeChild(this.horiz)\n parent.removeChild(this.vert)\n};\n\nvar NullScrollbars = function () {};\n\nNullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\nNullScrollbars.prototype.setScrollLeft = function () {};\nNullScrollbars.prototype.setScrollTop = function () {};\nNullScrollbars.prototype.clear = function () {};\n\nfunction updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm) }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight\n updateScrollbarsInner(cm, measure)\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm) }\n updateScrollbarsInner(cm, measureForScrollbars(cm))\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight\n }\n}\n\n// Re-synchronize the fake scrollbars with the actual size of the\n// content.\nfunction updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}\n\nvar scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars}\n\nfunction initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear()\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller)\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) }\n })\n node.setAttribute(\"cm-not-content\", \"true\")\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos) }\n else { updateScrollTop(cm, pos) }\n }, cm)\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) }\n}\n\n// Operations are used to wrap a series of changes to the editor\n// state in such a way that each change won't have to update the\n// cursor and display (which would be awkward, slow, and\n// error-prone). Instead, display updates are batched and then all\n// combined and executed at once.\n\nvar nextOpId = 0\n// Start a new operation.\nfunction startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n }\n pushOperation(cm.curOp)\n}\n\n// Finish an operation, updating the display and signalling delayed events\nfunction endOperation(cm) {\n var op = cm.curOp\n finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null }\n endOperations(group)\n })\n}\n\n// The DOM updates done when an operation finishes are batched so\n// that the minimum number of relayouts are required.\nfunction endOperations(group) {\n var ops = group.ops\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]) }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]) }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]) }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]) }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]) }\n}\n\nfunction endOperation_R1(op) {\n var cm = op.cm, display = cm.display\n maybeClipScrollbars(cm)\n if (op.updateMaxLine) { findMaxLine(cm) }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate)\n}\n\nfunction endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update)\n}\n\nfunction endOperation_R2(op) {\n var cm = op.cm, display = cm.display\n if (op.updatedDisplay) { updateHeightsInViewport(cm) }\n\n op.barMeasure = measureForScrollbars(cm)\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3\n cm.display.sizerWidth = op.adjustWidthTo\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth)\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm))\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(op.focus) }\n}\n\nfunction endOperation_W2(op) {\n var cm = op.cm\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\"\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) }\n cm.display.maxLineChanged = false\n }\n\n var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus) }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure) }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure) }\n\n if (op.selectionChanged) { restartBlink(cm) }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing) }\n if (takeFocus) { ensureFocus(op.cm) }\n}\n\nfunction endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll) }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true) }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin)\n maybeScrollWindow(cm, rect)\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\") } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\") } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs) }\n if (op.update)\n { op.update.finish() }\n}\n\n// Run the given function in an operation\nfunction runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm)\n try { return f() }\n finally { endOperation(cm) }\n}\n// Wraps a function in an operation. Returns the wrapped function.\nfunction operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm)\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm) }\n }\n}\n// Used to add methods to editor and doc instances, wrapping them in\n// operations.\nfunction methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this)\n try { return f.apply(this, arguments) }\n finally { endOperation(this) }\n }\n}\nfunction docMethodOp(f) {\n return function() {\n var cm = this.cm\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm)\n try { return f.apply(this, arguments) }\n finally { endOperation(cm) }\n }\n}\n\n// Updates the display.view data structure for a given change to the\n// document. From and to are in pre-change coordinates. Lendiff is\n// the amount of lines added or subtracted by the change. This is\n// used for changes that span multiple lines, or change the way\n// lines are divided into visual lines. regLineChange (below)\n// registers single-line changes.\nfunction regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first }\n if (to == null) { to = cm.doc.first + cm.doc.size }\n if (!lendiff) { lendiff = 0 }\n\n var display = cm.display\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from }\n\n cm.curOp.viewChanged = true\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm) }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm)\n } else {\n display.viewFrom += lendiff\n display.viewTo += lendiff\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm)\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1)\n if (cut) {\n display.view = display.view.slice(cut.index)\n display.viewFrom = cut.lineN\n display.viewTo += lendiff\n } else {\n resetView(cm)\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1)\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index)\n display.viewTo = cut$1.lineN\n } else {\n resetView(cm)\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1)\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1)\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index))\n display.viewTo += lendiff\n } else {\n resetView(cm)\n }\n }\n\n var ext = display.externalMeasured\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null }\n }\n}\n\n// Register a change to a single line. Type must be one of \"text\",\n// \"gutter\", \"class\", \"widget\"\nfunction regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true\n var display = cm.display, ext = cm.display.externalMeasured\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)]\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = [])\n if (indexOf(arr, type) == -1) { arr.push(type) }\n}\n\n// Clear the view.\nfunction resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first\n cm.display.view = []\n cm.display.viewOffset = 0\n}\n\nfunction viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom\n for (var i = 0; i < index; i++)\n { n += view[i].size }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN\n index++\n } else {\n diff = n - oldN\n }\n oldN += diff; newN += diff\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size\n index += dir\n }\n return {index: index, lineN: newN}\n}\n\n// Force the view to cover a given range, adding empty view element\n// or clipping off existing ones as needed.\nfunction adjustView(cm, from, to) {\n var display = cm.display, view = display.view\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to)\n display.viewFrom = from\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)) }\n display.viewFrom = from\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)) }\n }\n display.viewTo = to\n}\n\n// Count the number of lines in the view whose DOM representation is\n// out of date (or nonexistent).\nfunction countDirtyView(cm) {\n var view = cm.display.view, dirty = 0\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i]\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty }\n }\n return dirty\n}\n\n// HIGHLIGHT WORKER\n\nfunction startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)) }\n}\n\nfunction highlightWorker(cm) {\n var doc = cm.doc\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime\n var context = getContextBefore(cm, doc.highlightFrontier)\n var changedLines = []\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null\n var highlighted = highlightLine(cm, line, context, true)\n if (resetState) { context.state = resetState }\n line.styles = highlighted.styles\n var oldCls = line.styleClasses, newCls = highlighted.classes\n if (newCls) { line.styleClasses = newCls }\n else if (oldCls) { line.styleClasses = null }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass)\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] }\n if (ischange) { changedLines.push(context.line) }\n line.stateAfter = context.save()\n context.nextLine()\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context) }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null\n context.nextLine()\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay)\n return true\n }\n })\n doc.highlightFrontier = context.line\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line)\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\") }\n }) }\n}\n\n// DISPLAY DRAWING\n\nvar DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display\n\n this.viewport = viewport\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport)\n this.editorIsHidden = !display.wrapper.offsetWidth\n this.wrapperHeight = display.wrapper.clientHeight\n this.wrapperWidth = display.wrapper.clientWidth\n this.oldDisplayWidth = displayWidth(cm)\n this.force = force\n this.dims = getDimensions(cm)\n this.events = []\n};\n\nDisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments) }\n};\nDisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]) }\n};\n\nfunction maybeClipScrollbars(cm) {\n var display = cm.display\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth\n display.heightForcer.style.height = scrollGap(cm) + \"px\"\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\"\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\"\n display.scrollbarsClipped = true\n }\n}\n\nfunction selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt()\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active}\n if (window.getSelection) {\n var sel = window.getSelection()\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode\n result.anchorOffset = sel.anchorOffset\n result.focusNode = sel.focusNode\n result.focusOffset = sel.focusOffset\n }\n }\n return result\n}\n\nfunction restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus()\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range = document.createRange()\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset)\n range.collapse(false)\n sel.removeAllRanges()\n sel.addRange(range)\n sel.extend(snapshot.focusNode, snapshot.focusOffset)\n }\n}\n\n// Does the actual updating of the line display. Bails out\n// (returning false) when there is nothing to be done and forced is\n// false.\nfunction updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc\n\n if (update.editorIsHidden) {\n resetView(cm)\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm)\n update.dims = getDimensions(cm)\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin)\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from)\n to = visualLineEndNo(cm.doc, to)\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth\n adjustView(cm, from, to)\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\"\n\n var toUpdate = countDirtyView(cm)\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm)\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\" }\n patchDisplay(cm, display.updateLineNumbers, update.dims)\n if (toUpdate > 4) { display.lineDiv.style.display = \"\" }\n display.renderedView = display.view\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot)\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv)\n removeChildren(display.selectionDiv)\n display.gutters.style.height = display.sizer.style.minHeight = 0\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight\n display.lastWrapWidth = update.wrapperWidth\n startWorker(cm, 400)\n }\n\n display.updateLineNumbers = null\n\n return true\n}\n\nfunction postUpdateDisplay(cm, update) {\n var viewport = update.viewport\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport)\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm)\n var barMeasure = measureForScrollbars(cm)\n updateSelection(cm)\n updateScrollbars(cm, barMeasure)\n setDocumentHeight(cm, barMeasure)\n update.force = false\n }\n\n update.signal(cm, \"update\", cm)\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo)\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo\n }\n}\n\nfunction updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport)\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm)\n postUpdateDisplay(cm, update)\n var barMeasure = measureForScrollbars(cm)\n updateSelection(cm)\n updateScrollbars(cm, barMeasure)\n setDocumentHeight(cm, barMeasure)\n update.finish()\n }\n}\n\n// Sync the actual display DOM structure with display.view, removing\n// nodes for lines that are no longer in view, and creating the ones\n// that are not there yet, and updating the ones that are out of\n// date.\nfunction patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers\n var container = display.lineDiv, cur = container.firstChild\n\n function rm(node) {\n var next = node.nextSibling\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\" }\n else\n { node.parentNode.removeChild(node) }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i]\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims)\n container.insertBefore(node, cur)\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur) }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false }\n updateLineForChanges(cm, lineView, lineN, dims)\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber)\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)))\n }\n cur = lineView.node.nextSibling\n }\n lineN += lineView.size\n }\n while (cur) { cur = rm(cur) }\n}\n\nfunction updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth\n cm.display.sizer.style.marginLeft = width + \"px\"\n}\n\nfunction setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\"\n cm.display.heightForcer.style.top = measure.docHeight + \"px\"\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\"\n}\n\n// Rebuild the gutter elements, ensure the margin to the left of the\n// code matches their width.\nfunction updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters\n removeChildren(gutters)\n var i = 0\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i]\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass))\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\"\n }\n }\n gutters.style.display = i ? \"\" : \"none\"\n updateGutterSpace(cm)\n}\n\n// Make sure the gutters options contains the element\n// \"CodeMirror-linenumbers\" when the lineNumbers option is true.\nfunction setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\")\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"])\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0)\n options.gutters.splice(found, 1)\n }\n}\n\nvar wheelSamples = 0;\nvar wheelPixelsPerUnit = null;\n// Fill in a browser-detected starting value on browsers where we\n// know one. These don't have to be accurate -- the result of them\n// being wrong would just be a slight flicker on the first wheel\n// scroll (if it is large enough).\nif (ie) { wheelPixelsPerUnit = -.53 }\nelse if (gecko) { wheelPixelsPerUnit = 15 }\nelse if (chrome) { wheelPixelsPerUnit = -.7 }\nelse if (safari) { wheelPixelsPerUnit = -1/3 }\n\nfunction wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail }\n else if (dy == null) { dy = e.wheelDelta }\n return {x: dx, y: dy}\n}\nfunction wheelEventPixels(e) {\n var delta = wheelEventDelta(e)\n delta.x *= wheelPixelsPerUnit\n delta.y *= wheelPixelsPerUnit\n return delta\n}\n\nfunction onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y\n\n var display = cm.display, scroll = display.scroller\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth\n var canScrollY = scroll.scrollHeight > scroll.clientHeight\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)) }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit))\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e) }\n display.wheelStartX = null // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight\n if (pixels < 0) { top = Math.max(0, top + pixels - 50) }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50) }\n updateDisplaySimple(cm, {top: top, bottom: bot})\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop\n display.wheelDX = dx; display.wheelDY = dy\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX\n var movedY = scroll.scrollTop - display.wheelStartY\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX)\n display.wheelStartX = display.wheelStartY = null\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1)\n ++wheelSamples\n }, 200)\n } else {\n display.wheelDX += dx; display.wheelDY += dy\n }\n }\n}\n\n// Selection objects are immutable. A new one is created every time\n// the selection changes. A selection is one or more non-overlapping\n// (and non-touching) ranges, sorted, and an integer that indicates\n// which one is the primary selection (the one that's scrolled into\n// view, that getCursor returns, etc).\nvar Selection = function(ranges, primIndex) {\n this.ranges = ranges\n this.primIndex = primIndex\n};\n\nSelection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\nSelection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i]\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n};\n\nSelection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = []\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) }\n return new Selection(out, this.primIndex)\n};\n\nSelection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n};\n\nSelection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i]\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n};\n\nvar Range = function(anchor, head) {\n this.anchor = anchor; this.head = head\n};\n\nRange.prototype.from = function () { return minPos(this.anchor, this.head) };\nRange.prototype.to = function () { return maxPos(this.anchor, this.head) };\nRange.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n// Take an unsorted, potentially overlapping set of ranges, and\n// build a selection out of it. 'Consumes' ranges array (modifying\n// it).\nfunction normalizeSelection(ranges, primIndex) {\n var prim = ranges[primIndex]\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); })\n primIndex = indexOf(ranges, prim)\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1]\n if (cmp(prev.to(), cur.from()) >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to())\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head\n if (i <= primIndex) { --primIndex }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to))\n }\n }\n return new Selection(ranges, primIndex)\n}\n\nfunction simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n}\n\n// Compute the position of the end of a change (its 'to' property\n// refers to the pre-change end).\nfunction changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n}\n\n// Adjust a position to refer to the post-change position of the\n// same text, or the end of the change if the change covers it.\nfunction adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }\n return Pos(line, ch)\n}\n\nfunction computeSelAfterChange(doc, change) {\n var out = []\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i]\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)))\n }\n return normalizeSelection(out, doc.sel.primIndex)\n}\n\nfunction offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n}\n\n// Used by replaceSelections to allow moving the selection to the\n// start or around the replaced test. Hint may be \"start\" or \"around\".\nfunction computeReplacedSel(doc, changes, hint) {\n var out = []\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i]\n var from = offsetPos(change.from, oldPrev, newPrev)\n var to = offsetPos(changeEnd(change), oldPrev, newPrev)\n oldPrev = change.to\n newPrev = to\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0\n out[i] = new Range(inv ? to : from, inv ? from : to)\n } else {\n out[i] = new Range(from, from)\n }\n }\n return new Selection(out, doc.sel.primIndex)\n}\n\n// Used to get the editor into a consistent state again when options change.\n\nfunction loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption)\n resetModeState(cm)\n}\n\nfunction resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null }\n if (line.styles) { line.styles = null }\n })\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first\n startWorker(cm, 100)\n cm.state.modeGen++\n if (cm.curOp) { regChange(cm) }\n}\n\n// DOCUMENT DATA STRUCTURE\n\n// By default, updates that start and end at the beginning of a line\n// are treated specially, in order to make the association of line\n// widgets and marker elements with the text behave more intuitive.\nfunction isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n}\n\n// Perform a change on the document data structure.\nfunction updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight)\n signalLater(line, \"change\", line, change)\n }\n function linesFor(start, end) {\n var result = []\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)) }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length))\n doc.remove(text.length, doc.size - text.length)\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1)\n update(lastLine, lastLine.text, lastSpans)\n if (nlines) { doc.remove(from.line, nlines) }\n if (added.length) { doc.insert(from.line, added) }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)\n } else {\n var added$1 = linesFor(1, text.length - 1)\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n doc.insert(from.line + 1, added$1)\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))\n doc.remove(from.line + 1, nlines)\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)\n var added$2 = linesFor(1, text.length - 1)\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }\n doc.insert(from.line + 1, added$2)\n }\n\n signalLater(doc, \"change\", doc, change)\n}\n\n// Call f for all linked documents.\nfunction linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i]\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared)\n propagate(rel.doc, doc, shared)\n } }\n }\n propagate(doc, null, true)\n}\n\n// Attach a document to an editor.\nfunction attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc\n doc.cm = cm\n estimateLineHeights(cm)\n loadMode(cm)\n setDirectionClass(cm)\n if (!cm.options.lineWrapping) { findMaxLine(cm) }\n cm.options.mode = doc.modeOption\n regChange(cm)\n}\n\nfunction setDirectionClass(cm) {\n ;(cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\")\n}\n\nfunction directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm)\n regChange(cm)\n })\n}\n\nfunction History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = []\n this.undoDepth = Infinity\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0\n this.lastOp = this.lastSelOp = null\n this.lastOrigin = this.lastSelOrigin = null\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1\n}\n\n// Create a history change event from an updateDoc-style change\n// object.\nfunction historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)\n return histChange\n}\n\n// Pop all selection events off the end of a history array. Stop at\n// a change event.\nfunction clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array)\n if (last.ranges) { array.pop() }\n else { break }\n }\n}\n\n// Find the top change event in the history. Pop off selection\n// events that are in the way.\nfunction lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done)\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop()\n return lst(hist.done)\n }\n}\n\n// Register a change in the history. Merges changes that are within\n// a single operation, or are close together with an origin that\n// allows merging (starting with \"+\") into a single event.\nfunction addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history\n hist.undone.length = 0\n var time = +new Date, cur\n var last\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes)\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change)\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change))\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done)\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done) }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation}\n hist.done.push(cur)\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift()\n if (!hist.done[0].ranges) { hist.done.shift() }\n }\n }\n hist.done.push(selAfter)\n hist.generation = ++hist.maxGeneration\n hist.lastModTime = hist.lastSelTime = time\n hist.lastOp = hist.lastSelOp = opId\n hist.lastOrigin = hist.lastSelOrigin = change.origin\n\n if (!last) { signal(doc, \"historyAdded\") }\n}\n\nfunction selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0)\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n}\n\n// Called whenever the selection changes, sets the new selection as\n// the pending selection in the history, and pushes the old pending\n// selection into the 'done' array when it was significantly\n// different (in number of selected ranges, emptiness, or time).\nfunction addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel }\n else\n { pushSelectionToHistory(sel, hist.done) }\n\n hist.lastSelTime = +new Date\n hist.lastSelOrigin = origin\n hist.lastSelOp = opId\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone) }\n}\n\nfunction pushSelectionToHistory(sel, dest) {\n var top = lst(dest)\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel) }\n}\n\n// Used to store marked span information in the history.\nfunction attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans }\n ++n\n })\n}\n\n// When un/re-doing restores text containing marked spans, those\n// that have been explicitly cleared should not be restored.\nfunction removeClearedSpans(spans) {\n if (!spans) { return null }\n var out\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }\n else if (out) { out.push(spans[i]) }\n }\n return !out ? spans : out.length ? out : null\n}\n\n// Retrieve and filter the old marked spans stored in a change event.\nfunction getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id]\n if (!found) { return null }\n var nw = []\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])) }\n return nw\n}\n\n// Used for un/re-doing changes from the history. Combines the\n// result of computing the existing spans with the set of spans that\n// existed in the history (so that deleting around a span and then\n// undoing brings back the span).\nfunction mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change)\n var stretched = stretchSpansOverChange(doc, change)\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i]\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j]\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span)\n }\n } else if (stretchCur) {\n old[i] = stretchCur\n }\n }\n return old\n}\n\n// Used both to provide a JSON-safe object in .getHistory, and, when\n// detaching a document, to split the history in two\nfunction copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = []\n for (var i = 0; i < events.length; ++i) {\n var event = events[i]\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event)\n continue\n }\n var changes = event.changes, newChanges = []\n copy.push({changes: newChanges})\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0)\n newChanges.push({from: change.from, to: change.to, text: change.text})\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop]\n delete change[prop]\n }\n } } }\n }\n }\n return copy\n}\n\n// The 'scroll' parameter given to many of these indicated whether\n// the new cursor position should be scrolled into view after\n// modifying the selection.\n\n// If shift is held or the extend flag is set, extends a range to\n// include a given position (and optionally a second position).\n// Otherwise, simply returns the range between the given positions.\n// Used for cursor motion and such.\nfunction extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor\n if (other) {\n var posBefore = cmp(head, anchor) < 0\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head\n head = other\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n}\n\n// Extend the primary selection range, discard the rest.\nfunction extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend) }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options)\n}\n\n// Extend all selections (pos is an array of selections with length\n// equal the number of selections)\nfunction extendSelections(doc, heads, options) {\n var out = []\n var extend = doc.cm && (doc.cm.display.shift || doc.extend)\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend) }\n var newSel = normalizeSelection(out, doc.sel.primIndex)\n setSelection(doc, newSel, options)\n}\n\n// Updates a single range in the selection.\nfunction replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0)\n ranges[i] = range\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)\n}\n\n// Reset the selection to a single range.\nfunction setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options)\n}\n\n// Give beforeSelectionChange handlers a change to influence a\n// selection update.\nfunction filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = []\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)) }\n },\n origin: options && options.origin\n }\n signal(doc, \"beforeSelectionChange\", doc, obj)\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj) }\n if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n}\n\nfunction setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done)\n if (last && last.ranges) {\n done[done.length - 1] = sel\n setSelectionNoUndo(doc, sel, options)\n } else {\n setSelection(doc, sel, options)\n }\n}\n\n// Set a new selection.\nfunction setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options)\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options)\n}\n\nfunction setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options) }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1)\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true))\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm) }\n}\n\nfunction setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true\n signalCursorActivity(doc.cm)\n }\n signalLater(doc, \"cursorActivity\", doc)\n}\n\n// Verify that the selection does not partially select any atomic\n// marked ranges.\nfunction reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false))\n}\n\n// Return a selection that does not partially select any atomic\n// ranges.\nfunction skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i]\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear)\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear)\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i) }\n out[i] = new Range(newAnchor, newHead)\n }\n }\n return out ? normalizeSelection(out, sel.primIndex) : sel\n}\n\nfunction skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line)\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\")\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0)\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1)\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null) }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n}\n\n// Ensure a given position is not inside an atomic range.\nfunction skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true))\n if (!found) {\n doc.cantEdit = true\n return Pos(doc.first, 0)\n }\n return found\n}\n\nfunction movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n}\n\nfunction selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll)\n}\n\n// UPDATING\n\n// Allow \"beforeChange\" event handlers to influence a change\nfunction filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n }\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from) }\n if (to) { obj.to = clipPos(doc, to) }\n if (text) { obj.text = text }\n if (origin !== undefined) { obj.origin = origin }\n } }\n signal(doc, \"beforeChange\", doc, obj)\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj) }\n\n if (obj.canceled) { return null }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n}\n\n// Apply a change to a document, and add it to the document's\n// history, and propagating it to all linked documents.\nfunction makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true)\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to)\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text}) }\n } else {\n makeChangeInner(doc, change)\n }\n}\n\nfunction makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change)\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN)\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change))\n var rebased = []\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change)\n rebased.push(doc.history)\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change))\n })\n}\n\n// Revert a change stored in a document's history.\nfunction makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0\n for (; i < source.length; i++) {\n event = source[i]\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null\n\n for (;;) {\n event = source.pop()\n if (event.ranges) {\n pushSelectionToHistory(event, dest)\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false})\n return\n }\n selAfter = event\n }\n else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = []\n pushSelectionToHistory(selAfter, dest)\n dest.push({changes: antiChanges, generation: hist.generation})\n hist.generation = event.generation || ++hist.maxGeneration\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")\n\n var loop = function ( i ) {\n var change = event.changes[i]\n change.origin = type\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change))\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source)\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change))\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) }\n var rebased = []\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change)\n rebased.push(doc.history)\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change))\n })\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}\n\n// Sub-views need their line numbers shifted when text is added\n// above or below them in the parent document.\nfunction shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex)\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance)\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\") }\n }\n}\n\n// More lower-level change function, handling only a single document\n// (not linked ones).\nfunction makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line))\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line)\n shiftDoc(doc, shift)\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin}\n }\n var last = doc.lastLine()\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin}\n }\n\n change.removed = getBetween(doc, change.from, change.to)\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change) }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) }\n else { updateDoc(doc, change, spans) }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll)\n}\n\n// Handle the interaction of a change to a document with the editor\n// that this document is part of.\nfunction makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to\n\n var recomputeMaxLength = false, checkWidthStart = from.line\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true\n return true\n }\n })\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm) }\n\n updateDoc(doc, change, spans, estimateHeight(cm))\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line)\n if (len > display.maxLineLength) {\n display.maxLine = line\n display.maxLineLength = len\n display.maxLineChanged = true\n recomputeMaxLength = false\n }\n })\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true }\n }\n\n retreatFrontier(doc, from.line)\n startWorker(cm, 400)\n\n var lendiff = change.text.length - (to.line - from.line) - 1\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm) }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\") }\n else\n { regChange(cm, from.line, to.line + 1, lendiff) }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\")\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n }\n if (changeHandler) { signalLater(cm, \"change\", cm, obj) }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) }\n }\n cm.display.selForContextMenu = null\n}\n\nfunction replaceRange(doc, code, from, to, origin) {\n if (!to) { to = from }\n if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp }\n if (typeof code == \"string\") { code = doc.splitLines(code) }\n makeChange(doc, {from: from, to: to, text: code, origin: origin})\n}\n\n// Rebasing/resetting history to deal with externally-sourced changes\n\nfunction rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff\n } else if (from < pos.line) {\n pos.line = from\n pos.ch = 0\n }\n}\n\n// Tries to rebase an array of history events given a change in the\n// document. If the change touches the same lines as the event, the\n// event, and everything 'behind' it, is discarded. If the change is\n// before the event, the event's positions are updated. Uses a\n// copy-on-write scheme for the positions, to avoid having to\n// reallocate them all on every rebase, but also avoid problems with\n// shared position objects being unsafely updated.\nfunction rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff)\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff)\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1]\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch)\n cur.to = Pos(cur.to.line + diff, cur.to.ch)\n } else if (from <= cur.to.line) {\n ok = false\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1)\n i = 0\n }\n }\n}\n\nfunction rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1\n rebaseHistArray(hist.done, from, to, diff)\n rebaseHistArray(hist.undone, from, to, diff)\n}\n\n// Utility for applying a change to a line by handle or number,\n// returning the number and optionally registering the line as\n// changed.\nfunction changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)) }\n else { no = lineNo(handle) }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) }\n return line\n}\n\n// The document is represented as a BTree consisting of leaves, with\n// chunk of lines in them, and branches, with up to ten leaves or\n// other branch nodes below them. The top node is always a branch\n// node, and is the document object itself (meaning it has\n// additional methods and properties).\n//\n// All nodes have parent links. The tree is used both to go from\n// line numbers to line objects, and to go from objects to numbers.\n// It also indexes by height, and is used to convert between height\n// and line object, and to find the total height of the document.\n//\n// See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\nfunction LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines\n this.parent = null\n var height = 0\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1\n height += lines[i].height\n }\n this.height = height\n}\n\nLeafChunk.prototype = {\n chunkSize: function chunkSize() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function removeInner(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i]\n this$1.height -= line.height\n cleanUpLine(line)\n signalLater(line, \"delete\")\n }\n this.lines.splice(at, n)\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function collapse(lines) {\n lines.push.apply(lines, this.lines)\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function insertInner(at, lines, height) {\n var this$1 = this;\n\n this.height += height\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at))\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function iterN(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n}\n\nfunction BranchChunk(children) {\n var this$1 = this;\n\n this.children = children\n var size = 0, height = 0\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i]\n size += ch.chunkSize(); height += ch.height\n ch.parent = this$1\n }\n this.size = size\n this.height = height\n this.parent = null\n}\n\nBranchChunk.prototype = {\n chunkSize: function chunkSize() { return this.size },\n\n removeInner: function removeInner(at, n) {\n var this$1 = this;\n\n this.size -= n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize()\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height\n child.removeInner(at, rm)\n this$1.height -= oldHeight - child.height\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null }\n if ((n -= rm) == 0) { break }\n at = 0\n } else { at -= sz }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = []\n this.collapse(lines)\n this.children = [new LeafChunk(lines)]\n this.children[0].parent = this\n }\n },\n\n collapse: function collapse(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) }\n },\n\n insertInner: function insertInner(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length\n this.height += height\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize()\n if (at <= sz) {\n child.insertInner(at, lines, height)\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25))\n child.height -= leaf.height\n this$1.children.splice(++i, 0, leaf)\n leaf.parent = this$1\n }\n child.lines = child.lines.slice(0, remaining)\n this$1.maybeSpill()\n }\n break\n }\n at -= sz\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function maybeSpill() {\n if (this.children.length <= 10) { return }\n var me = this\n do {\n var spilled = me.children.splice(me.children.length - 5, 5)\n var sibling = new BranchChunk(spilled)\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children)\n copy.parent = me\n me.children = [copy, sibling]\n me = copy\n } else {\n me.size -= sibling.size\n me.height -= sibling.height\n var myIndex = indexOf(me.parent.children, me)\n me.parent.children.splice(myIndex + 1, 0, sibling)\n }\n sibling.parent = me.parent\n } while (me.children.length > 10)\n me.parent.maybeSpill()\n },\n\n iterN: function iterN(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize()\n if (at < sz) {\n var used = Math.min(n, sz - at)\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0\n } else { at -= sz }\n }\n }\n}\n\n// Line widgets are block elements displayed above or below a line.\n\nvar LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt] } } }\n this.doc = doc\n this.node = node\n};\n\nLineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line)\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } }\n if (!ws.length) { line.widgets = null }\n var height = widgetHeight(this)\n updateLineHeight(line, Math.max(0, line.height - height))\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height)\n regLineChange(cm, no, \"widget\")\n })\n signalLater(cm, \"lineWidgetCleared\", cm, this, no)\n }\n};\n\nLineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line\n this.height = null\n var diff = widgetHeight(this) - oldH\n if (!diff) { return }\n updateLineHeight(line, line.height + diff)\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true\n adjustScrollWhenAboveVisible(cm, line, diff)\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line))\n })\n }\n};\neventMixin(LineWidget)\n\nfunction adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff) }\n}\n\nfunction addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options)\n var cm = doc.cm\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = [])\n if (widget.insertAt == null) { widgets.push(widget) }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) }\n widget.line = line\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop\n updateLineHeight(line, line.height + widgetHeight(widget))\n if (aboveVisible) { addToScrollTop(cm, widget.height) }\n cm.curOp.forceUpdate = true\n }\n return true\n })\n signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle))\n return widget\n}\n\n// TEXTMARKERS\n\n// Created with markText and setBookmark methods. A TextMarker is a\n// handle that can be used to clear or find a marked position in the\n// document. Line objects hold arrays (markedSpans) containing\n// {from, to, marker} object pointing to such marker objects, and\n// indicating that such a marker is present on that line. Multiple\n// lines may point to the same marker when it spans across lines.\n// The spans will have null for their from/to properties when the\n// marker continues beyond the start/end of the line. Markers have\n// links back to the lines they currently touch.\n\n// Collapsed markers have unique ids, in order to be able to order\n// them, which is needed for uniquely determining an outer marker\n// when they overlap (they may nest, but not partially overlap).\nvar nextMarkerId = 0\n\nvar TextMarker = function(doc, type) {\n this.lines = []\n this.type = type\n this.doc = doc\n this.id = ++nextMarkerId\n};\n\n// Clear the marker.\nTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp\n if (withOp) { startOperation(cm) }\n if (hasHandler(this, \"clear\")) {\n var found = this.find()\n if (found) { signalLater(this, \"clear\", found.from, found.to) }\n }\n var min = null, max = null\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i]\n var span = getMarkedSpanFor(line.markedSpans, this$1)\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\") }\n else if (cm) {\n if (span.to != null) { max = lineNo(line) }\n if (span.from != null) { min = lineNo(line) }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span)\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)) }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual)\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual\n cm.display.maxLineLength = len\n cm.display.maxLineChanged = true\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) }\n this.lines.length = 0\n this.explicitlyCleared = true\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false\n if (cm) { reCheckSelection(cm.doc) }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max) }\n if (withOp) { endOperation(cm) }\n if (this.parent) { this.parent.clear() }\n};\n\n// Find the position of the marker in the document. Returns a {from,\n// to} object by default. Side can be passed to get a specific side\n// -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n// Pos objects returned contain a line object, rather than a line\n// number (used to prevent looking up the same line twice).\nTextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1 }\n var from, to\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i]\n var span = getMarkedSpanFor(line.markedSpans, this$1)\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from)\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to)\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n};\n\n// Signals that the marker's widget changed, and surrounding layout\n// should be recomputed.\nTextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line)\n var view = findViewForLine(cm, lineN)\n if (view) {\n clearLineMeasurementCacheFor(view)\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true\n }\n cm.curOp.updateMaxLine = true\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height\n widget.height = null\n var dHeight = widgetHeight(widget) - oldHeight\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight) }\n }\n signalLater(cm, \"markerChanged\", cm, this$1)\n })\n};\n\nTextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) }\n }\n this.lines.push(line)\n};\n\nTextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1)\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this)\n }\n};\neventMixin(TextMarker)\n\n// Create a marker, wire it up to the right lines, and\nfunction markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to)\n if (options) { copyObj(options, marker, false) }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\")\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\") }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans()\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN) }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null))\n ++curLine\n })\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) }\n }) }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }) }\n\n if (marker.readOnly) {\n seeReadOnlySpans()\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory() }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId\n marker.atomic = true\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1) }\n else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\") } }\n if (marker.atomic) { reCheckSelection(cm.doc) }\n signalLater(cm, \"markerAdded\", cm, marker)\n }\n return marker\n}\n\n// SHARED TEXTMARKERS\n\n// A shared marker spans multiple linked documents. It is\n// implemented as a meta-marker-object controlling multiple normal\n// markers.\nvar SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers\n this.primary = primary\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1 }\n};\n\nSharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear() }\n signalLater(this, \"clear\")\n};\n\nSharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n};\neventMixin(SharedTextMarker)\n\nfunction markTextShared(doc, from, to, options, type) {\n options = copyObj(options)\n options.shared = false\n var markers = [markText(doc, from, to, options, type)], primary = markers[0]\n var widget = options.widgetNode\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true) }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type))\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers)\n })\n return new SharedTextMarker(markers, primary)\n}\n\nfunction findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n}\n\nfunction copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find()\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to)\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type)\n marker.markers.push(subMark)\n subMark.parent = marker\n }\n }\n}\n\nfunction detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc]\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); })\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j]\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null\n marker.markers.splice(j--, 1)\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n}\n\nvar nextDocId = 0\nvar Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0 }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])])\n this.first = firstLine\n this.scrollTop = this.scrollLeft = 0\n this.cantEdit = false\n this.cleanGeneration = 1\n this.modeFrontier = this.highlightFrontier = firstLine\n var start = Pos(firstLine, 0)\n this.sel = simpleSelection(start)\n this.history = new History(null)\n this.id = ++nextDocId\n this.modeOption = mode\n this.lineSep = lineSep\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\"\n this.extend = false\n\n if (typeof text == \"string\") { text = this.splitLines(text) }\n updateDoc(this, {from: start, to: start, text: text})\n setSelection(this, simpleSelection(start), sel_dontScroll)\n}\n\nDoc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op) }\n else { this.iterN(this.first, this.first + this.size, from) }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height }\n this.insertInner(at - this.first, lines, height)\n },\n remove: function(at, n) { this.removeInner(at - this.first, n) },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size)\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true)\n if (this.cm) { scrollToCoords(this.cm, 0, 0) }\n setSelection(this, simpleSelection(top), sel_dontScroll)\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from)\n to = to ? clipPos(this, to) : from\n replaceRange(this, code, from, to, origin)\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to))\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line) }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos\n if (start == null || start == \"head\") { pos = range.head }\n else if (start == \"anchor\") { pos = range.anchor }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to() }\n else { pos = range.from() }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options)\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options)\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options)\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options)\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f)\n extendSelections(this, clipPosArray(this, heads), options)\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = []\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)) }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) }\n setSelection(this, normalizeSelection(out, primary), options)\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0)\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)))\n setSelection(this, normalizeSelection(ranges, ranges.length - 1), options)\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())\n lines = lines ? lines.concat(sel) : sel\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) }\n parts[i] = sel\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = []\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code }\n this.replaceSelections(dup, collapse, origin || \"+input\")\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i]\n changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin}\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse)\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]) }\n if (newSel) { setSelectionReplaceHistory(this, newSel) }\n else if (this.cm) { ensureCursorVisible(this.cm) }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\")}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\")}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true)}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true)}),\n\n setExtending: function(val) {this.extend = val},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration)},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true)\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration)\n hist.done = copyHistoryArray(histData.done.slice(0), null, true)\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true)\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {})\n markers[gutterID] = value\n if (!value && isEmpty(markers)) { line.gutterMarkers = null }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null }\n return true\n })\n }\n })\n }),\n\n lineInfo: function(line) {\n var n\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line\n line = getLine(this, line)\n if (!line) { return null }\n } else {\n n = lineNo(line)\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\"\n if (!line[prop]) { line[prop] = cls }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\"\n var cur = line[prop]\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null }\n else {\n var found = cur.match(classTest(cls))\n if (!found) { return false }\n var end = found.index + found[0].length\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear() },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents}\n pos = clipPos(this, pos)\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos)\n var markers = [], spans = getLine(this, pos.line).markedSpans\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker) }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to)\n var found = [], lineNo = from.line\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i]\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker) }\n } }\n ++lineNo\n })\n return found\n },\n getAllMarks: function() {\n var markers = []\n this.iter(function (line) {\n var sps = line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker) } } }\n })\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length\n this.iter(function (line) {\n var sz = line.text.length + sepSize\n if (sz > off) { ch = off; return true }\n off -= sz\n ++lineNo\n })\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords)\n var index = coords.ch\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize\n })\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction)\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft\n doc.sel = this.sel\n doc.extend = false\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth\n doc.setHistory(this.getHistory())\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {} }\n var from = this.first, to = this.first + this.size\n if (options.from != null && options.from > from) { from = options.from }\n if (options.to != null && options.to < to) { to = options.to }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction)\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist})\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]\n copySharedMarkers(copy, findSharedMarkers(this))\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i]\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1)\n other.unlinkDoc(this$1)\n detachSharedMarkers(findSharedMarkers(this$1))\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id]\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true)\n other.history = new History(null)\n other.history.done = copyHistoryArray(this.history.done, splitIds)\n other.history.undone = copyHistoryArray(this.history.undone, splitIds)\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f)},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\" }\n if (dir == this.direction) { return }\n this.direction = dir\n this.iter(function (line) { return line.order = null; })\n if (this.cm) { directionChanged(this.cm) }\n })\n})\n\n// Public alias.\nDoc.prototype.eachLine = Doc.prototype.iter\n\n// Kludge to work around strange IE behavior where it'll sometimes\n// re-fire a series of drag-related events right after the drop (#1551)\nvar lastDrop = 0\n\nfunction onDrop(e) {\n var cm = this\n clearDragCursor(cm)\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e)\n if (ie) { lastDrop = +new Date }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader\n reader.onload = operation(cm, function () {\n var content = reader.result\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\" }\n text[i] = content\n if (++read == n) {\n pos = clipPos(cm.doc, pos)\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"}\n makeChange(cm.doc, change)\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)))\n }\n })\n reader.readAsText(file)\n }\n for (var i = 0; i < n; ++i) { loadFile(files[i], i) }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e)\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20)\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\")\n if (text$1) {\n var selected\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections() }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos))\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\") } }\n cm.replaceSelection(text$1, \"around\", \"paste\")\n cm.display.input.focus()\n }\n }\n catch(e){}\n }\n}\n\nfunction onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection())\n e.dataTransfer.effectAllowed = \"copyMove\"\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\")\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"\n if (presto) {\n img.width = img.height = 1\n cm.display.wrapper.appendChild(img)\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop\n }\n e.dataTransfer.setDragImage(img, 0, 0)\n if (presto) { img.parentNode.removeChild(img) }\n }\n}\n\nfunction onDragOver(cm, e) {\n var pos = posFromMouse(cm, e)\n if (!pos) { return }\n var frag = document.createDocumentFragment()\n drawSelectionCursor(cm, pos, frag)\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\")\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv)\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag)\n}\n\nfunction clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor)\n cm.display.dragCursor = null\n }\n}\n\n// These must be handled carefully, because naively registering a\n// handler for each editor will cause the editors to never be\n// garbage collected.\n\nfunction forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\")\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror\n if (cm) { f(cm) }\n }\n}\n\nvar globalsRegistered = false\nfunction ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers()\n globalsRegistered = true\n}\nfunction registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null\n forEachCodeMirror(onResize)\n }, 100) }\n })\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); })\n}\n// Called when the window resizes\nfunction onResize(cm) {\n var d = cm.display\n if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)\n { return }\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null\n d.scrollbarsClipped = false\n cm.setSize()\n}\n\nvar keyNames = {\n 3: \"Enter\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n}\n\n// Number keys\nfor (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) }\n// Alphabetic keys\nfor (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) }\n// Function keys\nfor (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2 }\n\nvar keyMap = {}\n\nkeyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n}\n// Note that the save and find-related commands aren't defined by\n// default. User code or addons can define them. Unknown commands\n// are simply ignored.\nkeyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n fallthrough: \"basic\"\n}\n// Very basic readline/emacs-style bindings, which are standard on Mac.\nkeyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n}\nkeyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n fallthrough: [\"basic\", \"emacsy\"]\n}\nkeyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault\n\n// KEYMAP DISPATCH\n\nfunction normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/)\n name = parts[parts.length - 1]\n var alt, ctrl, shift, cmd\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i]\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true }\n else if (/^a(lt)?$/i.test(mod)) { alt = true }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true }\n else if (/^s(hift)?$/i.test(mod)) { shift = true }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name }\n if (ctrl) { name = \"Ctrl-\" + name }\n if (cmd) { name = \"Cmd-\" + name }\n if (shift) { name = \"Shift-\" + name }\n return name\n}\n\n// This is a kludge to keep keymaps mostly working as raw objects\n// (backwards compatibility) while at the same time support features\n// like normalization and multi-stroke key bindings. It compiles a\n// new normalized keymap, and then updates the old object to reflect\n// this.\nfunction normalizeKeyMap(keymap) {\n var copy = {}\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname]\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName)\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0)\n if (i == keys.length - 1) {\n name = keys.join(\" \")\n val = value\n } else {\n name = keys.slice(0, i + 1).join(\" \")\n val = \"...\"\n }\n var prev = copy[name]\n if (!prev) { copy[name] = val }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname]\n } }\n for (var prop in copy) { keymap[prop] = copy[prop] }\n return keymap\n}\n\nfunction lookupKey(key, map, handle, context) {\n map = getKeyMap(map)\n var found = map.call ? map.call(key, context) : map[key]\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context)\n if (result) { return result }\n }\n }\n}\n\n// Modifier key presses don't count as 'real' key presses for the\n// purpose of keymap fallthrough.\nfunction isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode]\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n}\n\nfunction addModifierNames(name, event, noShift) {\n var base = name\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name }\n return name\n}\n\n// Look up the name of a key as indicated by an event object.\nfunction keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode]\n if (name == null || event.altGraphKey) { return false }\n return addModifierNames(name, event, noShift)\n}\n\nfunction getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n}\n\n// Helper for deleting text near the selection(s), used to implement\n// backspace, delete, and similar functionality.\nfunction deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = []\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i])\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop()\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from\n break\n }\n }\n kill.push(toKill)\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\") }\n ensureCursorVisible(cm)\n })\n}\n\n// Commands are parameter-less actions that can be performed on an\n// editor, mostly used for keybindings.\nvar commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\")\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5\n var pos = cm.coordsChar({left: 0, top: top}, \"div\")\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from()\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize)\n spaces.push(spaceStr(tabSize - col % tabSize))\n }\n cm.replaceSelections(spaces)\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\") }\n else { cm.execCommand(\"insertTab\") }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = []\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1)\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\")\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text\n if (prev) {\n cur = new Pos(cur.line, 1)\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\")\n }\n }\n }\n newSel.push(new Range(cur, cur))\n }\n cm.setSelections(newSel)\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections()\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\") }\n sels = cm.listSelections()\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true) }\n ensureCursorVisible(cm)\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n}\n\n\nfunction lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN)\n var visual = visualLine(line)\n if (visual != line) { lineN = lineNo(visual) }\n return endOfLine(true, cm, visual, lineN, 1)\n}\nfunction lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN)\n var visual = visualLineEnd(line)\n if (visual != line) { lineN = lineNo(visual) }\n return endOfLine(true, cm, line, lineN, -1)\n}\nfunction lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line)\n var line = getLine(cm.doc, start.line)\n var order = getOrder(line, cm.doc.direction)\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/))\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n}\n\n// Run a handler that was bound to a key.\nfunction doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound]\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled()\n var prevShift = cm.display.shift, done = false\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true }\n if (dropShift) { cm.display.shift = false }\n done = bound(cm) != Pass\n } finally {\n cm.display.shift = prevShift\n cm.state.suppressEdits = false\n }\n return done\n}\n\nfunction lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm)\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n}\n\n// Note that, despite the name, this function is also used to check\n// for bound mouse clicks.\n\nvar stopSeq = new Delayed\nfunction dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null\n cm.display.input.reset()\n }\n })\n name = seq + \" \" + name\n }\n var result = lookupKeyForEditor(cm, name, handle)\n\n if (result == \"multi\")\n { cm.state.keySeq = name }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e) }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e)\n restartBlink(cm)\n }\n\n if (seq && !result && /\\'$/.test(name)) {\n e_preventDefault(e)\n return true\n }\n return !!result\n}\n\n// Handle a key from the keydown event.\nfunction handleKeyBinding(cm, e) {\n var name = keyName(e, true)\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n}\n\n// Handle a key from the keypress event\nfunction handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n}\n\nvar lastStoppedKey = null\nfunction onKeyDown(e) {\n var cm = this\n cm.curOp.focus = activeElt()\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false }\n var code = e.keyCode\n cm.display.shift = code == 16 || e.shiftKey\n var handled = handleKeyBinding(cm, e)\n if (presto) {\n lastStoppedKey = handled ? code : null\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\") }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm) }\n}\n\nfunction showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv\n addClass(lineDiv, \"CodeMirror-crosshair\")\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\")\n off(document, \"keyup\", up)\n off(document, \"mouseover\", up)\n }\n }\n on(document, \"keyup\", up)\n on(document, \"mouseover\", up)\n}\n\nfunction onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false }\n signalDOMEvent(this, e)\n}\n\nfunction onKeyPress(e) {\n var cm = this\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode)\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e)\n}\n\nvar DOUBLECLICK_DELAY = 400\n\nvar PastClick = function(time, pos, button) {\n this.time = time\n this.pos = pos\n this.button = button\n};\n\nPastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n};\n\nvar lastClick;\nvar lastDoubleClick;\nfunction clickRepeat(pos, button) {\n var now = +new Date\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button)\n lastClick = null\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button)\n lastDoubleClick = null\n return \"single\"\n }\n}\n\n// A mouse down can be a single click, double click, triple click,\n// start of selection drag, start of text drag, new cursor\n// (ctrl-click), rectangle drag (alt-drag), or xwin\n// middle-click-paste. Or it might be a click on something we should\n// not interfere with, such as a scrollbar or widget.\nfunction onMouseDown(e) {\n var cm = this, display = cm.display\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled()\n display.shift = e.shiftKey\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false\n setTimeout(function () { return display.scroller.draggable = true; }, 100)\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\"\n window.focus()\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e) }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e) }\n else if (e_target(e) == display.scroller) { e_preventDefault(e) }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos) }\n setTimeout(function () { return display.input.focus(); }, 20)\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e) }\n else { delayBlurEvent(cm) }\n }\n}\n\nfunction handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\"\n if (repeat == \"double\") { name = \"Double\" + name }\n else if (repeat == \"triple\") { name = \"Triple\" + name }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound] }\n if (!bound) { return false }\n var done = false\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true }\n done = bound(cm, pos) != Pass\n } finally {\n cm.state.suppressEdits = false\n }\n return done\n })\n}\n\nfunction configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\")\n var value = option ? option(cm, repeat, event) : {}\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\"\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey) }\n return value\n}\n\nfunction leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0) }\n else { cm.curOp.focus = activeElt() }\n\n var behavior = configureMouse(cm, repeat, event)\n\n var sel = cm.doc.sel, contained\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior) }\n else\n { leftButtonSelect(cm, event, pos, behavior) }\n}\n\n// Start a text drag. When it ends, see if any dragging actually\n// happen, and treat as a click if it didn't.\nfunction leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false }\n cm.state.draggingText = false\n off(document, \"mouseup\", dragEnd)\n off(document, \"mousemove\", mouseMove)\n off(display.scroller, \"dragstart\", dragStart)\n off(display.scroller, \"drop\", dragEnd)\n if (!moved) {\n e_preventDefault(e)\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend) }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {document.body.focus(); display.input.focus()}, 20) }\n else\n { display.input.focus() }\n }\n })\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10\n }\n var dragStart = function () { return moved = true; }\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true }\n cm.state.draggingText = dragEnd\n dragEnd.copy = !behavior.moveOnDrag\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop() }\n on(document, \"mouseup\", dragEnd)\n on(document, \"mousemove\", mouseMove)\n on(display.scroller, \"dragstart\", dragStart)\n on(display.scroller, \"drop\", dragEnd)\n\n delayBlurEvent(cm)\n setTimeout(function () { return display.input.focus(); }, 20)\n}\n\nfunction rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos)\n return new Range(result.from, result.to)\n}\n\n// Normal selection, as opposed to text dragging.\nfunction leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc\n e_preventDefault(event)\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start)\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex] }\n else\n { ourRange = new Range(start, start) }\n } else {\n ourRange = doc.sel.primary()\n ourIndex = doc.sel.primIndex\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start) }\n start = posFromMouse(cm, event, true, true)\n ourIndex = -1\n } else {\n var range = rangeForUnit(cm, start, behavior.unit)\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend) }\n else\n { ourRange = range }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0\n setSelection(doc, new Selection([ourRange], 0), sel_mouse)\n startSel = doc.sel\n } else if (ourIndex == -1) {\n ourIndex = ranges.length\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"})\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"})\n startSel = doc.sel\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)\n }\n\n var lastPos = start\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)) }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false})\n cm.scrollIntoView(pos)\n } else {\n var oldRange = ourRange\n var range = rangeForUnit(cm, pos, behavior.unit)\n var anchor = oldRange.anchor, head\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head\n anchor = minPos(oldRange.from(), range.anchor)\n } else {\n head = range.anchor\n anchor = maxPos(oldRange.to(), range.head)\n }\n var ranges$1 = startSel.ranges.slice(0)\n ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect()\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0\n\n function extend(e) {\n var curCount = ++counter\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\")\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt()\n extendTo(cur)\n var visible = visibleLines(display, doc)\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside\n extend(e)\n }), 50) }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false\n counter = Infinity\n e_preventDefault(e)\n display.input.focus()\n off(document, \"mousemove\", move)\n off(document, \"mouseup\", up)\n doc.history.lastSelOrigin = null\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e) }\n else { extend(e) }\n })\n var up = operation(cm, done)\n cm.state.selectingText = up\n on(document, \"mousemove\", move)\n on(document, \"mouseup\", up)\n}\n\n\n// Determines whether an event happened in the gutter, and fires the\n// handlers for the corresponding event.\nfunction gutterEvent(cm, e, type, prevent) {\n var mX, mY\n try { mX = e.clientX; mY = e.clientY }\n catch(e) { return false }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e) }\n\n var display = cm.display\n var lineBox = display.lineDiv.getBoundingClientRect()\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i]\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY)\n var gutter = cm.options.gutters[i]\n signal(cm, type, cm, line, gutter, e)\n return e_defaultPrevented(e)\n }\n }\n}\n\nfunction clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n}\n\n// CONTEXT MENU HANDLING\n\n// To make the context menu work, we need to briefly unhide the\n// textarea (making it as unobtrusive as possible) to let the\n// right-click take effect on it.\nfunction onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e)\n}\n\nfunction contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n}\n\nfunction themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\")\n clearCaches(cm)\n}\n\nvar Init = {toString: function(){return \"CodeMirror.Init\"}}\n\nvar defaults = {}\nvar optionHandlers = {}\n\nfunction defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle }\n }\n\n CodeMirror.defineOption = option\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true)\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val\n loadMode(cm)\n }, true)\n\n option(\"indentUnit\", 2, loadMode, true)\n option(\"indentWithTabs\", false)\n option(\"smartIndent\", true)\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm)\n clearCaches(cm)\n regChange(cm)\n }, true)\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos)\n if (found == -1) { break }\n pos = found + val.length\n newBreaks.push(Pos(lineNo, found))\n }\n lineNo++\n })\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }\n })\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\")\n if (old != Init) { cm.refresh() }\n })\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true)\n option(\"electricChars\", true)\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true)\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true)\n option(\"rtlMoveVisually\", !windows)\n option(\"wholeLineUpdateBefore\", true)\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm)\n guttersChanged(cm)\n }, true)\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val)\n var prev = old != Init && getKeyMap(old)\n if (prev && prev.detach) { prev.detach(cm, next) }\n if (next.attach) { next.attach(cm, prev || null) }\n })\n option(\"extraKeys\", null)\n option(\"configureMouse\", null)\n\n option(\"lineWrapping\", false, wrappingChanged, true)\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options)\n guttersChanged(cm)\n }, true)\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\"\n cm.refresh()\n }, true)\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true)\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm)\n updateScrollbars(cm)\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop)\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft)\n }, true)\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options)\n guttersChanged(cm)\n }, true)\n option(\"firstLineNumber\", 1, guttersChanged, true)\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true)\n option(\"showCursorWhenSelecting\", false, updateSelection, true)\n\n option(\"resetSelectionOnContextMenu\", true)\n option(\"lineWiseCopyCut\", true)\n option(\"pasteLinesPerSelection\", true)\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm)\n cm.display.input.blur()\n }\n cm.display.input.readOnlyChanged(val)\n })\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true)\n option(\"dragDrop\", true, dragDropChanged)\n option(\"allowDropFileTypes\", null)\n\n option(\"cursorBlinkRate\", 530)\n option(\"cursorScrollMargin\", 0)\n option(\"cursorHeight\", 1, updateSelection, true)\n option(\"singleCursorHeightPerLine\", true, updateSelection, true)\n option(\"workTime\", 100)\n option(\"workDelay\", 100)\n option(\"flattenSpans\", true, resetModeState, true)\n option(\"addModeClass\", false, resetModeState, true)\n option(\"pollInterval\", 100)\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; })\n option(\"historyEventDelay\", 1250)\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true)\n option(\"maxHighlightLength\", 10000, resetModeState, true)\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition() }\n })\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; })\n option(\"autofocus\", null)\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true)\n}\n\nfunction guttersChanged(cm) {\n updateGutters(cm)\n regChange(cm)\n alignHorizontally(cm)\n}\n\nfunction dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions\n var toggle = value ? on : off\n toggle(cm.display.scroller, \"dragstart\", funcs.start)\n toggle(cm.display.scroller, \"dragenter\", funcs.enter)\n toggle(cm.display.scroller, \"dragover\", funcs.over)\n toggle(cm.display.scroller, \"dragleave\", funcs.leave)\n toggle(cm.display.scroller, \"drop\", funcs.drop)\n }\n}\n\nfunction wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\")\n cm.display.sizer.style.minWidth = \"\"\n cm.display.sizerWidth = null\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\")\n findMaxLine(cm)\n }\n estimateLineHeights(cm)\n regChange(cm)\n clearCaches(cm)\n setTimeout(function () { return updateScrollbars(cm); }, 100)\n}\n\n// A CodeMirror instance represents an editor. This is the object\n// that user code is usually dealing with.\n\nfunction CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {}\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false)\n setGuttersForLineNumbers(options)\n\n var doc = options.value\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction) }\n this.doc = doc\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this)\n var display = this.display = new Display(place, doc, input)\n display.wrapper.CodeMirror = this\n updateGutters(this)\n themeChanged(this)\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\" }\n initScrollbars(this)\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n }\n\n if (options.autofocus && !mobile) { display.input.focus() }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) }\n\n registerEventHandlers(this)\n ensureGlobalHandlers()\n\n startOperation(this)\n this.curOp.forceUpdate = true\n attachDoc(this, doc)\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20) }\n else\n { onBlur(this) }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init) } }\n maybeUpdateLineNumberWidth(this)\n if (options.finishInit) { options.finishInit(this) }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) }\n endOperation(this)\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\" }\n}\n\n// The default configuration options.\nCodeMirror.defaults = defaults\n// Functions to run when options are changed.\nCodeMirror.optionHandlers = optionHandlers\n\n// Attach the necessary event handlers when initializing the editor\nfunction registerEventHandlers(cm) {\n var d = cm.display\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown))\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e)\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e)\n var word = cm.findWordAt(pos)\n extendSelection(cm.doc, word.anchor, word.head)\n })) }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }) }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0}\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)\n prevTouch = d.activeTouch\n prevTouch.end = +new Date\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0]\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n d.input.ensurePolled()\n clearTimeout(touchFinished)\n var now = +new Date\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null}\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX\n d.activeTouch.top = e.touches[0].pageY\n }\n }\n })\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true }\n })\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos) }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos) }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n cm.setSelection(range.anchor, range.head)\n cm.focus()\n e_preventDefault(e)\n }\n finishTouch()\n })\n on(d.scroller, \"touchcancel\", finishTouch)\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop)\n setScrollLeft(cm, d.scroller.scrollLeft, true)\n signal(cm, \"scroll\", cm)\n }\n })\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); })\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); })\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}\n }\n\n var inp = d.input.getField()\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); })\n on(inp, \"keydown\", operation(cm, onKeyDown))\n on(inp, \"keypress\", operation(cm, onKeyPress))\n on(inp, \"focus\", function (e) { return onFocus(cm, e); })\n on(inp, \"blur\", function (e) { return onBlur(cm, e); })\n}\n\nvar initHooks = []\nCodeMirror.defineInitHook = function (f) { return initHooks.push(f); }\n\n// Indent the given line. The how parameter can be \"smart\",\n// \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n// (typically set to true for forced single-line indents), empty\n// lines are not indented, and places where the mode returns Pass\n// are left alone.\nfunction indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state\n if (how == null) { how = \"add\" }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\" }\n else { state = getContextBefore(cm, n).state }\n }\n\n var tabSize = cm.options.tabSize\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize)\n if (line.stateAfter) { line.stateAfter = null }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0\n how = \"not\"\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text)\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\"\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) }\n else { indentation = 0 }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit\n } else if (typeof how == \"number\") {\n indentation = curSpace + how\n }\n indentation = Math.max(0, indentation)\n\n var indentString = \"\", pos = 0\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\"} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos) }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\")\n line.stateAfter = null\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1]\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length)\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1))\n break\n }\n }\n }\n}\n\n// This will be set to a {lineWise: bool, text: [string]} object, so\n// that, when pasting, we know what kind of selections the copied\n// text was made out of.\nvar lastCopied = null\n\nfunction setLastCopied(newLastCopied) {\n lastCopied = newLastCopied\n}\n\nfunction applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc\n cm.display.shift = false\n if (!sel) { sel = doc.sel }\n\n var paste = cm.state.pasteIncoming || origin == \"paste\"\n var textLines = splitLinesAuto(inserted), multiPaste = null\n // When pasing N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = []\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])) }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; })\n }\n }\n\n var updateInput\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1]\n var from = range.from(), to = range.to()\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted) }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) }\n else if (lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0) }\n }\n updateInput = cm.curOp.updateInput\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\")}\n makeChange(cm.doc, changeEvent)\n signalLater(cm, \"inputRead\", cm, changeEvent)\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted) }\n\n ensureCursorVisible(cm)\n cm.curOp.updateInput = updateInput\n cm.curOp.typing = true\n cm.state.pasteIncoming = cm.state.cutIncoming = false\n}\n\nfunction handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\")\n if (pasted) {\n e.preventDefault()\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }) }\n return true\n }\n}\n\nfunction triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i]\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head)\n var indented = false\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\")\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\") }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line) }\n }\n}\n\nfunction copyableRanges(cm) {\n var text = [], ranges = []\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}\n ranges.push(lineRange)\n text.push(cm.getRange(lineRange.anchor, lineRange.head))\n }\n return {text: text, ranges: ranges}\n}\n\nfunction disableBrowserMagic(field, spellcheck) {\n field.setAttribute(\"autocorrect\", \"off\")\n field.setAttribute(\"autocapitalize\", \"off\")\n field.setAttribute(\"spellcheck\", !!spellcheck)\n}\n\nfunction hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\")\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\")\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\" }\n else { te.setAttribute(\"wrap\", \"off\") }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\" }\n disableBrowserMagic(te)\n return div\n}\n\n// The publicly visible API. Note that methodOp(f) means\n// 'wrap f in an operation, performed on its `this` parameter'.\n\n// This is not the complete set of editor methods. Most of the\n// methods defined on the Doc type are also injected into\n// CodeMirror.prototype, for backwards compatibility and\n// convenience.\n\nfunction addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers\n\n var helpers = CodeMirror.helpers = {}\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus()},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option]\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old) }\n signal(this, \"optionChange\", this, option)\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map))\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1)\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec)\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; })\n this.state.modeGen++\n regChange(this)\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1)\n this$1.state.modeGen++\n regChange(this$1)\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\" }\n else { dir = dir ? \"add\" : \"subtract\" }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (!range.empty()) {\n var from = range.from(), to = range.to()\n var start = Math.max(end, from.line)\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how) }\n var newRanges = this$1.doc.sel.ranges\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) }\n } else if (range.head.line > end) {\n indentLine(this$1, range.head.line, how, true)\n end = range.head.line\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos)\n var styles = getLineStyles(this, getLine(this.doc, pos.line))\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch\n var type\n if (ch == 0) { type = styles[2] }\n else { for (;;) {\n var mid = (before + after) >> 1\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1 }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = []\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos)\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]) }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]]\n if (val) { found.push(val) }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType])\n } else if (help[mode.name]) {\n found.push(help[mode.name])\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1]\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val) }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line)\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary()\n if (start == null) { pos = range.head }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start) }\n else { pos = start ? range.from() : range.to() }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\")\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1\n if (line < this.doc.first) { line = this.doc.first }\n else if (line > last) { line = last; end = true }\n lineObj = getLine(this.doc, line)\n } else {\n lineObj = line\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display\n pos = cursorCoords(this, clipPos(this.doc, pos))\n var top = pos.bottom, left = pos.left\n node.style.position = \"absolute\"\n node.setAttribute(\"cm-ignore-events\", \"true\")\n this.display.input.setUneditable(node)\n display.sizer.appendChild(node)\n if (vert == \"over\") {\n top = pos.top\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth)\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth }\n }\n node.style.top = top + \"px\"\n node.style.left = node.style.right = \"\"\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth\n node.style.right = \"0px\"\n } else {\n if (horiz == \"left\") { left = 0 }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 }\n node.style.left = left + \"px\"\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}) }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text) }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1\n if (amount < 0) { dir = -1; amount = -amount }\n var cur = clipPos(this.doc, from)\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually)\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move)\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\") }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false)\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }) }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn\n if (amount < 0) { dir = -1; amount = -amount }\n var cur = clipPos(this.doc, from)\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\")\n if (x == null) { x = coords.left }\n else { coords.left = x }\n cur = findPosV(this$1, coords, dir, unit)\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = []\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected()\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\")\n if (range.goalColumn != null) { headPos.left = range.goalColumn }\n goals.push(headPos.left)\n var pos = findPosV(this$1, headPos, dir, unit)\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top) }\n return pos\n }, sel_move)\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i] } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text\n var start = pos.ch, end = pos.ch\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\")\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end }\n var startChar = line.charAt(start)\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); }\n while (start > 0 && check(line.charAt(start - 1))) { --start }\n while (end < line.length && check(line.charAt(end))) { ++end }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\") }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\") }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite)\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y) }),\n getScrollInfo: function() {\n var scroller = this.display.scroller\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null}\n if (margin == null) { margin = this.options.cursorScrollMargin }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null}\n } else if (range.from == null) {\n range = {from: range, to: null}\n }\n if (!range.to) { range.to = range.from }\n range.margin = margin || 0\n\n if (range.from.line != null) {\n scrollToRange(this, range)\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin)\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; }\n if (width != null) { this.display.wrapper.style.width = interpret(width) }\n if (height != null) { this.display.wrapper.style.height = interpret(height) }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this) }\n var lineNo = this.display.viewFrom\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo\n })\n this.curOp.forceUpdate = true\n signal(this, \"refresh\", this)\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight\n regChange(this)\n this.curOp.forceUpdate = true\n clearCaches(this)\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop)\n updateGutterSpace(this)\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this) }\n signal(this, \"refresh\", this)\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc\n old.cm = null\n attachDoc(this, doc)\n clearCaches(this)\n this.display.input.reset()\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop)\n this.curOp.forceScroll = true\n signalLater(this, \"swapDoc\", this, old)\n return old\n }),\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n }\n eventMixin(CodeMirror)\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} }\n helpers[type][name] = value\n }\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value)\n helpers[type]._global.push({pred: predicate, val: value})\n }\n}\n\n// Used for horizontal relative motion. Dir is -1 or 1 (left or\n// right), unit can be \"char\", \"column\" (like char, but doesn't\n// cross line boundaries), \"word\" (across next word), or \"group\" (to\n// the start of next group of word or non-word-non-whitespace\n// chars). The visually param controls whether, in right-to-left\n// text, direction 1 means to move towards the next index in the\n// string, or towards the character to the right of the current\n// position. The resulting position will have a hitSide=true\n// property if it reached the end of the document.\nfunction findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos\n var origDir = dir\n var lineObj = getLine(doc, pos.line)\n function findNextLine() {\n var l = pos.line + dir\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky)\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir)\n } else {\n next = moveLogically(lineObj, pos, dir)\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir) }\n else\n { return false }\n } else {\n pos = next\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce()\n } else if (unit == \"column\") {\n moveOnce(true)\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\"\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\")\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\"\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\"\n if (group && !first && !type) { type = \"s\" }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\"}\n break\n }\n\n if (type) { sawType = type }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true)\n if (equalCursorPos(oldPos, result)) { result.hitSide = true }\n return result\n}\n\n// For relative vertical movement. Dir may be -1 or 1. Unit can be\n// \"page\" or \"line\". The resulting position will have a hitSide=true\n// property if it reached the end of the document.\nfunction findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight)\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3)\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3\n }\n var target\n for (;;) {\n target = coordsChar(cm, x, y)\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5\n }\n return target\n}\n\n// CONTENTEDITABLE INPUT STYLE\n\nvar ContentEditableInput = function(cm) {\n this.cm = cm\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null\n this.polling = new Delayed()\n this.composing = null\n this.gracePeriod = false\n this.readDOMTimeout = null\n};\n\nContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm\n var div = input.div = display.lineDiv\n disableBrowserMagic(div, cm.options.spellcheck)\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20) }\n })\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false}\n })\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false} }\n })\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() }\n this$1.composing.done = true\n }\n })\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); })\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon() }\n })\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()})\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\") }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm)\n setLastCopied({lineWise: true, text: ranges.text})\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll)\n cm.replaceSelection(\"\", null, \"cut\")\n })\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData()\n var content = lastCopied.text.join(\"\\n\")\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content)\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault()\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild)\n te.value = lastCopied.text.join(\"\\n\")\n var hadFocus = document.activeElement\n selectInput(te)\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge)\n hadFocus.focus()\n if (hadFocus == div) { input.showPrimarySelection() }\n }, 50)\n }\n on(div, \"copy\", onCopyCut)\n on(div, \"cut\", onCopyCut)\n};\n\nContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false)\n result.focus = this.cm.state.focused\n return result\n};\n\nContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection() }\n this.showMultipleSelections(info)\n};\n\nContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = window.getSelection(), cm = this.cm, prim = cm.doc.sel.primary()\n var from = prim.from(), to = prim.to()\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges()\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset)\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0}\n var end = to.line < cm.display.viewTo && posToDOM(cm, to)\n if (!end) {\n var measure = view[view.length - 1].measure\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}\n }\n\n if (!start || !end) {\n sel.removeAllRanges()\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng\n try { rng = range(start.node, start.offset, end.offset, end.node) }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset)\n if (!rng.collapsed) {\n sel.removeAllRanges()\n sel.addRange(rng)\n }\n } else {\n sel.removeAllRanges()\n sel.addRange(rng)\n }\n if (old && sel.anchorNode == null) { sel.addRange(old) }\n else if (gecko) { this.startGracePeriod() }\n }\n this.rememberSelection()\n};\n\nContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod)\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) }\n }, 20)\n};\n\nContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors)\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection)\n};\n\nContentEditableInput.prototype.rememberSelection = function () {\n var sel = window.getSelection()\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset\n};\n\nContentEditableInput.prototype.selectionInEditor = function () {\n var sel = window.getSelection()\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer\n return contains(this.div, node)\n};\n\nContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true) }\n this.div.focus()\n }\n};\nContentEditableInput.prototype.blur = function () { this.div.blur() };\nContentEditableInput.prototype.getField = function () { return this.div };\n\nContentEditableInput.prototype.supportsTouch = function () { return true };\n\nContentEditableInput.prototype.receivedFocus = function () {\n var input = this\n if (this.selectionInEditor())\n { this.pollSelection() }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection()\n input.polling.set(input.cm.options.pollInterval, poll)\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll)\n};\n\nContentEditableInput.prototype.selectionChanged = function () {\n var sel = window.getSelection()\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n};\n\nContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = window.getSelection(), cm = this.cm\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs})\n this.blur()\n this.focus()\n return\n }\n if (this.composing) { return }\n this.rememberSelection()\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)\n var head = domToPos(cm, sel.focusNode, sel.focusOffset)\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }\n }) }\n};\n\nContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout)\n this.readDOMTimeout = null\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary()\n var from = sel.from(), to = sel.to()\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0) }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line)\n fromNode = display.view[0].node\n } else {\n fromLine = lineNo(display.view[fromIndex].line)\n fromNode = display.view[fromIndex - 1].node.nextSibling\n }\n var toIndex = findViewIndex(cm, to.line)\n var toLine, toNode\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1\n toNode = display.lineDiv.lastChild\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1\n toNode = display.view[toIndex + 1].node.previousSibling\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine))\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length))\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length)\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront }\n var newBot = lst(newText), oldBot = lst(oldText)\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0))\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--\n cutEnd++\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\")\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\")\n\n var chFrom = Pos(fromLine, cutFront)\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0)\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\")\n return true\n }\n};\n\nContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd()\n};\nContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd()\n};\nContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout)\n this.composing = null\n this.updateFromDOM()\n this.div.blur()\n this.div.focus()\n};\nContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null }\n else { return }\n }\n this$1.updateFromDOM()\n }, 80)\n};\n\nContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }) }\n};\n\nContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\"\n};\n\nContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0) { return }\n e.preventDefault()\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) }\n};\n\nContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\")\n};\n\nContentEditableInput.prototype.onContextMenu = function () {};\nContentEditableInput.prototype.resetPosition = function () {};\n\nContentEditableInput.prototype.needsContentAttribute = true\n\nfunction posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line)\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line)\n var info = mapFromLineView(view, line, pos.line)\n\n var order = getOrder(line, cm.doc.direction), side = \"left\"\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch)\n side = partPos % 2 ? \"right\" : \"left\"\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side)\n result.offset = result.collapse == \"right\" ? result.end : result.start\n return result\n}\n\nfunction isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n}\n\nfunction badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\nfunction domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator()\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep\n closing = false\n }\n }\n function addText(str) {\n if (str) {\n close()\n text += str\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\")\n if (cmText != null) {\n addText(cmText || node.textContent.replace(/\\u200b/g, \"\"))\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID))\n if (found.length && (range = found[0].find()))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)) }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p)$/i.test(node.nodeName)\n if (isBlock) { close() }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]) }\n if (isBlock) { closing = true }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue)\n }\n }\n for (;;) {\n walk(from)\n if (from == to) { break }\n from = from.nextSibling\n }\n return text\n}\n\nfunction domToPos(cm, node, offset) {\n var lineNode\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset]\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i]\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n}\n\nfunction locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true\n node = wrapper.childNodes[offset]\n offset = 0\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild\n if (offset) { offset = textNode.nodeValue.length }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode }\n var measure = lineView.measure, maps = measure.maps\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i]\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2]\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i])\n var ch = map[j] + offset\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset)\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0)\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1)\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length }\n }\n}\n\n// TEXTAREA INPUT STYLE\n\nvar TextareaInput = function(cm) {\n this.cm = cm\n // See input.poll and input.reset\n this.prevInput = \"\"\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false\n // Self-resetting timeout for the poller\n this.polling = new Delayed()\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false\n this.composing = null\n};\n\nTextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm\n\n // Wraps and hides input textarea\n var div = this.wrapper = hiddenTextarea()\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var te = this.textarea = div.firstChild\n display.wrapper.insertBefore(div, display.wrapper.firstChild)\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\" }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null }\n input.poll()\n })\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = true\n input.fastPoll()\n })\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()})\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm)\n setLastCopied({lineWise: true, text: ranges.text})\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll)\n } else {\n input.prevInput = \"\"\n te.value = ranges.text.join(\"\\n\")\n selectInput(te)\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = true }\n }\n on(te, \"cut\", prepareCopyCut)\n on(te, \"copy\", prepareCopyCut)\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n cm.state.pasteIncoming = true\n input.focus()\n })\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e) }\n })\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\")\n if (input.composing) { input.composing.range.clear() }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n }\n })\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll()\n input.composing.range.clear()\n input.composing = null\n }\n })\n};\n\nTextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc\n var result = prepareSelection(cm)\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\")\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect()\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top))\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left))\n }\n\n return result\n};\n\nTextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors)\n removeChildrenAndAdd(display.selectionDiv, drawn.selection)\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\"\n this.wrapper.style.left = drawn.teLeft + \"px\"\n }\n};\n\n// Reset the input to correspond to the selection (or to be empty,\n// when not typing and nothing is selected)\nTextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm\n if (cm.somethingSelected()) {\n this.prevInput = \"\"\n var content = cm.getSelection()\n this.textarea.value = content\n if (cm.state.focused) { selectInput(this.textarea) }\n if (ie && ie_version >= 9) { this.hasSelection = content }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\"\n if (ie && ie_version >= 9) { this.hasSelection = null }\n }\n};\n\nTextareaInput.prototype.getField = function () { return this.textarea };\n\nTextareaInput.prototype.supportsTouch = function () { return false };\n\nTextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus() }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n};\n\nTextareaInput.prototype.blur = function () { this.textarea.blur() };\n\nTextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0\n};\n\nTextareaInput.prototype.receivedFocus = function () { this.slowPoll() };\n\n// Poll for input changes, using the normal rate of polling. This\n// runs as long as the editor is focused.\nTextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll()\n if (this$1.cm.state.focused) { this$1.slowPoll() }\n })\n};\n\n// When an event has just come in that is likely to add or change\n// something in the input textarea, we poll faster, to ensure that\n// the change appears on the screen quickly.\nTextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this\n input.pollingFast = true\n function p() {\n var changed = input.poll()\n if (!changed && !missed) {missed = true; input.polling.set(60, p)}\n else {input.pollingFast = false; input.slowPoll()}\n }\n input.polling.set(20, p)\n};\n\n// Read input from the textarea, and update the document to match.\n// When something is selected, it is present in the textarea, and\n// selected (unless it is huge, in which case a placeholder is\n// used). When nothing is selected, the cursor sits after previously\n// seen text (can be empty), which is stored in prevInput (we must\n// not reset the textarea when typing, because that breaks IME).\nTextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset()\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0)\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\" }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length)\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null)\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\" }\n else { this$1.prevInput = text }\n\n if (this$1.composing) {\n this$1.composing.range.clear()\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"})\n }\n })\n return true\n};\n\nTextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false }\n};\n\nTextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null }\n this.fastPoll()\n};\n\nTextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText\n input.wrapper.style.cssText = \"position: absolute\"\n var wrapperBox = input.wrapper.getBoundingClientRect()\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\"\n var oldScrollY\n if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712)\n display.input.focus()\n if (webkit) { window.scrollTo(null, oldScrollY) }\n display.input.reset()\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \" }\n input.contextMenuPending = true\n display.selForContextMenu = cm.doc.sel\n clearTimeout(display.detectingSelectAll)\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected()\n var extval = \"\\u200b\" + (selected ? te.value : \"\")\n te.value = \"\\u21da\" // Used to catch context-menu undo\n te.value = extval\n input.prevInput = selected ? \"\" : \"\\u200b\"\n te.selectionStart = 1; te.selectionEnd = extval.length\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel\n }\n }\n function rehide() {\n input.contextMenuPending = false\n input.wrapper.style.cssText = oldWrapperCSS\n te.style.cssText = oldCSS\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm)\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500)\n } else {\n display.selForContextMenu = null\n display.input.reset()\n }\n }\n display.detectingSelectAll = setTimeout(poll, 200)\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack() }\n if (captureRightClick) {\n e_stop(e)\n var mouseup = function () {\n off(window, \"mouseup\", mouseup)\n setTimeout(rehide, 20)\n }\n on(window, \"mouseup\", mouseup)\n } else {\n setTimeout(rehide, 50)\n }\n};\n\nTextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset() }\n this.textarea.disabled = val == \"nocursor\"\n};\n\nTextareaInput.prototype.setUneditable = function () {};\n\nTextareaInput.prototype.needsContentAttribute = false\n\nfunction fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {}\n options.value = textarea.value\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt()\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body\n }\n\n function save() {textarea.value = cm.getValue()}\n\n var realSubmit\n if (textarea.form) {\n on(textarea.form, \"submit\", save)\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form\n realSubmit = form.submit\n try {\n var wrappedSubmit = form.submit = function () {\n save()\n form.submit = realSubmit\n form.submit()\n form.submit = wrappedSubmit\n }\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save\n cm.getTextArea = function () { return textarea; }\n cm.toTextArea = function () {\n cm.toTextArea = isNaN // Prevent this from being ran twice\n save()\n textarea.parentNode.removeChild(cm.getWrapperElement())\n textarea.style.display = \"\"\n if (textarea.form) {\n off(textarea.form, \"submit\", save)\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit }\n }\n }\n }\n\n textarea.style.display = \"none\"\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options)\n return cm\n}\n\nfunction addLegacyProps(CodeMirror) {\n CodeMirror.off = off\n CodeMirror.on = on\n CodeMirror.wheelEventPixels = wheelEventPixels\n CodeMirror.Doc = Doc\n CodeMirror.splitLines = splitLinesAuto\n CodeMirror.countColumn = countColumn\n CodeMirror.findColumn = findColumn\n CodeMirror.isWordChar = isWordCharBasic\n CodeMirror.Pass = Pass\n CodeMirror.signal = signal\n CodeMirror.Line = Line\n CodeMirror.changeEnd = changeEnd\n CodeMirror.scrollbarModel = scrollbarModel\n CodeMirror.Pos = Pos\n CodeMirror.cmpPos = cmp\n CodeMirror.modes = modes\n CodeMirror.mimeModes = mimeModes\n CodeMirror.resolveMode = resolveMode\n CodeMirror.getMode = getMode\n CodeMirror.modeExtensions = modeExtensions\n CodeMirror.extendMode = extendMode\n CodeMirror.copyState = copyState\n CodeMirror.startState = startState\n CodeMirror.innerMode = innerMode\n CodeMirror.commands = commands\n CodeMirror.keyMap = keyMap\n CodeMirror.keyName = keyName\n CodeMirror.isModifierKey = isModifierKey\n CodeMirror.lookupKey = lookupKey\n CodeMirror.normalizeKeyMap = normalizeKeyMap\n CodeMirror.StringStream = StringStream\n CodeMirror.SharedTextMarker = SharedTextMarker\n CodeMirror.TextMarker = TextMarker\n CodeMirror.LineWidget = LineWidget\n CodeMirror.e_preventDefault = e_preventDefault\n CodeMirror.e_stopPropagation = e_stopPropagation\n CodeMirror.e_stop = e_stop\n CodeMirror.addClass = addClass\n CodeMirror.contains = contains\n CodeMirror.rmClass = rmClass\n CodeMirror.keyNames = keyNames\n}\n\n// EDITOR CONSTRUCTOR\n\ndefineOptions(CodeMirror)\n\naddEditorMethods(CodeMirror)\n\n// Set up methods on CodeMirror's prototype to redirect to the editor's document.\nvar dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \")\nfor (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]) } }\n\neventMixin(Doc)\n\n// INPUT HANDLING\n\nCodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput}\n\n// MODE DEFINITION AND QUERYING\n\n// Extra arguments are stored as the mode's dependencies, which is\n// used by (legacy) mechanisms like loadmode.js to automatically\n// load a mode. (Preferred mechanism is the require/define calls.)\nCodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name }\n defineMode.apply(this, arguments)\n}\n\nCodeMirror.defineMIME = defineMIME\n\n// Minimal default mode.\nCodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); })\nCodeMirror.defineMIME(\"text/plain\", \"null\")\n\n// EXTENSIONS\n\nCodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func\n}\nCodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func\n}\n\nCodeMirror.fromTextArea = fromTextArea\n\naddLegacyProps(CodeMirror)\n\nCodeMirror.version = \"5.28.0\"\n\nreturn CodeMirror;\n\n})));","/*!\n * clipboard.js v1.7.1\n * https://zenorocha.github.io/clipboard.js\n *\n * Licensed MIT © Zeno Rocha\n */\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Clipboard = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this.action = options.action;\n this.container = options.container;\n this.emitter = options.emitter;\n this.target = options.target;\n this.text = options.text;\n this.trigger = options.trigger;\n\n this.selectedText = '';\n }\n }, {\n key: 'initSelection',\n value: function initSelection() {\n if (this.text) {\n this.selectFake();\n } else if (this.target) {\n this.selectTarget();\n }\n }\n }, {\n key: 'selectFake',\n value: function selectFake() {\n var _this = this;\n\n var isRTL = document.documentElement.getAttribute('dir') == 'rtl';\n\n this.removeFake();\n\n this.fakeHandlerCallback = function () {\n return _this.removeFake();\n };\n this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;\n\n this.fakeElem = document.createElement('textarea');\n // Prevent zooming on iOS\n this.fakeElem.style.fontSize = '12pt';\n // Reset box model\n this.fakeElem.style.border = '0';\n this.fakeElem.style.padding = '0';\n this.fakeElem.style.margin = '0';\n // Move element out of screen horizontally\n this.fakeElem.style.position = 'absolute';\n this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';\n // Move element to the same position vertically\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n this.fakeElem.style.top = yPosition + 'px';\n\n this.fakeElem.setAttribute('readonly', '');\n this.fakeElem.value = this.text;\n\n this.container.appendChild(this.fakeElem);\n\n this.selectedText = (0, _select2.default)(this.fakeElem);\n this.copyText();\n }\n }, {\n key: 'removeFake',\n value: function removeFake() {\n if (this.fakeHandler) {\n this.container.removeEventListener('click', this.fakeHandlerCallback);\n this.fakeHandler = null;\n this.fakeHandlerCallback = null;\n }\n\n if (this.fakeElem) {\n this.container.removeChild(this.fakeElem);\n this.fakeElem = null;\n }\n }\n }, {\n key: 'selectTarget',\n value: function selectTarget() {\n this.selectedText = (0, _select2.default)(this.target);\n this.copyText();\n }\n }, {\n key: 'copyText',\n value: function copyText() {\n var succeeded = void 0;\n\n try {\n succeeded = document.execCommand(this.action);\n } catch (err) {\n succeeded = false;\n }\n\n this.handleResult(succeeded);\n }\n }, {\n key: 'handleResult',\n value: function handleResult(succeeded) {\n this.emitter.emit(succeeded ? 'success' : 'error', {\n action: this.action,\n text: this.selectedText,\n trigger: this.trigger,\n clearSelection: this.clearSelection.bind(this)\n });\n }\n }, {\n key: 'clearSelection',\n value: function clearSelection() {\n if (this.trigger) {\n this.trigger.focus();\n }\n\n window.getSelection().removeAllRanges();\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.removeFake();\n }\n }, {\n key: 'action',\n set: function set() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';\n\n this._action = action;\n\n if (this._action !== 'copy' && this._action !== 'cut') {\n throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n }\n },\n get: function get() {\n return this._action;\n }\n }, {\n key: 'target',\n set: function set(target) {\n if (target !== undefined) {\n if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {\n if (this.action === 'copy' && target.hasAttribute('disabled')) {\n throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n }\n\n if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n }\n\n this._target = target;\n } else {\n throw new Error('Invalid \"target\" value, use a valid Element');\n }\n }\n },\n get: function get() {\n return this._target;\n }\n }]);\n\n return ClipboardAction;\n }();\n\n module.exports = ClipboardAction;\n});\n\n},{\"select\":5}],8:[function(require,module,exports){\n(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['module', './clipboard-action', 'tiny-emitter', 'good-listener'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener'));\n } else {\n var mod = {\n exports: {}\n };\n factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener);\n global.clipboard = mod.exports;\n }\n})(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) {\n 'use strict';\n\n var _clipboardAction2 = _interopRequireDefault(_clipboardAction);\n\n var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);\n\n var _goodListener2 = _interopRequireDefault(_goodListener);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n function _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n\n var Clipboard = function (_Emitter) {\n _inherits(Clipboard, _Emitter);\n\n /**\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n * @param {Object} options\n */\n function Clipboard(trigger, options) {\n _classCallCheck(this, Clipboard);\n\n var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));\n\n _this.resolveOptions(options);\n _this.listenClick(trigger);\n return _this;\n }\n\n /**\n * Defines if attributes would be resolved using internal setter functions\n * or custom functions that were passed in the constructor.\n * @param {Object} options\n */\n\n\n _createClass(Clipboard, [{\n key: 'resolveOptions',\n value: function resolveOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n this.container = _typeof(options.container) === 'object' ? options.container : document.body;\n }\n }, {\n key: 'listenClick',\n value: function listenClick(trigger) {\n var _this2 = this;\n\n this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {\n return _this2.onClick(e);\n });\n }\n }, {\n key: 'onClick',\n value: function onClick(e) {\n var trigger = e.delegateTarget || e.currentTarget;\n\n if (this.clipboardAction) {\n this.clipboardAction = null;\n }\n\n this.clipboardAction = new _clipboardAction2.default({\n action: this.action(trigger),\n target: this.target(trigger),\n text: this.text(trigger),\n container: this.container,\n trigger: trigger,\n emitter: this\n });\n }\n }, {\n key: 'defaultAction',\n value: function defaultAction(trigger) {\n return getAttributeValue('action', trigger);\n }\n }, {\n key: 'defaultTarget',\n value: function defaultTarget(trigger) {\n var selector = getAttributeValue('target', trigger);\n\n if (selector) {\n return document.querySelector(selector);\n }\n }\n }, {\n key: 'defaultText',\n value: function defaultText(trigger) {\n return getAttributeValue('text', trigger);\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.listener.destroy();\n\n if (this.clipboardAction) {\n this.clipboardAction.destroy();\n this.clipboardAction = null;\n }\n }\n }], [{\n key: 'isSupported',\n value: function isSupported() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n\n var actions = typeof action === 'string' ? [action] : action;\n var support = !!document.queryCommandSupported;\n\n actions.forEach(function (action) {\n support = support && !!document.queryCommandSupported(action);\n });\n\n return support;\n }\n }]);\n\n return Clipboard;\n }(_tinyEmitter2.default);\n\n /**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n function getAttributeValue(suffix, element) {\n var attribute = 'data-clipboard-' + suffix;\n\n if (!element.hasAttribute(attribute)) {\n return;\n }\n\n return element.getAttribute(attribute);\n }\n\n module.exports = Clipboard;\n});\n\n},{\"./clipboard-action\":7,\"good-listener\":4,\"tiny-emitter\":6}]},{},[8])(8)\n});","'use strict';\n\nwindow._native = function () {\n\tvar _options = {};\n\tvar _construct = function _construct(e) {\n\t\tvar defaultOptions = {\n\t\t\tcarbonZoneKey: '',\n\t\t\tfallback: '',\n\t\t\tignore: 'false',\n\t\t\tplacement: '',\n\t\t\tprefix: 'native',\n\t\t\ttargetClass: 'native-ad'\n\t\t};\n\n\t\tif (typeof e === 'undefined') return defaultOptions;\n\t\tObject.keys(defaultOptions).forEach(function (key, index) {\n\t\t\tif (typeof e[key] === 'undefined') {\n\t\t\t\te[key] = defaultOptions[key];\n\t\t\t}\n\t\t});\n\t\treturn e;\n\t};\n\n\tvar init = function init(zone, options) {\n\t\t_options = _construct(options);\n\n\t\tvar jsonUrl = 'https://srv.buysellads.com/ads/' + zone + '.json?callback=_native_go';\n\t\tif (_options['placement'] !== '') {\n\t\t\tjsonUrl += '&segment=placement:' + _options['placement'];\n\t\t}\n\t\tif (_options['ignore'] === 'true') {\n\t\t\tjsonUrl += '&ignore=yes';\n\t\t}\n\n\t\tvar srv = document.createElement('script');\n\t\tsrv.src = jsonUrl;\n\t\tdocument.getElementsByTagName('head')[0].appendChild(srv);\n\t};\n\n\tvar carbon = function carbon(e) {\n\t\tvar srv = document.createElement('script');\n\t\tsrv.src = '//cdn.carbonads.com/carbon.js?serve=' + e['carbonZoneKey'] + '&placement=' + e['placement'];\n\t\tsrv.id = '_carbonads_js';\n\n\t\treturn srv;\n\t};\n\n\tvar sanitize = function sanitize(ads) {\n\t\treturn ads.filter(function (ad) {\n\t\t\treturn Object.keys(ad).length > 0;\n\t\t}).filter(function (ad) {\n\t\t\treturn ad.hasOwnProperty('statlink');\n\t\t});\n\t};\n\n\tvar pixel = function pixel(p, timestamp) {\n\t\tvar c = '';\n\t\tif (p) {\n\t\t\tp.split('||').forEach(function (pixel, index) {\n\t\t\t\tc += '';\n\t\t\t});\n\t\t}\n\t\treturn c;\n\t};\n\n\tvar options = function options() {\n\t\treturn _options;\n\t};\n\n\treturn {\n\t\tcarbon: carbon,\n\t\tinit: init,\n\t\toptions: options,\n\t\tpixel: pixel,\n\t\tsanitize: sanitize\n\t};\n}({});\n\nwindow._native_go = function (json) {\n\tvar options = _native.options();\n\tvar ads = _native.sanitize(json['ads']);\n\tvar selectedClass = document.querySelectorAll('.' + options['targetClass']);\n\n\tif (ads.length < 1) {\n\t\tselectedClass.forEach(function (className, index) {\n\t\t\tvar selectedTarget = document.getElementsByClassName(options['targetClass'])[index];\n\n\t\t\tif (options['fallback'] !== '' || options['carbonZoneKey'] !== '') selectedTarget.setAttribute('data-state', 'visible');\n\t\t\tselectedTarget.innerHTML = options['fallback'];\n\t\t\tif (options['carbonZoneKey'] !== '') selectedTarget.appendChild(_native.carbon(options));\n\t\t});\n\n\t\t// End at this line if no ads are found, avoiding unnecessary steps\n\t\treturn;\n\t}\n\n\tselectedClass.forEach(function (className, index) {\n\t\tvar selectedTarget = document.getElementsByClassName(options['targetClass'])[index];\n\t\tvar adElement = selectedTarget.innerHTML||\"\";\n\t\tvar prefix = options['prefix'];\n\t\tvar ad = ads[index];\n\n\t\tif (ad && className) {\n\t\t\tvar adInnerHtml = adElement.replace(new RegExp('#' + prefix + '_bg_color#', 'g'), ad['backgroundColor']).replace(new RegExp('#' + prefix + '_bg_color_hover#', 'g'), ad['backgroundHoverColor']).replace(new RegExp('#' + prefix + '_company#', 'g'), ad['company']).replace(new RegExp('#' + prefix + '_cta#', 'g'), ad['callToAction']).replace(new RegExp('#' + prefix + '_cta_bg_color#', 'g'), ad['ctaBackgroundColor']).replace(new RegExp('#' + prefix + '_cta_bg_color_hover#', 'g'), ad['ctaBackgroundHoverColor']).replace(new RegExp('#' + prefix + '_cta_color#', 'g'), ad['ctaTextColor']).replace(new RegExp('#' + prefix + '_cta_color_hover#', 'g'), ad['ctaTextColorHover']).replace(new RegExp('#' + prefix + '_desc#', 'g'), ad['description']).replace(new RegExp('#' + prefix + '_index#', 'g'), prefix + '-' + ad['i']).replace(new RegExp('#' + prefix + '_img#', 'g'), ad['image']).replace(new RegExp('#' + prefix + '_small_img#', 'g'), ad['smallImage']).replace(new RegExp('#' + prefix + '_link#', 'g'), ad['statlink']).replace(new RegExp('#' + prefix + '_logo#', 'g'), ad['logo']).replace(new RegExp('#' + prefix + '_color#', 'g'), ad['textColor']).replace(new RegExp('#' + prefix + '_color_hover#', 'g'), ad['textColorHover']).replace(new RegExp('#' + prefix + '_title#', 'g'), ad['title']);\n\t\t\tselectedTarget.innerHTML = adInnerHtml + _native.pixel(ad['pixel'], ad['timestamp']);\n\t\t\tselectedTarget.setAttribute('data-state', 'visible');\n\t\t} else {\n\t\t\tselectedTarget.innerHTML = \"\";\n\t\t}\n\t});\n};","/*\n* Event\n* Visit http://createjs.com/ for documentation, updates and examples.\n*\n* Copyright (c) 2010 gskinner.com, inc.\n*\n* Permission is hereby granted, free of charge, to any person\n* obtaining a copy of this software and associated documentation\n* files (the \"Software\"), to deal in the Software without\n* restriction, including without limitation the rights to use,\n* copy, modify, merge, publish, distribute, sublicense, and/or sell\n* copies of the Software, and to permit persons to whom the\n* Software is furnished to do so, subject to the following\n* conditions:\n*\n* The above copyright notice and this permission notice shall be\n* included in all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n* OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n/**\n * A collection of Classes that are shared across all the CreateJS libraries. The classes are included in the minified\n * files of each library and are available on the createjs namespace directly.\n *\n *

    Example

    \n *\n * myObject.addEventListener(\"change\", createjs.proxy(myMethod, scope));\n *\n * @module CreateJS\n * @main CreateJS\n */\n\n\n/**\n * Contains properties and methods shared by all events for use with\n * {{#crossLink \"EventDispatcher\"}}{{/crossLink}}.\n * \n * Note that Event objects are often reused, so you should never\n * rely on an event object's state outside of the call stack it was received in.\n * @class Event\n * @param {String} type The event type.\n * @param {Boolean} bubbles Indicates whether the event will bubble through the display list.\n * @param {Boolean} cancelable Indicates whether the default behaviour of this event can be cancelled.\n * @constructor\n **/\nexport default class Event {\n\t\t\n\t\n\tconstructor(type, bubbles, cancelable) {\n\t// public properties:\n\t\t/**\n\t\t * The type of event.\n\t\t * @property type\n\t\t * @type String\n\t\t **/\n\t\tthis.type = type;\n\t\n\t\t/**\n\t\t * The object that generated an event.\n\t\t * @property target\n\t\t * @type Object\n\t\t * @default null\n\t\t * @readonly\n\t\t*/\n\t\tthis.target = null;\n\t\n\t\t/**\n\t\t * The current target that a bubbling event is being dispatched from. For non-bubbling events, this will\n\t\t * always be the same as target. For example, if childObj.parent = parentObj, and a bubbling event\n\t\t * is generated from childObj, then a listener on parentObj would receive the event with\n\t\t * target=childObj (the original target) and currentTarget=parentObj (where the listener was added).\n\t\t * @property currentTarget\n\t\t * @type Object\n\t\t * @default null\n\t\t * @readonly\n\t\t*/\n\t\tthis.currentTarget = null;\n\t\n\t\t/**\n\t\t * For bubbling events, this indicates the current event phase:
      \n\t\t * \t
    1. capture phase: starting from the top parent to the target
    2. \n\t\t * \t
    3. at target phase: currently being dispatched from the target
    4. \n\t\t * \t
    5. bubbling phase: from the target to the top parent
    6. \n\t\t *
    \n\t\t * @property eventPhase\n\t\t * @type Number\n\t\t * @default 0\n\t\t * @readonly\n\t\t*/\n\t\tthis.eventPhase = 0;\n\t\n\t\t/**\n\t\t * Indicates whether the event will bubble through the display list.\n\t\t * @property bubbles\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.bubbles = !!bubbles;\n\t\n\t\t/**\n\t\t * Indicates whether the default behaviour of this event can be cancelled via\n\t\t * {{#crossLink \"Event/preventDefault\"}}{{/crossLink}}. This is set via the Event constructor.\n\t\t * @property cancelable\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.cancelable = !!cancelable;\n\t\n\t\t/**\n\t\t * The epoch time at which this event was created.\n\t\t * @property timeStamp\n\t\t * @type Number\n\t\t * @default 0\n\t\t * @readonly\n\t\t*/\n\t\tthis.timeStamp = (new Date()).getTime();\n\t\n\t\t/**\n\t\t * Indicates if {{#crossLink \"Event/preventDefault\"}}{{/crossLink}} has been called\n\t\t * on this event.\n\t\t * @property defaultPrevented\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.defaultPrevented = false;\n\t\n\t\t/**\n\t\t * Indicates if {{#crossLink \"Event/stopPropagation\"}}{{/crossLink}} or\n\t\t * {{#crossLink \"Event/stopImmediatePropagation\"}}{{/crossLink}} has been called on this event.\n\t\t * @property propagationStopped\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.propagationStopped = false;\n\t\n\t\t/**\n\t\t * Indicates if {{#crossLink \"Event/stopImmediatePropagation\"}}{{/crossLink}} has been called\n\t\t * on this event.\n\t\t * @property immediatePropagationStopped\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.immediatePropagationStopped = false;\n\t\t\n\t\t/**\n\t\t * Indicates if {{#crossLink \"Event/remove\"}}{{/crossLink}} has been called on this event.\n\t\t * @property removed\n\t\t * @type Boolean\n\t\t * @default false\n\t\t * @readonly\n\t\t*/\n\t\tthis.removed = false;\n\t}\n\n// public methods:\n\t/**\n\t * Sets {{#crossLink \"Event/defaultPrevented\"}}{{/crossLink}} to true if the event is cancelable.\n\t * Mirrors the DOM level 2 event standard. In general, cancelable events that have `preventDefault()` called will\n\t * cancel the default behaviour associated with the event.\n\t * @method preventDefault\n\t **/\n\tpreventDefault() {\n\t\tthis.defaultPrevented = this.cancelable&&true;\n\t};\n\n\t/**\n\t * Sets {{#crossLink \"Event/propagationStopped\"}}{{/crossLink}} to true.\n\t * Mirrors the DOM event standard.\n\t * @method stopPropagation\n\t **/\n\tstopPropagation() {\n\t\tthis.propagationStopped = true;\n\t};\n\n\t/**\n\t * Sets {{#crossLink \"Event/propagationStopped\"}}{{/crossLink}} and\n\t * {{#crossLink \"Event/immediatePropagationStopped\"}}{{/crossLink}} to true.\n\t * Mirrors the DOM event standard.\n\t * @method stopImmediatePropagation\n\t **/\n\tstopImmediatePropagation() {\n\t\tthis.immediatePropagationStopped = this.propagationStopped = true;\n\t};\n\t\n\t/**\n\t * Causes the active listener to be removed via removeEventListener();\n\t * \n\t * \t\tmyBtn.addEventListener(\"click\", function(evt) {\n\t * \t\t\t// do stuff...\n\t * \t\t\tevt.remove(); // removes this listener.\n\t * \t\t});\n\t * \n\t * @method remove\n\t **/\n\tremove() {\n\t\tthis.removed = true;\n\t};\n\t\n\t/**\n\t * Returns a clone of the Event instance.\n\t * @method clone\n\t * @return {Event} a clone of the Event instance.\n\t **/\n\tclone() {\n\t\treturn new Event(this.type, this.bubbles, this.cancelable);\n\t};\n\t\n\t/**\n\t * Provides a chainable shortcut method for setting a number of properties on the instance.\n\t *\n\t * @method set\n\t * @param {Object} props A generic object containing properties to copy to the instance.\n\t * @return {Event} Returns the instance the method is called on (useful for chaining calls.)\n\t * @chainable\n\t*/\n\tset(props) {\n\t\tfor (let n in props) { this[n] = props[n]; }\n\t\treturn this;\n\t};\n\n\t/**\n\t * Returns a string representation of this object.\n\t * @method toString\n\t * @return {String} a string representation of the instance.\n\t **/\n\ttoString() {\n\t\treturn \"[Event (type=\"+this.type+\")]\";\n\t};\n}\n","/*\n* EventDispatcher\n* Visit http://createjs.com/ for documentation, updates and examples.\n*\n* Copyright (c) 2010 gskinner.com, inc.\n*\n* Permission is hereby granted, free of charge, to any person\n* obtaining a copy of this software and associated documentation\n* files (the \"Software\"), to deal in the Software without\n* restriction, including without limitation the rights to use,\n* copy, modify, merge, publish, distribute, sublicense, and/or sell\n* copies of the Software, and to permit persons to whom the\n* Software is furnished to do so, subject to the following\n* conditions:\n*\n* The above copyright notice and this permission notice shall be\n* included in all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n* OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n\n\n// constructor:\n/**\n* EventDispatcher provides methods for managing queues of event listeners and dispatching events.\n*\n* You can either extend EventDispatcher or mix its methods into an existing prototype or instance by using the\n* EventDispatcher {{#crossLink \"EventDispatcher/initialize\"}}{{/crossLink}} method.\n* \n* Together with the CreateJS Event class, EventDispatcher provides an extended event model that is based on the\n* DOM Level 2 event model, including addEventListener, removeEventListener, and dispatchEvent. It supports\n* bubbling / capture, preventDefault, stopPropagation, stopImmediatePropagation, and handleEvent.\n* \n* EventDispatcher also exposes a {{#crossLink \"EventDispatcher/on\"}}{{/crossLink}} method, which makes it easier\n* to create scoped listeners, listeners that only run once, and listeners with associated arbitrary data. The \n* {{#crossLink \"EventDispatcher/off\"}}{{/crossLink}} method is merely an alias to\n* {{#crossLink \"EventDispatcher/removeEventListener\"}}{{/crossLink}}.\n* \n* Another addition to the DOM Level 2 model is the {{#crossLink \"EventDispatcher/removeAllEventListeners\"}}{{/crossLink}}\n* method, which can be used to listeners for all events, or listeners for a specific event. The Event object also \n* includes a {{#crossLink \"Event/remove\"}}{{/crossLink}} method which removes the active listener.\n*\n*

    Example

    \n* Add EventDispatcher capabilities to the \"MyClass\" class.\n*\n* EventDispatcher.initialize(MyClass.prototype);\n*\n* Add an event (see {{#crossLink \"EventDispatcher/addEventListener\"}}{{/crossLink}}).\n*\n* instance.addEventListener(\"eventName\", handlerMethod);\n* function handlerMethod(event) {\n* console.log(event.target + \" Was Clicked\");\n* }\n*\n* Maintaining proper scope
    \n* Scope (ie. \"this\") can be be a challenge with events. Using the {{#crossLink \"EventDispatcher/on\"}}{{/crossLink}}\n* method to subscribe to events simplifies this.\n*\n* instance.addEventListener(\"click\", function(event) {\n* console.log(instance == this); // false, scope is ambiguous.\n* });\n* \n* instance.on(\"click\", function(event) {\n* console.log(instance == this); // true, \"on\" uses dispatcher scope by default.\n* });\n* \n* If you want to use addEventListener instead, you may want to use function.bind() or a similar proxy to manage\n* scope.\n*\n* Browser support\n* The event model in CreateJS can be used separately from the suite in any project, however the inheritance model\n* requires modern browsers (IE9+).\n* \n*\n* @class EventDispatcher\n* @constructor\n**/\nimport Event from \"./Event.js\";\n\nexport default class EventDispatcher {\n\t\n\tconstructor() {\n\t// private properties:\n\t\t/**\n\t\t * @protected\n\t\t * @property _listeners\n\t\t * @type Object\n\t\t **/\n\t\tthis._listeners = null;\n\t\t\n\t\t/**\n\t\t * @protected\n\t\t * @property _captureListeners\n\t\t * @type Object\n\t\t **/\n\t\tthis._captureListeners = null;\n\t\t\n\t\t\n\t\t/**\n\t\t * A shortcut to the removeEventListener method, with the same parameters and return value. This is a companion to the\n\t\t * .on method.\n\t\t * \n\t\t * IMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener. See \n\t\t * {{#crossLink \"EventDispatcher/on\"}}{{/crossLink}} for an example.\n\t\t *\n\t\t * @method off\n\t\t * @param {String} type The string type of the event.\n\t\t * @param {Function | Object} listener The listener function or object.\n\t\t * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.\n\t\t **/\n\t\t this.off = this.removeEventListener;\n\t}\n\t\n\t\n// static public methods:\n\t/**\n\t * Static initializer to mix EventDispatcher methods into a target object or prototype.\n\t * \n\t * \t\tEventDispatcher.initialize(MyClass.prototype); // add to the prototype of the class\n\t * \t\tEventDispatcher.initialize(myObject); // add to a specific instance\n\t * \n\t * @method initialize\n\t * @static\n\t * @param {Object} target The target object to inject EventDispatcher methods into. This can be an instance or a\n\t * prototype.\n\t **/\n\tstatic EventDispatcher(target) {\n\t\ttarget.addEventListener = p.addEventListener;\n\t\ttarget.on = p.on;\n\t\ttarget.removeEventListener = target.off = p.removeEventListener;\n\t\ttarget.removeAllEventListeners = p.removeAllEventListeners;\n\t\ttarget.hasEventListener = p.hasEventListener;\n\t\ttarget.dispatchEvent = p.dispatchEvent;\n\t\ttarget._dispatchEvent = p._dispatchEvent;\n\t\ttarget.willTrigger = p.willTrigger;\n\t};\n\t\n\n// public methods:\n\t/**\n\t * Adds the specified event listener. Note that adding multiple listeners to the same function will result in\n\t * multiple callbacks getting fired.\n\t *\n\t *

    Example

    \n\t *\n\t * displayObject.addEventListener(\"click\", handleClick);\n\t * function handleClick(event) {\n\t * // Click happened.\n\t * }\n\t *\n\t * @method addEventListener\n\t * @param {String} type The string type of the event.\n\t * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when\n\t * the event is dispatched.\n\t * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.\n\t * @return {Function | Object} Returns the listener for chaining or assignment.\n\t **/\n\taddEventListener(type, listener, useCapture) {\n\t\tlet listeners;\n\t\tif (useCapture) {\n\t\t\tlisteners = this._captureListeners = this._captureListeners||{};\n\t\t} else {\n\t\t\tlisteners = this._listeners = this._listeners||{};\n\t\t}\n\t\tlet arr = listeners[type];\n\t\tif (arr) { this.removeEventListener(type, listener, useCapture); }\n\t\tarr = listeners[type]; // remove may have deleted the array\n\t\tif (!arr) { listeners[type] = [listener]; }\n\t\telse { arr.push(listener); }\n\t\treturn listener;\n\t};\n\t\n\t/**\n\t * A shortcut method for using addEventListener that makes it easier to specify an execution scope, have a listener\n\t * only run once, associate arbitrary data with the listener, and remove the listener.\n\t * \n\t * This method works by creating an anonymous wrapper function and subscribing it with addEventListener.\n\t * The wrapper function is returned for use with `removeEventListener` (or `off`).\n\t * \n\t * IMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener, or use\n\t * {{#crossLink \"Event/remove\"}}{{/crossLink}}. Likewise, each time you call `on` a NEW wrapper function is subscribed, so multiple calls\n\t * to `on` with the same params will create multiple listeners.\n\t * \n\t *

    Example

    \n\t * \n\t * \t\tvar listener = myBtn.on(\"click\", handleClick, null, false, {count:3});\n\t * \t\tfunction handleClick(evt, data) {\n\t * \t\t\tdata.count -= 1;\n\t * \t\t\tconsole.log(this == myBtn); // true - scope defaults to the dispatcher\n\t * \t\t\tif (data.count == 0) {\n\t * \t\t\t\talert(\"clicked 3 times!\");\n\t * \t\t\t\tmyBtn.off(\"click\", listener);\n\t * \t\t\t\t// alternately: evt.remove();\n\t * \t\t\t}\n\t * \t\t}\n\t * \n\t * @method on\n\t * @param {String} type The string type of the event.\n\t * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when\n\t * the event is dispatched.\n\t * @param {Object} [scope] The scope to execute the listener in. Defaults to the dispatcher/currentTarget for function listeners, and to the listener itself for object listeners (ie. using handleEvent).\n\t * @param {Boolean} [once=false] If true, the listener will remove itself after the first time it is triggered.\n\t * @param {*} [data] Arbitrary data that will be included as the second parameter when the listener is called.\n\t * @param {Boolean} [useCapture=false] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.\n\t * @return {Function} Returns the anonymous function that was created and assigned as the listener. This is needed to remove the listener later using .removeEventListener.\n\t **/\n\ton(type, listener, scope, once, data, useCapture) {\n\t\tif (listener.handleEvent) {\n\t\t\tscope = scope||listener;\n\t\t\tlistener = listener.handleEvent;\n\t\t}\n\t\tscope = scope||this;\n\t\treturn this.addEventListener(type, function(evt) {\n\t\t\t\tlistener.call(scope, evt, data);\n\t\t\t\tonce&&evt.remove();\n\t\t\t}, useCapture);\n\t};\n\n\t/**\n\t * Removes the specified event listener.\n\t *\n\t * Important Note: that you must pass the exact function reference used when the event was added. If a proxy\n\t * function, or function closure is used as the callback, the proxy/closure reference must be used - a new proxy or\n\t * closure will not work.\n\t *\n\t *

    Example

    \n\t *\n\t * displayObject.removeEventListener(\"click\", handleClick);\n\t *\n\t * @method removeEventListener\n\t * @param {String} type The string type of the event.\n\t * @param {Function | Object} listener The listener function or object.\n\t * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.\n\t **/\n\tremoveEventListener(type, listener, useCapture) {\n\t\tlet listeners = useCapture ? this._captureListeners : this._listeners;\n\t\tif (!listeners) { return; }\n\t\tlet arr = listeners[type];\n\t\tif (!arr) { return; }\n\t\tfor (let i=0,l=arr.length; iExample\n\t *\n\t * // Remove all listeners\n\t * displayObject.removeAllEventListeners();\n\t *\n\t * // Remove all click listeners\n\t * displayObject.removeAllEventListeners(\"click\");\n\t *\n\t * @method removeAllEventListeners\n\t * @param {String} [type] The string type of the event. If omitted, all listeners for all types will be removed.\n\t **/\n\tremoveAllEventListeners(type) {\n\t\tif (!type) { this._listeners = this._captureListeners = null; }\n\t\telse {\n\t\t\tif (this._listeners) { delete(this._listeners[type]); }\n\t\t\tif (this._captureListeners) { delete(this._captureListeners[type]); }\n\t\t}\n\t};\n\n\t/**\n\t * Dispatches the specified event to all listeners.\n\t *\n\t *

    Example

    \n\t *\n\t * // Use a string event\n\t * this.dispatchEvent(\"complete\");\n\t *\n\t * // Use an Event instance\n\t * var event = new Event(\"progress\");\n\t * this.dispatchEvent(event);\n\t *\n\t * @method dispatchEvent\n\t * @param {Object | String | Event} eventObj An object with a \"type\" property, or a string type.\n\t * While a generic object will work, it is recommended to use a CreateJS Event instance. If a string is used,\n\t * dispatchEvent will construct an Event instance if necessary with the specified type. This latter approach can\n\t * be used to avoid event object instantiation for non-bubbling events that may not have any listeners.\n\t * @param {Boolean} [bubbles] Specifies the `bubbles` value when a string was passed to eventObj.\n\t * @param {Boolean} [cancelable] Specifies the `cancelable` value when a string was passed to eventObj.\n\t * @return {Boolean} Returns false if `preventDefault()` was called on a cancelable event, true otherwise.\n\t **/\n\tdispatchEvent(eventObj, bubbles, cancelable) {\n\t\tif (typeof eventObj == \"string\") {\n\t\t\t// skip everything if there's no listeners and it doesn't bubble:\n\t\t\tlet listeners = this._listeners;\n\t\t\tif (!bubbles && (!listeners || !listeners[eventObj])) { return true; }\n\t\t\teventObj = new Event(eventObj, bubbles, cancelable);\n\t\t} else if (eventObj.target && eventObj.clone) {\n\t\t\t// redispatching an active event object, so clone it:\n\t\t\teventObj = eventObj.clone();\n\t\t}\n\t\t\n\t\t// TODO: it would be nice to eliminate this. Maybe in favour of evtObj instanceof Event? Or !!evtObj.createEvent\n\t\ttry { eventObj.target = this; } catch (e) {} // try/catch allows redispatching of native events\n\n\t\tif (!eventObj.bubbles || !this.parent) {\n\t\t\tthis._dispatchEvent(eventObj, 2);\n\t\t} else {\n\t\t\tlet top=this, list=[top];\n\t\t\twhile (top.parent) { list.push(top = top.parent); }\n\t\t\tlet i, l=list.length;\n\n\t\t\t// capture & atTarget\n\t\t\tfor (i=l-1; i>=0 && !eventObj.propagationStopped; i--) {\n\t\t\t\tlist[i]._dispatchEvent(eventObj, 1+(i==0));\n\t\t\t}\n\t\t\t// bubbling\n\t\t\tfor (i=1; i.\n*/\n\nlet DOMUtils = {}, $ = DOMUtils;\nexport default DOMUtils;\n\t\n$.query = function(query, element = document.body) {\n\treturn (query[0] === \">\") ? $._childQuery(query, element, $.query) : element.querySelector(query);\n};\n\n$.queryAll = function(query, element = document.body) {\n\treturn (query[0] === \">\") ? $._childQuery(query, element, $.queryAll) : element.querySelectorAll(query);\n};\n\n$.removeClass = function(element, className) {\n\tif ($._runOnNodeList($.removeClass, element, className)) { return element; }\n\tif (className instanceof RegExp) {\n\t\tlet arr = (element.getAttribute(\"class\")||\"\").split(\" \"), re = className;\n\t\telement.setAttribute(\"class\", arr.filter((s)=> !re.test(s)).join(\" \"));\n\t} else {\n\t\tlet list = element.classList;\n\t\tlist.remove.apply(list, className.split(\" \"));\n\t}\n\treturn element;\n};\n\n$.addClass = function(element, className) {\n\tif ($._runOnNodeList($.addClass, element, className)) { return element; }\n\t\n\t$.removeClass(element, className);\n\n\tlet names = className.split(\" \");\n\tfor (let i = 0; i < names.length; i++) {\n\t\telement.classList.add(names[i]);\n\t}\n\treturn element;\n};\n\n$.toggleClass = function(element, className, value) {\n\tif ($._runOnNodeList($.toggleClass, element, className, value)) { return element; }\n\tlet curValue = $.hasClass(element, className);\n\tif (value == null) { value = !curValue; }\n\telse if (value === curValue) { return; }\n\tif (value) { $.addClass(element, className); }\n\telse { $.removeClass(element, className); }\n};\n\n$.hasClass = function(element, className) {\n\treturn !!(element.getAttribute(\"class\")||\"\").match(new RegExp(\"\\\\b\\\\s?\" + className + \"\\\\b\", \"g\"));\n};\n\n$.swapClass = function(element, oldClass, newClass) {\n\t$.removeClass(element, oldClass);\n\t$.addClass(element, newClass);\n\treturn element;\n};\n\n$.remove = function(element) {\n\tif ($._runOnNodeList($.remove, element)) { return element; }\n\t\n\tif (element.remove) {\n\t\telement.remove();\n\t} else if (element.parentNode) {\n\t\telement.parentNode.removeChild(element);\n\t}\n\treturn element;\n};\n\n$.on = function(element, event, listener) {\n\tif ($._runOnNodeList($.on, element, event, listener)) { return element; }\n\telement.addEventListener(event, listener);\n}\n\n$.off = function(element, event, listener) {\n\tif ($._runOnNodeList($.off, element, event, listener)) { return element; }\n\telement.removeEventListener(event, listener);\n}\n\n/*\n Remove all children from an element.\n When using .innerHTML = \"\"; IE fails when adding new dom elements via appendChild();\n */\n$.empty = function(element) {\n\tif ($._runOnNodeList($.empty, element)) { return element; }\n\t\n\twhile (element.firstChild) {\n\t\telement.removeChild(element.firstChild);\n\t}\n\treturn element;\n};\n\n$.create = function(type, className, content, parent) {\n\tlet element = document.createElement(type || \"div\");\n\tif (className) { element.className = className; }\n\tif (content) {\n\t\tif (content instanceof HTMLElement) { element.appendChild(content); }\n\t\telse { element.innerHTML = content; }\n\t}\n\tif (parent) { parent.appendChild(element); }\n\treturn element;\n};\n\n$.getEl = function(query, scope) {\n\tif (query instanceof HTMLElement || !query) { return query; }\n\treturn $.query(query, scope);\n};\n\n$.togglePanel = function(element, openEl, closedEl, open) {\n\tlet el1 = $.getEl(openEl, element), el2 = $.getEl(closedEl, element), tmp, isOpen = !$.hasClass(element, \"closed\");\n\tif (open === undefined) { open = !isOpen; }\n\telse { open = !!open; }\n\tif (open === isOpen) { return; }\n\tif (open) {\n\t\t$.removeClass(element, \"closed\");\n\t\ttmp = el2;\n\t\tel2 = el1;\n\t\tel1 = tmp;\n\t}\n\telse { $.addClass(element, \"closed\"); }\n\n\tel1 && (el1.style.display = \"none\");\n\tif (el2) {\n\t\tlet f = function(evt) {\n\t\t\tif (evt.target !== element) { return; }\n\t\t\tel2.style.display = \"flex\";\n\t\t\telement.removeEventListener(\"transitionend\", f);\n\t\t};\n\t\telement.addEventListener(\"transitionend\", f);\n\t}\n};\n\n$.transition = function(target, className, then) {\n\tlet f = (evt) => {\n\t\tif (evt.target !== target) { return; }\n\t\ttarget.removeEventListener(\"transition\", f);\n\t\tthen();\n\t};\n\ttarget.addEventListener(\"transitionend\", f);\n\t$.addClass(target, className);\n};\n\n$.template = function(strings, ...keys) {\n\treturn (o) => {\n\t\tlet result = strings[0];\n\t\tfor (let i=0, l=keys.length; i.\n*/\n\nlet Utils = {};\nexport default Utils;\n\nUtils.prepMenuContent = function(content, idMap) {\n\tif (!idMap.__next_id) { idMap.__next_id = 1; }\n\tlet kids = content.kids;\n\tfor (let i = 0, l = kids.length; i < l; i++) {\n\t\tlet o = kids[i];\n\t\t// current list implementation requires everything to have an id:\n\t\tif (!o.id) { o.id = \"__id_\"+(idMap.__next_id++); }\n\t\tidMap[o.id] = o;\n\t\to.parent = content;\n\t\tif (o.kids) { Utils.prepMenuContent(o, idMap); }\n\t}\n\treturn content;\n};\n\nUtils.find = function(arr, f) {\n\tfor (let i=0, l=arr.length; i 0 && str.length > length;\n\tif (b) { str = str.substr(0, length-1); }\n\tif (htmlSafe) { str = Utils.htmlSafe(str); }\n\treturn !b ? str : str + (tag&&\"<\"+tag+\">\") + \"\\u2026\" + (tag&&\"\");\n};\n\nUtils.unescSubstStr = function(str) {\n\tif (!str) { return \"\"; }\n\treturn str.replace(Utils.SUBST_ESC_RE, (a, b, c)=> Utils.SUBST_ESC_CHARS[b] || String.fromCharCode(parseInt(c, 16)) );\n};\n\n\nUtils.getRegExp = function(str) {\n\t// returns a JS RegExp object.\n\tlet match = str.match(/^\\/(.+)\\/([a-z]+)?$/), regex=null;\n\ttry {\n\t\tregex = match ? new RegExp(match[1], match[2] || \"\") : new RegExp(str, \"g\");\n\t} catch(e) { }\n\treturn regex;\n};\n\nUtils.decomposeRegEx = function(str, delim=\"/\") {\n\tlet re = new RegExp(\"^\"+delim+\"(.*)\"+delim+\"([igmsuUxy]*)$\");\n\tlet match = re.exec(str);\n\tif (match) {\n\t\treturn {source: match[1], flags: match[2]};\n\t} else {\n\t\treturn {source: str, flags: \"g\"};\n\t}\n};\n\nUtils.isMac = function () {\n\treturn !!(navigator.userAgent.match(/Mac\\sOS/i))\n};\n\nUtils.getCtrlKey = function () {\n\treturn Utils.isMac() ? \"cmd\" : \"ctrl\";\n};\n\nUtils.now = function() {\n\treturn window.performance ? performance.now() : Date.now();\n};\n\nUtils.getUrlParams = function() {\n\tlet match, re = /([^&=]+)=?([^&]*)/g, params = {};\n\tlet url = window.location.search.substr(1).replace(/\\+/g, \" \");\n\twhile (match = re.exec(url)) { params[decodeURIComponent(match[1])] = decodeURIComponent(match[2]); }\n\treturn params;\n};\n\nlet deferIds = {};\nUtils.defer = function (f, id, t=1) {\n\tclearTimeout(deferIds[id]);\n\tif (f === null) {\n\t\tdelete(deferIds[id]);\n\t\treturn;\n\t}\n\tdeferIds[id] = setTimeout(()=>{\n\t\tdelete deferIds[id];\n\t\tf();\n\t}, t)\n};\n\nUtils.getHashCode = function(s) {\n\tlet hash = 0, l = s.length, i;\n\tfor (i = 0; i < l; i++ ) {\n\t\thash = ((hash << 5) - hash) + s.charCodeAt(i) | 0;\n\t}\n\treturn hash;\n};\n\nUtils.getPatternURL = function(pattern) {\n\tlet a = Utils.isLocal ? \"?id=\" : \"/\";\n\tlet url = window.location.origin, id=pattern&&pattern.id||\"\";\n\treturn url+a+id;\n}\n\nUtils.isLocal = (window.location.hostname === \"localhost\");\n\nUtils.getPatternURLStr = function(pattern) {\n\tif (!pattern || !pattern.id) { return null; }\n\tlet a = Utils.isLocal ? \"?id=\" : \"/\";\n\tlet url = window.location.host, id=pattern.id;\n\treturn url+a+id;\n}\n\nUtils.getForkName = function(name) {\n\tlet res = / ?\\(fork ?(\\d*)\\)$/.exec(name);\n\tif (res) {\n\t\tlet num = (res[1]||1)*1 + 1;\n\t\treturn name.substr(0, res.index) + \" (fork \"+num+\")\";\n\t}\n\treturn name + \" (fork)\";\n}\n\nUtils.SUBST_ESC_CHARS = {\n\t// this is just the list supported in Replace. Others: b, f, \", etc.\n\tn: \"\\n\",\n\tr: \"\\r\",\n\tt: \"\\t\",\n\t\"\\\\\": \"\\\\\"\n};\n\nUtils.SUBST_ESC_RE = /\\\\([nrt\\\\]|u([A-Z0-9]{4}))/ig;","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\n\nexport default class Tooltip {\n\t\n\tconstructor(el, transition=false) {\n\t\tthis.el = $.remove(el);\n\t\tthis.transition = transition;\n\t\tthis.contentEl = $.query(\".content\", el);\n\t\tthis.tipEl = $.query(\".tip\", el);\n\t\tthis.hideF = (evt)=> Date.now()>this._showT && this.handleBodyClick(evt);\n\t\tthis.curId = null;\n\t}\n\t\n\ttoggle(id, content, x, y, autohide, th) {\n\t\tif (id === this.curId) { return this.hide(id); }\n\t\tthis.show(id, content, x, y, autohide, th);\n\t}\n\t\n\ttoggleOn(id, content, el, autohide, th) {\n\t\tif (id === this.curId) { return this.hide(id); }\n\t\tthis.showOn(id, content, el, autohide, th);\n\t\tthis.toggleEl = el;\n\t\t$.addClass(el, \"selected\");\n\t}\n\t\n\thide(id) {\n\t\tif (id && this.curId !== id) { return; }\n\t\tlet el = this.el, elStyle = el.style;\n\t\t$.empty($.query(\".content\", $.remove(el)));\n\t\t$.removeClass(el, \"flipped\");\n\t\tdocument.body.removeEventListener(\"mousedown\", this.hideF);\n\t\t\n\t\tif (this.toggleEl) {\n\t\t\t$.removeClass(this.toggleEl, \"selected\");\n\t\t\tthis.toggleEl = null;\n\t\t}\n\t\t\n\t\t// reset position and width so that content wrapping resolves properly:\n\t\telStyle.left = elStyle.top = \"0\";\n\t\telStyle.width = \"\";\n\t\tif (this.transition) {\n\t\t\telStyle.opacity = 0;\n\t\t\telStyle.marginTop = \"-0.25em\";\n\t\t}\n\t\tthis.curId = null;\n\t}\n\n\tshow(id, content, x, y, autohide = false, th = 0) {\n\t\tthis.hide();\n\t\tif (!content) { return; }\n\n\t\tlet el = this.el, elStyle = el.style, contentEl = this.contentEl, body = document.body, pad = 8;\n\t\tif (content instanceof HTMLElement) { contentEl.appendChild(content); }\n\t\telse { contentEl.innerHTML = content; }\n\n\t\tif (autohide) {\n\t\t\tthis._showT = Date.now()+30; // ignore double clicks and events in the current stack.\n\t\t\tbody.addEventListener(\"mousedown\", this.hideF);\n\t\t}\n\n\t\tbody.appendChild(el);\n\n\t\tlet wh = window.innerHeight, ww = window.innerWidth;\n\t\tlet rect = el.getBoundingClientRect(), w = rect.right - rect.left, h = rect.bottom - rect.top, off = 0;\n\t\tif (y + h > wh - pad) {\n\t\t\t$.addClass(el, \"flipped\");\n\t\t\ty -= th;\n\t\t}\n\t\tif (x - w / 2 < pad) { off = pad - x + w / 2; }\n\t\telse if (x + w / 2 > ww - pad) { off = ww - pad - x - w / 2; }\n\t\tthis.tipEl.style.marginRight = Math.max(-w / 2 + 10, Math.min(w / 2 - 10, off)) * 2 + \"px\";\n\t\telStyle.width = Math.ceil(w/2)*2 + \"px\";\n\t\telStyle.top = Math.round(y) + \"px\";\n\t\telStyle.left = Math.round(x + off) + \"px\";\n\t\tif (this.transition) {\n\t\t\telStyle.opacity = 1;\n\t\t\telStyle.marginTop = 0;\n\t\t}\n\t\t\n\t\tthis.curId = id;\n\t}\n\t\n\tshowOn(id, content, el, autohide, th=0) {\n\t\tlet rect = el.getBoundingClientRect();\n\t\tlet x = Math.round((rect.left+rect.right)/2);\n\t\tlet y = rect.bottom+th;\n\t\tlet h = rect.bottom-rect.top;\n\t\tthis.show(id, content, x, y, autohide, h);\n\t}\n\n\thandleBodyClick(evt) {\n\t\tlet id = this.curId;\n\t\tif (this.el.contains(evt.target) || (this.toggleEl && this.toggleEl.contains(evt.target))) { return; }\n\t\tthis.hide(id);\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"../utils/Utils\";\nimport app from \"../app\";\n\nexport default class Server {\n\n// regex:\n\tstatic solve(req) {\n\t\treturn Server._getRequest(\"regex/solve\", {data: JSON.stringify(req)});\n\t}\n\n\tstatic version(flavor) {\n\t\treturn Server._getRequest(\"regex/version\", {flavor:flavor});\n\t}\n\n// patterns:\n\tstatic communitySearch(str) {\n\t\treturn Server._getRequest(\"patterns/search\", {query:str||\"\", startIndex:0, limit:100}, (data) => { this._processPatternList(data); });\n\t}\n\n\tstatic load(id) {\n\t\treturn Server._getRequest(\"patterns/load\", {patternId:id}, (data) => this._processPattern(data));\n\t}\n\n\tstatic save(pattern, fork, community) {\n\t\t// clone and prep the pattern object:\n\t\tlet o = this._prepPattern(pattern, fork, community);\n\t\treturn Server._getRequest(\"patterns/save\", o, (data) => this._processPattern(data));\n\t}\n\n\tstatic rate(id, rating) {\n\t\treturn Server._getRequest(\"patterns/rate\", {patternId:id, userRating:rating}, (data) => data.rating = Number(data.rating));\n\t}\n\n\tstatic delete(id) {\n\t\treturn Server._getRequest(\"patterns/delete\", {patternId:id});\n\t}\n\n\tstatic favorite(id, value) {\n\t\treturn Server._getRequest(\"patterns/favorite\", {patternId:id, favorite:!!value});\n\t}\n\n\tstatic private(id, value) {\n\t\treturn Server.setAccess(id, value ? \"private\" : \"protected\");\n\t}\n\n\tstatic setAccess(id, value) {\n\t\treturn Server._getRequest(\"patterns/setAccess\", {patternId:id, access:value});\n\t}\n\n\tstatic multiFavorite(ids) {\n\t\treturn Server._getRequest(\"patterns/multiFavorite\", {patternIds:JSON.stringify(ids)});\n\t}\n\n// account:\n\tstatic login(service) {\n\t\twindow.location = Server.url + \"?action=account/login&type=\"+service;\n\t}\n\n\tstatic logout() {\n\t\treturn Server._getRequest(\"account/logout\", {});\n\t}\n\n\tstatic verify() {\n\t\treturn Server._getRequest(\"account/verify\", {});\n\t}\n\n\tstatic patterns() {\n\t\treturn Server._getRequest(\"account/patterns\", {}, (data) => {\n\t\t\tthis._processPatternList(data);\n\t\t\tdata.results.sort((a, b) => {\n\t\t\t\treturn (b.favorite - a.favorite) || (b.dateAdded - a.dateAdded) || 1-2*(a.id > b.id);\n\t\t\t})\n\t\t});\n\t}\n\n// helpers:\n\tstatic _processPatternList(data) {\n\t\tdata.results.forEach(this._processPattern);\n\t}\n\n\tstatic _processPattern(o) {\n\t\t// parse values:\n\t\to.rating = Number(o.rating);\n\t\to.userRating = Number(o.userRating);\n\t\to.flavor = o.flavor || \"js\";\n\t\to.mode = o.mode || \"text\";\n\t\to.text = o.text || null;\n\t\tif (o.tool && o.tool.id) { o.tool.id = o.tool.id.toLowerCase(); }\n\t}\n\n\tstatic _prepPattern(o, fork, community) {\n\t\to = Utils.clone(o);\n\t\tif (fork) {\n\t\t\to.parentId = o.id;\n\t\t\tdelete(o.id);\n\t\t\tif (!community) { o.name = Utils.getForkName(o.name); }\n\t\t}\n\t\t// clear null values:\n\t\tif (!o.id) { delete(o.id); }\n\t\tif (!o.parentId) { delete(o.parentId); }\n\t\tdelete(o.userId); // this gets added by the server\n\t\to.tool = o.tool && JSON.stringify(o.tool);\n\t\to.tests = o.tests && JSON.stringify(o.tests);\n\t\treturn o;\n\t}\n\n// private methods:\n\tstatic _getRequest(action, data={}, postprocess) {\n\t\tlet req = new XMLHttpRequest(), p = new ServerPromise(req, postprocess), params = [];\n\t\treq.open(\"POST\", Server.url);\n\t\treq.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\", true);\n\t\treq.timeout = 30*1000;\n\t\tdata.action = action;\n\n\t\tif (Server.isLocal && Server.useBeta) { data.userId = 111; }\n\t\tfor (let n in data) { params.push(n + \"=\" + encodeURIComponent(data[n])); }\n\t\tif (Server.isLocal) { console.log(data); }\n\t\treq.send(params.join(\"&\"));\n\t\treturn p;\n\t}\n}\n\nclass ServerPromise {\n\tconstructor(req, postprocess) {\n\t\tthis._req = req;\n\t\tthis._postprocess = postprocess;\n\t\treq.addEventListener(\"load\", ()=>this._load());\n\t\treq.addEventListener(\"timeout\", (evt)=>this._error(\"servercomm\"));\n\t\treq.addEventListener(\"error\", (evt)=>this._error(\"servercomm\"));\n\t}\n\n\tthen(f, cf, ff) {\n\t\tthis._loadF = f;\n\t\tif (cf) { this.catch(cf); }\n\t\tif (this._data) { f(this._data); }\n\t\tif (ff) { this.finally(ff); }\n\t\treturn this;\n\t}\n\n\tcatch(f) {\n\t\tthis._errorF = f;\n\t\tif (this._err) { f(this._err); }\n\t\treturn this;\n\t}\n\n\tfinally(f) {\n\t\tthis._finallyF = f;\n\t\tif (this._complete) { f(); }\n\t\treturn this;\n\t}\n\n\tabort() {\n\t\tif (this._complete) { return; }\n\t\tthis._complete = true;\n\t\tthis._req.abort();\n\t\tthis._finallyF && this._finallyF();\n\t\tthis._loadF = this._errorF = this._finallyF = null; // just to make sure.\n\t}\n\n\t_load() {\n\t\tlet json;\n\t\tthis._complete = true;\n\t\tif (Server.isLocal) { console.log(this._req.response || this._req.responseText); }\n\t\ttry { json = JSON.parse(this._req.response || this._req.responseText); }\n\t\tcatch (e) { return this._error(e); }\n\t\tif (!json.success) { return this._error(json.data); }\n\t\tthis._postprocess && this._postprocess(json.data);\n\t\tthis._data = json.data;\n\t\tthis._loadF && this._loadF(this._data);\n\t\tthis._finallyF && this._finallyF();\n\t}\n\n\t_error(e) {\n\t\tthis._err = (e.data && e.data.error) || e.message || e.detail || e.type || String(e);\n\t\tthis._errorF && this._errorF(this._err);\n\t\tthis._finallyF && this._finallyF();\n\t}\n}\n\nServer.isLocal = Utils.isLocal;\nServer.useBeta = Server.isLocal || (window.location.hostname === \"beta.regexr.com\");\nServer.host = \"https://\" + (Server.useBeta ? \"beta.\" : \"\") + \"regexr.com\"\nServer.url = Server.host + \"/server/api.php\";\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n/*\nUtilities for working with CodeMirror.\n*/\n\nimport Utils from \"../utils/Utils\";\nimport $ from \"../utils/DOMUtils\";\n\nlet CMUtils = {};\nexport default CMUtils;\n\nCMUtils.create = function (target, opts={}, width=\"100%\", height=\"100%\") {\n\tlet keys = {}, ctrlKey = Utils.getCtrlKey();\n\t//keys[ctrlKey + \"-Z\"] = keys[ctrlKey + \"-Y\"] = keys[\"Shift-\" + ctrlKey + \"-Z\"] = () => false; // block CM handling\n\n\tlet o = Utils.copy({\n\t\tlineNumbers: false,\n\t\ttabSize: 3,\n\t\tindentWithTabs: true,\n\t\textraKeys: keys,\n\t\tspecialChars: /[ \\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/,\n\t\tspecialCharPlaceholder: (ch) => $.create(\"span\", ch === \" \" ? \"cm-space\" : \"cm-special\", \" \") // needs to be a space so wrapping works\n\t}, opts);\n\t\n\tlet cm = CodeMirror(target, o);\n\tcm.setSize(width, height);\n\t\n\t\n\tif (cm.getOption(\"maxLength\")) {\n\t\tcm.on(\"beforeChange\", CMUtils.enforceMaxLength);\n\t}\n\tif (cm.getOption(\"singleLine\")) {\n\t\tcm.on(\"beforeChange\", CMUtils.enforceSingleLine);\n\t}\n\t\n\treturn cm;\n};\n\nCMUtils.getCharIndexAt = function (cm, winX, winY) {\n\tlet pos = cm.coordsChar({left: winX, top: winY}, \"page\");\n\t// test current and prev character, since CM seems to use the center of each character for coordsChar:\n\tfor (let i = 0; i <= 1; i++) {\n\t\tlet rect = cm.charCoords(pos, \"page\");\n\t\tif (winX >= rect.left && winX <= rect.right && winY >= rect.top && winY <= rect.bottom) {\n\t\t\treturn cm.indexFromPos(pos);\n\t\t}\n\t\tif (pos.ch-- <= 0) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn null;\n};\n/*\n// unused?\nCMUtils.getEOLPos = function (cm, pos) {\n\tif (!isNaN(pos)) {\n\t\tpos = cm.posFromIndex(pos);\n\t}\n\tlet rect = cm.charCoords(pos, \"local\"), w = cm.getScrollInfo().width;\n\treturn cm.coordsChar({left: w - 1, top: rect.top}, \"local\");\n};\n*/\nCMUtils.getCharRect = function (cm, index) {\n\tif (index == null) { return null; }\n\tlet pos = cm.posFromIndex(index), rect = cm.charCoords(pos);\n\trect.x = rect.left;\n\trect.y = rect.top;\n\trect.width = rect.right - rect.left;\n\trect.height = rect.bottom - rect.top;\n\treturn rect;\n};\n\n\nCMUtils.enforceMaxLength = function (cm, change) {\n\tlet maxLength = cm.getOption(\"maxLength\");\n\tif (maxLength && change.update) {\n\t\tlet str = change.text.join(\"\\n\");\n\t\tlet delta = str.length - (cm.indexFromPos(change.to) - cm.indexFromPos(change.from));\n\t\tif (delta <= 0) { return true; \n\t\t}\n\t\tdelta = cm.getValue().length + delta - maxLength;\n\t\tif (delta > 0) {\n\t\t\tstr = str.substr(0, str.length - delta);\n\t\t\tchange.update(change.from, change.to, str.split(\"\\n\"));\n\t\t}\n\t}\n\treturn true;\n};\n\nCMUtils.enforceSingleLine = function (cm, change) {\n\tif (change.update) {\n\t\tlet str = change.text.join(\"\").replace(/(\\n|\\r)/g, \"\");\n\t\tchange.update(change.from, change.to, [str]);\n\t}\n\treturn true;\n};\n\nCMUtils.selectAll = function(cm) {\n\tcm.focus();\n\tcm.setSelection({ch:0,line:0},{ch:0, line:cm.lineCount()});\n}\n\nCMUtils.calcRangePos = function(cm, i, l=0, o={}) {\n\tlet doc = cm.getDoc();\n\to.startPos = doc.posFromIndex(i);\n\to.endPos = doc.posFromIndex(i+l);\n\treturn o;\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nlet Track = {};\nexport default Track;\n\nTrack.GA_ID = \"UA-3579542-6\";\n\nTrack.page = function(path) {\n\tgtag(\"config\", Track.GA_ID, {\"page_path\": \"/\"+path});\n};\n\n// https://developers.google.com/analytics/devguides/collection/gtagjs/events\nTrack.event = function(name, category, label) {\n\tlet o = {};\n\tif (category) { o.event_category = category; }\n\tif (label) { o.event_label = label; }\n\tgtag(\"event\", name, o);\n}\n\n\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nexport default class List extends EventDispatcher {\n\tconstructor(el, opts) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis.multi = opts.multi;\n\t\tthis.template = opts.template;\n\t\tthis.data = opts.data;\n\t\tif (opts.selected) { this.selected = opts.selected; }\n\t}\n\t\n\tset data(data) {\n\t\t$.empty(this.el);\n\t\tthis._data = data;\n\t\tif (!data || !data.length) { return; }\n\t\tfor (let i=0, l=data.length; i$.addClass($.query(\"[data-id='\"+id+\"']\",this.el), \"selected\"));\n\t\t\n\t\tif (!this.multi) { this.scrollTo(ids[0]); }\n\t}\n\t\n\tget selected() {\n\t\tlet els = $.queryAll(\"li.selected\", this.el);\n\t\tif (!els[0]) { return null; }\n\t\tif (!this.multi) { return els[0].dataset.id; }\n\t\tlet ids = [];\n\t\tfor (let i=0, l=els.length; i o.id === id);\n\t}\n\t\n\tget selectedItem() {\n\t\tlet el = this.selectedEl;\n\t\treturn el && el.item;\n\t}\n\n\tget selectedEl() {\n\t\treturn $.query(\"li.selected\", this.el);\n\t}\n\t\n\trefresh() {\n\t\tlet sel = this.selected;\n\t\tthis.data = this._data;\n\t\tthis.selected = sel;\n\t}\n\n\taddItem(o, selected=null) {\n\t\tlet label, id, sel;\n\t\tlet f=(evt) => this.handleClick(evt), template=this.template;\n\t\tif (typeof o === \"string\") {\n\t\t\tid = o;\n\t\t\tlabel = template ? template(o) : o;\n\t\t} else {\n\t\t\tif (o.hide) { return; }\n\t\t\tid = o.id || o.label;\n\t\t\tlabel = template ? template(o) : o.label;\n\t\t\tif (selected === null) { sel = o.selected; }\n\t\t}\n\t\tlet item = $.create(\"li\", sel ? \"selected\" : null, label, this.el);\n\t\titem.dataset.id = id;\n\t\titem.item = o;\n\t\titem.addEventListener(\"click\", f);\n\t\titem.addEventListener(\"dblclick\", f);\n\n\t\tif (selected) {\n\t\t\tthis.selected = o.id;\n\t\t}\n\t}\n\n\tremoveItem(id) {\n\t\tlet el = $.query(\"[data-id='\"+id+\"']\",this.el);\n\t\tel && el.remove();\n\t}\n\n\thandleClick(evt) {\n\t\tlet id = evt.currentTarget.dataset.id, old = this.selected;\n\t\tif (!this.getEl(id)) { return; }\n\t\tif (evt.type === \"dblclick\") {\n\t\t\tif (id != null) { this.dispatchEvent(\"dblclick\"); }\n\t\t\treturn;\n\t\t} else if (this.multi) {\n\t\t\t$.toggleClass(evt.currentTarget, \"selected\");\n\t\t} else if (old === id) {\n\t\t\tif (id != null) { this.dispatchEvent(\"selclick\"); }\n\t\t\treturn;\n\t\t} else {\n\t\t\tthis.selected = id;\n\t\t}\n\t\tif (!this.dispatchEvent(\"change\", false, true)) { this.selected = old; }\n\t}\n\t\n\tscrollTo(id=this.selected) {\n\t\tlet el = this.getEl(id);\n\t\tif (!el) { return; }\n\t\t//el.scrollIntoView(); // this is too jumpy, but would handle horizontal.\n\n\t\tlet scrollEl = this.scrollEl || this.el;\n\t\tlet top = el.offsetTop - scrollEl.offsetTop;\n\t\tif (top + el.offsetHeight > scrollEl.scrollTop+scrollEl.offsetHeight) {\n\t\t\tscrollEl.scrollTop = top+el.offsetHeight-scrollEl.offsetHeight+10;\n\t\t} else if (top < scrollEl.scrollTop) {\n\t\t\tscrollEl.scrollTop = top-10;\n\t\t}\n\t}\n\n\tgetEl(id) {\n\t\treturn $.query(\"[data-id='\"+id+\"']\", this.el);\n\t}\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"./utils/Utils.js\";\n\nexport default class ExpressionLexer {\n\tconstructor() {\n\t\tthis.profile = null;\n\t}\n\t\n\tset profile(profile) {\n\t\tthis._profile = profile;\n\t\tthis.string = this.token = this.errors = this.captureGroups = this.namedGroups = null;\n\t}\n\t\n\tparse(str) {\n\t\tif (!this._profile) { return null; }\n\t\tif (str === this.string) { return this.token; }\n\t\n\t\tthis.token = null;\n\t\tthis._modes = {};\n\t\tthis.string = str;\n\t\tthis.errors = [];\n\t\tlet capgroups = this.captureGroups = [];\n\t\tlet namedgroups = this.namedGroups = {};\n\t\tlet brgroups = this.branchResetGroups = [];\n\t\tlet groups = [], refs = [], i = 0, l = str.length;\n\t\tlet o, c, token, charset = null;\n\t\t// previous is the previous token, prv is the previous \"active\" token (!ignore)\n\t\tlet prev = null, prv = null\n\t\tlet profile = this._profile, unquantifiable = profile.unquantifiable;\n\t\tlet charTypes = profile.charTypes;\n\t\tlet closeIndex = str.lastIndexOf(\"/\");\n\t\t\n\t\tfor (let i=closeIndex+1; i= closeIndex) {\n\t\t\t\tthis.parseFlag(str, token);\n\t\t\t} else if (c === \"(\" && !charset) {\n\t\t\t\tthis.parseParen(str, token);\n\t\t\t\tif (token.close === null) {\n\t\t\t\t\ttoken.depth = groups.length;\n\t\t\t\t\tgroups.push(token);\n\t\t\t\t}\n\t\t\t\tif (token.capture) { this.addCaptureGroup(token, groups); }\n\t\t\t} else if (c === \")\" && !charset) {\n\t\t\t\ttoken.type = \"groupclose\";\n\t\t\t\tif (groups.length) {\n\t\t\t\t\to = token.open = groups.pop();\n\t\t\t\t\to.close = token;\n\t\t\t\t\tif (o.type === \"branchreset\") {\n\t\t\t\t\t\tbrgroups.pop();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttoken.error = {id: \"groupclose\"};\n\t\t\t\t}\n\t\t\t} else if (c === \"[\") {\n\t\t\t\tcharset = this.parseSquareBracket(str, token, charset);\n\t\t\t} else if (c === \"]\" && charset) {\n\t\t\t\ttoken.type = \"setclose\";\n\t\t\t\ttoken.open = charset;\n\t\t\t\tcharset.close = token;\n\t\t\t\tcharset = null;\n\t\t\t} else if (c === \"+\" && prv && prv.clss === \"quant\" && profile.tokens.possessive) {\n\t\t\t\ttoken.type = \"possessive\";\n\t\t\t\ttoken.related = [prv];\n\t\t\t} else if ((c === \"+\" || c === \"*\") && !charset) {\n\t\t\t\ttoken.type = charTypes[c];\n\t\t\t\ttoken.clss = \"quant\";\n\t\t\t\ttoken.min = (c === \"+\" ? 1 : 0);\n\t\t\t\ttoken.max = -1;\n\t\t\t} else if (c === \"{\" && !charset && str.substr(i).search(/^{\\d+,?\\d*}/) !== -1) {\n\t\t\t\tthis.parseQuant(str, token);\n\t\t\t} else if (c === \"\\\\\") {\n\t\t\t\tthis.parseBackSlash(str, token, charset, closeIndex);\n\t\t\t} else if (c === \"?\" && !charset) {\n\t\t\t\tif (!prv || prv.clss !== \"quant\") {\n\t\t\t\t\ttoken.type = charTypes[c];\n\t\t\t\t\ttoken.clss = \"quant\";\n\t\t\t\t\ttoken.min = 0;\n\t\t\t\t\ttoken.max = 1;\n\t\t\t\t} else {\n\t\t\t\t\ttoken.type = \"lazy\";\n\t\t\t\t\ttoken.related = [prv];\n\t\t\t\t}\n\t\t\t} else if (c === \"-\" && charset && prv.code !== undefined && prv.prv && prv.prv.type !== \"range\") {\n\t\t\t\t// this may be the start of a range, but we'll need to validate after the next token.\n\t\t\t\ttoken.type = \"range\";\n\t\t\t} else {\n\t\t\t\tthis.parseChar(str, token, charset);\n\t\t\t\tif (!charset && this._modes.x && /\\s/.test(c)) {\n\t\t\t\t\ttoken.ignore = true;\n\t\t\t\t\ttoken.type = \"ignorews\";\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// post process token:\n\t\t\t// quantifier:\n\t\t\tif (token.clss === \"quant\") {\n\t\t\t\tif (!prv || prv.close !== undefined || unquantifiable[prv.type] || (prv.open && unquantifiable[prv.open.type])) {\n\t\t\t\t\ttoken.error = {id: \"quanttarg\"};\n\t\t\t\t} else {\n\t\t\t\t\ttoken.related = [prv.open || prv];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// reference:\n\t\t\tif (token.group === true) {\n\t\t\t\trefs.push(token);\n\t\t\t}\n\n\t\t\t// conditional:\n\t\t\tlet curGroup = groups.length ? groups[groups.length-1] : null;\n\t\t\tif (curGroup && (curGroup.type === \"conditional\" || curGroup.type === \"conditionalgroup\") && token.type === \"alt\") {\n\t\t\t\tif (!curGroup.alt) { curGroup.alt = token; }\n\t\t\t\telse { token.error = {id: \"extraelse\"}; }\n\t\t\t\ttoken.related = [curGroup];\n\t\t\t\ttoken.type = \"conditionalelse\";\n\t\t\t\ttoken.clss = \"special\";\n\t\t\t} else if (curGroup && curGroup.type === \"branchreset\") {\n\t\t\t\t// reset group\n\t\t\t\tcurGroup.curGroupNum = curGroup.inGroupNum;\n\t\t\t}\n\n\t\t\t// range:\n\t\t\tif (prv && prv.type === \"range\" && prv.l === 1) {\n\t\t\t\tthis.validateRange(str, token);\n\t\t\t}\n\t\t\t\n\t\t\t// js warnings:\n\t\t\t// TODO: this isn't ideal, but I'm hesitant to write a more robust solution for a couple of edge cases.\n\t\t\tif (profile.id === \"js\") { this.addJSWarnings(token); }\n\n\t\t\t// general:\n\t\t\tif (token.open && !token.clss) {\n\t\t\t\ttoken.clss = token.open.clss;\n\t\t\t}\n\t\t\tif (token.error) {\n\t\t\t\tthis.addError(token);\n\t\t\t}\n\t\t\ti += token.l;\n\t\t\tprev = token;\n\t\t\tif (!token.ignore) { prv = token; }\n\t\t}\n\t\n\t\t// post processing:\n\t\twhile (groups.length) {\n\t\t\tthis.addError(groups.pop(), {id: \"groupopen\"});\n\t\t}\n\t\tthis.matchRefs(refs, capgroups, namedgroups);\n\t\tif (charset) {\n\t\t\tthis.addError(charset, {id: \"setopen\"});\n\t\t}\n\t\n\t\treturn this.token;\n\t}\n\n\taddError(token, error=token.error) {\n\t\ttoken.error = error;\n\t\tthis.errors.push(token);\n\t}\n\n\taddJSWarnings(token) {\n\t\tif (token.error) { return; }\n\t\tif ((token.type === \"neglookbehind\" || token.type === \"poslookbehind\") ||\n\t\t\t(token.type === \"sticky\" || token.type === \"unicode\" || token.type == \"dotall\") ||\n\t\t\t(token.type === \"unicodecat\" || token.type === \"unicodescript\") ||\n\t\t\t(token.type === \"namedgroup\")\n\t\t\t) {\n\t\t\t\ttoken.error = {id: \"jsfuture\", warning:true};\n\t\t}\n\t}\n\n\taddCaptureGroup(token, groups) {\n\t\t// it would be nice to make branch reset groups actually highlight all of the groups that share the same number\n\t\t// that would require switching to arrays of groups for each group num - requires rearchitecture throughout the app.\n\t\tlet capgroups = this.captureGroups, brgroups = this.branchResetGroups, namedgroups = this.namedGroups;\n\t\tlet curGroup = groups.length ? groups[groups.length-1] : null;\n\t\tif (brgroups.length) {\n\t\t\tlet brgroup = brgroups[brgroups.length-1];\n\t\t\ttoken.num = ++brgroup.curGroupNum;\n\t\t} else {\n\t\t\ttoken.num = capgroups.length+1;\n\t\t}\n\t\tif (!capgroups[token.num-1]) { capgroups.push(token); }\n\t\tif (token.name && !token.error) {\n\t\t\tif (/\\d/.test(token.name[0])) { token.error = {id: \"badname\"}; }\n\t\t\telse if (namedgroups[token.name]) {\n\t\t\t\ttoken.error = {id: \"dupname\"};\n\t\t\t\ttoken.related = [namedgroups[token.name]];\n\t\t\t} else { namedgroups[token.name] = token; }\n\t\t}\n\t}\n\t\n\tgetRef(token, str) {\n\t\ttoken.clss = \"ref\";\n\t\ttoken.group = true;\n\t\ttoken.relIndex = this.captureGroups.length;\n\t\ttoken.name = str;\n\t}\n\t\n\tmatchRefs(refs, indexes, names) {\n\t\twhile (refs.length) {\n\t\t\tlet token = refs.pop(), name=token.name, group = names[name];\n\t\n\t\t\tif (!group && !isNaN(name)) {\n\t\t\t\tlet sign = name[0], index = parseInt(name) + ((sign === \"+\" || sign === \"-\") ? token.relIndex : 0);\n\t\t\t\tif (sign === \"-\") { index++; }\n\t\t\t\tgroup = indexes[index-1];\n\t\t\t}\n\t\t\tif (group) {\n\t\t\t\ttoken.group = group;\n\t\t\t\ttoken.related = [group];\n\t\t\t\ttoken.dir = (token.i < group.i) ? 1 : (!group.close || token.i < group.close.i) ? 0 : -1;\n\t\t\t} else {\n\t\t\t\tdelete token.group;\n\t\t\t\tdelete token.relIndex;\n\t\t\t\tthis.refToOctal(token);\n\t\t\t\tif (token.error) { this.errors.push(token.error); }\n\t\t\t}\n\t\t}\n\t};\n\t\n\trefToOctal(token) {\n\t\t// PCRE: \\# unmatched, \\0 \\00 \\## = octal\n\t\t// JS: \\# \\0 \\00 \\## = octal\n\t\t// PCRE matches \\8 \\9 to \"8\" \"9\"\n\t\t// JS: without the u flag \\8 \\9 match \"8\" \"9\" in IE, FF & Chrome, and \"\\8\" \"\\9\" in Safari. We support the former.\n\t\t// JS: with the u flag, Chrome & FF throw an esc error, Safari does not.\n\t\t\n\t\t// TODO: handle \\0 for PCRE? Would need more testing.\n\t\t// TODO: this doesn't handle two digit refs with 8/9 in them. Ex. \\18 - not even sure what this is interpreted as.\n\t\tlet name = token.name, profile = this._profile;\n\t\tif (token.type !== \"numref\") {\n\t\t\t// not a simple \\4 style reference, so can't decompose into an octal.\n\t\t\ttoken.error = {id: \"unmatchedref\"};\n\t\t} else if (/^[0-7]{2}$/.test(name) || (profile.config.reftooctalalways && /^[0-7]$/.test(name))) { // octal\n\t\t\tlet next = token.next, char = String.fromCharCode(next.code);\n\t\t\tif (next.type === \"char\" && char >= \"0\" && char <= \"7\" && parseInt(name+char, 8) <= 255) {\n\t\t\t\tname += char;\n\t\t\t\tthis.mergeNext(token);\n\t\t\t}\n\t\t\ttoken.code = parseInt(name,8);\n\t\t\ttoken.clss = \"esc\";\n\t\t\ttoken.type = \"escoctal\";\n\t\t\tdelete token.name;\n\t\t} else if (name === \"8\" || name === \"9\") {\n\t\t\tthis.parseEscChar(token, name);\n\t\t\tdelete token.name;\n\t\t} else {\n\t\t\ttoken.error = {id: \"unmatchedref\"};\n\t\t}\n\t};\n\t\n\tmergeNext(token) {\n\t\tlet next = token.next;\n\t\ttoken.next = next.next;\n\t\ttoken.next.prev = token;\n\t\ttoken.l++;\n\t};\n\t\n\tparseFlag(str, token) {\n\t\t// note that this doesn't deal with misformed patterns or incorrect flags.\n\t\tlet i = token.i, c = str[i];\n\t\tif (str[i] === \"/\") {\n\t\t\ttoken.type = (i === 0) ? \"open\" : \"close\";\n\t\t\tif (i !== 0) {\n\t\t\t\ttoken.related = [this.token];\n\t\t\t\tthis.token.related = [token];\n\t\t\t}\n\t\t} else {\n\t\t\ttoken.type = this._profile.flags[c];\n\t\t}\n\t\t//token.clear = true;\n\t};\n\t\n\tparseChar(str, token, charset) {\n\t\tlet c = str[token.i];\n\t\ttoken.type = (!charset && this._profile.charTypes[c]) || \"char\";\n\t\tif (!charset && c === \"/\") {\n\t\t\ttoken.error = {id: \"fwdslash\"};\n\t\t}\n\t\tif (token.type === \"char\") {\n\t\t\ttoken.code = c.charCodeAt(0);\n\t\t} else if (ExpressionLexer.ANCHOR_TYPES[token.type]) {\n\t\t\ttoken.clss = \"anchor\";\n\t\t} else if (token.type === \"dot\") {\n\t\t\ttoken.clss = \"charclass\";\n\t\t}\n\t\treturn token;\n\t};\n\t\n\tparseSquareBracket(str, token, charset) {\n\t\tlet match;\n\t\tif (this._profile.tokens.posixcharclass && (match = str.substr(token.i).match(/^\\[(:|\\.)([^\\]]*?)\\1]/))) {\n\t\t\t// posixcharclass: [:alpha:]\n\t\t\t// posixcollseq: [.ch.]\n\t\t\t// currently neither flavor supports posixcollseq, but PCRE does flag as an error:\n\t\t\t// TODO: the expression above currently does not catch [.\\].]\n\t\t\ttoken.l = match[0].length;\n\t\t\ttoken.value = match[2];\n\t\t\ttoken.clss = \"charclass\";\n\t\t\tif (match[1] === \":\") {\n\t\t\t\ttoken.type = \"posixcharclass\";\n\t\t\t\tif (!this._profile.posixCharClasses[match[2]]) { token.error = {id: \"posixcharclassbad\"}; }\n\t\t\t\telse if (!charset) { token.error = {id: \"posixcharclassnoset\"}; }\n\t\t\t} else {\n\t\t\t\ttoken.type = \"posixcollseq\";\n\t\t\t\t// TODO: can this be generalized? Right now, no, because we assign ids that aren't in the profile.\n\t\t\t\ttoken.error = {id: \"notsupported\"};\n\t\t\t}\n\t\t} else if (!charset) {\n\t\t\t// set [a-z] [aeiou]\n\t\t\t// setnot [^a-z]\n\t\t\ttoken.type = token.clss = \"set\";\n\t\t\tif (str[token.i + 1] === \"^\") {\n\t\t\t\ttoken.l++;\n\t\t\t\ttoken.type += \"not\";\n\t\t\t}\n\t\t\tcharset = token;\n\t\t} else {\n\t\t\t// [[] (square bracket inside a set)\n\t\t\tthis.parseChar(str, token, charset);\n\t\t}\n\t\treturn charset;\n\t};\n\t\n\tparseParen(str, token) {\n\t\t/*\n\t\tcore:\n\t.\t\tgroup:\n\t.\t\tlookahead: ?= ?!\n\t.\t\tnoncap: ?:\n\t\tPCRE:\n\t.\t\tlookbehind: ?<= ? ?'name' ?\n\t.\t\tnamedref: ?P=name\t\tAlso: \\g'name' \\k'name' etc\n\t.\t\tcomment: ?#\n\t.\t\tatomic: ?>\n\t.\t\trecursion: ?0 ?R\t\tAlso: \\g<0>\n\t.\t\tdefine: ?(DEFINE)\n\t.\t\tsubroutine: ?1 ?-1 ?&name ?P>name\n\t\t\tconditionalgroup: ?(1)a|b ?(-1)a|b ?(name)a|b\n\t\t\tconditional: ?(?=if)then|else\n\t\t\tmode: ?c-i\n\t\t\tbranchreset: ?|\n\t\t*/\n\t\n\t\ttoken.clss = token.type = \"group\";\n\t\tif (str[token.i+1] !== \"?\") {\n\t\t\ttoken.close = null; // indicates that it needs a close token.\n\t\t\ttoken.capture = true;\n\t\t\treturn token;\n\t\t}\n\t\n\t\tlet sub = str.substr(token.i+2), match, s=sub[0];\n\t\n\t\tif (s === \":\") {\n\t\t\t// (?:foo)\n\t\t\ttoken.type = \"noncapgroup\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.l = 3;\n\t\t} else if (s === \">\") {\n\t\t\t// (?>foo)\n\t\t\ttoken.type = \"atomic\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.l = 3;\n\t\t} else if (s === \"|\") {\n\t\t\t// (?|(a)|(b))\n\t\t\ttoken.type = \"branchreset\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.l = 3;\n\t\t\ttoken.inGroupNum = token.curGroupNum = this.captureGroups.length;\n\t\t\tthis.branchResetGroups.push(token);\n\t\t} else if (s === \"#\" && (match = sub.match(/[^)]*\\)/))) {\n\t\t\t// (?#foo)\n\t\t\ttoken.clss = token.type = \"comment\";\n\t\t\ttoken.ignore = true;\n\t\t\ttoken.l = 2+match[0].length;\n\t\t} else if (/^(R|0)\\)/.test(sub)) {\n\t\t\t// (?R) (?0)\n\t\t\ttoken.clss = \"ref\";\n\t\t\ttoken.type = \"recursion\";\n\t\t\ttoken.l = 4;\n\t\t} else if (match = sub.match(/^P=(\\w+)\\)/i)) {\n\t\t\t// (?P=name)\n\t\t\ttoken.type = \"namedref\";\n\t\t\tthis.getRef(token, match[1]);\n\t\t\ttoken.l = match[0].length+2;\n\t\t} else if (/^\\(DEFINE\\)/.test(sub)) {\n\t\t\t// (?(DEFINE)foo)\n\t\t\ttoken.type = \"define\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.l = 10;\n\t\t} else if (match = sub.match(/^/)) ||\n\t\t\t(this._profile.config.namedgroupalt && ((match = sub.match(/^'(\\w+)'/)) || (match = sub.match(/^P<(\\w+)>/))))\n\t\t\t) {\n\t\t\t// (?foo) (?'name'foo) (?Pfoo)\n\t\t\ttoken.type = \"namedgroup\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.name = match[1];\n\t\t\ttoken.capture = true;\n\t\t\ttoken.l = match[0].length + 2;\n\t\t} else if ((match = sub.match(/^([-+]?\\d\\d?)\\)/)) || (match = sub.match(/^(?:&|P>)(\\w+)\\)/))) {\n\t\t\t// (?1) (?-1) (?&name) (?P>name)\n\t\t\ttoken.type = (isNaN(match[1]) ? \"named\" : \"num\") + \"subroutine\";\n\t\t\tthis.getRef(token, match[1]);\n\t\t\ttoken.l = match[0].length + 2;\n\t\t} else if ((match = sub.match(/^\\(([-+]?\\d\\d?)\\)/)) || (match = sub.match(/^\\((\\w+)\\)/))) {\n\t\t\t// (?(1)a|b) (?(-1)a|b) (?(name)a|b)\n\t\t\tthis.getRef(token, match[1]);\n\t\t\ttoken.clss = \"special\";\n\t\t\ttoken.type = \"conditionalgroup\";\n\t\t\ttoken.close = null;\n\t\t\ttoken.l = match[0].length + 2;\n\t\t} else if (/^\\(\\?255). In theory it should allow 4?\n\t\t\tif (isNaN(val) || val > 255 || /[^\\da-f]/i.test(match[1])) { token.error = {id: \"esccharbad\"}; }\n\t\t\telse { token.code = val; }\n\t\t} else if (match = sub.match(/^x([\\da-fA-F]{0,2})/)) {\n\t\t\t// hex ascii: \\xFF\n\t\t\ttoken.type = \"eschexadecimal\";\n\t\t\ttoken.l += match[0].length;\n\t\t\ttoken.code = parseInt(match[1]||0, 16);\n\t\t} else if (match = sub.match(/^c([a-zA-Z])?/)) {\n\t\t\t// control char: \\cA \\cz\n\t\t\t// also handles: \\c\n\t\t\t// not supported in JS strings\n\t\t\ttoken.type = \"esccontrolchar\";\n\t\t\tif (match[1]) {\n\t\t\t\ttoken.code = match[1].toUpperCase().charCodeAt(0) - 64; // A=65\n\t\t\t\ttoken.l += 2;\n\t\t\t} else if (profile.config.ctrlcodeerr) {\n\t\t\t\ttoken.l++;\n\t\t\t\ttoken.error = {id: \"esccharbad\"};\n\t\t\t} else {\n\t\t\t\treturn this.parseChar(str, token, charset); // this builds the \"/\" token\n\t\t\t}\n\t\t} else if (match = sub.match(/^[0-7]{1,3}/)) {\n\t\t\t// octal ascii: \\011\n\t\t\ttoken.type = \"escoctal\";\n\t\t\tsub = match[0];\n\t\t\tif (parseInt(sub, 8) > 255) {\n\t\t\t\tsub = sub.substr(0, 2);\n\t\t\t}\n\t\t\ttoken.l += sub.length;\n\t\t\ttoken.code = parseInt(sub, 8);\n\t\t} else if (profile.tokens.escoctalo && (match = sub.match(/^o\\{(.*?)}/i))) {\n\t\t\t// \\o{377}\n\t\t\ttoken.type = \"escoctal\";\n\t\t\ttoken.l += match[0].length;\n\t\t\tval = parseInt(match[1], 8);\n\t\t\tif (isNaN(val) || val > 255 || /[^0-7]/.test(match[1])) { token.error = {id: \"esccharbad\"}; }\n\t\t\telse { token.code = val; }\n\t\t} else {\n\t\t\t// single char\n\t\t\tif (token.type = profile.escCharTypes[c]) {\n\t\t\t\ttoken.l++;\n\t\t\t\ttoken.clss = ExpressionLexer.ANCHOR_TYPES[token.type] ? \"anchor\" : \"charclass\";\n\t\t\t\treturn token;\n\t\t\t}\n\t\t\t\n\t\t\ttoken.code = profile.escCharCodes[c];\n\t\t\tif (token.code === undefined || token.code === false) {\n\t\t\t\t// unrecognized.\n\t\t\t\treturn this.parseEscChar(token, c);\n\t\t\t}\n\t\t\t\n\t\t\t// update SubstLexer if this changes:\n\t\t\ttoken.l++;\n\t\t\ttoken.type = \"esc_\"+token.code;\n\t\t}\n\t\ttoken.clss = \"esc\";\n\t\treturn token;\n\t};\n\t\n\tparseEscChar(token, c) {\n\t\t// unrecognized escchar: \\u \\a \\8, etc\n\t\t// JS: allowed except if u flag set, Safari still allows \\8 \\9\n\t\t// PCRE: allows \\8 \\9 but not others // TODO: support?\n\t\tlet profile = this._profile;\n\t\ttoken.l=2;\n\t\tif (!profile.badEscChars[c] && (profile.tokens.escchar && !this._modes.u) || profile.escChars[c]) {\n\t\t\ttoken.type = \"escchar\";\n\t\t\ttoken.code = c.charCodeAt(0);\n\t\t\ttoken.clss = \"esc\";\n\t\t} else {\n\t\t\ttoken.error = {id: \"esccharbad\"};\n\t\t}\n\t}\n\t\n\tparseRef(token, sub) {\n\t\t// namedref: \\k \\k'name' \\k{name} \\g{name}\n\t\t// namedsubroutine: \\g \\g'name'\n\t\t// numref: \\g1 \\g+2 \\g{2}\n\t\t// numsubroutine: \\g<-1> \\g'1'\n\t\t// recursion: \\g<0> \\g'0'\n\t\tlet c=sub[0], s=\"\", match;\n\t\tif (match = sub.match(/^[gk](?:'\\w*'|<\\w*>|{\\w*})/)) {\n\t\t\ts = match[0].substr(2, match[0].length - 3);\n\t\t\tif (c === \"k\" && !isNaN(s)) { s = \"\"; } // TODO: specific error for numeric \\k?\n\t\t} else if (match = sub.match(/^g(?:({[-+]?\\d+}|<[-+]?\\d+>|'[-+]?\\d+')|([-+]?\\d+))/)) {\n\t\t\ts = match[2] !== undefined ? match[2] : match[1].substr(1, match[1].length-2);\n\t\t}\n\t\tlet isRef = c === \"k\" || !(sub[1] === \"'\" || sub[1] === \"<\");\n\t\tif (!isRef && s == 0) {\n\t\t\ttoken.type = \"recursion\";\n\t\t\ttoken.clss = \"ref\";\n\t\t} else {\n\t\t\t// namedref, extnumref, namedsubroutine, numsubroutine\n\t\t\ttoken.type = (isNaN(s) ? \"named\" : (isRef?\"ext\":\"\")+\"num\") + (isRef ? \"ref\" : \"subroutine\");\n\t\t\tthis.getRef(token, s);\n\t\t}\n\t\ttoken.l += match ? match[0].length : 1;\n\t};\n\t\n\tparseUnicode(token, sub) {\n\t\t// unicodescript: \\p{Cherokee}\n\t\t// unicodecat: \\p{Ll} \\pL\n\t\t// not: \\P{Ll} \\p{^Lu}\n\t\tlet match = sub.match(/p\\{\\^?([^}]*)}/i), val = match && match[1], not = sub[0] === \"P\";\n\t\tif (!match && (match = sub.match(/[pP]([LMZSNPC])/))) { val = match[1]; }\n\t\telse { not = not !== (sub[2] === \"^\"); }\n\t\ttoken.l += match ? match[0].length : 1;\n\t\ttoken.type = \"unicodecat\";\n\t\tif (this._profile.unicodeScripts[val]) {\n\t\t\ttoken.type = \"unicodescript\";\n\t\t} else if (!this._profile.unicodeCategories[val]) {\n\t\t\tval = null;\n\t\t}\n\t\tif (not) { token.type = \"not\"+token.type; }\n\t\tif ((!this._profile.config.unicodenegated && sub[2] === \"^\") || !val) {\n\t\t\ttoken.error = {id: \"unicodebad\"}\n\t\t}\n\t\ttoken.value = val;\n\t\ttoken.clss = \"charclass\"\n\t\treturn token;\n\t};\n\t\n\tparseMode(token, sub) {\n\t\t// (?i-x)\n\t\t// supported modes in PCRE: i-caseinsens, x-freespacing, s-dotall, m-multiline, U-switchlazy, [J-samename]\n\t\tlet match = sub.match(/^[-a-z]+\\)/i);\n\t\tif (!match) { return; }\n\t\tlet supModes = this._profile.modes;\n\t\tlet modes = Utils.copy({}, this._modes), bad=false, not=false, s=match[0], c;\n\t\ttoken.on = token.off = \"\";\n\n\t\tfor (let i=0, l=s.length-1; i token.max) {\n\t\t\ttoken.error = {id: \"quantrev\"};\n\t\t}\n\t\treturn token;\n\t};\n\t\n\tvalidateRange(str, end) {\n\t\t// char range: [a-z] [\\11-\\n]\n\t\tlet next = end, token = end.prv, prv = token.prv;\n\t\tif (prv.code === undefined || next.code === undefined) {\n\t\t\t// not a range, rewrite as a char:\n\t\t\tthis.parseChar(str, token);\n\t\t} else {\n\t\t\ttoken.clss = \"set\";\n\t\t\tif (prv.code > next.code) {\n\t\t\t\t// this gets added here because parse has already moved to the next token:\n\t\t\t\tthis.errors.push(token.error = {id: \"rangerev\"});\n\t\t\t}\n\t\t\t// preserve as separate tokens, but treat as one in the UI:\n\t\t\tnext.proxy = prv.proxy = token;\n\t\t\ttoken.set = [prv, token, next];\n\t\t}\n\t};\n\n}\n\nExpressionLexer.ANCHOR_TYPES = {\n\t\"bof\": true,\n\t\"eof\": true,\n\t\"bos\": true,\n\t\"eos\": true,\n\t\"abseos\": true,\n\t\"wordboundary\": true,\n\t\"notwordboundary\": true,\n\t\"prevmatchend\": true\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n\nimport EventDispatcher from \"../events/EventDispatcher\";\nimport CMUtils from \"../utils/CMUtils\";\n\nexport default class ExpressionHighlighter extends EventDispatcher {\n\tconstructor(cm) {\n\t\tsuper();\n\t\tthis.cm = cm;\n\t\tthis._activeMarks = [];\n\t\tthis._hoverMarks = [];\n\t\tthis._hoverToken = null;\n\t}\n\t\n\tclear() {\n\t\tthis.cm.operation(() => {\n\t\t\tlet marks = this._activeMarks;\n\t\t\tfor (var i = 0, l = marks.length; i < l; i++) {\n\t\t\t\tmarks[i].clear();\n\t\t\t}\n\t\t\tmarks.length = 0;\n\t\t});\n\t}\n\t\n\tdraw(token) {\n\t\tlet cm = this.cm, pre = ExpressionHighlighter.CSS_PREFIX;\n\t\n\t\tthis.clear();\n\t\tcm.operation(() => {\n\t\t\t\n\t\t\tlet groupClasses = ExpressionHighlighter.GROUP_CLASS_BY_TYPE;\n\t\t\tlet doc = cm.getDoc(), endToken, marks = this._activeMarks;\n\t\n\t\t\twhile (token) {\n\t\t\t\tif (token.clear) {\n\t\t\t\t\ttoken = token.next;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttoken = this._calcTokenPos(token);\n\t\n\t\t\t\tvar className = pre + (token.clss || token.type);\n\t\t\t\tif (token.error) {\n\t\t\t\t\tclassName += \" \" + pre + (token.error.warning ? \"warning\" : \"error\");\n\t\t\t\t}\n\t\n\t\t\t\tif (className) {\n\t\t\t\t\tmarks.push(doc.markText(token.startPos, token.endPos, {className: className}));\n\t\t\t\t}\n\t\n\t\t\t\tif (token.close) {\n\t\t\t\t\tendToken = this._calcTokenPos(token.close);\n\t\t\t\t\tclassName = groupClasses[token.clss || token.type];\n\t\t\t\t\tif (className) {\n\t\t\t\t\t\tclassName = className.replace(\"%depth%\", token.depth);\n\t\t\t\t\t\tmarks.push(doc.markText(token.startPos, endToken.endPos, {className: className}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttoken = token.next;\n\t\t\t}\n\t\t});\n\t}\n\t\n\tset hoverToken(token) {\n\t\tif (token === this._hoverToken) { return; }\n\t\tif (token && token.set && token.set.indexOf(this._hoverToken) !== -1) { return; }\n\t\twhile (this._hoverMarks.length) { this._hoverMarks.pop().clear(); }\n\t\t\n\t\tthis._hoverToken = token;\n\t\tif (token) {\n\t\t\tif (token.open) {\n\t\t\t\tthis._drawSelect(token.open);\n\t\t\t} else {\n\t\t\t\tthis._drawSelect(token);\n\t\t\t}\n\t\t\tif (token.related) {\n\t\t\t\tfor (let i = 0, l=token.related.length; i < l; i++) {\n\t\t\t\t\tthis._drawSelect(token.related[i], ExpressionHighlighter.CSS_PREFIX + \"related\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.dispatchEvent(\"hover\");\n\t};\n\t\n\tget hoverToken() {\n\t\treturn this._hoverToken;\n\t}\n\t\n\t\n// private methods:\n\t_drawSelect(token, style = ExpressionHighlighter.CSS_PREFIX+\"selected\") {\n\t\tlet doc = this.cm.getDoc(), endToken = token.close || token;\n\t\tif (token.set) {\n\t\t\tendToken = token.set[token.set.length - 1];\n\t\t\ttoken = token.set[0];\n\t\t}\n\t\t\n\t\tthis._calcTokenPos(endToken);\n\t\tthis._calcTokenPos(token);\n\t\tthis._hoverMarks.push(doc.markText(token.startPos, endToken.endPos, {\n\t\t\tclassName: style,\n\t\t\tstartStyle: style + \"-left\",\n\t\t\tendStyle: style + \"-right\"\n\t\t}));\n\t};\n\n\t_calcTokenPos(token) {\n\t\tif (token.startPos || token == null) {\n\t\t\treturn token;\n\t\t}\n\t\tCMUtils.calcRangePos(this.cm, token.i, token.l, token);\n\t\treturn token;\n\t};\n\t\n};\n\nExpressionHighlighter.CSS_PREFIX = \"exp-\";\n\nExpressionHighlighter.GROUP_CLASS_BY_TYPE = {\n\tset: ExpressionHighlighter.CSS_PREFIX+\"group-set\",\n\tsetnot: ExpressionHighlighter.CSS_PREFIX+\"group-set\",\n\tgroup: ExpressionHighlighter.CSS_PREFIX+\"group-%depth%\",\n\tlookaround: ExpressionHighlighter.CSS_PREFIX+\"group-%depth%\"\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport CMUtils from \"../utils/CMUtils\";\n\nimport app from \"../app\";\n\nexport default class ExpressionHover {\n\tconstructor (editor, highlighter) {\n\t\tthis.editor = editor;\n\t\tthis.highlighter = highlighter;\n\t\tthis.isMouseDown = false;\n\t\tthis.token = null;\n\t\t\n\t\tlet o = editor.display.lineDiv;\n\t\to.addEventListener(\"mousemove\", (evt)=> this._handleMouseMove(evt));\n\t\to.addEventListener(\"mouseout\", (evt)=> this._handleMouseOut(evt));\n\t\to.addEventListener(\"mousedown\", (evt)=> this._handleMouseDown(evt));\n\t\t\n\t}\n\n\t\n// private methods:\n\t_handleMouseMove(evt) {\n\t\tif (this.isMouseDown) { return; }\n\t\t\n\t\tlet index, editor = this.editor, token = this.token, target = null;\n\t\t\n\t\tif (evt && token && (index = CMUtils.getCharIndexAt(editor, evt.clientX, evt.clientY + window.pageYOffset)) != null) {\n\t\t\twhile (token) {\n\t\t\t\tif (index >= token.i && index < token.i+token.l) {\n\t\t\t\t\ttarget = token;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttoken = token.next;\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (target) {\n\t\t\tif (target.open) { target = target.open; }\n\t\t\telse if (target.proxy) { target = target.proxy; }\n\t\t\telse { break; }\n\t\t}\n\t\n\t\tthis.highlighter.hoverToken = target;\n\t\tlet rect = (index != null) && CMUtils.getCharRect(editor, index);\n\t\tif (rect) { rect.right = rect.left = evt.clientX; }\n\t\tapp.tooltip.hover.show(\"ExpressionHover\", app.reference.tipForToken(target), evt.clientX, rect.bottom, true, 0);\n\t}\n\t\n\t_handleMouseOut(evt) {\n\t\tthis.highlighter.hoverToken = null;\n\t\tapp.tooltip.hover.hide(\"ExpressionHover\");\n\t}\n\t\n\t_handleMouseDown(evt) {\n\t\t// TODO: Should this also be in TextHover?\n\t\tif (evt.which !== 1 && evt.button !== 1) { return; }\n\t\t\n\t\tthis.isMouseDown = true;\n\t\tlet f, t = window.addEventListener ? window : document;\n\t\tt.addEventListener(\"mouseup\", f = () => {\n\t\t\tt.removeEventListener(\"mouseup\", f);\n\t\t\tthis.isMouseDown = false;\n\t\t});\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n/*\nThe core profile essentially defines every feature we support, and is then pared down by other profiles. All values should be y (true).\n\nIt also acts in part as pseudo documentation for all of the \"type\" values.\n */\nlet y=true, n=false;\n\nlet core = {\n\tid: \"core\",\n\t\n\tflags: {\n\t\t\"g\": \"global\", // note that this is not a real flag in some flavors, but a different method call\n\t\t\"i\": \"caseinsensitive\",\n\t\t\"m\": \"multiline\",\n\t\t\"s\": \"dotall\",\n\t\t\"u\": \"unicode\",\n\t\t\"y\": \"sticky\",\n\t\t\"x\": \"extended\",\n\t\t\"U\": \"ungreedy\"\n\t},\n\t\n\t// reserved characters that need to be escaped:\n\tescChars: \"+*?^$\\\\.[]{}()|/\".split(\"\").reduce((o, c) => { o[c] = y; return o}, {}),\n\n\t// escape chars that are specifically not supported by the flavor:\n\tbadEscChars: n,\n\t\n\tescCharCodes: {\n\t\t\"0\": 0, // null\n\t\t\"a\": 7, // bell\n\t\t\"t\": 9, // tab\n\t\t\"n\": 10, // lf\n\t\t\"v\": 11, // vertical tab\n\t\t\"f\": 12, // form feed\n\t\t\"r\": 13, // cr\n\t\t\"e\": 27 // escape\n\t},\n\t\n\tescCharTypes: {\n\t\t\"A\": \"bos\",\n\t\t\"b\": \"wordboundary\",\n\t\t\"B\": \"notwordboundary\",\n\t\t\"d\": \"digit\",\n\t\t\"D\": \"notdigit\",\n\t\t\"G\": \"prevmatchend\",\n\t\t\"h\": \"hwhitespace\",\n\t\t\"H\": \"nothwhitespace\",\n\t\t\"K\": \"keepout\",\n\t\t\"N\": \"notlinebreak\",\n\t\t\"R\": \"linebreak\",\n\t\t\"s\": \"whitespace\",\n\t\t\"S\": \"notwhitespace\",\n\t\t\"v\": \"vwhitespace\",\n\t\t\"V\": \"notvwhitespace\",\n\t\t\"w\": \"word\",\n\t\t\"W\": \"notword\",\n\t\t\"X\": \"unicodegrapheme\",\n\t\t\"Z\": \"eos\",\n\t\t\"z\": \"abseos\"\n\t},\n\t\n\tcharTypes: {\n\t\t\".\": \"dot\",\n\t\t\"|\": \"alt\",\n\t\t\"$\": \"eof\",\n\t\t\"^\": \"bof\",\n\t\t\"?\": \"opt\", // also: \"lazy\"\n\t\t\"+\": \"plus\", // also: \"possessive\"\n\t\t\"*\": \"star\"\n\t},\n\t\n\tunquantifiable: {\n\t\t// all group/set open tokens are unquantifiable by default (ie. tokens with a .close value)\n\t\t\"quant\": y,\n\t\t\"plus\": y,\n\t\t\"star\": y,\n\t\t\"opt\": y,\n\t\t\"lazy\": y,\n\t\t\"possessive\": y,\n\t\t\"eof\": y,\n\t\t\"bof\": y,\n\t\t\"eos\": y,\n\t\t\"abseos\": y,\n\t\t\"alt\": y,\n\t\t\"open\": y,\n\t\t\"mode\": y,\n\t\t\"comment\":y, // TODO: this should actually be ignored by quantifiers.\n\t\t\"condition\": y\n\t},\n\t\n\tunicodeScripts: {\n\t\t// from: http://www.pcre.org/original/doc/html/pcrepattern.html\n\t\t\"Arabic\": y,\n\t\t\"Armenian\": y,\n\t\t\"Avestan\": y,\n\t\t\"Balinese\": y,\n\t\t\"Bamum\": y,\n\t\t\"Bassa_Vah\": y,\n\t\t\"Batak\": y,\n\t\t\"Bengali\": y,\n\t\t\"Bopomofo\": y,\n\t\t\"Brahmi\": y,\n\t\t\"Braille\": y,\n\t\t\"Buginese\": y,\n\t\t\"Buhid\": y,\n\t\t\"Canadian_Aboriginal\": y,\n\t\t\"Carian\": y,\n\t\t\"Caucasian_Albanian\": y,\n\t\t\"Chakma\": y,\n\t\t\"Cham\": y,\n\t\t\"Cherokee\": y,\n\t\t\"Common\": y,\n\t\t\"Coptic\": y,\n\t\t\"Cuneiform\": y,\n\t\t\"Cypriot\": y,\n\t\t\"Cyrillic\": y,\n\t\t\"Deseret\": y,\n\t\t\"Devanagari\": y,\n\t\t\"Duployan\": y,\n\t\t\"Egyptian_Hieroglyphs\": y,\n\t\t\"Elbasan\": y,\n\t\t\"Ethiopic\": y,\n\t\t\"Georgian\": y,\n\t\t\"Glagolitic\": y,\n\t\t\"Gothic\": y,\n\t\t\"Grantha\": y,\n\t\t\"Greek\": y,\n\t\t\"Gujarati\": y,\n\t\t\"Gurmukhi\": y,\n\t\t\"Han\": y,\n\t\t\"Hangul\": y,\n\t\t\"Hanunoo\": y,\n\t\t\"Hebrew\": y,\n\t\t\"Hiragana\": y,\n\t\t\"Imperial_Aramaic\": y,\n\t\t\"Inherited\": y,\n\t\t\"Inscriptional_Pahlavi\": y,\n\t\t\"Inscriptional_Parthian\": y,\n\t\t\"Javanese\": y,\n\t\t\"Kaithi\": y,\n\t\t\"Kannada\": y,\n\t\t\"Katakana\": y,\n\t\t\"Kayah_Li\": y,\n\t\t\"Kharoshthi\": y,\n\t\t\"Khmer\": y,\n\t\t\"Khojki\": y,\n\t\t\"Khudawadi\": y,\n\t\t\"Lao\": y,\n\t\t\"Latin\": y,\n\t\t\"Lepcha\": y,\n\t\t\"Limbu\": y,\n\t\t\"Linear_A\": y,\n\t\t\"Linear_B\": y,\n\t\t\"Lisu\": y,\n\t\t\"Lycian\": y,\n\t\t\"Lydian\": y,\n\t\t\"Mahajani\": y,\n\t\t\"Malayalam\": y,\n\t\t\"Mandaic\": y,\n\t\t\"Manichaean\": y,\n\t\t\"Meetei_Mayek\": y,\n\t\t\"Mende_Kikakui\": y,\n\t\t\"Meroitic_Cursive\": y,\n\t\t\"Meroitic_Hieroglyphs\": y,\n\t\t\"Miao\": y,\n\t\t\"Modi\": y,\n\t\t\"Mongolian\": y,\n\t\t\"Mro\": y,\n\t\t\"Myanmar\": y,\n\t\t\"Nabataean\": y,\n\t\t\"New_Tai_Lue\": y,\n\t\t\"Nko\": y,\n\t\t\"Ogham\": y,\n\t\t\"Ol_Chiki\": y,\n\t\t\"Old_Italic\": y,\n\t\t\"Old_North_Arabian\": y,\n\t\t\"Old_Permic\": y,\n\t\t\"Old_Persian\": y,\n\t\t\"Old_South_Arabian\": y,\n\t\t\"Old_Turkic\": y,\n\t\t\"Oriya\": y,\n\t\t\"Osmanya\": y,\n\t\t\"Pahawh_Hmong\": y,\n\t\t\"Palmyrene\": y,\n\t\t\"Pau_Cin_Hau\": y,\n\t\t\"Phags_Pa\": y,\n\t\t\"Phoenician\": y,\n\t\t\"Psalter_Pahlavi\": y,\n\t\t\"Rejang\": y,\n\t\t\"Runic\": y,\n\t\t\"Samaritan\": y,\n\t\t\"Saurashtra\": y,\n\t\t\"Sharada\": y,\n\t\t\"Shavian\": y,\n\t\t\"Siddham\": y,\n\t\t\"Sinhala\": y,\n\t\t\"Sora_Sompeng\": y,\n\t\t\"Sundanese\": y,\n\t\t\"Syloti_Nagri\": y,\n\t\t\"Syriac\": y,\n\t\t\"Tagalog\": y,\n\t\t\"Tagbanwa\": y,\n\t\t\"Tai_Le\": y,\n\t\t\"Tai_Tham\": y,\n\t\t\"Tai_Viet\": y,\n\t\t\"Takri\": y,\n\t\t\"Tamil\": y,\n\t\t\"Telugu\": y,\n\t\t\"Thaana\": y,\n\t\t\"Thai\": y,\n\t\t\"Tibetan\": y,\n\t\t\"Tifinagh\": y,\n\t\t\"Tirhuta\": y,\n\t\t\"Ugaritic\": y,\n\t\t\"Vai\": y,\n\t\t\"Warang_Citi\": y,\n\t\t\"Yi\": y\n\t},\n\t\n\tunicodeCategories: {\n\t\t// from: http://www.pcre.org/original/doc/html/pcrepattern.html\n\t\t\"C\": y, // Other\n\t\t\"Cc\": y, // Control\n\t\t\"Cf\": y, // Format\n\t\t\"Cn\": y, // Unassigned\n\t\t\"Co\": y, // Private use\n\t\t\"Cs\": y, // Surrogate\n\t\t\"L\": y, // Letter\n\t\t\"L&\": y, // Any letter \n\t\t\"Ll\": y, // Lower case letter\n\t\t\"Lm\": y, // Modifier letter\n\t\t\"Lo\": y, // Other letter\n\t\t\"Lt\": y, // Title case letter\n\t\t\"Lu\": y, // Upper case letter\n\t\t\"M\": y, // Mark\n\t\t\"Mc\": y, // Spacing mark\n\t\t\"Me\": y, // Enclosing mark\n\t\t\"Mn\": y, // Non-spacing mark\n\t\t\"N\": y, // Number\n\t\t\"Nd\": y, // Decimal number\n\t\t\"Nl\": y, // Letter number\n\t\t\"No\": y, // Other number\n\t\t\"P\": y, // Punctuation\n\t\t\"Pc\": y, // Connector punctuation\n\t\t\"Pd\": y, // Dash punctuation\n\t\t\"Pe\": y, // Close punctuation\n\t\t\"Pf\": y, // Final punctuation\n\t\t\"Pi\": y, // Initial punctuation\n\t\t\"Po\": y, // Other punctuation\n\t\t\"Ps\": y, // Open punctuation\n\t\t\"S\": y, // Symbol\n\t\t\"Sc\": y, // Currency symbol\n\t\t\"Sk\": y, // Modifier symbol\n\t\t\"Sm\": y, // Mathematical symbol\n\t\t\"So\": y, // Other symbol\n\t\t\"Z\": y, // Separator\n\t\t\"Zl\": y, // Line separator\n\t\t\"Zp\": y, // Paragraph separator\n\t\t\"Zs\": y // Space separator\n\t},\n\t\n\tposixCharClasses: {\n\t\t// from: http://www.pcre.org/original/doc/html/pcrepattern.html\n\t\t\"alnum\": y, // letters and digits\n\t\t\"alpha\": y, // letters\n\t\t\"ascii\": y, // character codes 0 - 127\n\t\t\"blank\": y, // space or tab only\n\t\t\"cntrl\": y, // control characters\n\t\t\"digit\": y, // decimal digits (same as \\d)\n\t\t\"graph\": y, // printing characters, excluding space\n\t\t\"lower\": y, // lower case letters\n\t\t\"print\": y, // printing characters, including space\n\t\t\"punct\": y, // printing characters, excluding letters and digits and space\n\t\t\"space\": y, // white space (the same as \\s from PCRE 8.34)\n\t\t\"upper\": y, // upper case letters\n\t\t\"word\": y, // \"word\" characters (same as \\w)\n\t\t\"xdigit\": y // hexadecimal digits\n\t},\n\t\n\tmodes: {\n\t\t\"i\": \"caseinsensitive\",\n\t\t\"s\": \"dotall\",\n\t\t\"m\": \"multiline\",\n\t\t\"x\": \"freespacing\",\n\t\t\"J\": \"samename\",\n\t\t\"U\": \"switchlazy\"\n\t},\n\t\n\ttokens: {\n\t\t// note that not all of these are actively used in the lexer, but are included for completeness.\n\t\t\"open\": y, // opening /\n\t\t\"close\": y, // closing /\n\t\t\"char\": y, // abc\n\t\t\n\t\t// classes:\n\t\t// also in escCharTypes and charTypes\n\t\t\"set\": y, // [a-z]\n\t\t\"setnot\": y, // [^a-z]\n\t\t\"setclose\": y, // ]\n\t\t\"range\": y, // [a-z]\n\t\t\"unicodecat\": y, // \\p{Ll} \\P{^Ll} \\pL\n\t\t\"notunicodecat\": y, // \\P{Ll} \\p{^Ll} \\PL\n\t\t\"unicodescript\": y, // \\p{Cherokee} \\P{^Cherokee}\n\t\t\"notunicodescript\": y, // \\P{Cherokee} \\p{^Cherokee}\n\t\t\"posixcharclass\": y, // [[:alpha:]]\n\t\t// not in supported flavors:\t\"posixcollseq\": y, // [[.foo.]] // this is recognized by the lexer, currently returns \"notsupported\" error\n\t\t// not in supported flavors:\t\"unicodeblock\": y, // \\p{InThai} \\p{IsThai} and NOT \\P\n\t\t// not in supported flavors:\t\"subtract\": y, // [base-[subtract]]\n\t\t// not in supported flavors:\t\"intersect\": y, // [base&&[intersect]]\n\t\t\n\t\t// esc:\n\t\t// also in escCharCodes and escCharTypes\n\t\t\"escoctal\": y, // \\11\n\t\t\"escunicodeu\": y, // \\uFFFF\n\t\t\"escunicodeub\": y, // \\u{00A9}\n\t\t\"escunicodexb\": y, // \\x{00A9}\n\t\t\"escsequence\": y, // \\Q...\\E\n\t\t\"eschexadecimal\": y, // \\xFF\n\t\t\"esccontrolchar\": y, // \\cA\n\t\t\"escoctalo\": y, // \\o{377} // resolved to escoctal in lexer, no docs required\n\t\t\"escchar\": y, // \\m (unrecognized escapes) // no reference documentation required\n\t\t\n\t\t// group:\n\t\t\"group\": y, // (foo)\n\t\t\"groupclose\": y, // )\n\t\t\"noncapgroup\": y, // (?:foo)\n\t\t\"namedgroup\": y, // (?Pfoo) (?foo) (?'name'foo)\n\t\t\"atomic\": y, // (?>foo|bar)\n\t\t\"define\": y, // (?(DEFINE)foo)\n\t\t\"branchreset\": y, // (?|(a)|(b))\n\t\t\n\t\t// lookaround:\n\t\t\"poslookbehind\" : y, // (?<=foo)\n\t\t\"neglookbehind\": y, // (? \\k'name' \\k{name} (?P=name) \\g{name}\n\t\t\"numref\": y, // \\1\n\t\t\"extnumref\": y, // \\g{-1} \\g{+1} \\g{1} \\g1 \\g-1\n\t\t\"recursion\": y, // (?R) (?0) \\g<0> \\g'0'\n\t\t\"numsubroutine\": y, // \\g<1> \\g'-1' (?1) (?-1)\n\t\t\"namedsubroutine\": y, // \\g \\g'name' (?&name) (?P>name)\n\t\t\n\t\t// quantifiers:\n\t\t// also in specialChars\n\t\t\"quant\": y, // {1,2}\n\t\t\"possessive\": y, // ++\n\t\t\"lazy\": y, // ?\n\t\t\n\t\t// special:\n\t\t\"conditional\": y, // (?(?=if)then|else)\n\t\t\"condition\": y, // (?=if) any lookaround\n\t\t\"conditionalelse\": y, // |\n\t\t\"conditionalgroup\": y, // (?(1)a|b) (?(-1)a|b) (?(name)a|b)\n\t\t\"mode\": y, // (?i-x) see modes above\n\t\t\"comment\": y, // (?#comment)\n\n\t\t// meta:\n\t\t\"matchanyset\": y // [\\s\\S]\n\t},\n\t\n\tsubstTokens: {\n\t\t// named references aren't supported in JS or PCRE / PHP\n\t\t\"subst_$esc\": y, // $$\n\t\t\"subst_$&match\": y, // $&\n\t\t\"subst_$before\": y, // $`\n\t\t\"subst_$after\": y, // $'\n\t\t\"subst_$group\": y, // $1 $99 // resolved to subst_group in lexer, no docs required\n\t\t\"subst_$bgroup\": y, // ${1} ${99} // resolved to subst_group in lexer, no docs required\n\t\t\"subst_bsgroup\": y, // \\1 \\99 // resolved to subst_group in lexer, no docs required\n\t\t\"subst_group\": y, // $1 \\1 \\{1} // combined in docs, not used by lexer\n\t\t\"subst_0match\": y, // $0 \\0 \\{0}\n\t\t\n\t\t// this isn't a feature of the engine, but of RegExr:\n\t\t\"subst_esc\": y // \\n \\r \\u1234\n\t},\n\t\n\tconfig: {\n\t\t\"forwardref\": y, // \\1(a)\n\t\t\"nestedref\": y, // (\\1a|b)+\n\t\t\"ctrlcodeerr\": y, // does \\c error? (vs decompose)\n\t\t\"reftooctalalways\": y, // does a single digit reference \\1 become an octal? (vs remain an unmatched ref)\n\t\t\"substdecomposeref\": y, // will a subst reference decompose? (ex. \\3 becomes \"\\\" & \"3\" if < 3 groups)\n\t\t\"looseesc\": y, // should unrecognized escape sequences match the character (ex. \\u could match \"u\") // disabled when `u` flag is set\n\t\t\"unicodenegated\": y, // \\p{^etc}\"\n\t\t\"namedgroupalt\": y, // if false, only support (?foo)\n\t},\n\t\n\tdocs: {\n\t\t// for example:\n\t\t//possessive: {desc: \"+This will be appended to the existing entry.\" },\n\t\t//namedgroup: {tip: \"This will overwrite the existing entry.\" }\n\t}\n};\n\nexport default core;\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n/*\nThe PCRE profile is almost a straight copy of the core profile.\n*/\nlet y=true, n=false;\n\nlet pcre = {\n\tid: \"pcre\",\n\tlabel: \"PCRE\",\n\tbrowser: false,\n\t\n\tflags: {\n\t\t\"u\": n,\n\t\t\"y\": n\n\t},\n\t\n\tbadEscChars: \"uUlLN\".split(\"\").reduce((o, c) => { o[c] = y; return o}, {}),\n\n\tescCharCodes: {\n\t\t\"v\": n // vertical tab // PCRE support \\v as vertical whitespace\n\t},\n\t\n\ttokens: {\n\t\t\"escunicodeu\": n, // \\uFFFF\n\t\t\"escunicodeub\": n, // \\u{00A9}\n\t\t// octalo PCRE 8.34+\n\t},\n\t\n\tsubstTokens: {\n\t\t\"subst_$esc\": n, // $$\n\t\t\"subst_$&match\": n, // $&\n\t\t\"subst_$before\": n, // $`\n\t\t\"subst_$after\": n // $'\n\t},\n\t\n\tconfig: {\n\t\t\"reftooctalalways\": n, // does a single digit reference \\1 become an octal? (vs remain an unmatched ref)\n\t\t\"substdecomposeref\": n, // will a subst reference decompose? (ex. \\3 becomes \"\\\" & \"3\" if < 3 groups)\n\t\t\"looseesc\": n // should unrecognized escape sequences match the character (ex. \\u could match \"u\") // disabled when `u` flag is set\n\t},\n\t\n\tdocs: {\n\t\t\"escoctal\":{ext:\"+

    The syntax \\\\o{FFF} is also supported.

    \"},\n\t\t\"numref\":{\n\t\t\text:\"

    There are multiple syntaxes for this feature: \\\\1 \\\\g1 \\\\g{1}.

    \"+\n\t\t\t\t\"

    The latter syntaxes support relative values preceded by + or -. For example \\\\g-1 would match the group preceding the reference.

    \"\n\t\t},\n\t\t\"lazy\": { ext:\"+

    This behaviour is reversed by the ungreedy (U) flag/modifier.

    \" }\n\t}\n};\n\nexport default pcre;","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n/*\nThe javascript profile disables a large number of features.\n\nNote that JS warnings are currently added in addJSWarnings in the ExpresssionLexer.\n*/\n\nlet y=true, n=false;\nfunction test(expr, flag) { try { return new RegExp(expr, flag) && undefined; } catch (e) { return n; } }\nfunction testFlag(flag) { return test(\".\", flag); }\nlet unicodeFlag = testFlag(\"u\");\nlet stickyFlag = testFlag(\"y\");\nlet dotallFlag = testFlag(\"s\");\nlet lookbehind = test(\"(?<=A)\");\nlet namedgroup = test(\"(?B)\");\nlet unicodecat = test(\"\\\\p{Ll}\", \"u\"); // disabled when `u` flag is not set\n\n\nlet javascript = {\n\tid: \"js\",\n\tlabel: \"JavaScript\",\n\tbrowser: true,\n\t\n\tflags: {\n\t\t\"s\": dotallFlag, // warning\n\t\t\"x\": n,\n\t\t\"u\": unicodeFlag, // warning\n\t\t\"y\": stickyFlag, // warning\n\t\t\"U\": n\n\t},\n\n\tescCharCodes: {\n\t\t\"a\": n, // bell\n\t\t\"e\": n // escape\n\t},\n\n\tescCharTypes: {\n\t\t\"A\": n, // bos\n\t\t\"G\": n, // prevmatchend\n\t\t\"h\": n, // hwhitespace\n\t\t\"H\": n, // nothwhitespace\n\t\t\"K\": n, // keepout\n\t\t\"N\": n, // notlinebreak\n\t\t\"R\": n, // newline\n\t\t\"v\": n, // vwhitespace\n\t\t\"V\": n, // notvwhitespace\n\t\t\"X\": n, // unicodegrapheme\n\t\t\"Z\": n, // eos\n\t\t\"z\": n // abseos\n\t},\n\n\tunicodeScripts: unicodecat,\n\n\tunicodeCategories: unicodecat,\n\n\tposixCharClasses: n,\n\n\tmodes: n,\n\n\ttokens: {\n\t\t// classes:\n\t\t// also in escCharSpecials and specialChars\n\t\t\"unicodecat\": unicodecat, // \\p{Ll} \\P{^Ll} \\pL\n\t\t\"notunicodecat\": unicodecat, // \\P{Ll} \\p{^Ll} \\PL\n\t\t\"unicodescript\": unicodecat, // \\p{Cherokee} \\P{^Cherokee}\n\t\t\"notunicodescript\": unicodecat, // \\P{Cherokee} \\p{^Cherokee}\n\t\t\"posixcharclass\": n, // [[:alpha:]]\n\n\t\t// esc:\n\t\t// also in escCharCodes and escCharSpecials\n\t\t\"escunicodeub\": unicodeFlag, // \\u{00A9}\n\t\t\"escunicodexb\": n, // \\x{00A9}\n\t\t\"escsequence\": n, // \\Q...\\E\n\t\t\"escoctalo\": n, // \\o{377}\n\n\t\t// group:\n\t\t\"namedgroup\": namedgroup, // (?Pfoo) (?foo) (?'name'foo)\n\t\t\"atomic\": n, // (?>foo|bar)\n\t\t\"define\": n, // (?(DEFINE)foo)\n\t\t\"branchreset\": n, // (?|(a)|(b))\n\n\t\t// lookaround:\n\t\t\"poslookbehind\": lookbehind, // (?<=foo) // warning\n\t\t\"neglookbehind\": lookbehind, // (? \\k'name' \\k{name} (?P=name) \\g{name}\n\t\t\"extnumref\": n, // \\g{-1} \\g{+1} \\g{1} \\g1 \\g-1\n\t\t\"recursion\": n, // (?R) (?0) \\g<0> \\g'0'\n\t\t\"numsubroutine\": n, // \\g<1> \\g'-1' (?1) (?-1)\n\t\t\"namedsubroutine\": n, // \\g \\g'name' (?&name) (?P>name)\n\n\t\t// quantifiers:\n\t\t// also in specialChars\n\t\t\"possessive\": n,\n\n\t\t// special:\n\t\t\"conditional\": n, // (?(?=if)then|else)\n\t\t\"conditionalif\": n, // (?=if) any lookaround\n\t\t\"conditionalelse\": n, // |\n\t\t\"conditionalgroup\": n, // (?(1)a|b) (?(-1)a|b) (?(name)a|b)\n\t\t\"mode\": n, // (?i-x) see modes above\n\t\t\"comment\": n // (?#comment)\n\t},\n\n\tconfig: {\n\t\t\"forwardref\": n, // \\1(a)\n\t\t\"nestedref\": n, // (\\1a|b)+\n\t\t\"ctrlcodeerr\": n, // does \\c error, or decompose?\n\t\t\"unicodenegated\": n, // \\p{^etc}\n\t\t\"namedgroupalt\": n, // if false, only support (?foo)\n\t},\n\t\n\tsubstTokens: {\n\t\t\"subst_0match\": n, // $0 \\0 \\{0}\n\t\t\"subst_$bgroup\": n, // ${1} ${99}\n\t\t\"subst_bsgroup\": n // \\1 \\99\n\t},\n\t\n\tdocs: {\n\t\t\"subst_group\": {ext:\"\"}, // remove other syntaxes.\n\t\t\"namedgroup\": {ext:\"\"}, // remove other syntaxes.\n\t\t\"unicodecat\": {\n\t\t\text: \"

    Requires the u flag.

    \"+\n\t\t\t\"

    For a list of values, see this MDN page.

    \"\n\t\t},\n\t\t// notunicodecat, unicodescript, notunicodescript are copied from unicodecat below.\n\t}\n};\n\njavascript.docs.notunicodecat = javascript.docs.unicodescript = javascript.docs.notunicodescript = javascript.docs.unicodecat;\n\nexport default javascript;\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport core from \"./core\";\nimport pcre from \"./pcre\";\nimport js from \"./javascript\";\n\nlet profiles = {core};\nexport default profiles;\n\nprofiles.pcre = merge(core, pcre);\nprofiles.js = merge(core, js);\n\nfunction merge(p1, p2) {\n\t// merges p1 into p2, essentially just a simple deep copy without array support.\n\tfor (let n in p1) {\n\t\tif (p2[n] === false) { continue; }\n\t\telse if (typeof p1[n] === \"object\") { p2[n] = merge(p1[n], p2[n] || {}); }\n\t\telse if (p2[n] === undefined) { p2[n] = p1[n]; }\n\t}\n\treturn p2;\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport CMUtils from \"../utils/CMUtils\";\nimport Utils from \"../utils/Utils\";\nimport Track from \"../utils/Track\";\n\nimport List from \"../controls/List\";\nimport ExpressionLexer from \"../ExpressionLexer\";\nimport ExpressionHighlighter from \"./ExpressionHighlighter\";\nimport ExpressionHover from \"./ExpressionHover\";\nimport profiles from \"../profiles/profiles\";\nimport EventDispatcher from \"../events/EventDispatcher\"\n\nimport app from \"../app\";\n\nexport default class Expression extends EventDispatcher {\n\tconstructor (el) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis.delim = \"/\";\n\t\tthis.lexer = new ExpressionLexer();\n\t\t\n\t\tthis._initUI(el);\n\t\tapp.flavor.on(\"change\", ()=> this._onFlavorChange());\n\t\tthis._onFlavorChange();\n\t}\n\t\n\tset value(expression) {\n\t\tlet regex = Utils.decomposeRegEx(expression || Expression.DEFAULT_EXPRESSION, this.delim);\n\t\tthis.pattern = regex.source;\n\t\tthis.flags = regex.flags;\n\t}\n\t\n\tget value() {\n\t\treturn this.editor.getValue();\n\t}\n\t\n\tset pattern(pattern) {\n\t\tlet index = this.editor.getValue().lastIndexOf(this.delim);\n\t\tthis.editor.replaceRange(pattern, {line: 0, ch: 1}, {line: 0, ch: index});\n\t\tthis._deferUpdate();\n\t}\n\t\n\tget pattern() {\n\t\treturn Utils.decomposeRegEx(this.editor.getValue(), this.delim).source;\n\t}\n\t\n\tset flags(flags) {\n\t\tflags = app.flavor.validateFlagsStr(flags);\n\t\tlet str = this.editor.getValue(), index = str.lastIndexOf(this.delim);\n\t\tthis.editor.replaceRange(flags, {line: 0, ch: index + 1}, {line: 0, ch: str.length }); // this doesn't work if readOnly is false.\n\t}\n\t\n\tget flags() {\n\t\treturn Utils.decomposeRegEx(this.editor.getValue(), this.delim).flags;\n\t}\n\t\n\tget token() {\n\t\treturn this.lexer.token;\n\t}\n\t\n\tshowFlags() {\n\t\tthis.flagsList.selected = this.flags.split(\"\");\n\t\tapp.tooltip.toggle.toggleOn(\"flags\", this.flagsEl, this.flagsBtn, true, -2);\n\t}\n\n\ttoggleFlag(s) {\n\t\tlet flags = this.flags, i = flags.indexOf(s);\n\t\tthis.flags = i>=0 ? flags.replace(s, \"\") : flags+s;\n\t}\n\t\n\tshowFlavors() {\n\t\tapp.tooltip.toggle.toggleOn(\"flavor\", this.flavorEl, this.flavorBtn, true, -2)\n\t}\n\t\n\tinsert(str) {\n\t\tthis.editor.replaceSelection(str, \"end\");\n\t}\n\n\tselectAll() {\n\t\tCMUtils.selectAll(this.editor);\n\t}\n\t\n// private methods:\n\t_initUI(el) {\n\t\tthis.editorEl = $.query(\"> .editor\", el);\n\t\tlet editor = this.editor = CMUtils.create(this.editorEl, {\n\t\t\tautofocus: true,\n\t\t\tmaxLength: 2500,\n\t\t\tsingleLine: true\n\t\t}, \"100%\", \"100%\");\n\t\t\n\t\teditor.on(\"mousedown\", (cm, evt)=> this._onEditorMouseDown(cm, evt));\n\t\teditor.on(\"change\", (cm, evt)=> this._onEditorChange(cm, evt));\n\t\teditor.on(\"keydown\", (cm, evt)=> this._onEditorKeyDown(cm, evt));\n\t\t// hacky method to disable overwrite mode on expressions to avoid overwriting flags:\n\t\teditor.toggleOverwrite = ()=>{};\n\t\t\n\t\tthis.errorEl = $.query(\".icon.alert\", this.editorEl);\n\t\tthis.errorEl.addEventListener(\"mouseenter\", (evt)=>this._onMouseError(evt));\n\t\tthis.errorEl.addEventListener(\"mouseleave\", (evt)=>this._onMouseError(evt));\n\t\t\n\t\tthis.highlighter = new ExpressionHighlighter(editor);\n\t\tthis.hover = new ExpressionHover(editor, this.highlighter);\n\t\t\n\t\tthis._setInitialExpression();\n\t\tthis._initTooltips(el);\n\t\tthis.value = Expression.DEFAULT_EXPRESSION;\n\t}\n\t\n\t_setInitialExpression() {\n\t\tlet editor = this.editor;\n\t\teditor.setValue(\"/./g\");\n\t\t\n\t\t// leading /\n\t\teditor.getDoc().markText({line: 0, ch: 0}, {\n\t\t\tline: 0,\n\t\t\tch: 1\n\t\t}, {\n\t\t\tclassName: \"exp-decorator\",\n\t\t\treadOnly: true,\n\t\t\tatomic: true,\n\t\t\tinclusiveLeft: true\n\t\t});\n\t\t\n\t\t// trailing /g\n\t\teditor.getDoc().markText({line: 0, ch: 2}, {\n\t\t\tline: 0,\n\t\t\tch: 4\n\t\t}, {\n\t\t\tclassName: \"exp-decorator\",\n\t\t\treadOnly: false,\n\t\t\tatomic: true,\n\t\t\tinclusiveRight: true\n\t\t});\n\t\tthis._deferUpdate();\n\t}\n\t\n\t_deferUpdate() {\n\t\tUtils.defer(()=>this._update(), \"Expression._update\");\n\t}\n\t\n\t_update() {\n\t\tlet expr = this.editor.getValue();\n\t\tthis.lexer.profile = app.flavor.profile;\n\t\tlet token = this.lexer.parse(expr);\n\t\t$.toggleClass(this.editorEl, \"error\", !!this.lexer.errors.length);\n\t\tthis.hover.token = token;\n\t\tthis.highlighter.draw(token);\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\t\n\t_initTooltips(el) {\n\t\tconst template = $.template` ${\"label\"}`;\n\t\tlet flavorData = app.flavor.profiles.map((o)=>({id:o.id, label:o.label+\" (\"+(o.browser?\"Browser\":\"Server\")+\")\"}));\n\t\t\n\t\tthis.flavorBtn = $.query(\"section.expression .button.flavor\", el);\n\t\tthis.flavorEl = $.query(\"#library #tooltip-flavor\");\n\t\tthis.flavorList = new List($.query(\"ul.list\", this.flavorEl), {data:flavorData, template});\n\t\tthis.flavorList.on(\"change\", ()=>this._onFlavorListChange());\n\t\tthis.flavorBtn.addEventListener(\"click\", (evt) => this.showFlavors());\n\t\t$.query(\".icon.help\", this.flavorEl).addEventListener(\"click\", ()=> app.sidebar.goto(\"engine\"));\n\t\t\n\t\tthis.flagsBtn = $.query(\"section.expression .button.flags\", el);\n\t\tthis.flagsEl = $.query(\"#library #tooltip-flags\");\n\t\tthis.flagsList = new List($.query(\"ul.list\", this.flagsEl), {data:[], multi:true, template});\n\t\tthis.flagsList.on(\"change\", ()=> this._onFlagListChange());\n\t\tthis.flagsBtn.addEventListener(\"click\", (evt) => this.showFlags());\n\t\t$.query(\".icon.help\", this.flagsEl).addEventListener(\"click\", ()=> app.sidebar.goto(\"flags\"));\n\t}\n\n// event handlers:\n\t_onFlavorListChange() {\n\t\tapp.tooltip.toggle.hide(\"flavor\");\n\t\tapp.flavor.value = this.flavorList.selected;\n\t\tTrack.page(\"flavor/\"+this.flavorList.selected);\n\t}\n\t\n\t_onFlagListChange() {\n\t\tlet sel = this.flagsList.selected;\n\t\tthis.flags = sel ? sel.join(\"\") : \"\";\n\t\tTrack.event(\"set_flags\", \"engagement\", this.flags);\n\t}\n\t\n\t_onFlavorChange() {\n\t\tlet flavor = app.flavor, profile = flavor.profile;\n\t\tthis.flavorList.selected = profile.id;\n\t\t$.query(\"> .label\", this.flavorBtn).innerText = profile.label;\n\t\t\n\t\tlet supported = Expression.FLAGS.split(\"\").filter((n)=>!!profile.flags[n]);\n\t\tlet labels = Expression.FLAG_LABELS;\n\t\tthis.flagsList.data = supported.map((n)=>({id:n, label:labels[n]}));\n\t\tthis.flags = this.flags.split(\"\").filter((n)=>!!profile.flags[n]).join(\"\");\n\t}\n\t\n\t_onEditorMouseDown(cm, evt) {\n\t\t// offset by half a character to make accidental clicks less likely:\n\t\tlet index = CMUtils.getCharIndexAt(cm, evt.clientX - cm.defaultCharWidth() * 0.6, evt.clientY);\n\t\tif (index >= cm.getValue().lastIndexOf(this.delim)) {\n\t\t\tthis.showFlags();\n\t\t}\n\t}\n\t\t\n\t\n\t_onEditorChange(cm, evt) {\n\t\t// catches pasting full expressions in.\n\t\t// TODO: will need to be updated to work with other delimeters\n\t\tthis._deferUpdate();\n\t\tlet str = evt.text[0];\n\t\tif (str.length < 3 || !str.match(/^\\/.+[^\\\\]\\/[a-z]*$/ig) || evt.from.ch !== 1 || evt.to.ch != 1 + evt.removed[0].length) {\n\t\t\t// not pasting a full expression.\n\t\t\treturn;\n\t\t}\n\t\tthis.value = str;\n\t}\n\t\n\t_onEditorKeyDown(cm, evt) {\n\t\t// Ctrl or Command + D by default, will delete the expression and the flags field, Re: https://github.com/gskinner/regexr/issues/74\n\t\t// So we just manually reset to nothing here.\n\t\tif ((evt.ctrlKey || evt.metaKey) && evt.keyCode == 68) {\n\t\t\tevt.preventDefault();\n\t\t\tthis.pattern = \"\";\n\t\t}\n\t}\n\t\n\t_onMouseError(evt) {\n\t\tlet tt = app.tooltip.hover, errs = this.lexer.errors;\n\t\tif (evt.type === \"mouseleave\") { return tt.hide(\"error\"); }\n\t\tif (errs.length === 0) { return; }\n\t\tlet err = errs.length === 1 && errs[0].error;\n\t\tlet str = err ? app.reference.getError(err, errs[0]) : \"Problems in the Expression are underlined in red. Roll over them for details.\";\n\t\tlet label = err && err.warning ? \"WARNING\" : \"PARSE ERROR\";\n\t\ttt.showOn(\"error\", \"\"+label+\": \"+str, this.errorEl);\n\t}\n\t\n}\n\nExpression.DEFAULT_EXPRESSION = \"/([A-Z])\\\\w+/g\";\n\nExpression.FLAGS = \"gimsuxyU\"; // for flag order\nExpression.FLAG_LABELS = {\n\t\"g\": \"global\",\n\t\"i\": \"case insensitive\",\n\t\"m\": \"multiline\",\n\t\"s\": \"single line (dotall)\",\n\t\"u\": \"unicode\",\n\t\"x\": \"extended\",\n\t\"y\": \"sticky\",\n\t\"U\": \"Ungreedy\"\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nlet UID = {\n\t_next: 0,\n\tget id() { return Date.now() + \"_\" + this._next++; },\n\tassign(list, force=false) {\n\t\tlist.forEach((o) => o.id = o.id == null || force ? this.id : o.id );\n\t}\n};\nexport default UID;\n\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"../utils/Utils\";\n\nexport default class TextHighlighter {\n\tconstructor(editor, canvas, fill = \"#6CF\", stroke=\"#888\") {\n\t\tthis.lineSpacing = 2;\n\t\tthis.capWidth = 4;\n\t\tthis.lastBottom = -1;\n\t\tthis.lastRight = -1;\n\t\tthis.editor = editor;\n\t\tthis.canvas = canvas;\n\t\tthis.fill = fill;\n\t\tthis.stroke = stroke;\n\t}\n\t\n\tset matches(val) {\n\t\tthis._matches = val;\n\t\tthis._deferUpdate();\n\t}\n\t\n\tset hoverMatch(val) {\n\t\tthis._hoverMatch = val;\n\t\tthis._deferUpdate();\n\t}\n\t\n\tset selectedMatch(val) {\n\t\tthis._selectedMatch = val;\n\t\tthis._deferUpdate();\n\t}\n\n\tredraw() {\n\t\tthis._update();\n\t}\n\t\n\t_deferUpdate() {\n\t\tUtils.defer(()=>this._update(), \"TextHighlighter._update\");\n\t}\n\t\n\t_update() {\n\t\tthis.clear();\n\t\tlet matches = this._matches, hoverMatch = this._hoverMatch, selectedMatch = this._selectedMatch;\n\t\tif (!matches || !matches.length) { return; }\n\t\t\n\t\n\t\tlet cm = this.editor, doc = cm.getDoc()\n\t\tlet ctx = this.canvas.getContext(\"2d\");\n\t\tctx.fillStyle = this.fill;\n\t\tctx.strokeStyle = this.stroke;\n\t\tctx.lineWidth = 2;\n\t\n\t\t// find the range of the visible text:\n\t\tlet scroll = cm.getScrollInfo();\n\t\tlet top = cm.indexFromPos(cm.coordsChar({\n\t\t\tleft: 0,\n\t\t\ttop: scroll.top\n\t\t}, \"local\"));\n\t\tlet bottom = cm.indexFromPos(cm.coordsChar({\n\t\t\tleft: scroll.clientWidth,\n\t\t\ttop: scroll.top + scroll.clientHeight\n\t\t}, \"local\"));\n\t\n\t\tfor (let i = 0, l = matches.length; i < l; i++) {\n\t\t\tlet match = matches[i], start = match.i, end = match.i+match.l-1;\n\t\t\t\n\t\t\tif (start > bottom) { break; } // all done.\n\t\t\tif (end < top || end < start) { continue; } // not visible, so don't mark.\n\t\t\tlet startPos = match.startPos || (match.startPos = doc.posFromIndex(start));\n\t\t\tlet endPos = match.endPos || (match.endPos = doc.posFromIndex(end));\n\t\t\tlet emphasis = match === hoverMatch || match === selectedMatch;\n\t\n\t\t\tlet startRect = cm.charCoords(startPos, \"local\"), endRect = cm.charCoords(endPos, \"local\");\n\t\n\t\t\tif (startRect.bottom === endRect.bottom) {\n\t\t\t\tthis.drawHighlight(ctx, startRect.left, startRect.top, endRect.right, endRect.bottom, scroll.top, false, false, emphasis);\n\t\t\t} else {\n\t\t\t\tlet lw = cm.getScrollInfo().width, lh = cm.defaultTextHeight();\n\t\t\t\t// render first line:\n\t\t\t\tthis.drawHighlight(ctx, startRect.left, startRect.top, lw - 2, startRect.bottom, scroll.top, false, true, emphasis); // startRect.top+lh\n\t\t\t\t// render lines in between:\n\t\t\t\tlet y = startRect.top;\n\t\t\t\twhile ((y += lh) < endRect.top - 1) { // the -1 is due to fractional issues on FF\n\t\t\t\t\tthis.drawHighlight(ctx, 0, y, lw - 2, y + startRect.bottom - startRect.top, scroll.top, true, true, emphasis); // lh\n\t\t\t\t}\n\t\t\t\t// render last line:\n\t\t\t\tthis.drawHighlight(ctx, 0, endRect.top, endRect.right, endRect.bottom, scroll.top, true, false, emphasis);\n\t\t\t\t// CMUtils.getEOLPos(this.sourceCM, startPos);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tdrawHighlight(ctx, left, top, right, bottom, scrollY, startCap, endCap, emphasis) {\n\t\tlet capW = this.capWidth;\n\t\n\t\tif (right < 0 || left + 1 >= right) { return; } // weird bug in CodeMirror occasionally returns negative values\n\t\tleft = left + 0.5 | 0;\n\t\tright = right + 0.5 | 0;\n\t\ttop = (top + 0.5 | 0) + this.lineSpacing;\n\t\tbottom = bottom + 0.5 | 0;\n\t\n\t\tif (top + 1 > this.lastBottom) {\n\t\t\tthis.lastBottom = bottom;\n\t\t}\n\t\telse if (left < this.lastRight) {\n\t\t\tleft = this.lastRight;\n\t\t}\n\t\tthis.lastRight = right;\n\t\t\n\t\tlet a = ctx.globalAlpha;\n\t\tif (startCap) {\n\t\t\tctx.globalAlpha = a * 0.5;\n\t\t\tctx.fillRect(left + 1 | 0, top - scrollY, capW + 1, bottom - top);\n\t\t\tleft += capW;\n\t\t}\n\t\tif (endCap) {\n\t\t\tctx.globalAlpha = a * 0.5;\n\t\t\tctx.fillRect(right - capW - 1 | 0, top - scrollY, capW + 1, bottom - top);\n\t\t\tright -= capW;\n\t\t}\n\t\tctx.globalAlpha = a;\n\t\tctx.fillRect(left + 1, top - scrollY, right - left - 1, bottom - top);\n\n\t\tif (emphasis) {\n\t\t\tctx.strokeRect(left + 1, top - scrollY, right - left - 1, bottom - top);\n\t\t}\n\t}\n\t\n\tclear() {\n\t\tthis.canvas.width = this.canvas.width;\n\t\tthis.lastBottom = -1;\n\t}\n}\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport CMUtils from \"../utils/CMUtils\";\nimport $ from \"../utils/DOMUtils\";\n\nimport app from \"../app\";\n\nexport default class TextHover {\n\tconstructor (editor, highlighter) {\n\t\tthis.editor = editor;\n\t\tthis.highlighter = highlighter;\n\t\tthis._matches = this._x = null;\n\t\t\n\t\tlet o = editor.display.lineDiv;\n\t\to.addEventListener(\"mousemove\", (evt)=> this._handleMouseMove(evt));\n\t\to.addEventListener(\"mouseout\", (evt)=> this._handleMouseOut(evt));\n\t}\n\n\tset matches(val) {\n\t\tthis._matches = val;\n\t\tthis._update();\n\t}\n\n// private methods:\n\t_handleMouseMove(evt) {\n\t\tthis._x = evt.clientX;\n\t\tthis._y = evt.clientY + window.pageYOffset;\n\t\tthis._update();\n\t}\n\t\n\t_handleMouseOut(evt) {\n\t\tthis._x = null;\n\t\tthis._update();\n\t}\n\n\t_update() {\n\t\tif (this._x === null) {\n\t\t\tthis.highlighter.hoverMatch = null;\n\t\t\tapp.tooltip.hover.hide(\"TextHover\");\n\t\t\treturn;\n\t\t}\n\t\tlet index, cm = this.editor, match, matches = this._matches, x = this._x, y = this._y;\n\t\t\n\t\tif (matches && matches.length && (index = CMUtils.getCharIndexAt(cm, x, y)) != null) {\n\t\t\tmatch = this.highlighter.hoverMatch = app.text.getMatchAt(index);\n\t\t}\n\t\tlet rect = (index != null) && CMUtils.getCharRect(cm, index);\n\t\tif (rect) { rect.right = rect.left = x; }\n\t\tlet tip = app.reference.tipForMatch(match, cm.getValue());\n\t\tif (tip) {\n\t\t\tlet div = $.create(\"div\", \"texthover\", tip);\n\t\t\tapp.tooltip.hover.show(\"TextHover\", div, x, rect.bottom, true, 0);\n\t\t}\n\t\t\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n/*\nTODO:\nAdd analytics.\nSave / load - don't forget to assign IDs on load.\nServer solve.\nIssue with CM not updating in Text when loading pattern in Test mode.\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils\";\nimport UID from \"../utils/UID\";\nimport CMUtils from \"../utils/CMUtils\";\nimport TextHighlighter from \"./TextHighlighter\";\nimport TextHover from \"./TextHover\";\nimport EventDispatcher from \"../events/EventDispatcher\";\nimport List from \"../controls/List\";\nimport Track from \"../utils/Track\";\n\nimport app from \"../app\";\n\nexport default class Text extends EventDispatcher {\n\tconstructor (el) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis._initUI(el);\n\t\tthis._initTestUI(el);\n\t\tapp.on(\"result\", () => this._setResult(app.result));\n\t\tapp.theme.on(\"change\", () => this._handleThemeChange());\n\t}\n\t\n\tset value(val) {\n\t\tthis.editor.setValue(val || this.defaultText);\n\t}\n\t\n\tget value() {\n\t\treturn this.editor.getValue();\n\t}\n\n\tset tests(val) {\n\t\tif (!(val instanceof Array)) {\n\t\t\tval = [];\n\t\t\t$.removeClass(this.testsEl, \"tests-added\");\n\t\t}\n\t\tthis._tests = this.testList.data = val;\n\t\tthis._testMatches = null;\n\t\tthis._reselectTest();\n\t}\n\n\tget tests() {\n\t\treturn this._tests;\n\t}\n\n\tset mode(val) {\n\t\tif (val === this.mode) { return; }\n\t\tthis.modeList.selected = val || \"text\";\n\t\tthis._handleModeChange();\n\t}\n\n\tget mode() {\n\t\treturn this.modeList.selected;\n\t}\n\t\n\tget selectedMatch() {\n\t\tlet cm = this.editor;\n\t\treturn this.getMatchAt(cm.indexFromPos(cm.getCursor()), true);\n\t}\n\t\n\tgetMatchValue(match) {\n\t\t// this also works for groups.\n\t\treturn match ? this.value.substr(match.i, match.l) : null;\n\t}\n\t\n\tgetMatchAt(index, inclusive) {\n\t\t// also used by TextHover\n\t\tlet match, offset=(inclusive ? -1 : 0), matches=this._result && this._result.matches;\n\t\tif (!matches) { return null; }\n\t\tfor (let i = 0, l = matches.length; i < l; i++) {\n\t\t\tmatch = matches[i];\n\t\t\tif (match.l+match.i-1 < index + offset) { continue; }\n\t\t\tif (match.i > index) { break; }\n\t\t\treturn match;\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetEmptyTest() {\n\t\treturn {\n\t\t\tid: UID.id,\n\t\t\tname: \"\",\n\t\t\ttext: \"Enter your test text here.\",\n\t\t\ttype: \"any\"\n\t\t}\n\t}\n\t\n// private methods:\n\t_initUI(el) {\n\t\tthis.resultEl = $.query(\"> header .result\", el);\n\t\tthis.resultEl.addEventListener(\"mouseenter\", (evt)=>this._mouseResult(evt));\n\t\tthis.resultEl.addEventListener(\"mouseleave\", (evt)=>this._mouseResult(evt));\n\n\t\tthis.modeListEl = $.query(\"> header .modelist\", el);\n\t\tlet data = [\"Text\", \"Tests\"].map((val) => ({label:val, id:val.toLowerCase()}));\n\t\tthis.modeList = new List(this.modeListEl, {data});\n\t\tthis.modeList.on(\"change\", ()=> this._handleModeChange());\n\t\tthis.modeList.selected = \"text\";\n\t\t\n\t\tlet textEl = $.query(\".editor > .pad\", el);\n\t\tthis.defaultText = $.query(\"textarea\", textEl).value;\n\t\tlet editor = this.editor = CMUtils.create($.empty(textEl), {lineWrapping: true}, \"100%\", \"100%\");\n\t\teditor.setValue(this.defaultText);\n\t\t\n\t\teditor.on(\"change\", ()=> this._change());\n\t\teditor.on(\"scroll\", ()=> this._update());\n\t\teditor.on(\"cursorActivity\", () => this._updateSelected());\n\t\t\n\t\tlet detector = $.create(\"iframe\", \"resizedetector\", null, textEl), win = detector.contentWindow;\n\t\tlet canvas = this.canvas = $.create(\"canvas\", \"highlights\", null, textEl);\n\t\ttextEl.appendChild(editor.display.wrapper); // move the editor on top of the iframe & canvas.\n\n\t\twin.onresize = ()=> {\n\t\t\tlet w = win.innerWidth|0, h = win.innerHeight|0;\n\t\t\tthis._startResize();\n\t\t\tUtils.defer(() => this._handleResize(w, h), \"text_resize\", 250);\n\t\t};\n\t\twin.onresize();\n\t\t\n\t\tthis.highlighter = new TextHighlighter(editor, canvas, $.getCSSValue(\"match\", \"color\"), $.getCSSValue(\"selected-stroke\", \"color\"));\n\t\tthis.hover = new TextHover(editor, this.highlighter);\n\t}\n\n\t_handleThemeChange() {\n\t\tthis.highlighter.fill = $.getCSSValue(\"match\", \"color\");\n\t\tthis.highlighter.stroke = $.getCSSValue(\"selected-stroke\", \"color\");\n\t\tthis.highlighter.redraw();\n\t}\n\n\t_handleModeChange(evt) {\n\t\tthis.dispatchEvent(\"modechange\");\n\t\tif (this.mode === \"text\") { this.editor.refresh(); }\n\t\telse { $.addClass(this.el, \"tests-viewed\"); }\n\n\t\tTrack.page(\"mode/\"+this.mode);\n\t}\n\t\n\t_setResult(val) {\n\t\tthis._result = val;\n\t\tthis._testMatches = null;\n\n\t\tif (this.mode !== val.mode) { return; }\n\t\tif (val.mode === \"tests\") {\n\t\t\tthis._updateTests();\n\t\t} else { // mode === \"text\"\n\t\t\tthis._updateEmptyCount();\n\t\t\tthis._updateResult();\n\t\t\tthis._updateSelected();\n\t\t\tthis._deferUpdate();\n\t\t}\n\t}\n\t\n\t_deferUpdate() {\n\t\tUtils.defer(()=>this._update(), \"Text._update\");\n\t}\n\t\n\t_update() {\n\t\tlet result = this._result, matches = result && result.matches;\n\t\tif (result && result.mode === \"tests\") {\n\t\t\tthis._updateTests();\n\t\t} else { // mode === \"text\"\n\t\t\tthis.hover.matches = this.highlighter.matches = matches;\n\t\t}\n\t}\n\t\n\t_updateResult() {\n\t\tlet result = this._result, matches=result&&result.matches, l=matches&&matches.length, text;\n\t\t\n\t\tif (l && result && !result.error) {\n\t\t\ttext = l + \" match\" + (l>1?\"es\":\"\") + (this._emptyCount?\"*\":\"\");\n\t\t} else if (!result || !result.error) {\n\t\t\ttext = \"No match\";\n\t\t}\n\t\tthis._showResult(text);\n\t}\n\n\t_showResult(text, clss) {\n\t\tlet result = this._result, el = this.resultEl;\n\t\t$.removeClass(el, \"error warning matches pass fail\");\n\n\t\tif (result && result.error) {\n\t\t\tif (!text) { text = result.error.warning ? \"WARNING\" : \"ERROR\"; }\n\t\t\t$.addClass(el, \"error\");\n\t\t\tif (result.error.warning) { $.addClass(el, \"warning\"); }\n\t\t}\n\n\t\tif (clss) { $.addClass(el, clss); }\n\t\tel.innerHTML = text;\n\t\tif (result.time != null) { el.innerHTML += \" (\"+parseFloat(result.time).toFixed(1)+\"ms)\"; }\n\t}\n\t\n\t_updateSelected() {\n\t\tlet match = this.selectedMatch;\n\t\tif (this.highlighter.selectedMatch === match) { return; }\n\t\tthis.highlighter.selectedMatch = match;\n\t\tthis.dispatchEvent(\"select\");\n\t}\n\t\n\t_change() {\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\n\t_startResize() {\n\t\tlet canvas = this.canvas, style=canvas.style;\n\t\tstyle.visibility = \"hidden\";\n\t\tstyle.opacity = 0;\n\t\t// keeps it from causing scrollbars:\n\t\tcanvas.width = canvas.height = 1;\n\t}\n\t\n\t_mouseResult(evt) {\n\t\tlet tt = app.tooltip.hover, res=this._result, err = res&&res.error, str=\"\";\n\t\tif (evt.type === \"mouseleave\") { return tt.hide(\"result\"); }\n\t\tif (err && !err.warning) {\n\t\t\tstr = \"EXEC ERROR: \" + this._errorText(err);\n\t\t} else {\n\t\t\tif (err && err.warning) {\n\t\t\t\tstr = \"WARNING: \"+ this._errorText(err) + \"
    \";\n\t\t\t}\n\t\t\tlet l = this._tests.length;\n\t\t\tif (this.mode === \"tests\") {\n\t\t\t\tif (this._tests.length === 0) {\n\t\t\t\t\tstr += \"Use the 'Add Test' button to create a new test.\";\n\t\t\t\t} else if (this._testFails) {\n\t\t\t\t\tstr += this._testFails+\" out of \"+l+\" tests failed.\";\n\t\t\t\t} else {\n\t\t\t\t\tstr += \"All \"+l+\" tests passed.\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr += (l||\"No\")+\" match\"+(l>1?\"es\":\"\")+\" found in \"+this.value.length+\" characters\";\n\t\t\t\tstr += this._emptyCount ? \", including \"+this._emptyCount+\" empty matches (* not displayed).\" : \".\";\n\t\t\t\tlet cm = this.editor, sel = cm.listSelections()[0], pos = sel.head;\n\t\t\t\tlet i0 = cm.indexFromPos(pos), i1=cm.indexFromPos(sel.anchor), range=Math.abs(i0-i1);\n\t\t\t\tstr += \"
    Insertion point: line \"+pos.line+\", col \"+pos.ch+\", index \"+i0;\n\t\t\t\tstr += (range>0 ? \" (\"+range+\" character\"+(range===1?\"\":\"s\")+\" selected)\" : \"\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\ttt.showOn(\"result\", str, this.resultEl, false, -2);\n\t}\n\n\t_updateEmptyCount() {\n\t\tlet result = this._result, matches = result && result.matches;\n\t\tthis._emptyCount = matches ? matches.reduce((v,o)=>v+(o.l?0:1),0) : 0;\n\t}\n\n\t_errorText(err) {\n\t\treturn err.message || app.reference.getError(err);\n\t}\n\t\n\t_handleResize(w, h) {\n\t\tlet canvas = this.canvas, style=canvas.style;\n\t\tstyle.visibility = style.opacity = \"\";\n\t\tcanvas.width = w;\n\t\tcanvas.height = h;\n\t\tthis.editor.refresh();\n\t\tthis._deferUpdate();\n\t}\n\n// Test mode:\n\t_initTestUI(el) {\n\t\tconst types = [\n\t\t\t{id:\"all\", label:\"Match Full\"},\n\t\t\t{id:\"any\", label:\"Match Any\"},\n\t\t\t// {id:\"start\", label:\"Match Start\"},\n\t\t\t{id:\"none\", label:\"Match None\"},\n\t\t];\n\t\tthis.typeLabels = types.reduce((o, t) => { o[t.id] = t.label; return o; }, {});\n\n\t\tthis.testsEl = $.query(\".tests\", el);\n\t\tthis.testItemEl = $.query(\"#library > #tests_item\");\n\t\tthis.testListEl = $.query(\".list\", this.testsEl);\n\t\tthis.testList = new List(this.testListEl, {template:(o) => this._testItemTemplate(o)});\n\t\tthis.testList.scrollEl = this.testsEl;\n\n\t\tthis.testList.on(\"change\", (evt) => this._handleTestChange(evt));\n\n\t\t$.on($.queryAll(\".button.add\", el), \"click\", ()=>this._addTest());\n\n\t\tconst template = $.template` ${\"label\"}`;\n\t\tthis.typesEl = $.query(\"#library #tooltip-testtypes\");\n\t\tthis.typesList = new List($.query(\"ul.list\", this.typesEl), {data:types, template});\n\t\tthis.typesList.on(\"change\", ()=> this._handleTypesChange());\n\n\t\tthis.tests = null;\n\t}\n\n\t_updateTests() {\n\t\tlet result = this._result;\n\t\tif (result.error) { return this._showResult(); }\n\n\t\tlet data = this._tests, l=data.length;\n\t\tif (!data || !l) { return this._showResult(\"No tests.\"); }\n\t\t\n\t\tlet matches = result.matches.reduce((o, t) => { o[t.id] = t; return o; }, {}), fails=0;\n\t\tfor (let i=0; i this._showTypes(typeBtn, o));\n\n\t\tlet delBtn = $.query(\"header .delete\", el);\n\t\tdelBtn.addEventListener(\"click\", (evt) => this._deleteTest(o));\n\n\t\tlet nameFld = $.query(\"header .name\", el);\n\t\tnameFld.addEventListener(\"input\", () => this._handleTestNameChange(nameFld, o));\n\n\t\tthis._updateTestHeader(o, el, false);\n\n\t\treturn el;\n\t}\n\n\t_updateTestHeader(o, el, edit) {\n\t\tlet nameFld = $.query(\"header .name\", el);\n\t\tnameFld.value = o.name||\"\";\n\t\tnameFld.placeholder = o.text && !edit ? o.text.substr(0, 100) : \"Untitled Test\";\n\n\t\tlet typeLbl = $.query(\"header .button.type .label\", el);\n\t\ttypeLbl.innerText = this.typeLabels[o.type];\n\t}\n\n\t_addTest() {\n\t\tconst o = this.getEmptyTest();\n\t\tthis._tests.push(o);\n\t\tthis.testList.addItem(o, true);\n\t\tthis._handleTestChange();\n\t\tthis.testEditor.execCommand(\"selectAll\");\n\t\t$.addClass(this.testsEl, \"tests-added\");\n\t\tthis._change();\n\t}\n\n\t_reselectTest() {\n\t\tif (this._selTest) {\n\t\t\tthis.testList.selected = this._selTest.id;\n\t\t}\n\t\tif (!this._selTest || this.testList.selected == null) {\n\t\t\tthis.testList.selectedIndex = 0;\n\t\t}\n\t\tthis._selTest = null;\n\t\tthis._handleTestChange();\n\t}\n\n\t_handleTestChange() {\n\t\tlet el, o;\n\t\tif (this._selTest) {\n\t\t\to = this._selTest;\n\t\t\tel = this.testList.getEl(o.id);\n\t\t\tthis._updateTestHeader(o, el, false);\n\t\t}\n\n\t\tel = this.testList.selectedEl;\n\t\to = this._selTest = this.testList.selectedItem;\n\n\t\tif (!o) { return; }\n\n\t\tthis._getTestEditor($.query(\"article .editor .pad\", el), o);\n\t\tthis._updateTestHeader(o, el, true);\n\t\tthis._updateSelTest();\n\t\tthis.testEditor.focus();\n\t\tthis.testEditor.setCursor(this.testEditor.lineCount(), 0);\n\t}\n\n\t_handleTestNameChange(fld, o) {\n\t\to.name = fld.value;\n\t\tthis._change();\n\t}\n\n\t_handleTypesChange() {\n\t\tlet el = this.testList.selectedEl, o = this.testList.selectedItem;\n\t\to.type = this.typesList.selectedItem.id;\n\t\tapp.tooltip.toggle.hide(\"testtypes\");\n\t\tthis._updateTestHeader(o, el, true);\n\t\tthis._change();\n\t}\n\n\t_handleTestTextChange(change) {\n\t\tthis._selTest.text = this.testEditor.getValue();\n\t\tif (change.origin !== \"setValue\") { this._change(); }\n\t}\n\n\t_showTypes(el, o) {\n\t\tthis.typesList.selected = o.type;\n\t\tapp.tooltip.toggle.toggleOn(\"testtypes\", this.typesEl, el, true, -2);\n\t}\n\n\t_deleteTest(o) {\n\t\tlet data = this._tests;\n\t\tlet i = data.indexOf(o);\n\t\tdata.splice(i, 1);\n\t\tthis._selTest = null;\n\t\tthis.testList.removeItem(o.id);\n\t\tif (data.length) { this.testList.selected = data[Math.min(i, data.length-1)].id; }\n\t\tthis._updateTests();\n\t\tthis._handleTestChange();\n\t\tthis._change();\n\t}\n\n\t_getTestEditor(el, o) {\n\t\tlet cm = this.testEditor;\n\t\tif (!cm) {\n\t\t\tcm = this.testEditor = CMUtils.create($.empty(el), {lineWrapping: true}, \"100%\", \"100%\");\n\t\t\tcm.on(\"change\", (a, b) => this._handleTestTextChange(b));\n\t\t} else {\n\t\t\tel.appendChild(cm.getWrapperElement());\n\t\t}\n\t\tcm.setValue(o.text);\n\t}\n}\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../../utils/DOMUtils\";\nimport Utils from \"../../utils/Utils.js\";\n\nimport ExpressionHighlighter from \"../ExpressionHighlighter\";\n\nimport app from \"../../app\";\n\nexport default class Explain {\n\t\n\tconstructor(el) {\n\t\tthis.el = el;\n\t\t$.addClass(el, \"explain\");\n\t\tthis._update();\n\t\t\n\t\tthis._bound_handleEvent = (evt) => this._handleEvent(evt);\n\t\tapp.expression.addEventListener(\"change\", this._bound_handleEvent);\n\t\tapp.expression.highlighter.addEventListener(\"hover\", this._bound_handleEvent);\n\t}\n\t\n\t\n\tcleanup() {\n\t\t$.empty(this.el);\n\t\t$.removeClass(this.el, \"explain\");\n\t\tapp.expression.removeEventListener(\"change\", this._bound_handleEvent);\n\t\tapp.expression.highlighter.removeEventListener(\"hover\", this._bound_handleEvent);\n\t}\n\t\n// private methods:\n\t_update() {\n\t\tlet el = $.empty(this.el), token = app.expression.token, expr = app.expression.value;\n\t\tthis._divs = [];\n\t\tif (!token || token.next.type === \"close\") {\n\t\t\tel.innerHTML = \"Enter an Expression above and it will be explained here.\";\n\t\t\treturn;\n\t\t}\n\t\tel.innerHTML = \"Roll-over elements below to highlight in the Expression above. Click to open in Reference.\";\n\t\twhile ((token = token.next) && (token.type !== \"close\")) {\n\t\t\t\n\t\t\tif (token.proxy || (token.open && token.open.proxy)) { continue; }\n\t\t\t\n\t\t\tlet groupClasses = ExpressionHighlighter.GROUP_CLASS_BY_TYPE, pre = ExpressionHighlighter.CSS_PREFIX;\n\t\t\tlet i = token.i, end = token.i+token.l, content=expr.substring(i, end).replace(\"<\", \"<\");\n\t\t\tif (token.set) {\n\t\t\t\tlet set0=token.set[0], set2=token.set[2];\n\t\t\t\tcontent = \"\"+expr.substring(set0.i, set0.i+set0.l)+\"\";\n\t\t\t\tcontent += expr.substring(i, end);\n\t\t\t\tcontent += \"\"+expr.substring(set2.i, set2.i+set2.l)+\"\";\n\t\t\t}\n\t\t\t\n\t\t\tlet className = pre + (token.clss || token.type);\n\t\t\tcontent = \"\"+content+\" \";\n\t\t\tif (!token.open) { content += app.reference.tipForToken(token); }\n\t\t\telse { content += \" \"; }\n\t\t\tlet div = $.create(\"div\", null, content, el);\n\t\t\t\n\t\t\tif (token.close) {\n\t\t\t\tclassName = groupClasses[token.clss || token.type];\n\t\t\t\tif (className) {\n\t\t\t\t\tclassName = className.replace(\"%depth%\", Math.min(4,token.depth));\n\t\t\t\t\t$.addClass(div, className);\n\t\t\t\t}\n\t\t\t\tif (token.depth > 3) {\n\t\t\t\t\tdiv.innerHTML = \"So... you wanted to see what would happen if you just kept nesting groups, eh? Well, this is it.\"+\n\t\t\t\t\t\t\" I was going to reward your curiosity with a RegEx joke, but a quick search on google reveals that not even\"+\n\t\t\t\t\t\t\" the collective wisdom of the internet can make regular expressions funny. Well, except the whole 'now you've got two problems'\"+\n\t\t\t\t\t\t\" shtick, but you've probably heard that one already. Wasn't really worth the effort, was it?\";\n\t\t\t\t\ttoken = token.close.prv;\n\t\t\t\t\tthis._divs.push(div);\n\t\t\t\t\tel = div;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tel = div;\n\t\t\t}\n\t\t\t\n\t\t\tdiv.token = token;\n\t\n\t\t\tif (token.open) {\n\t\t\t\t$.addClass(div, \"close\");\n\t\t\t\tdiv.proxy = el;\n\t\t\t\tel = el.parentNode;\n\t\t\t}\n\t\n\t\t\tif (token.error) {\n\t\t\t\t$.addClass(div, \"error\");\n\t\t\t\tif (token.error.warning) { $.addClass(div, \"warning\"); }\n\t\t\t}\n\t\n\t\t\tif (!token.open) {\n\t\t\t\tdiv.addEventListener(\"mouseover\", this._handleMouseEvent);\n\t\t\t\tdiv.addEventListener(\"mouseout\", this._handleMouseEvent);\n\t\t\t\tdiv.addEventListener(\"click\", this._handleMouseEvent);\n\t\t\t}\n\t\t\t\n\t\t\tif (token.clss === \"quant\" || token.type === \"lazy\" || token.type === \"possessive\") {\n\t\t\t\tthis._insertApplied(div);\n\t\t\t} else {\n\t\t\t\tthis._divs.push(div);\n\t\t\t}\n\t\t}\n\t}\n\n\t_insertApplied(div) {\n\t\tlet divs = this._divs, prv = div.token.prv, d, i=divs.length;\n\t\twhile ((d = divs[--i]) && d.token !== prv) {} // search backwards for efficiency\n\t\td = d.proxy||d;\n\t\tdivs.splice(i, 0, div);\n\t\td.insertAdjacentElement(\"afterend\", div);\n\t\t$.addClass(div, \"applied\");\n\t}\n\n\t_handleHoverChange() {\n\t\tlet token = app.expression.highlighter.hoverToken;\n\t\t$.removeClass($.queryAll(\"div.selected\", this.el), \"selected\");\n\t\t$.removeClass($.queryAll(\"div.related\", this.el), \"related\");\n\t\tif (!token) { return; }\n\t\t\n\t\tlet div = this._findDiv(token);\n\t\t$.addClass(div, \"selected\");\n\t\tif (token.related) {\n\t\t\tfor (let i = 0, l=token.related.length; i < l; i++) {\n\t\t\t\t$.addClass(this._findDiv(token.related[i]), \"related\");\n\t\t\t}\n\t\t}\n\t}\n\t\n\t_findDiv(token) {\n\t\treturn Utils.find(this._divs, (div) => div.token === token);\n\t}\n\n\t_handleMouseEvent(evt) {\n\t\tlet type = evt.type, token = evt.currentTarget.token;\n\t\tif (type == \"click\") { app.sidebar.showToken(token); }\n\t\telse { app.expression.highlighter.hoverToken = type === \"mouseout\" ? null : token; }\n\t\tevt.stopPropagation();\n\t}\n\t\n\t_handleEvent(evt) {\n\t\tif (evt.type === \"change\") { this._update(); }\n\t\telse if (evt.type === \"hover\") { this._handleHoverChange(); }\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../../utils/DOMUtils\";\nimport Utils from \"../../utils/Utils\";\n\nimport app from \"../../app\";\n\nexport default class Details {\n\t\n\tconstructor(el) {\n\t\tthis.el = el;\n\t\t$.addClass(el, \"details\");\n\t\tthis._update();\n\t\t\n\t\tthis._bound_handleEvent = (evt) => this._handleEvent(evt);\n\t\tapp.addEventListener(\"result\", this._bound_handleEvent);\n\t\tapp.text.addEventListener(\"select\", this._bound_handleEvent);\n\t}\n\t\n\t\n\tcleanup() {\n\t\t$.empty(this.el);\n\t\t$.removeClass(this.el, \"details\");\n\t\tapp.removeEventListener(\"result\", this._bound_handleEvent);\n\t\tapp.text.removeEventListener(\"select\", this._bound_handleEvent);\n\t\tUtils.defer(null, \"Details._update\");\n\t}\n\t\n// private methods:\n\t_update() {\n\t\t$.empty(this.el);\n\t\t$.create(\"div\", \"desc\", \"Click a match above to display match & group details. Mouse over a Group row to highlight it in the Expression.\", this.el);\n\t\tthis._addMatch(app.text.selectedMatch, app.text.value);\n\t}\n\t\n\t_addMatch(match, textVal) {\n\t\tif (!match) { return; }\n\t\tlet groups = match.groups, l=groups&&groups.length, ext=l&&(groups[0].i != null), matchVal=this._getMatchVal(match, textVal), extStr=\"\", me = match.i+match.l;\n\t\tlet groupTokens = app.expression.lexer.captureGroups;\n\t\t\n\t\tlet tableEl = $.create(\"table\", null, null, this.el);\n\t\tlet matchEl = $.create(\"tr\", \"match\", \"Match \"+match.num+\"\"+this._getRangeStr(match)+\"\", tableEl);\n\t\t\n\t\tif (l) {\n\t\t\tlet inGroups = [], lastIndex = match.i;\n\t\t\tfor (let i = 0; i <= l; i++) {\n\t\t\t\tlet group = groups[i], index = group ? group.i : me, num = i + 1, token = groupTokens[i];\n\t\t\t\tif (ext) {\n\t\t\t\t\tfor (let j = inGroups.length - 1; j >= 0; j--) {\n\t\t\t\t\t\tlet inGroup = inGroups[j], ge = inGroup.i + inGroup.l;\n\t\t\t\t\t\tif (ge > index) { break; }\n\t\t\t\t\t\tinGroups.pop();\n\t\t\t\t\t\textStr += Utils.htmlSafe(textVal.substring(lastIndex, ge)) + \"\";\n\t\t\t\t\t\tlastIndex = ge;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!group) { break; }\n\t\t\t\tif (group.l) {\n\t\t\t\t\textStr += Utils.htmlSafe(textVal.substring(lastIndex, index)) + \"\";\n\t\t\t\t\tinGroups.push(group);\n\t\t\t\t\tlastIndex = index;\n\t\t\t\t}\n\t\t\t\tlet val = \"\" + this._getMatchVal(group, textVal) + \"\";\n\t\t\t\tlet label = token.name ? \"'\"+token.name+\"'\" : (\"Group \" + num);\n\t\t\t\tlet tr = $.create(\"tr\", \"group\", \"\" + label + \"\" + this._getRangeStr(group) + \"\" + val + \"\", tableEl);\n\t\t\t\t\n\t\t\t\ttr.token = token;\n\t\t\t\ttr.addEventListener(\"mouseover\", this._handleMouseEvent);\n\t\t\t\ttr.addEventListener(\"mouseout\", this._handleMouseEvent);\n\t\t\t}\n\t\t\tif (ext) { extStr += Utils.htmlSafe(textVal.substring(lastIndex, me)); }\n\t\t} else {\n\t\t\t$.create(\"tr\", \"nogroup\", \"No groups.\", tableEl);\n\t\t}\n\t\t\n\t\t$.query(\"td:last-child\", matchEl).innerHTML = extStr || matchVal;\n\t}\n\t\n\t_getMatchVal(match, str) {\n\t\tlet val = match.s || (match.i === undefined ? \"\" : str.substr(match.i, match.l));\n\t\treturn val ? Utils.htmlSafe(val) : \"<empty>\";\n\t}\n\t\n\t_getRangeStr(match) {\n\t\t// we could check for match.l>0 to catch empty matches, but having a weird range might be more accurate.\n\t\treturn match.i != null ? match.i + \"-\" + (match.i+match.l-1) : \"n/a\";\n\t}\n\n\t_handleEvent(evt) {\n\t\tUtils.defer(()=>this._update(), \"Details._update\");\n\t}\n\t\n\t_handleMouseEvent(evt) {\n\t\tlet type = evt.type, token = evt.currentTarget.token;\n\t\tapp.expression.highlighter.hoverToken = type === \"mouseout\" ? null : token;\n\t\tif (type === \"mouseover\") { $.addClass($.query(\"span.num-\"+token.num, this.el), \"hover\"); }\n\t\telse { $.removeClass($.query(\"span.hover\", this.el), \"hover\"); }\n\t\tevt.stopPropagation();\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../../utils/DOMUtils\";\nimport Utils from \"../../utils/Utils\";\nimport app from \"../../app\";\n\nexport default class Replace {\n\tconstructor(el, cm) {\n\t\tthis.el = el;\n\t\tthis.editor = cm;\n\t\t\n\t\tthis._bound_handleEvent = (evt) => this._handleEvent(evt);\n\t\tapp.addEventListener(\"result\", this._bound_handleEvent);\n\t\t\n\t\tthis._initUI();\n\t\tthis._update();\n\t}\n\t\n\tcleanup() {\n\t\t$.empty(this.el);\n\t\tthis.output.value = \"\";\n\t\t$.removeClass(this.el, \"details\");\n\t\tapp.removeEventListener(\"result\", this._bound_handleEvent);\n\t\tUtils.defer(null, \"Replace._update\");\n\t}\n\t\n// private methods:\n\t_initUI() {\n\t\tthis.output = $.create(\"textarea\", null, null, this.el);\n\t\tthis.output.readOnly = true;\n\t}\n\t\n\t_update() {\n\t\tlet o = app.result && app.result.tool, result = o&&o.result;\n\t\tthis.output.value = result || \"no result\";\n\t}\n\n\t_handleEvent(evt) {\n\t\tUtils.defer(()=>this._update(), \"Replace._update\");\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"./utils/Utils\";\n\nimport app from \"./app\";\n\nexport default class SubstLexer {\n\tconstructor() {\n\t\tthis.profile = null;\n\t}\n\t\n\tset profile(profile) {\n\t\tthis._profile = profile;\n\t\tthis.string = this.token = this.errors = null;\n\t}\n\t\n\tparse(str) {\n\t\tif (!this._profile) { return null; }\n\t\t\n\t\tthis.token = null;\n\t\tthis.string = str;\n\t\tthis.errors = [];\n\t\t\n\t\t// TODO: should this be passed in from Tools?\n\t\tlet capGroups = app.expression.lexer.captureGroups;\n\t\t\n\t\tlet prev=null, token, c;\n\t\tfor (let i=0, l=str.length; i= 10 && capGroups[(num = (num/10|0))-1]) { l = numStr.length-1; }\n\t\tif (l) {\n\t\t\ttoken.l += l;\n\t\t\t// we don't assign the original type, because the docs combine them all into one id:\n\t\t\ttoken.type = num > 0 ? \"subst_group\" : \"subst_0match\";\n\t\t\ttoken.clss = \"subst\";\n\t\t\tif (num > 0) { token.group = capGroups[num-1]; }\n\t\t}\n\t}\n}\n\nSubstLexer.$_TYPES = {\n\t\"$\": \"subst_$esc\",\n\t\"&\": \"subst_$&match\",\n\t\"`\": \"subst_$before\",\n\t\"'\": \"subst_$after\",\n\t\"0\": \"subst_0match\"\n};\n\nSubstLexer.SUBST_ESC_RE = new RegExp(\"^\"+Utils.SUBST_ESC_RE.source,\"i\");\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport CMUtils from \"../utils/CMUtils\";\nimport Utils from \"../utils/Utils\";\nimport Track from \"../utils/Track\";\n\nimport List from \"../controls/List\";\nimport ExpressionHighlighter from \"./ExpressionHighlighter\";\nimport ExpressionHover from \"./ExpressionHover\";\nimport Explain from \"./tools/Explain\";\nimport Details from \"./tools/Details\";\nimport Replace from \"./tools/Replace\";\n\nimport SubstLexer from \"../SubstLexer\";\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport app from \"../app\";\n\nexport default class Tools extends EventDispatcher {\n\tconstructor (el) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis._initUI();\n\t\tthis.value = null;\n\t}\n\t\n\tset value(o) {\n\t\tif (!o) {\n\t\t\tthis.show(\"explain\");\n\t\t\tthis._toolValues = Utils.copy({}, Tools.DEFAULT_VALUES);\n\t\t} else {\n\t\t\tthis.show(o.id);\n\t\t\tif (o.input != null) { this.editor.setValue(o.input); }\n\t\t}\n\t}\n\t\n\tget value() {\n\t\treturn {\n\t\t\tid: this._toolId,\n\t\t\tinput: this.input\n\t\t};\n\t}\n\t\n\tget input() {\n\t\treturn this.hasInput ? this.editor.getValue() : null;\n\t}\n\t\n\tget hasInput() {\n\t\tlet id = this._toolId;\n\t\treturn (id === \"replace\" || id === \"list\");\n\t}\n\t\n\tshow(id) {\n\t\tif (!id || id === this._toolId) { return; }\n\n\t\tthis.toolList.selected = this._toolId = id;\n\t\tlet input = (id === \"replace\" || id === \"list\");\n\t\t\n\t\tif (this._tool) { this._tool.cleanup(); }\n\t\t\n\t\t$.toggleClass($.query(\"> article\", this.el), \"showinput\", input);\n\t\tif (input) {\n\t\t\tthis.editor.setValue(this._toolValues[id]);\n\t\t\tthis.editor.refresh();\n\t\t\tthis.editor.focus();\n\t\t}\n\t\t\n\t\tif (id === \"explain\") { this._tool = new Explain(this.contentEl); }\n\t\telse if (id === \"details\") { this._tool = new Details(this.contentEl); }\n\t\telse if (id === \"replace\" || id === \"list\") { this._tool = new Replace(this.resultEl, this.editor); }\n\t\t\n\t\tthis._toolId = id;\n\t\tthis._updateHighlights();\n\t}\n\t\n\t_initUI() {\n\t\tlet el = this.el;\n\t\tthis.headerEl = $.query(\"header\", this.el);\n\t\tthis.headerEl.addEventListener(\"click\", (evt) => this._handleHeaderClick(evt));\n\t\t\n\t\tthis.contentEl = $.query(\"> article > .content\", el);\n\t\tthis.resultEl = $.query(\"> article > .inputtool > .result\", el);\n\t\t\n\t\tthis.toolListEl = $.query(\".toollist\", this.headerEl);\n\t\tlet data = [\"Replace\", \"List\", \"Details\", \"Explain\"].map((val) => ({label:val, id:val.toLowerCase()}));\n\t\tthis.toolList = new List(this.toolListEl, {data});\n\t\tthis.toolList.on(\"change\", ()=> this._handleListChange());\n\t\t\n\t\tlet editor = this.editor = CMUtils.create($.query(\".inputtool .editor\", el), {\n\t\t\tmaxLength: 2500,\n\t\t\tsingleLine: true\n\t\t}, \"100%\", \"100%\");\n\n\t\t$.query(\".help.icon\", el).addEventListener(\"click\", () => app.sidebar.goto(this._toolId));\n\t\t\n\t\t// TODO: evaluate this living here or in Replace:\n\t\teditor.on(\"change\", ()=> this._handleEditorChange());\n\t\t\n\t\tapp.flavor.on(\"change\", () => this._updateHighlights());\n\t\tapp.expression.on(\"change\", () => this._updateHighlights());\n\t\t\n\t\tthis.lexer = new SubstLexer();\n\t\tthis.highlighter = new ExpressionHighlighter(editor);\n\t\tthis.hover = new ExpressionHover(editor, this.highlighter);\n\t}\n\t\n\t_handleEditorChange() {\n\t\tthis._updateHighlights();\n\t\tthis._toolValues[this._toolId] = this.editor.getValue();\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\t\n\t_updateHighlights() {\n\t\tif (!this.hasInput) { return; } // only for Replace & List\n\t\tthis.lexer.profile = app.flavor.profile;\n\t\tlet token = this.lexer.parse(this.editor.getValue());\n\t\tthis.highlighter.draw(token);\n\t\tthis.hover.token = token;\n\t}\n\t\n\t_handleListChange() {\n\t\tthis.show(this.toolList.selected);\n\t\tTrack.page(\"tool/\"+this.toolList.selected);\n\t}\n\t\n\t_handleHeaderClick(evt) {\n\t\tif ($.hasClass(this.el, \"closed\") || !this.toolListEl.contains(evt.target)) {\n\t\t\t$.togglePanel(this.el, 'article');\n\t\t}\n\t}\n}\nTools.DEFAULT_VALUES = {\n\treplace: \"<< $& >>\",\n\tlist: \"$&\\\\n\"\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nlet home = {};\nexport default home;\n\nhome.id = \"home\";\nhome.label = \"Menu\";\nhome.desc = \"[from HTML]\";\nhome.kids = [\n\n\n\t{\n\tlabel: \"Pattern Settings\",\n\tid: \"share\",\n\tel: \"#share_main\",\n\tlist: false,\n\tkids: [\n\t\t{\n\t\tlabel: \"Save to my Favorites\",\n\t\tid: \"share_favorites\",\n\t\tel:\"#share_favorites\"\n\t\t},\n\t\t{\n\t\tlabel: \"Share with the Community\",\n\t\tid: \"share_community\",\n\t\tel:\"#share_community\"\n\t\t}\n\t]\n\t},\n\n\t{\n\tlabel: \"My Patterns\",\n\tid:\"favorites\",\n\tdesc: \"The list above will display any patterns that you create or favorite.\"+\n\t\t\"

    To edit a pattern you created, click its URL or double-click it in the list to load it, then open Save / Share to edit and save.

    \",\n\tsearch: true,\n\tkids: []\n\t},\n\n\t{\n\tlabel: \"Cheatsheet\",\n\tid:\"cheatsheet\",\n\tel: \"#cheatsheet\"\n\t},\n\n\t{ // injected from Reference\n\tid:\"reference\"\n\t},\n\n\t{\n\tlabel: \"Community Patterns\",\n\tid: \"community\",\n\tdesc: \"Welcome to Community Patterns, a searchable database of patterns submitted by users like you.\"+\n\t\t\"

    After selecting a pattern, click its URL or double-click it in the list to load the full pattern. Or use the right arrow icon to load just the expression or text.

    \"+\n\t\t\"

    Help make the Community better by rating patterns, and submitting your own via Search & Share in the menu.

    \",\n\tsearch: true,\n\tkids: []\n\t},\n\n\t{\n\tlabel: \"Help\",\n\tid: \"help\",\n\tdesc: \"Help for the RegExr application. See the RegEx Reference for help with Regular Expressions.\",\n\tkids: [\n\n\t\t{\n\t\tlabel:\"About\",\n\t\tdesc:\"RegExr v<%= build_version %> (<%= build_date %>).\"+\n\t\t\t\"

    Created by Grant Skinner and the gskinner team, using the CreateJS & CodeMirror libraries.

    \"+\n\t\t\t\"

    You can provide feedback or log bugs on GitHub.

    \"\n\t\t},\n\t\t{\n\t\tlabel:\"Getting started\",\n\t\tdesc:\"RegExr provides real-time visual results, syntax highlighting, tooltips, and undo/redo ({{getCtrlKey()}}-Z / Y) so it's easy and fun to explore Regular Expressions.\"+\n\t\t\t\"

    Browse through the RegEx Reference and test different tokens to see what they do, then check out Community Patterns to see examples.

    \"+\n\t\t\t\"

    You can also Save your patterns for later reference, or to share with others. Sign In to ensure you don't lose your patterns.

    \"+\n\t\t\t\"

    Modify your pattern's details, share it with the Community, or make it private, or delete it in Pattern Settings

    \",\n\t\tkids: [\n\t\t\t{\n\t\t\tlabel:\"Expression panel\",\n\t\t\tdesc:\"This is where you enter a regular expression to test. The results in the Text and Tools panel will update as you type.\"+\n\t\t\t\t\"Roll over the expression for information on each token.\"+\n\t\t\t\t\"

    The buttons to the right allow you to switch RegEx engines, or edit the expression flags.

    \"\n\t\t\t},\n\t\t\t{\n\t\t\tlabel:\"Text panel\",\n\t\t\tdesc:\"This is where you enter text to test your expression against. Drag & drop a text file to load its contents.\"+\n\t\t\t\t\"

    Matches will be highlighted as you type. Roll over a match for information on the match and its capture groups. The match count and execution time are shown in the title bar.

    \"+\n\t\t\t\t\"

    Lighter colored caps at the start or end of a line indicate the match continues between lines.

    \"\n\t\t\t},\n\t\t\t{\n\t\t\tlabel:\"Tests panel\",\n\t\t\tdesc:\"This allows you to create a suite of tests that you can use to validate your Expression in real time.\"+\n\t\t\t\t\"

    A test can check if the pattern matches anything, matches everything, or matches nothing in the test text.

    \"+\n\t\t\t\t\"

    Access this panel with the toggle at the top of the Text panel. When you save, both your Text and Tests will be saved.

    \"\n\t\t\t},\n\t\t\t{\n\t\t\tlabel:\"Tools panel\",\n\t\t\tdesc:\"Click the Tools title bar below the Text panel to show or hide the Tools panel.\"+\n\t\t\t\t\"

    Tools provide different ways of working with or exploring your results.

    \",\n\t\t\tkids: [\n\t\t\t\t{\n\t\t\t\tlabel:\"Replace\",\n\t\t\t\tid: \"replace\",\n\t\t\t\tdesc:\"The Replace tool replaces matches with a specified string or pattern.\"+\n\t\t\t\t\t\"

    Matches in the Text panel are replaced by the substitution string & displayed as you type.

    \"+\n\t\t\t\t\t\"

    Substitution tokens and escaped characters are supported, such as \\\\n, \\\\t & \\\\u0009.

    \"+\n\t\t\t\t\t\"

    Roll over tokens for information, and check out the RegEx Reference for more information.

    \"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\tlabel:\"List\",\n\t\t\t\tid: \"list\",\n\t\t\t\tdesc:\"The List tool lists all found matches.\"+\n\t\t\t\t\t\"

    You can specify either a simple delimiter (ex. , or \\\\n), or use substitution tokens to generate more advanced reports. For example, $1\\\\n would list all group 1 results (in the JavaScript engine).

    \"+\n\t\t\t\t\t\"

    Escaped characters are supported, such as \\\\n, \\\\t & \\\\u0009.

    \"+\n\t\t\t\t\t\"

    Roll over tokens for information.

    \"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\tlabel:\"Details\",\n\t\t\t\tid: \"details\",\n\t\t\t\tdesc:\"The Details tool displays the full text of a match and its capture groups.\"+\n\t\t\t\t\t\"

    Click on a highlighted match in the Text panel to display the details for that match.

    \"+\n\t\t\t\t\t\"

    Roll over a group row to highlight that group in your Expression.

    \"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\tlabel:\"Explain\",\n\t\t\t\tid: \"explain\",\n\t\t\t\tdesc:\"The Explain tool displays a detailed breakdown of the Expression.\"+\n\t\t\t\t\t\"

    Mouse over the explanation to highlight the related tokens in the Expression panel and vice versa.

    \"+\n\t\t\t\t\t\"

    Click an item in the explanation to show more info in the RegEx Reference.

    \"\n\t\t\t\t}\n\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\tlabel:\"Menu\",\n\t\t\tdesc:\"The Menu (this panel) includes Help, a full RegEx Reference, a Cheatsheet, and Pattern Settings features.\"+\n\t\t\t\t\"

    Double-click a selected item in the RegEx Reference to insert it into your Expression. Click the arrow beside an example to load it.

    \"+\n\t\t\t\t\"

    The menu also includes searchable Community Patterns, and patterns you've created or favorited in My Patterns.

    \"\n\t\t\t}\n\t\t]\n\t\t},\n\t\t{\n\t\tlabel:\"Signing in\",\n\t\tid: \"signin\",\n\t\tdesc:\"Before you sign in, RegExr creates a temporary account which relies on a browser cookie. This means you can't access your patterns on other computers, and that you could lose your patterns if your cookies are deleted or expire.\"+\n\t\t\t\"

    Signing in creates a permanent account, so you can access your patterns anywhere, anytime.

    \"+\n\t\t\t\"

    Your existing patterns & favorites will automatically be assigned to the new account.

    \"+\n\t\t\t\"

    We don't use your info for anything other than signing you into your RegExr account.

    \"\n\t\t},\n\t\t{\n\t\tid: \"engine\",\n\t\tlabel:\"RegEx engines\",\n\t\tdesc:\"While the core feature set of regular expressions is fairly consistent, different implementations (ex. Perl vs Java) may have different features or behaviours.\"+\n\t\t\t \"

    RegExr currently supports JavaScript RegExp executed in your browser and PCRE via PHP.

    \"+\n\t\t\t \"

    You can switch engines using the dropdown in Expression.

    \",\n\t\tkids: [\n\t\t\t{\n\t\t\tlabel:\"JavaScript\",\n\t\t\tdesc:\"Your browser's JavaScript engine is used to execute RegEx in an asynchronous worker using RegExp.exec().\"+\n\t\t\t\t\"

    Note that while implementations are mostly consistent, there are small variations between browsers. Here is a short list of known differences:

      \"+\n\t\t\t\t\"
    • Older browsers don't support the u or y flags
    • \"+\n\t\t\t\t\"
    • Differences in handling of certain ambiguous escapes: \\\\8 \\\\9
    • \"+\n\t\t\t\t\"
    • Chrome handles \\\\x & \\\\u escapes slightly differently than other browsers
    • \"+\n\t\t\t\t\"
    • Chrome supports lookbehind, but it isn't yet in the JS spec
    • \"+\n\t\t\t\t\"
    • Safari ignores leading zeros in octal escapes (ex. \\\\00020)
    • \"+\n\t\t\t\t\"

    \"\n\t\t\t},\n\t\t\t{\n\t\t\tlabel:\"PCRE (PHP)\",\n\t\t\tdesc:\"PHP {{getPHPVersion()}} and PCRE {{getPCREVersion()}} are used to execute your pattern on our server.\"\n\t\t\t}\n\t\t]\n\t\t},\n\t\t{\n\t\tlabel:\"Query string support\",\n\t\tdesc:\"In addition to the built in Save mechanism which creates a shareable link, RegExr also supports the ability to pre-populate a pattern via the query string.\"+\n\t\t\t\"

    The following query string params are recognized:

      \"+\n\t\t\t\"
    • engine - the RegEx engine to use (js or pcre)
    • \"+\n\t\t\t\"
    • expression - populates the Expression area. It is recommended to pass a full expression with flags (/.*/ig) not just the pattern (.*)
    • \"+\n\t\t\t\"
    • text - populates the Text area
    • \"+\n\t\t\t\"
    • tool - sets the tool (replace, list, details, or explain)
    • \"+\n\t\t\t\"
    • input - populates the tool input field
    • \"+\n\t\t\t\"

    \"+\n\t\t\t\"Ex. regexr.com/?expression=/./g&text=test\"\n\t\t}\n\t]\n\t}\n];\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils\";\nimport app from \"../app\";\n\nexport default class LinkRow {\n\tconstructor(el) {\n\t\tthis.el = el;\n\t\tthis._initUI();\n\t\tthis.url = null;\n\t}\n\t\n\tset pattern(val) {\n\t\tlet url = Utils.getPatternURLStr(val)\n\t\tthis._pattern = val;\n\t\t$.query(\".url\", this.el).innerText = url || \"\";\n\t\t$.toggleClass(this.el, \"disabled\", !url);\n\t\t$.toggleClass(this.el, \"active\", !!url);\n\t}\n\n\tshowMessage(message) {\n\t\t// for some reason this displays one line too low if it's synchronous:\n\t\tsetTimeout(()=>app.tooltip.toggle.showOn(\"linkrow\", message, $.query(\".copy.icon\", this.el), true, 0), 1);\n\t}\n\n\t_initUI() {\n\t\tthis.el.onclick = (evt) => this._onClick(evt);\n\n\t\tlet fld=$.query(\".url\", this.el), copyBtn = $.query(\".copy\", this.el);\n\t\tlet clipboard = new Clipboard(copyBtn, { target: () => fld });\n\t\tclipboard.on(\"success\", () => app.tooltip.toggle.toggleOn(\"copy\", \"Copied to clipboard.\", copyBtn, true, 3));\n\t\tclipboard.on(\"error\", (e) => app.tooltip.toggle.toggleOn(\"copy\", Utils.getCtrlKey()+\"-C to copy.\", copyBtn, true, 3)); // TODO: cmd/ctrl\n\t}\n\n\t_onClick(evt) {\n\t\tif ($.query(\".copy\", this.el).contains(evt.target)) { return; }\n\t\tif (evt.which === 2 || evt.metaKey || evt.ctrlKey) {\n\t\t\twindow.open(Utils.getPatternURL(this._pattern));\n\t\t} else {\n\t\t\tapp.load(this._pattern);\n\t\t}\n\t}\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils.js\";\n\nimport app from \"../app\";\n\nexport default class Example {\n\tconstructor (title, ex) {\n\t\tthis.el = $.create(\"div\", \"example\");\n\t\tthis.title = title;\n\t\tthis.example = ex;\n\t}\n\t\n\tset example(ex) {\n\t\tif (ex === this._example) { return; }\n\t\tthis._example = ex;\n\t\t\n\t\tlet str = \"\", txt, exp, regex;\n\t\tif (ex) {\n\t\t\texp = ex[0];\n\t\t\ttxt = ex[1];\n\t\t\tregex = Utils.getRegExp(exp, \"g\");\n\t\t\tif (this.title) { str += \"

    \" + this.title + \"


    \"; }\n\t\t\tstr += \"Load expression\" + Utils.htmlSafe(exp) + \"\";\n\t\t\tif (txt && regex) {\n\t\t\t\tlet over=Math.max(0, txt.length-160), s=txt;\n\t\t\t\tif (over) { s = Utils.htmlSafe(s.substr(0,159)); }\n\t\t\t\tif (regex) { s = s.replace(regex, \"$&\"); }\n\t\t\t\t// TODO: this won't match on html elements:\n\t\t\t\tstr += \"
    Load text\" + s + (over?\"\\u2026\" : \"\") + \"\";\n\t\t\t}\n\t\t}\n\t\tthis.el.innerHTML = str;\n\t\tif (exp) {\n\t\t\t$.query(\"code.expression > .load\", this.el).addEventListener(\"click\", ()=> {\n\t\t\t\t// TODO: this will need to be updated when we support other delimiters:\n\t\t\t\tapp.expression.value = exp[0] === \"/\" ? exp : \"/\"+exp+\"/g\";\n\t\t\t});\n\t\t\t\n\t\t}\n\t\tif (txt) { $.query(\"code.text > .load\", this.el).addEventListener(\"click\", ()=> app.text.value = txt); }\n\t}\n\t\n\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport LinkRow from \"../controls/LinkRow\";\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils\";\nimport Example from \"./Example\";\nimport Server from \"../net/Server\";\n\nimport app from \"../app\";\n\n// also used for My Patterns.\nexport default class CommunityContent {\n\tconstructor (el) {\n\t\tthis.el = el;\n\t\tthis.example = new Example();\n\t\tel.appendChild(this.example.el);\n\t\t$.query(\".icon.thumbup\", el).addEventListener(\"click\", ()=>this._rate(1));\n\t\t$.query(\".icon.thumbdown\", el).addEventListener(\"click\", ()=>this._rate(-1));\n\t\t$.query(\".icon.favorites\", el).addEventListener(\"click\", ()=>this._favorite());\n\t\tthis.linkRow = new LinkRow($.query(\".row.link\", el))\n\t\t$.query(\".icon.share\", el).addEventListener(\"click\", ()=>this._share());\n\t}\n\t\n\tset item(o) {\n\t\tlet el = this.el;\n\t\tthis._pattern = o;\n\t\t$.query(\".author\", el).innerText = o.author ? \"by \"+o.author : \"\";\n\t\t$.query(\".name.label\", el).innerText = o.name;\n\t\t$.query(\".desc\", el).innerText = o.description || \"No description available.\";\n\t\tthis._updateRating();\n\t\tthis._updateFavorite();\n\t\tthis.example.example = [o.expression, o.text];\n\n\t\tthis.linkRow.pattern = o;\n\t}\n\t\n// private methods:\n\t_updateRating() {\n\t\tlet o = this._pattern, el = this.el;\n\t\t$.query(\".rating\", el).innerText = o.rating.toFixed(1);\n\t\t$.removeClass($.query(\".icon.rate.selected\", el), \"selected\");\n\t\tif (o.userRating === 1) { $.addClass($.query(\".icon.thumbup\", el), \"selected\"); }\n\t\telse if (o.userRating === -1) { $.addClass($.query(\".icon.thumbdown\", el), \"selected\"); }\n\t}\n\n\t_updateFavorite() {\n\t\tlet o = this._pattern, el = this.el;\n\t\t$.toggleClass($.query(\".icon.favorites\", el), \"selected\", !!o.favorite);\n\t}\n\n\t_rate(val) {\n\t\tlet o = this._pattern;\n\t\to.userRating = (val === o.userRating) ? 0 : val;\n\t\tthis._updateRating();\n\t\t\n\t\tServer.rate(o.id, o.userRating).then((data) => this._handleRate(data));\n\t}\n\n\t_share() {\n\t\tapp.load(this._pattern);\n\t\tapp.share.show();\n\t}\n\n\t_handleRate(data) {\n\t\tif (data.id === this._pattern.id) {\n\t\t\tthis._pattern.rating = data.rating;\n\t\t\tthis._updateRating();\n\t\t}\n\t}\n\n\t_favorite() {\n\t\tlet o = this._pattern;\n\t\tServer.favorite(o.id, !o.favorite).then((data) => this._handleFavorite(data));\n\t}\n\n\t_handleFavorite(data) {\n\t\tif (data.id === this._pattern.id) {\n\t\t\tthis._pattern.favorite = data.favorite;\n\t\t\tthis._updateFavorite();\n\t\t}\n\t}\n\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport app from \"../app\";\n\nexport default class Status {\n\tconstructor(el) {\n\t\tif (!el) { el = document.createElement(\"div\"); }\n\t\tthis.el = el;\n\t\t$.addClass(el, \"status\");\n\n\t\tel.addEventListener(\"mouseover\", () => this._showTooltip());\n\t\tel.addEventListener(\"mouseout\", () => this._hideTooltip());\n\t}\n\n\tdistract() {\n\t\tthis.el.innerHTML = '';\n\t\tthis._show();\n\t\treturn this;\n\t}\n\n\thide(t=0) {\n\t\tthis._clearTimeout();\n\t\tif (t) {\n\t\t\tthis._timeoutId = setTimeout(()=>this._hide(), t*1000);\n\t\t} else { this._hide(); }\n\t\treturn this;\n\t}\n\n\tsuccess() {\n\t\tthis.el.innerHTML = '';\n\t\tthis._show();\n\t\treturn this;\n\t}\n\n\terror(msg) {\n\t\tlet el = this.el;\n\t\tel.innerHTML = '';\n\t\tthis._show();\n\t\tthis._ttMsg = msg;\n\t\treturn this;\n\t}\n\n\t_showTooltip() {\n\t\tif (!this._ttMsg) { return; }\n\t\tapp.tooltip.hover.showOn(\"status\", this._ttMsg, this.el, true, 0);\n\t}\n\n\t_hideTooltip() {\n\t\tapp.tooltip.hover.hide(\"status\");\n\t}\n\n\t_show() {\n\t\tthis.el.style.display = null;\n\t\tthis._ttMsg = null;\n\t\tthis._hideTooltip();\n\t\tthis._clearTimeout();\n\t}\n\n\t_hide() {\n\t\tthis.el.style.display = \"none\";\n\t\tthis._hideTooltip();\n\t\tthis._clearTimeout();\n\t}\n\n\t_clearTimeout() {\n\t\tif (this._timeoutId == null) { return; }\n\t\tclearTimeout(this._timeoutId);\n\t\tthis._timeoutId = null;\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport $ from \"../utils/DOMUtils\"\nimport Track from \"../utils/Track\"\n\nimport List from \"../controls/List\";\nimport Server from \"../net/Server\";\n\nimport app from \"../app\";\n\nexport default class Account extends EventDispatcher {\n\tconstructor () {\n\t\tsuper();\n\t\tthis._value = {};\n\t\tthis._initUI();\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\tset value(val={}) {\n\t\tthis._value = val;\n\t\tthis._updateUI();\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\n\tget userId() { return this._value.userId; }\n\tget author() { return this._value.author || this._value.username || \"\"; }\n\tget username() { return this._value.username || \"\"; }\n\tget authenticated() { return !!this._value.username; } // this._value.authenticated;\n\tget type() { return this._value.type; }\n\n\tshowTooltip() {\n\t\tapp.tooltip.toggle.toggleOn(\"signin\", this.tooltipEl, this.signinBtn, true, 20);\n\t}\n\n// private methods:\n\t_initUI() {\n\t\tlet template = (o) => ''+o;\n\t\tthis.signinBtn = $.query(\".header .signin\");\n\t\tthis.tooltipEl = $.query(\"#library > #tooltip-signin\");\n\t\tthis.signinEl = $.query(\".signin\", this.tooltipEl);\n\t\tthis.signoutEl = $.query(\".signout\", this.tooltipEl);\n\t\t$.query(\".signoutbtn\", this.signoutEl).addEventListener(\"click\", (evt) => this._doSignout());\n\t\tthis.signinBtn.addEventListener(\"click\", (evt) => this.showTooltip());\n\t\t$.query(\".icon.help\", this.signinEl).addEventListener(\"click\", ()=> app.sidebar.goto(\"signin\"));\n\t\tthis.signinList = new List($.query(\"ul.list\", this.signinEl), {data:[\"GitHub\", \"Google\"], template});\n\t\tthis.signinList.on(\"change\", ()=>this._signinListChange());\n\t}\n\n\t_updateUI() {\n\t\tlet auth = this.authenticated;\n\t\t$.toggleClass(this.tooltipEl, \"authenticated\", auth);\n\t\t$.query(\".label\", this.signinBtn).innerText = auth ? \"Sign Out\" : \"Sign In\";\n\t\tif (auth) {\n\t\t\t$.query(\".username\", this.signoutEl).innerText = this.username;\n\t\t\t$.query(\".type\", this.signoutEl).innerText = this.type;\n\t\t}\n\t}\n\n\t_doSignout() {\n\t\t$.addClass(this.tooltipEl, \"wait\");\n\t\tServer.logout().then((data) => { this._handleSignout(data); }).finally(()=>this._cleanSignout());\n\t}\n\n\t_handleSignout(data) {\n\t\tthis.value = data;\n\t}\n\n\t_cleanSignout(err) {\n\t\t$.removeClass(this.tooltipEl, \"wait\");\n\t}\n\n\t_signinListChange() {\n\t\tlet service = this.signinList.selected.toLowerCase();\n\t\t$.addClass(this.tooltipEl, \"wait\");\n\t\tTrack.event(\"login\", \"access\", service);\n\t\tsetTimeout(() => Server.login(service), 100);\n\t}\n}\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils\";\nimport app from \"../app\";\n\nimport LinkRow from \"../controls/LinkRow\";\nimport Status from \"../controls/Status\";\nimport Account from \"./Account\";\nimport Server from \"../net/Server\";\n\nexport default class Share extends EventDispatcher {\n\tconstructor (el) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis._pattern = false;\n\t\tthis._initUI();\n\t\tapp.on(\"change\", () => this._handleAppChange());\n\t\tapp.on(\"load\", () => this._handleAppLoad());\n\t\tapp.account.on(\"change\", () => this._handleAccountChange());\n\t}\n\n// public methods:\n\tget value() {\n\t\treturn {\n\t\t\tid: this._pattern ? this._pattern.id : null,\n\t\t\tname: this.name,\n\t\t\tauthor: this.author,\n\t\t\tdescription: this.description,\n\t\t\tkeywords: this.keywords\n\t\t}\n\t}\n\n\tset pattern(o) {\n\t\tthis._pattern = o;\n\t\tthis.name = o.name;\n\t\tthis.description = o.description;\n\t\tthis.keywords = o.keywords;\n\n\t\tthis._updateUI();\n\t\tthis._pushHistory(o);\n\t}\n\n\tget name() { return this.nameFld.value; }\n\tset name(val) {\n\t\tthis.nameFld.value = val||\"\";\n\t\tthis.hNameFld.innerText = val||\"Untitled Pattern\";\n\t}\n\n\tget author() { return this.authorFld.value; }\n\tset author(val) { this.authorFld.value = val||\"\"; }\n\n\tget description() { return this.descriptionFld.value; }\n\tset description(val) { this.descriptionFld.value = val||\"\"; }\n\n\tget keywords() { return this.keywordsFld.value; }\n\tset keywords(val) { this.keywordsFld.value = val||\"\"; }\n\n\tshow() {\n\t\tapp.sidebar.goto(\"share\");\n\t}\n\n// private methods:\n\t_initUI() {\n\t\tlet el = this.el;\n\t\tlet mainEl = this.mainEl = $.query(\"> #share_main\", el);\n\t\tlet comEl = this.communityEl = $.query(\"> #share_community\", el);\n\n\t\t// set up header:\n\t\tlet hEl = $.query(\".header\");\n\t\tthis.hNewBtn = $.query(\".new\", hEl);\n\t\tthis.hForkBtn = $.query(\".fork\", hEl);\n\t\tthis.hSaveBtn = $.query(\".save\", hEl);\n\t\tthis.hNameFld = $.query(\".name\", hEl);\n\t\t$.query(\".settings\", hEl).addEventListener(\"click\", () => this.show());\n\t\t$.query(\".savekey\", this.hSaveBtn).innerText = \"(\"+Utils.getCtrlKey()+\"-s)\";\n\t\tthis.hSaveBtn.addEventListener(\"click\", () => this._doSave());\n\t\tthis.hNewBtn.addEventListener(\"click\", () => this._doNew());\n\n\t\tthis._defaultName = this.hNameFld.innerText;\n\n\t\t// set up main:\n\t\tthis._privateRow = $.query(\".row.private\", this.mainEl);\n\t\tthis._privateRow.addEventListener(\"click\", ()=> this._doPrivate());\n\t\tthis._privateStatus = new Status($.query(\".status\", this._privateRow));\n\t\tthis._favoritesRow = $.query(\".row.favorites\", this.mainEl);\n\t\tthis._favoritesRow.addEventListener(\"click\", ()=> this._doFavorite());\n\t\tthis._favoritesStatus = new Status($.query(\".status\", this._favoritesRow));\n\t\tthis._communityRow = $.query(\".row.community\", this.mainEl);\n\t\tthis._communityRow.addEventListener(\"click\", ()=> this._showCommunity());\n\t\tthis._deleteRow = $.query(\".row.delete\", this.mainEl);\n\t\tthis._deleteRow.addEventListener(\"click\", ()=> this._doDelete());\n\t\tthis._deleteStatus = new Status($.query(\".status\", this._deleteRow));\n\t\t$.query(\".row.signin a\", this.mainEl).addEventListener(\"click\", ()=> this._doSignin());\n\n\t\t// set up link row:\n\t\tthis._linkRow = new LinkRow($.query(\".link.row\", mainEl));\n\n\t\t// set up save buttons:\n\t\tlet saveEl = this.saveEl = $.query(\"> .save\", mainEl);\n\t\tthis.saveBtn = $.query(\".button.save\", saveEl);\n\t\tthis.forkBtn = $.query(\".button.fork\", saveEl);\n\t\tthis.saveBtn.addEventListener(\"click\", ()=> this._doSave());\n\t\tthis.forkBtn.addEventListener(\"click\", ()=> this._doSave(true));\n\t\tthis.saveStatus = new Status($.query(\".status\", saveEl));\n\t\tthis.saveMessage = $.query(\".message\", saveEl);\n\n\t\t// set up input fields:\n\t\tlet infoEl = this.infoEl = $.query(\"> .info\", mainEl);\n\t\tthis.nameFld = $.query(\".name\", infoEl);\n\t\tthis.authorFld = $.query(\".author\", infoEl);\n\t\tthis.descriptionFld = $.query(\".description\", infoEl);\n\t\tthis.keywordsFld = $.query(\".keywords\", infoEl);\n\n\t\t// listen for changes:\n\t\tthis.nameFld.addEventListener(\"input\", () => this._handleChange());\n\t\tthis.authorFld.addEventListener(\"input\", () => this._handleChange());\n\t\tthis.descriptionFld.addEventListener(\"input\", () => this._handleChange());\n\t\tthis.keywordsFld.addEventListener(\"input\", () => this._handleChange());\n\t\t\n\t\t/// set up community:\n\t\tlet comInputsEl = $.query(\".inputs\", comEl)\n\t\t$.query(\".button.cancel\", comEl).addEventListener(\"click\", ()=> app.sidebar.goto(\"share\"));\n\t\t$.query(\".button.share\", comEl).addEventListener(\"click\", ()=> this._doComSave());\n\t\tthis.comSaveStatus = new Status($.query(\".status\", comEl));\n\t\tthis._comNameFld = $.query(\".name\", comInputsEl);\n\t\tthis._comAuthorFld = $.query(\".author\", comInputsEl);\n\t\tthis._comDescriptionFld = $.query(\".description\", comInputsEl);\n\t\tthis._comKeywordsFld = $.query(\".keywords\", comInputsEl);\n\n\t\t// set up cmd-s listener:\n\t\twindow.document.addEventListener(\"keydown\", (evt) => this._handleKey(evt) );\n\t}\n\n\t_updateUI() {\n\t\tlet o = this._pattern, text;\n\t\tlet isChanged = this._isChanged(), isNew = this._isNew(), isOwned = this._isOwned();\n\t\t\n\t\t$.toggleClass([this.forkBtn, this.hForkBtn], \"disabled\", !this._canFork());\n\t\t$.toggleClass(this.saveBtn, \"disabled\", !this._canSave());\n\n\t\t$.toggleClass(this.hSaveBtn, \"disabled\", !this._canSave() && isOwned);\n\t\t$.query(\".action\",this.hSaveBtn).innerText = isOwned ? \"Save\" : \"Fork\";\n\t\t\n\t\tif (!isOwned) { text = \"This pattern was created by '\"+(o.author||\"[anonymous]\")+\"'.\"; }\n\t\telse if (!isChanged) { text = \"No unsaved changes.\" }\n\t\telse if (isNew) { text = \"Save will create a shareable public link.\"; }\n\t\telse { text = \"Save will update the current link.\"; }\n\n\t\tif (!isOwned && !isChanged) { text += \" Fork to create your own copy.\"; }\n\t\telse if (!isNew) { text += \" Fork will create a new copy\" + (isChanged ? \" with your changes.\" : \".\"); }\n\t\t\n\t\tthis._setSaveText(text);\n\n\t\tthis._linkRow.pattern = this._pattern.id && this._pattern;\n\n\t\t$.toggleClass(this._privateRow, \"disabled\", isNew || !isOwned);\n\t\t$.toggleClass(this._favoritesRow, \"disabled\", isNew || !isOwned);\n\t\t$.toggleClass(this._communityRow, \"disabled\", isNew || !isOwned);\n\t\t$.toggleClass(this._deleteRow, \"disabled\", isNew || !isOwned);\n\n\t\t$.toggleClass(this._privateRow, \"active\", o.access === \"private\");\n\t\t$.toggleClass(this._favoritesRow, \"active\", !!o.favorite);\n\t}\n\t\n\t_isNew() {\n\t\treturn !this._pattern.id;\n\t}\n\n\t_isOwned() {\n\t\tlet o = this._pattern;\n\t\treturn this._isNew() || (o.userId === app.account.userId);\n\t}\n\n\t_isChanged() {\n\t\treturn app.unsaved;\n\t}\n\n\t_canSave() {\n\t\treturn this._isChanged() && this._isOwned();\n\t}\n\n\t_canFork() {\n\t\treturn !this._isNew();\n\t}\n\n\t_pushHistory(pattern) {\n\t\tlet history = window.history, url = Utils.getPatternURL(pattern);\n\t\tlet title = \"RegExr: \"+ (pattern.name || \"Learn, Build, & Test RegEx\");\n\t\t\n\t\tif (history.state && (pattern.id === history.state.id)) {\n\t\t\thistory.replaceState(pattern, title, url);\n\t\t} else {\n\t\t\thistory.pushState(pattern, title, url);\n\t\t}\n\t\twindow.document.title = title;\n\t}\n\n\t_handleKey(evt) {\n\t\tlet mac = Utils.isMac();\n\t\tif (evt.key === \"s\" && ((mac && evt.metaKey) || (!mac && evt.ctrlKey))) {\n\t\t\tthis._doSave(false);\n\t\t\tevt.preventDefault();\n\t\t}\n\t}\n\n\t_doSave(fork) {\n\t\t// if we can't save for some reason, then show the panel.\n\t\tif (!fork && !this._canSave()) {\n\t\t\tapp.sidebar.goto(\"share\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (fork && !this._canFork()) { return; }\n\n\t\tlet o = app.state;\n\t\t$.addClass($.query(\".buttons\", this.saveEl), \"wait\");\n\t\tthis.saveStatus.distract();\n\t\tServer.save(o, fork)\n\t\t\t.then((data) => this._handleSave(data))\n\t\t\t.catch((err) => this._handleSaveErr(err));\n\t}\n\n\t_handleSave(data) {\n\t\tlet isNew = (this._pattern.id == null), isFork = !isNew && (data.id !== this._pattern.id);\n\t\t$.removeClass($.query(\".buttons\", this.saveEl), \"wait\");\n\t\tthis.saveStatus.hide();\n\n\t\tapp.state = data;\n\n\t\tif (isFork || isNew) {\n\t\t\tthis.show();\n\t\t\tif (isFork || !this.name) {\n\t\t\t\tthis.nameFld.focus();\n\t\t\t\tthis.nameFld.select();\n\t\t\t}\n\t\t\tthis._linkRow.showMessage(\"Saved. New share link created. Click to copy to clipboard.\");\n\t\t}\n\t}\n\t\n\t_handleSaveErr(err) {\n\t\t$.removeClass($.query(\".buttons\", this.saveEl), \"wait\");\n\t\tthis.saveStatus.error(this._getErrMsg(err));\n\t}\n\t\n\t_doNew() {\n\t\tapp.newDoc();\n\t}\n\n\t_doPrivate() {\n\t\tlet o = this._pattern;\n\t\tthis._privateStatus.distract();\n\t\tServer.private(o.id, o.access !== \"private\")\n\t\t\t.then((data) => this._handlePrivate(data))\n\t\t\t.catch((err) => this._handleErr(err, this._privateStatus));\n\t}\n\n\t_handlePrivate(data) {\n\t\tif (data.id === this._pattern.id) {\n\t\t\tthis._pattern.access = data.access;\n\t\t\tthis._privateStatus.hide();\n\t\t\tthis._updateUI();\n\t\t}\n\t}\n\t\n\t_doFavorite() {\n\t\tlet o = this._pattern;\n\t\tthis._favoritesStatus.distract();\n\t\tServer.favorite(o.id, !o.favorite)\n\t\t\t.then((data) => this._handleFavorite(data))\n\t\t\t.catch((err) => this._handleErr(err, this._favoritesStatus));\n\t}\n\t\n\t_handleFavorite(data) {\n\t\tif (data.id === this._pattern.id) {\n\t\t\tthis._pattern.favorite = data.favorite;\n\t\t\tthis._favoritesStatus.hide();\n\t\t\tthis._updateUI();\n\t\t}\n\t}\n\n\t_doDelete() {\n\t\tlet o = this._pattern;\n\t\tif (!confirm(\"Are you sure you want to permanently delete this pattern?\")) { return; }\n\t\tthis._deleteStatus.distract();\n\t\tServer.delete(o.id)\n\t\t\t.then((data) => this._handleDelete(data))\n\t\t\t.catch((err) => this._handleErr(err, this._deleteStatus));\n\t}\n\n\t_handleDelete(data) {\n\t\tthis._deleteStatus.hide();\n\t\tapp.state = {\n\t\t\tflavor: app.flavor.value\n\t\t}\n\t\tsetTimeout(()=>app.tooltip.toggle.showOn(\"delete\", \"Pattern was permanently deleted.\", this._deleteRow, true, 0), 1);\n\t}\n\n\t_handleErr(err, status) {\n\t\tstatus.error(this._getErrMsg(err)).hide(6);\n\t}\n\n\t_showCommunity() {\n\t\tapp.sidebar.goto(\"share_community\");\n\t\tthis._comNameFld.value = this.name;\n\t\tthis._comAuthorFld.value = this.author;\n\t\tthis._comDescriptionFld.value = this.description;\n\t\tthis._comKeywordsFld.value = this.keywords;\n\t}\n\n\t_doComSave() {\n\t\tif (!this._comNameFld.value) {\n\t\t\tthis._comNameFld.focus();\n\t\t\treturn;\n\t\t}\n\t\tlet o = app.state;\n\t\tthis.name = o.name = this._comNameFld.value;\n\t\tthis.author = o.author = this._comAuthorFld.value;\n\t\tthis.description = o.description = this._comDescriptionFld.value;\n\t\tthis.keywords = o.keywords = this._comKeywordsFld.value;\n\t\to.access = \"public\";\n\t\t$.addClass($.query(\".buttons\", this.communityEl), \"wait\");\n\t\tthis.comSaveStatus.distract();\n\t\tServer.save(o, true, true)\n\t\t\t.then((data) => this._handleComSave(data))\n\t\t\t.catch((err) => this._handleComSaveErr(err));\n\t}\n\n\t_handleComSave(data) {\n\t\t$.removeClass($.query(\".buttons\", this.communityEl), \"wait\");\n\t\tthis.comSaveStatus.hide();\n\t\tthis.show();\n\t}\n\n\t_handleComSaveErr(err) {\n\t\t$.removeClass($.query(\".buttons\", this.communityEl), \"wait\");\n\t\tthis.comSaveStatus.error(this._getErrMsg(err));\n\t}\n\n\t_handleChange() {\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\n\t_handleAppChange() {\n\t\tthis._updateUI();\n\t}\n\n\t_handleAccountChange() {\n\t\tlet acc = app.account, rowEl = $.query(\".signin.row\", this.mainEl);\n\t\tif (!this.authorFld.value) { this.authorFld.value = acc.author || acc.username; }\n\t\t$.toggleClass(rowEl, \"authenticated\", acc.authenticated);\n\t\t$.query(\".username\", rowEl).innerText = acc.username;\n\t}\n\n\t_handleAppLoad() {\n\t\t$.toggleClass($.query(\".save .actions\", this.mainEl), \"disabled\");\n\t}\n\n\t_doSignin() {\n\t\tapp.account.showTooltip();\n\t}\n\n\t_setSaveText(str) {\n\t\tthis.saveMessage.innerText = str;\n\t}\n\n\t_getErrMsg(err) {\n\t\treturn \"ERROR: \"+app.reference.getError(\"servercomm\");\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport $ from \"../utils/DOMUtils\";\nimport Utils from \"../utils/Utils\";\n\nimport List from \"../controls/List\";\nimport content from \"../docs/sidebar_content\";\nimport Track from \"../utils/Track\";\nimport Server from \"../net/Server\";\nimport Community from \"./Community\";\nimport Example from \"./Example\";\nimport Share from \"./Share\";\n\nimport app from \"../app\";\n\nexport default class Sidebar {\n\tconstructor (el) {\n\t\tthis.el = el;\n\t\tthis.itemEl = null;\n\t\tthis.openReq = null;\n\t\tthis._initUI(el);\n\t\tthis._content = this._prepContent(content);\n\t\tthis.minList.data = [{id: \"menu\", label:\"Menu\"}].concat(content.kids);\n\t\tapp.flavor.on(\"change\", ()=>this._onFlavorChange());\n\t\tlet id = app.prefs.read(\"side\");\n\t\tif (!id || !this._idMap[id] || id === \"share\") { id = \"home\"; }\n\t\tthis.goto(id);\n\t\tif (app.isNarrow) { setTimeout(() => this.minimize(true, false), 1500); }\n\t}\n\n\tminimize(val=true, track=true) {\n\t\tif (val === this._minimized) { return; }\n\t\tif (val && track) { Track.event(\"minimize_menu\", \"engagement\"); }\n\t\t$.togglePanel(this.el, '.full', '.min', !val);\n\t\tthis._minimized = val;\n\t\tthis._updateUI();\n\t}\n\t\n\tgoto(id) {\n\t\tthis.show(this._idMap[id]);\n\t}\n\t\n\tshowToken(token) {\n\t\tthis.goto(app.reference.idForToken(token));\n\t}\n\t\n\tshow(item) {\n\t\tif (!item) { return; }\n\t\tif (item.hide) { return this.show(item.parent); }\n\t\tif (!item || item.id === \"menu\") { return; } // expand button on the min menu\n\t\tthis.minimize(false);\n\t\tif (item.id) {\n\t\t\tif (item.id === \"home\" || (item.parent && item.parent.id === \"home\") || this._isInReference(item)) {\n\t\t\t\tapp.prefs.write(\"side\", item.id);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!item.el && !item.kids) {\n\t\t\tif (this.searchMode || !item.parent || item.parent === this.curItem) {\n\t\t\t\t// in a search, community / favorites, of selecting a leaf child from a list.\n\t\t\t\tthis.selItem = item;\n\t\t\t\tthis.menuList.selected = item.id;\n\t\t\t\treturn this._showContent(item);\n\t\t\t} else if (item.parent !== this.curItem) {\n\t\t\t\t// trying to jump to a leaf child without previously showing parent.\n\t\t\t\tthis.show(item.parent);\n\t\t\t\treturn this.show(item);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis._resetFull();\n\t\t\n\t\tthis.curItem = item;\n\t\t$.query(\"h1\", this.titleEl).innerText = item.label;\n\t\t$.query(\"svg.back.icon use\", this.titleEl).setAttribute(\"xlink:href\", \"#\"+(item.parent ? \"arrowleft\" : \"menu\"));\n\t\tif (item.el) {\n\t\t\tthis._showEl($.query(\"#library \"+item.el));\n\t\t} else {\n\t\t\tthis._showContent(item);\n\t\t}\n\t\t\n\t\tif (item.kids && item.list !== false) {\n\t\t\t$.removeClass(this.fullEl, \"no-list\");\n\t\t\tthis.menuList.data = item.kids || item.parent.kids;\n\t\t}\n\t\tif (item.search) { $.removeClass(this.fullEl, \"no-search\"); }\n\t\t\n\t\t// special handling:\n\t\tif (item.id === \"community\") {\n\t\t\tthis.menuList.template = this.communityListTemplate;\n\t\t\tthis._onSearchSubmit();\n\t\t} else if (item.id === \"favorites\") {\n\t\t\tthis.menuList.template = this.communityListTemplate;\n\t\t\tthis._loadFavorites();\n\t\t}\n\t}\n\t\n\tback() {\n\t\tif (this.curItem.parent) { this.show(this.curItem.parent); }\n\t\telse { this.minimize(true); }\n\t}\n\t\n\tmenuListTemplate(o) {\n\t\treturn (o.parent && o.parent.id === \"home\" ? '' : \"\") + \n\t\t\t ''+ (o.label||o.id) +\"\" + \n\t\t\t (o.token ? ''+ o.token.replace(\"<\", \"<\") + '' : \"\") +\n\t\t\t (o.kids || o.el ? '' : \"\");\n\t}\n\t\n\tcommunityListTemplate(o) {\n\t\treturn ''+ Utils.htmlSafe(o.name) +\"\" +\n\t\t\t '' +\n\t\t\t (o.favorite ? '' : '') +\n\t\t\t ''+o.rating.toFixed(1)+'';\n\t}\n\t\n// private methods:\n\t_initUI(el) {\n\t\t// set up full width content:\n\t\tthis.fullEl = $.query(\"> .full\", el);\n\t\t\n\t\t// title bar:\n\t\tthis.titleEl = $.query(\"> header\", this.fullEl);\n\t\t$.query(\"> .close.icon\", this.titleEl).addEventListener(\"click\", () => this.minimize(true));\n\t\t$.query(\"> .backrow\", this.titleEl).addEventListener(\"click\", () => this.back());\n\t\t\n\t\t// search:\n\t\tthis.searchEl = $.query(\"> .search\", this.fullEl);\n\t\tthis.searchFld = $.query(\"> .search > input\", this.fullEl);\n\t\tthis.searchFld.addEventListener(\"input\", ()=>this._onSearchChange());\n\t\tthis.searchFld.addEventListener(\"keyup\", (evt)=>(evt.keyCode === 13)&&this._onSearchSubmit());\n\t\tlet searchBtn = $.query(\"> svg.icon.search\", this.searchEl);\n\t\tsearchBtn.addEventListener(\"click\", ()=>this._onSearchSubmit());\n\t\t\n\t\t// list & content:\n\t\tthis.listEl = $.query(\"> .list\", this.fullEl);\n\t\tthis.menuList = new List(this.listEl, {data:content.kids, template:this.menuListTemplate});\n\t\tthis.menuList.on(\"change\", () => {\n\t\t\tconst lastId = this.curItem.id;\n\t\t\tthis.show(this.menuList.selectedItem);\n\t\t\tif (lastId !== this.curItem.id) {\n\t\t\t\tTrack.page(\"sidebar/\"+this.curItem.id);\n\t\t\t}\n\t\t});\n\t\tthis.menuList.on(\"dblclick\", ()=> this._onDblClick(this.menuList.selectedItem));\n\t\tthis.contentEl = $.query(\"> .content\", this.fullEl);\n\t\t\n\t\t// set up minimized sidebar:\n\t\tthis.minEl = $.query(\"> .min\", el);\n\t\tthis.minEl.addEventListener(\"click\", () => this.minimize(false));\n\t\t\n\t\tlet template = $.template``;\n\t\tthis.minList = new List($.query(\"> .list\", this.minEl), {template});\n\t\tthis.minList.on(\"change\", (evt)=> { this.show(this.minList.selectedItem); evt.preventDefault(); Track.page(\"sidebar/\"+this.curItem.id); });\n\n\t\t// set up special content:\n\t\tthis.community = new Community($.query(\"#library > #community\"));\n\t\tthis.share = new Share($.query(\"#library > #share\"));\n\t\tthis._prepCheatsheet(); // TODO: switch to a Cheatsheet class.\n\n\t\t$.query(\".doc > .blocker\").addEventListener(\"mousedown\", (evt) => {\n\t\t\tthis.minimize(true);\n\t\t})\n\t}\n\n\t_updateUI() {\n\t\t// TODO: this is cheating a bit:\n\t\tlet doc = $.query(\".doc\");\n\t\t$.toggleClass(doc, \"fadeback\", !this._minimized);\n\t}\n\n\t_resetFull() {\n\t\tif (this.itemEl) {\n\t\t\t$.query(\"#library\").appendChild(this.itemEl);\n\t\t\tthis.itemEl = null;\n\t\t}\n\t\tthis._abortReq();\n\t\t$.addClass(this.fullEl, \"no-search no-list\");\n\t\tthis.searchFld.value = \"\";\n\t\tthis.searchMode = false;\n\t\tthis.menuList.template = this.menuListTemplate;\n\t\t$.removeClass(this.searchEl, \"wait\");\n\t}\n\t\n\t_showContent(o) {\n\t\tif ((this.curItem.id === \"community\" || this.curItem.id === \"favorites\") && o !== this.curItem) {\n\t\t\tthis._showEl(this.community.el);\n\t\t\tthis.community.item = o;\n\t\t} else {\n\t\t\tlet ref = app.reference;\n\t\t\tthis.contentEl.innerHTML = this._isInReference(o) ? ref.getContent(o.id) : ref.fillTags((o.desc || \"\") + (o.ext || \"\"), o, ref);\n\t\t\tif (o.example) { this.contentEl.appendChild(new Example(\"Example\", o.example).el); }\n\t\t}\n\t}\n\n\t_isInReference(o) {\n\t\treturn this._isIn(o, \"reference\");\n\t}\n\t\n\t_isIn(o, id) {\n\t\tdo { if (o.id === id) { return true; } } while (o = o.parent);\n\t\treturn false;\n\t}\n\t\n\t_onDblClick(o) {\n\t\tif (o.token) {\n\t\t\tlet expr = app.expression;\n\t\t\tif (o.parent.id === \"flags\") { expr.toggleFlag(o.token); }\n\t\t\telse { expr.insert(o.token); }\n\t\t} else if (this.curItem.id === \"community\" || this.curItem.id === \"favorites\") {\n\t\t\tapp.load(o);\n\t\t}\n\t}\n\t\n\t_showEl(el) {\n\t\tif (this.itemEl === el) { return; }\n\t\tthis.itemEl = el;\n\t\t$.empty(this.contentEl).appendChild(el);\n\t}\n\n\t_prepContent(content) {\n\t\t// inject reference:\n\t\tlet i = Utils.findIndex(content.kids, (o)=>o.id===\"reference\");\n\t\tcontent.kids.splice(i, 1, app.reference.content);\n\t\t// grab home content from HTML:\n\t\tcontent.desc = this.contentEl.innerHTML;\n\t\t// build idMap:\n\t\tthis._idMap = {home:content};\n\t\treturn Utils.prepMenuContent(content, this._idMap);\n\t}\n\t\n\t_prepCheatsheet() {\n\t\tlet els = $.queryAll(\"#cheatsheet *[data-id]\");\n\t\tlet f = (evt)=>this.goto(evt.target.dataset.id);\n\t\tfor (let i=0, l=els.length; iapp.expression.insert(evt.target.innerText);\n\t\tfor (let i=0, l=els.length; i o.hide = !rank(o, search));\n\t\tthis.menuList.data = data;\n\t}\n\t\n\t_onFlavorChange() {\n\t\tlet item = this.selItem || this.curItem;\n\t\tif (!this._isInReference(item)) { return; }\n\t\tthis.selItem = this.curItem = null;\n\t\tthis.show(item);\n\t}\n\t\n\t_onSearchSubmit() {\n\t\tthis._abortReq();\n\t\tlet val = this.searchFld.value;\n\t\tif (this.curItem.id === \"community\") {\n\t\t\tif (val) { Track.event(\"search\", \"engagement\", {search_term:val, target:\"community\"}); }\n\t\t\t$.addClass(this.searchEl, \"wait\");\n\t\t\tthis._showListMsg();\n\t\t\tthis.openReq = Server.communitySearch(val)\n\t\t\t\t.then((data)=>this._showServerResults(data))\n\t\t\t\t.catch((msg)=>this._showListMsg(msg))\n\t\t\t\t.finally(()=>this._reqCleanup());\n\t\t}\n\t\tthis.searchFld.select();\n\t}\n\t\n\t_loadFavorites() {\n\t\tthis._abortReq();\n\t\tlet val = this.searchFld.value;\n\t\tthis.openReq = Server.patterns()\n\t\t\t.then((data)=>this._showServerResults(data))\n\t\t\t.catch((msg)=>this._showListMsg(msg))\n\t\t\t.finally(()=>this._reqCleanup());\n\t\tthis._showListMsg();\n\t}\n\n\t_showListMsg(msg=\"Loading...\") {\n\t\tthis.listEl.innerHTML = \"
  • \"+msg+\"
  • \";\n\t}\n\t\n\t_abortReq() {\n\t\tif (this.openReq) { this.openReq.abort(); }\n\t\tthis.openReq = null;\n\t}\n\t\n\t_showServerResults(data) {\n\t\tthis.menuList.data = data.results;\n\t\tif (data.results.length === 0) {\n\t\t\tthis._showListMsg(this.curItem.id === \"community\" ? \"No matches.\" : \"No patterns created or favorited.\");\n\t\t}\n\t}\n\t\n\t_reqCleanup(msg) {\n\t\t$.removeClass(this.searchEl, \"wait\");\n\t}\n\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport $ from \"../utils/DOMUtils\"\nimport app from \"../app\";\n\nexport default class Theme extends EventDispatcher {\n\tconstructor (el) {\n\t\tsuper();\n\t\tthis.el = el;\n\t\tthis.urlTemplate = \"./assets/themes/%name%.css\";\n\t\tthis.targetNode = this._node = null;\n\t\tthis._dark = false;\n\t\tthis._initUI();\n\t\tthis.dark = !!app.prefs.read(\"dark\");\n\t}\n\n\tset dark(val) {\n\t\tval = !!val;\n\t\tif (this._dark === val) { return; }\n\t\tthis._dark = val;\n\t\tthis._load(val ? \"dark\" : null);\n\t\t$.toggleClass(this.themeBtn, \"selected\", val);\n\t\tapp.prefs.write(\"dark\", val);\n\t}\n\t\n\tget dark() {\n\t\treturn this._dark;\n\t}\n\n\t_initUI() {\n\t\tthis.themeBtn = $.query(\".header .button.theme\", this.el);\n\t\tthis.themeBtn.addEventListener(\"click\", (evt) => this._toggleTheme());\n\t}\n\n\t_load(id) {\n\t\tif (id === this._id) { return; }\n\t\tthis._id = id;\n\t\tif (this._node) { this._node.remove(); }\n\t\tif (!id) { this._change(); return; }\n\t\tlet tmpl = this.urlTemplate, n = $.create(\"link\");\n\t\tn.addEventListener(\"load\", () => this._change());\n\t\tn.rel = \"stylesheet\";\n\t\tn.type = \"text/css\";\n\t\tn.href = tmpl ? tmpl.replace(/%name%/g, id) : id;\n\t\tthis._node = (this.targetNode || document.head).appendChild(n);\n\t}\n\n\t_change() {\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\n\t_toggleTheme() {\n\t\tthis.dark = !this.dark;\n\t}\n\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"../utils/Utils.js\";\n\nexport default class Reference {\n\t\n\tconstructor(content, flavor, config) {\n\t\tthis._config = config;\n\t\tthis._flavor = flavor;\n\t\tthis._flavor.on(\"change\", ()=> this._flavorChange());\n\t\t\n\t\tthis._injectEscChars(content);\n\t\t\n\t\tthis._idMap = {reference:content};\n\t\tthis._content = Utils.prepMenuContent(content, this._idMap);\n\t\tthis._misc = Utils.prepMenuContent(content.misc, this._idMap);\n\t\tthis._flavorChange();\n\t}\n\t\n\tget content() {\n\t\treturn this._content;\n\t}\n\t\n\tsearch(searchStr) {\n\t\tfunction srch(kids, results) {\n\t\t\tfor (let i=0, l=kids.length; ib.__searchPoints - a.__searchPoints);\n\t}\n\t\n\tidForToken(token) {\n\t\tlet errId = token.error && token.error.id;\n\t\tif (this._idMap[errId]) { return errId; }\n\t\tif (this._idMap[token.type]) { return token.type; }\n\t\tif (this._idMap[token.clss]) { return token.clss; }\n\t\treturn errId || token.type || token.clss;\n\t}\n\t\n// methods used in fillTags:\n\tgetChar(token) {\n\t\tlet chr = Reference.NONPRINTING_CHARS[token.code];\n\t\treturn chr ? chr : \"\\\"\" + String.fromCharCode(token.code) + \"\\\"\";\n\t}\n\t\n\tgetQuant(token) {\n\t\tlet min = token.min, max = token.max;\n\t\treturn min === max ? min : max === -1 ? min + \" or more\" : \"between \" + min + \" and \" + max;\n\t}\n\t\n\tgetUniCat(token) {\n\t\treturn Reference.UNICODE_CATEGORIES[token.value] || \"[Unrecognized]\";\n\t}\n\n\tgetModes(token) {\n\t\tlet str = (token.on ? \" Enable \\\"\"+token.on+\"\\\".\" : \"\")\n\t\tif (token.off) { str += \" Disable \\\"\"+token.off+\"\\\".\"; }\n\t\treturn str;\n\t}\n\n\tgetInsensitive(token) {\n\t\tif (token.code) {\n\t\t\tlet chr = String.fromCharCode(token.code);\n\t\t\tif (chr.toLowerCase() === chr.toUpperCase()) { return \"\"; }\n\t\t}\n\t\treturn token.modes ? `Case ${token.modes.i ? \"in\" : \"\"}sensitive.` : \"\";\n\t}\n\n\tgetDotAll(token) {\n\t\treturn (token.modes.s ? \"including\" : \"except\") + \" line breaks\";\n\t}\n\n\tgetLabel(token) {\n\t\tlet node = this.getNodeForToken(token);\n\t\treturn node ? node.label || node.id || \"\" : token.type;\n\t}\n\n\tgetDesc(token) {\n\t\treturn this.getVal(this.getNodeForToken(token), \"desc\");\n\t}\n\n\tgetLazy(token) {\n\t\treturn token.modes.U ? \"greedy\" : \"lazy\";\n\t}\n\n\tgetLazyFew(token) {\n\t\treturn token.modes.U ? \"many\" : \"few\";\n\t}\n\n\tgetPHPVersion() {\n\t\treturn this._config.PHPVersion;\n\t}\n\n\tgetPCREVersion() {\n\t\treturn this._config.PCREVersion;\n\t}\n\n\tgetCtrlKey() {\n\t\treturn Utils.getCtrlKey();\n\t}\n\n\tgetEscChars() {\n\t\tlet o = this._flavor.profile.escChars, str=\"\";\n\t\tfor (let n in o) { str += n; }\n\t\treturn str;\n\t}\n\n\t/*\n\tSearches for tags in the string in the format:\n\t`{{prop.prop}}` or `{{method(prop.prop)}}`\n\t\n\tThe first format will inject the specified property of the data object.\n\tFor example, `{{a.b}}` would inject the value of `data.a.b`.\n\t\n\tThe second will inject the results of calling the specified function on the functs object with a property of the data object as it's parameter (or the data object itself if empty).\n\tFor example, `{{myMethod(a.b)}}` would inject the return value of `functs.myMethod(data.a.b)`.\n\t\n\tCurrently only supports a single param.\n\t */\n\tfillTags(str, data, functs, maxLength=20, htmlSafe=true) {\n\t\tlet match;\n\t\twhile (match = str.match(/{{~?[\\w.()]+}}/)) {\n\t\t\tlet val, f, safe=false;\n\t\t\tval = match[0].substring(2, match[0].length - 2);\n\t\t\tif (val[0] === \"~\") {\n\t\t\t\tval = val.substr(1);\n\t\t\t\tsafe = true;\n\t\t\t}\n\t\t\tlet match2 = val.match(/\\([\\w.]*\\)/);\n\t\t\tif (match2) {\n\t\t\t\tf = val.substr(0, match2.index);\n\t\t\t\tval = match2[0].substring(1, match2[0].length - 1);\n\t\t\t} else {\n\t\t\t\tf = null;\n\t\t\t}\n\t\t\tlet o = data, arr = val.split(\".\");\n\t\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\t\tlet prop = arr[i];\n\t\t\t\tif (prop && o) { o = o[prop]; }\n\t\t\t}\n\t\t\tval = o;\n\t\t\tif (f) {\n\t\t\t\tif (functs[f]) { val = functs[f](val); }\n\t\t\t\telse { val = \" [\"+f+\"] \"; }\n\t\t\t}\n\t\t\tif (!safe && (maxLength || htmlSafe)) { val = Utils.shorten(val, maxLength, htmlSafe, \"i\"); }\n\t\t\tstr = str.replace(match[0], val);\n\t\t}\n\t\treturn str;\n\t}\n\t\n\t// returns doc props from the profile or reference as appropriate (ex. tip, desc, ext)\n\tgetVal(node, prop) {\n\t\tif (!node) { return \"\"; }\n\t\tlet pDocs = this._flavor.getDocs(node.id), pRef = (pDocs && pDocs[prop]);\n\t\tif (pRef != null && pRef[0] !== \"+\") { return pRef; }\n\t\tlet ref=(node&&node[prop])||\"\";\n\t\treturn pRef != null ? ref+pRef.substr(1) : ref;\n\t}\n\t\n\tgetNodeForToken(token) {\n\t\tlet id=this.idForToken(token), clss = token.clss;\n\t\t\n\t\t// Special cases:\n\t\tif (clss === \"quant\") { id = clss; }\n\t\tif (clss === \"esc\" && token.type !== \"escsequence\") { id = \"escchar\"; }\n\n\t\treturn this.getNode(id);\n\t}\n\n\tgetNode(id) {\n\t\tlet map=this._idMap, node = map[id]\n\t\twhile (node&&node.proxy) { node = map[node.proxy]; }\n\t\treturn node;\n\t}\n\t\n\tgetError(error, token) {\n\t\tlet errId = error && error.id;\n\t\tlet str = this._content.errors[errId] || \"no docs for error='\" + errId + \"'\";\n\t\tif (token) { str = this.fillTags(str, token, this, 20); }\n\t\treturn str;\n\t}\n\t\n\ttipForToken(token) {\n\t\tif (!token) { return null; }\n\n\t\tlet node = this.getNodeForToken(token), label, tip;\n\n\t\tif (token.error && !token.error.warning) {\n\t\t\tlabel = \"ERROR: \";\n\t\t\ttip = this.getError(token.error, token);\n\t\t} else {\n\t\t\tlabel = node ? node.label || node.id || \"\" : token.type;\n\t\t\ttip = this.getVal(node, \"tip\") || this.getVal(node, \"desc\");\n\t\t\ttip = this.fillTags(tip, token, this, 20);\n\t\t\tif (token.type === \"group\") { label += \" #\" + token.num; }\n\t\t\tlabel = \"\" + label[0].toUpperCase() + label.substr(1) + \". \";\n\n\t\t\tif (token.error) {\n\t\t\t\ttip += \"WARNING: \" + this.getError(token.error, token) + \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn tip ? label + tip : \"no docs for id='\" + this.idForToken(token) + \"'\";\n\t}\n\t\n\tgetContent(id) {\n\t\tlet node = this.getNode(id);\n\t\treturn this.fillTags(this.getVal(node, \"desc\") + this.getVal(node, \"ext\"), node, this);\n\t}\n\t\n\t// TODO: this isn't necessarily the most ideal place for this method (has nothing to do with Reference). Maybe move into Text?\n\ttipForMatch(match, text) {\n\t\tif (!match) { return null; }\n\t\tlet more = match.l > 150;\n\t\tlet str = \"match: \" + Utils.shorten(text.substr(match.i, match.l), 150, true, \"i\") +\n\t\t\t\t \"
    range: \" + match.i + \"-\" + (match.i+match.l-1)+ \"\";\n\t\t\n\t\tlet groups = match.groups, l = groups && groups.length;\n\t\tfor (let i = 0; i < l; i++) {\n\t\t\tif (i > 3 && l > 5) {\n\t\t\t\tmore = false;\n\t\t\t\tstr += \"
    see Details for \"+(l-i)+\" more\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet group = groups[i], s;\n\t\t\ts = (group.i !== undefined) ? text.substr(group.i, group.l) : group.s;\n\t\t\tmore = more || (s && s.length > 50);\n\t\t\tstr += (i > 0) ? \"
    \" : \"
    \";\n\t\t\tstr += \"group #\" + (i+1) + \": \" + Utils.shorten(s, 50, true, \"i\");\n\t\t}\n\t\tif (more) { str += \"
    see Details for full matches\" }\n\t\treturn str;\n\t};\n\t\n// private methods:\n\t_flavorChange() {\n\t\tthis._updateHide(this.content);\n\t}\n\t\n\t_updateHide(o, list) {\n\t\t// the list param is for debugging, it is populated with the ids of all nodes that were hidden.\n\t\t// parent nodes aren't hidden unless all their children are.\n\t\tlet kids = o.kids, hide=true;\n\t\tif (kids) {\n\t\t\tfor (let i = 0, l = kids.length; i < l; i++) {\n\t\t\t\thide = this._updateHide(kids[i], list) && hide;\n\t\t\t}\n\t\t} else {\n\t\t\thide = (o.show === false) || (o.show !== true && o.id && !this._flavor.isTokenSupported(o.id));\n\t\t}\n\t\tif (list && hide) { list.push(o.id); }\n\t\treturn (o.hide = hide);\n\t}\n\n\t_injectEscChars(content) {\n\t\tlet kids=Utils.find(content.kids, (o)=>o.id===\"escchars\").kids;\n\t\tlet template = Utils.find(content.misc.kids, (o)=>o.id===\"escchar\").tip;\n\t\t// \\x07 - bell, \\x1b - esc\n\t\tlet chars = \"\\t\\n\\v\\f\\r\\0\\x07\\x1b\", tokens = \"tnvfr0ae\"; // .\\\\+*?^$[]{}()|/\n\t\tfor (let i=0, l=chars.length; i.\n*/\n\n// this is just raw content for the Reference.\n// right now all examples are executed in-browser, so they need to be compatible. Maybe swap to XRegExp at some point.\n// TODO: rewrite to use multiline template literals?\n\nlet reference_content = {}, o = reference_content;\nexport default reference_content; \n\no.label = \"RegEx Reference\";\no.id = \"reference\";\no.search = true,\no.desc = `Information on all of the tokens available to create regular expressions.\n\t

    Double-click an item in the list to insert it into your Expression.

    \n\t

    Click the arrow beside an example to load it.

    `;\n\no.kids = [\n\t{\n\tlabel: \"Character classes\",\n\tid: \"charclasses\",\n\tdesc: \"Character classes match a character from a specific set. There are a number of predefined character classes and you can also define your own sets.\",\n\tkids: [\n\t\t\n\t\t{\n\t\tid:\"set\",\n\t\tlabel: \"character set\",\n\t\tdesc:\"Match any character in the set.\",\n\t\texample:[\"[aeiou]\",\"glib jocks vex dwarves!\"],\n\t\ttoken:\"[ABC]\"\n\t\t},\n\t\t{\n\t\tid:\"setnot\",\n\t\tlabel: \"negated set\",\n\t\tdesc:\"Match any character that is not in the set.\",\n\t\texample:[\"[^aeiou]\",\"glib jocks vex dwarves!\"],\n\t\ttoken:\"[^ABC]\"\n\t\t},\n\t\t{\n\t\tid:\"range\",\n\t\ttip:\"Matches a character in the range {{getChar(prev)}} to {{getChar(next)}} (char code {{prev.code}} to {{next.code}}). {{getInsensitive()}}\",\n\t\texample:[\"[g-s]\",\"abcdefghijklmnopqrstuvwxyz\"],\n\t\tdesc: \"Matches a character having a character code between the two specified characters inclusive.\",\n\t\ttoken:\"[A-Z]\"\n\t\t},\n\t\t{\n\t\tid:\"posixcharclass\",\n\t\ttip:\"Matches any character in the '{{value}}' POSIX class.\",\n\t\tlabel:\"POSIX class\",\n\t\tdesc:\"Matches any character in the specified POSIX class. Must be in a character set. For example, [[:alnum:]$] will match alphanumeric characters and $.\",\n\t\text:\"

    For a list of classes, see the PCRE spec.

    \",\n\t\ttoken:\"[:alnum:]\"\n\t\t},\n\t\t{\n\t\tid:\"dot\",\n\t\ttip:\"Matches any character {{getDotAll()}}.\",\n\t\tdesc:\"Matches any character except linebreaks.\",\n\t\text:\" Equivalent to [^\\\\n\\\\r].\",\n\t\texample:[\".\", \"glib jocks vex dwarves!\"],\n\t\ttoken:\".\"\n\t\t},\n\t\t{\n\t\tid:\"matchanyset\",\n\t\tlabel:\"match any\",\n\t\tdesc:\"A character set that can be used to match any character, including line breaks, without the dotall flag (s).\"+\n\t\t\t\"

    An alternative is [^], but it is not supported in all browsers.

    \",\n\t\texample:[\"[\\\\s\\\\S]\", \"glib jocks vex dwarves!\"],\n\t\ttoken:\"[\\\\s\\\\S]\"\n\t\t},\n\t\t{\n\t\tid:\"unicodegrapheme\",\n\t\tlabel:\"unicode grapheme\",\n\t\tdesc:\"Matches any single unicode grapheme (ie. character).\",\n\t\text:\" This includes line breaks (regardless of the dotall mode) and graphemes encoded as multiple code points.\",\n\t\ttoken:\"\\\\X\"\n\t\t},\n\t\t{\n\t\tid:\"word\",\n\t\tdesc:\"Matches any word character (alphanumeric & underscore).\",\n\t\text:\" Only matches low-ascii characters (no accented or non-roman characters). Equivalent to [A-Za-z0-9_]\",\n\t\texample:[\"\\\\w\",\"bonjour, mon fr\\u00E8re\"],\n\t\ttoken:\"\\\\w\"\n\t\t},\n\t\t{\n\t\tid:\"notword\",\n\t\tlabel: \"not word\",\n\t\tdesc:\"Matches any character that is not a word character (alphanumeric & underscore).\",\n\t\text:\" Equivalent to [^A-Za-z0-9_]\",\n\t\texample:[\"\\\\W\",\"bonjour, mon fr\\u00E8re\"],\n\t\ttoken:\"\\\\W\"\n\t\t},\n\t\t{\n\t\tid:\"digit\",\n\t\tdesc:\"Matches any digit character (0-9).\",\n\t\text:\" Equivalent to [0-9].\",\n\t\texample:[\"\\\\d\",\"+1-(444)-555-1234\"],\n\t\ttoken:\"\\\\d\"\n\t\t},\n\t\t{\n\t\tid:\"notdigit\",\n\t\tlabel: \"not digit\",\n\t\tdesc:\"Matches any character that is not a digit character (0-9).\",\n\t\text:\" Equivalent to [^0-9].\",\n\t\texample:[\"\\\\D\",\"+1-(444)-555-1234\"],\n\t\ttoken:\"\\\\D\"\n\t\t},\n\t\t{\n\t\tid:\"whitespace\",\n\t\tdesc:\"Matches any whitespace character (spaces, tabs, line breaks).\",\n\t\texample:[\"\\\\s\", \"glib jocks vex dwarves!\"],\n\t\ttoken:\"\\\\s\"\n\t\t},\n\t\t{\n\t\tid:\"notwhitespace\",\n\t\tlabel: \"not whitespace\",\n\t\tdesc:\"Matches any character that is not a whitespace character (spaces, tabs, line breaks).\",\n\t\texample:[\"\\\\S\", \"glib jocks vex dwarves!\"],\n\t\ttoken:\"\\\\S\"\n\t\t},\n\t\t{\n\t\tid:\"hwhitespace\",\n\t\tlabel:\"horizontal whitespace\",\n\t\tdesc:\"Matches any horizontal whitespace character (spaces, tabs).\",\n\t\ttoken:\"\\\\h\"\n\t\t},\n\t\t{\n\t\tid:\"nothwhitespace\",\n\t\tlabel: \"not horizontal whitespace\",\n\t\tdesc:\"Matches any character that is not a horizontal whitespace character (spaces, tabs).\",\n\t\ttoken:\"\\\\H\"\n\t\t},\n\t\t{\n\t\tid:\"vwhitespace\",\n\t\tlabel:\"vertical whitespace\",\n\t\tdesc:\"Matches any vertical whitespace character (line breaks).\",\n\t\ttoken:\"\\\\v\"\n\t\t},\n\t\t{\n\t\tid:\"notvwhitespace\",\n\t\tlabel: \"not vertical whitespace\",\n\t\tdesc:\"Matches any character that is not a vertical whitespace character (line breaks).\",\n\t\ttoken:\"\\\\V\"\n\t\t},\n\t\t{\n\t\tid:\"linebreak\",\n\t\tlabel:\"line break\",\n\t\tdesc:\"Matches any line break character, including the CRLF pair, and CR / LF individually.\",\n\t\ttoken:\"\\\\R\"\n\t\t},\n\t\t{\n\t\tid:\"notlinebreak\",\n\t\tlabel:\"not line break\",\n\t\tdesc:\"Matches any character that is not a line break.\",\n\t\text:\" Similar to dot (.) but is unaffected by the dotall flag (s).\",\n\t\ttoken:\"\\\\N\"\n\t\t},\n\t\t{\n\t\tid:\"unicodecat\",\n\t\ttip:\"Matches any character in the '{{getUniCat()}}' unicode category.\",\n\t\tlabel:\"unicode category\",\n\t\tdesc:\"Matches a character in the specified unicode category. For example, \\\\p{Ll} will match any lowercase letter.\",\n\t\text:\"

    For a list of categories, see the PCRE spec.

    \"+\n\t\t\t\"

    There are multiple syntaxes for this feature:

    \\\\p{L} \\\\pL

    \",\n\t\ttoken:\"\\\\p{L}\"\n\t\t},\n\t\t{\n\t\tid:\"notunicodecat\",\n\t\ttip:\"Matches any character that is not in the '{{getUniCat()}}' unicode category.\",\n\t\tlabel:\"not unicode category\",\n\t\tdesc:\"Matches any character that is not in the specified unicode category.\",\n\t\text:\"

    For a list of categories, see the PCRE spec.

    \"+\n\t\t\t\"

    There are multiple syntaxes for this feature:

    \\\\P{L} \\\\p{^L} \\\\PL

    \",\n\t\ttoken:\"\\\\P{L}\"\n\t\t},\n\t\t{\n\t\tid:\"unicodescript\",\n\t\ttip:\"Matches any character in the '{{value}}' unicode script.\",\n\t\tlabel:\"unicode script\",\n\t\tdesc:\"Matches any character in the specified unicode script. For example, \\\\p{Arabic} will match characters in the Arabic script.\",\n\t\text:\"

    For a list of scripts, see the PCRE spec.

    \",\n\t\ttoken:\"\\\\p{Han}\"\n\t\t},\n\t\t{\n\t\tid:\"notunicodescript\",\n\t\ttip:\"Matches any character that is not in the '{{value}}' unicode script.\",\n\t\tlabel:\"not unicode script\",\n\t\tdesc:\"Matches any character that is not in the specified unicode script.\",\n\t\text:\"

    For a list of scripts, see the PCRE spec.

    \"+\n\t\t\t\"

    There are multiple syntaxes for this feature:

    \\\\P{Han} \\\\p{^Han}\",\n\t\ttoken:\"\\\\P{Han}\"\n\t\t}\n\t]\n\t},\n\n\t{\n\tlabel:\"Anchors\",\n\tid:\"anchors\",\n\tdesc:\"Anchors are unique in that they match a position within a string, not a character.\",\n\tkids:[\n\t\t{\n\t\tid:\"bos\",\n\t\tlabel:\"beginning of string\",\n\t\tdesc:\"Matches the beginning of the string.\",\n\t\text:\" Unlike ^, this is unaffected by the multiline flag (m). This matches a position, not a character.\",\n\t\ttoken:\"\\\\A\"\n\t\t},\n\t\t{\n\t\tid:\"eos\",\n\t\tlabel:\"end of string\",\n\t\tdesc:\"Matches the end of the string.\",\n\t\text:\" Unlike $, this is unaffected by the multiline flag (m). This matches a position, not a character.\",\n\t\ttoken:\"\\\\Z\"\n\t\t},\n\t\t{\n\t\tid:\"abseos\",\n\t\tlabel:\"strict end of string\",\n\t\tdesc:\"Matches the end of the string. Unlike $ or \\\\Z, it does not allow for a trailing newline.\",\n\t\text:\" This is unaffected by the multiline flag (m). This matches a position, not a character.\",\n\t\ttoken:\"\\\\z\"\n\t\t},\n\t\t{\n\t\tid:\"bof\",\n\t\tlabel:\"beginning\",\n\t\tdesc:\"Matches the beginning of the string, or the beginning of a line if the multiline flag (m) is enabled.\",\n\t\text:\" This matches a position, not a character.\",\n\t\texample:[\"^\\\\w+\",\"she sells seashells\"],\n\t\ttoken:\"^\"\n\t\t},\n\t\t{\n\t\tid:\"eof\",\n\t\tlabel:\"end\",\n\t\tdesc:\"Matches the end of the string, or the end of a line if the multiline flag (m) is enabled.\",\n\t\text:\" This matches a position, not a character.\",\n\t\texample:[\"\\\\w+$\",\"she sells seashells\"],\n\t\ttoken:\"$\"\n\t\t},\n\t\t{\n\t\tid:\"wordboundary\",\n\t\tlabel:\"word boundary\",\n\t\tdesc:\"Matches a word boundary position between a word character and non-word character or position (start / end of string).\",\n\t\text:\" See the word character class (\\w) for more info.\",\n\t\texample:[\"s\\\\b\",\"she sells seashells\"],\n\t\ttoken:\"\\\\b\"\n\t\t},\n\t\t{\n\t\tid:\"notwordboundary\",\n\t\tlabel: \"not word boundary\",\n\t\tdesc:\"Matches any position that is not a word boundary.\",\n\t\text:\" This matches a position, not a character.\",\n\t\texample:[\"s\\\\B\",\"she sells seashells\"],\n\t\ttoken:\"\\\\B\"\n\t\t},\n\t\t{\n\t\tid:\"prevmatchend\",\n\t\tlabel: \"previous match end\",\n\t\tdesc:\"Matches the end position of the previous match.\",\n\t\text:\" This matches a position, not a character.\",\n\t\ttoken:\"\\\\G\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tlabel: \"Escaped characters\",\n\tid:\"escchars\",\n\tdesc: \"Escape sequences can be used to insert reserved, special, and unicode characters. All escaped characters begin with the \\\\ character.\",\n\tkids: [\n\t\t{\n\t\tid:\"reservedchar\",\n\t\tlabel:\"reserved characters\",\n\t\tdesc:\"The following character have special meaning, and should be preceded by a \\\\ (backslash) to represent a literal character:\"+\n\t\t\t\"

    {{getEscChars()}}

    \"+\n\t\t\t\"

    Within a character set, only \\\\, -, and ] need to be escaped.

    \",\n\t\texample:[\"\\\\+\",\"1 + 1 = 2\"],\n\t\ttoken:\"\\\\+\",\n\t\tshow:true\n\t\t},\n\t\t{\n\t\tid:\"escoctal\",\n\t\tlabel:\"octal escape\",\n\t\tdesc:\"Octal escaped character in the form \\\\000.\",\n\t\text:\" Value must be less than 255 (\\\\377).\", // PCRE profile adds to ext.\n\t\texample:[\"\\\\251\",\"RegExr is \\u00A92014\"],\n\t\ttoken:\"\\\\000\"\n\t\t},\n\t\t{\n\t\tid:\"eschexadecimal\",\n\t\tlabel:\"hexadecimal escape\",\n\t\tdesc:\"Hexadecimal escaped character in the form \\\\xFF.\",\n\t\texample:[\"\\\\xA9\",\"RegExr is \\u00A92014\"],\n\t\ttoken:\"\\\\xFF\"\n\t\t},\n\t\t{\n\t\tid:\"escunicodeu\",\n\t\tlabel:\"unicode escape\",\n\t\tdesc:\"Unicode escaped character in the form \\\\uFFFF\",\n\t\texample:[\"\\\\u00A9\",\"RegExr is \\u00A92014\"],\n\t\ttoken:\"\\\\uFFFF\"\n\t\t},\n\t\t{\n\t\tid:\"escunicodeub\",\n\t\tlabel:\"extended unicode escape\",\n\t\tdesc:\"Unicode escaped character in the form \\\\u{FFFF}.\",\n\t\text:\" Supports a full range of unicode point escapes with any number of hex digits.

    Requires the unicode flag (u).

    \",\n\t\ttoken:\"\\\\u{FFFF}\"\n\t\t},\n\t\t{\n\t\tid:\"escunicodexb\",\n\t\tlabel:\"unicode escape\",\n\t\tdesc:\"Unicode escaped character in the form \\\\x{FF}.\",\n\t\ttoken:\"\\\\x{FF}\"\n\t\t},\n\t\t{\n\t\tid:\"esccontrolchar\",\n\t\tlabel:\"control character escape\",\n\t\tdesc:\"Escaped control character in the form \\\\cZ.\",\n\t\text:\" This can range from \\\\cA (SOH, char code 1) to \\\\cZ (SUB, char code 26).

    Example:

    \\\\cI matches TAB (char code 9).\",\n\t\ttoken:\"\\\\cI\"\n\t\t},\n\t\t{\n\t\tid:\"escsequence\",\n\t\tlabel:\"escape sequence\",\n\t\ttip: \"Matches the literal string '{{value}}'.\",\n\t\tdesc:\"All characters between the \\\\Q and the \\\\E are interpreted as a literal string. If \\\\E is omitted, it continues to the end of the expression.\",\n\t\text:\" For example, the expression /\\\\Q(?.)\\\\E/ will match the string (?.).\",\n\t\ttoken:\"\\\\Q...\\\\E\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tlabel: \"Groups & References\",\n\tid:\"groups\",\n\tdesc: \"Groups allow you to combine a sequence of tokens to operate on them together. Capture groups can be referenced by a backreference and accessed separately in the results.\",\n\tkids: [\n\t\t{\n\t\tid:\"group\",\n\t\tlabel: \"capturing group\",\n\t\tdesc: \"Groups multiple tokens together and creates a capture group for extracting a substring or using a backreference.\",\n\t\texample:[\"(ha)+\",\"hahaha haa hah!\"],\n\t\ttoken:\"(ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"namedgroup\",\n\t\tlabel: \"named capturing group\",\n\t\ttip:\"Creates a capturing group named '{{name}}'.\",\n\t\tdesc:\"Creates a capturing group that can be referenced via the specified name.\",\n\t\text:\"

    There are multiple syntaxes for this feature:

    (?'name'ABC) (?P<name>ABC) (?<name>ABC)

    \",\n\t\ttoken:\"(?ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"namedref\",\n\t\tlabel:\"named reference\",\n\t\ttip:\"Matches the results of the capture group named '{{group.name}}'.\",\n\t\tdesc:\"Matches the results of a named capture group.\",\n\t\text:\"

    There are multiple syntaxes for this feature:

    \\\\k'name' \\\\k<name> \\\\k{name} \\\\g{name} (?P=name)

    \",\n\t\ttoken:\"\\\\k'name'\"\n\t\t},\n\t\t{\n\t\tid:\"numref\",\n\t\tlabel:\"numeric reference\",\n\t\ttip:\"Matches the results of capture group #{{group.num}}.\",\n\t\tdesc:\"Matches the results of a capture group. For example \\\\1 matches the results of the first capture group & \\\\3 matches the third.\",\n\t\t// PCRE adds relative and alternate syntaxes in ext\n\t\texample:[\"(\\\\w)a\\\\1\",\"hah dad bad dab gag gab\"],\n\t\ttoken:\"\\\\1\"\n\t\t},\n\t\t{\n\t\tid:\"branchreset\",\n\t\tlabel: \"branch reset group\",\n\t\tdesc:\"Define alternative groups that share the same group numbers.\",\n\t\text: \"

    For example, in (?|(a)|(b)) both groups (a and b) would be counted as group #1.\",\n\t\ttoken:\"(?|(a)|(b))\"\n\t\t},\n\t\t{\n\t\tid:\"noncapgroup\",\n\t\tlabel: \"non-capturing group\",\n\t\tdesc:\"Groups multiple tokens together without creating a capture group.\",\n\t\texample:[\"(?:ha)+\",\"hahaha haa hah!\"],\n\t\ttoken:\"(?:ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"atomic\",\n\t\tlabel:\"atomic group\",\n\t\tdesc:\"Non-capturing group that discards backtracking positions once matched.\",\n\t\text:\"

    For example, /(?>ab|a)b/ will match abb but not ab because once the ab option has matched, the atomic group prevents backtracking to retry with the a option.

    \",\n\t\ttoken:\"(?>ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"define\",\n\t\tdesc:\"Used to define named groups for use as subroutines without including them in the match.\",\n\t\text:\"

    For example, /A(?(DEFINE)(?'foo'Z))B\\\\g'foo'/ will match ABZ, because the define group is ignored in the match except to define the foo subroutine that is referenced later with \\\\g'foo'.

    \",\n\t\ttoken:\"(?(DEFINE)(?'foo'ABC))\"\n\t\t},\n\t\t{\n\t\tid:\"numsubroutine\",\n\t\tlabel:\"numeric subroutine\",\n\t\ttip:\"Matches the expression in capture group #{{group.num}}.\",\n\t\tdesc:\"Matches the expression in a capture group. Compare this to a reference, that matches the result.\"+\n\t\t\t\" For example /(a|b)\\\\g'1'/ can match ab, because the expression a|b is evaluated again.\",\n\t\text:\"

    There are multiple syntaxes for this feature: \\\\g<1> \\\\g'1' (?1).

    \"+\n\t\t\t\"

    Relative values preceded by + or - are also supported. For example \\\\g<-1> would match the group preceding the reference.

    \",\n\t\ttoken:\"\\\\g'1'\"\n\t\t},\n\t\t{\n\t\tid:\"namedsubroutine\",\n\t\tlabel:\"named subroutine\",\n\t\ttip:\"Matches the expression in the capture group named '{{group.name}}'.\",\n\t\tdesc:\"Matches the expression in a capture group. Compare this to a reference, that matches the result.\",\n\t\text:\"

    There are multiple syntaxes for this feature: \\\\g<name> \\\\g'name' (?&name) (?P>name).

    \",\n\t\ttoken:\"\\\\g'name'\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tlabel: \"Lookaround\",\n\tid:\"lookaround\",\n\tdesc: \"Lookaround lets you match a group before (lookbehind) or after (lookahead) your main pattern without including it in the result.\"+\n\t\t\"

    Negative lookarounds specify a group that can NOT match before or after the pattern.

    \",\n\tkids: [\n\t\t{\n\t\tid:\"poslookahead\",\n\t\tlabel: \"positive lookahead\",\n\t\tdesc:\"Matches a group after the main expression without including it in the result.\",\n\t\texample:[\"\\\\d(?=px)\",\"1pt 2px 3em 4px\"],\n\t\ttoken:\"(?=ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"neglookahead\",\n\t\tlabel: \"negative lookahead\",\n\t\tdesc:\"Specifies a group that can not match after the main expression (if it matches, the result is discarded).\",\n\t\texample:[\"\\\\d(?!px)\",\"1pt 2px 3em 4px\"],\n\t\ttoken:\"(?!ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"poslookbehind\",\n\t\tlabel: \"positive lookbehind\",\n\t\tdesc:\"Matches a group before the main expression without including it in the result.\",\n\t\ttoken:\"(?<=ABC)\"\n\t\t},\n\t\t{\n\t\tid:\"neglookbehind\",\n\t\tlabel: \"negative lookbehind\",\n\t\tdesc:\"Specifies a group that can not match before the main expression (if it matches, the result is discarded).\",\n\t\ttoken:\"(?/o\\\\Kbar/ will match bar within the string foobar\",\n\t\ttoken:\"\\\\K\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tlabel: \"Quantifiers & Alternation\",\n\tid:\"quants\",\n\tdesc: \"Quantifiers indicate that the preceding token must be matched a certain number of times. By default, quantifiers are greedy, and will match as many characters as possible.\"+\n\t\t\"
    Alternation acts like a boolean OR, matching one sequence or another.\",\n\tkids: [\n\t\t{\n\t\tid:\"plus\",\n\t\tdesc:\"Matches 1 or more of the preceding token.\",\n\t\texample:[\"b\\\\w+\",\"b be bee beer beers\"],\n\t\ttoken:\"+\"\n\t\t},\n\t\t{\n\t\tid:\"star\",\n\t\tdesc:\"Matches 0 or more of the preceding token.\",\n\t\texample:[\"b\\\\w*\",\"b be bee beer beers\"],\n\t\ttoken:\"*\"\n\t\t},\n\t\t{\n\t\tid:\"quant\",\n\t\tlabel:\"quantifier\",\n\t\ttip:\"Match {{getQuant()}} of the preceding token.\",\n\t\tdesc:\"Matches the specified quantity of the previous token. \"+\n\t\t\t\"{1,3} will match 1 to 3. \"+\n\t\t\t\"{3} will match exactly 3. \"+\n\t\t\t\"{3,} will match 3 or more. \",\n\t\texample:[\"b\\\\w{2,3}\",\"b be bee beer beers\"],\n\t\ttoken:\"{1,3}\"\n\t\t},\n\t\t{\n\t\tid:\"opt\",\n\t\tlabel:\"optional\",\n\t\tdesc:\"Matches 0 or 1 of the preceding token, effectively making it optional.\",\n\t\texample: [\"colou?r\", \"color colour\"],\n\t\ttoken:\"?\"\n\t\t},\n\t\t{\n\t\tid:\"lazy\",\n\t\ttip:\"Makes the preceding quantifier {{getLazy()}}, causing it to match as {{getLazyFew()}} characters as possible.\",\n\t\tdesc:\"Makes the preceding quantifier lazy, causing it to match as few characters as possible.\",\n\t\text:\" By default, quantifiers are greedy, and will match as many characters as possible.\",\n\t\texample:[\"b\\\\w+?\",\"b be bee beer beers\"],\n\t\ttoken:\"?\"\n\t\t},\n\t\t{\n\t\tid:\"possessive\",\n\t\tdesc:\"Makes the preceding quantifier possessive. It will match as many characters as possible, and will not release them to match subsequent tokens.\",\n\t\text:\"

    For example /.*a/ would match aaa, but /.*+a/ would not, because the repeating dot would match and not release the last character to match a.

    \",\n\t\ttoken:\"+\"\n\t\t},\n\t\t{\n\t\tid:\"alt\",\n\t\tlabel:\"alternation\",\n\t\tdesc:\"Acts like a boolean OR. Matches the expression before or after the |.\",\n\t\text:\"

    It can operate within a group, or on a whole expression. The patterns will be tested in order.

    \",\n\t\texample:[\"b(a|e|i)d\",\"bad bud bod bed bid\"],\n\t\ttoken:\"|\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tlabel: \"Special\",\n\tid:\"other\",\n\tdesc: \"Tokens that don't quite fit anywhere else.\",\n\tkids: [\n\t\t{\n\t\tid:\"comment\",\n\t\tdesc:\"Allows you to insert a comment into your expression that is ignored when finding a match.\",\n\t\ttoken:\"(?#foo)\"\n\t\t},\n\t\t{\n\t\tid:\"conditional\",\n\t\tdesc:\"Conditionally matches one of two options based on whether a lookaround is matched.\",\n\t\text:\"

    For example, /(?(?=a)ab|..)/ will match ab and zx but not ax, because if the first character matches the condition a then it evaluates the pattern ab.

    \"+\n\t\t\t\"

    Any lookaround can be used as the condition. A lookahead will start the subsequent match at the start of the condition, a lookbehind will start it after.

    \",\n\t\ttoken:\"(?(?=A)B|C)\"\n\t\t},\n\t\t{\n\t\tid:\"conditionalgroup\",\n\t\tlabel:\"group conditional\",\n\t\tdesc:\"Conditionally matches one of two options based on whether group '{{name}}' matched.\",\n\t\text:\"

    For example, /(z)?(?(1)a|b)/ will match za because the first capture group matches z successfully, which causes the conditional to match the first option a.

    \"+\n\t\t\t\"

    The same pattern will also match b on its own, because group 1 doesn't match, so it instead tries to match the second option b.

    \"+\n\t\t\t\"

    You can reference a group by name, number, or relative position (ex. -1).

    \",\n\t\ttoken:\"(?(1)B|C)\"\n\t\t},\n\t\t{\n\t\tid:\"recursion\",\n\t\tdesc:\"Attempts to match the full expression again at the current position.\",\n\t\text:\"

    For example, /a(?R)?b/ will match any number of a followed by the same number of z: the full text of az or aaaazzzz, but not azzz.

    \"+\n\t\t\t\"

    There are multiple syntaxes for this feature:

    (?R) (?0) \\\\g<0> \\\\g'0'

    \",\n\t\ttoken:\"(?R)\"\n\t\t},\n\t\t{\n\t\tid:\"mode\",\n\t\tlabel:\"mode modifier\",\n\t\ttip:\"{{~getDesc()}}{{~getModes()}}\",\n\t\tdesc:\"Enables or disables modes for the remainder of the expression.\",\n\t\text:\"Matching modes generally map to expression flags. For example (?i) would enable case insensitivity for the remainder of the expression.\"+\n\t\t\t\"

    Multiple modifiers can be specified, and any modifiers that follow - are disabled. For example (?im-s) would enable case insensitivity & multiline modes, and disable dotall.

    \"+\n\t\t\t\"

    Supported modifiers are: i - case insensitive, s - dotall, m - multiline, x - free spacing, J - allow duplicate names, U - ungreedy.

    \",\n\t\ttoken:\"(?i)\"\n\t\t}\n\t]\n\t},\n\n\t{\n\tlabel: \"Substitution\",\n\tdesc: \"These tokens are used in a substitution string to insert different parts of the match.\",\n\ttarget: \"subst\",\n\tid:\"subst\",\n\tkids: [\n\t\t{\n\t\tid:\"subst_$&match\",\n\t\tlabel: \"match\",\n\t\tdesc:\"Inserts the matched text.\",\n\t\ttoken:\"$&\"\n\t\t},\n\t\t{\n\t\tid:\"subst_0match\",\n\t\tlabel: \"match\",\n\t\tdesc:\"Inserts the matched text.\",\n\t\text:\"

    There are multiple syntaxes for this feature:

    $0 \\\\0 \\\\{0}

    \",\n\t\ttoken:\"$0\"\n\t\t},\n\t\t{\n\t\tid:\"subst_group\",\n\t\tlabel: \"capture group\",\n\t\ttip:\"Inserts the results of capture group #{{group.num}}.\",\n\t\tdesc:\"Inserts the results of the specified capture group. For example, $3 would insert the third capture group.\",\n\t\t// NOTE: javascript profile overrides this:\n\t\text:\"

    There are multiple syntaxes for this feature:

    $1 \\\\1 \\\\{1}

    \",\n\t\ttoken:\"$1\"\n\t\t},\n\t\t{\n\t\tid:\"subst_$before\",\n\t\tlabel: \"before match\",\n\t\tdesc:\"Inserts the portion of the source string that precedes the match.\",\n\t\ttoken:\"$`\"\n\t\t},\n\t\t{\n\t\tid:\"subst_$after\",\n\t\tlabel: \"after match\",\n\t\tdesc:\"Inserts the portion of the source string that follows the match.\",\n\t\ttoken:\"$'\"\n\t\t},\n\t\t{\n\t\tid:\"subst_$esc\",\n\t\tlabel: \"escaped $\",\n\t\tdesc:\"Inserts a dollar sign character ($).\",\n\t\ttoken:\"$$\"\n\t\t},\n\t\t{\n\t\tid: \"subst_esc\",\n\t\tlabel: \"escaped characters\",\n\t\ttoken: \"\\\\n\",\n\t\tdesc: \"For convenience, these escaped characters are supported in the Replace string in RegExr: \\\\n, \\\\r, \\\\t, \\\\\\\\, and unicode escapes \\\\uFFFF. This may vary in your deploy environment.\"\n\t\t}\n\t]\n\t},\n\t\n\t{\n\tid:\"flags\",\n\tlabel:\"Flags\",\n\ttooltip:\"Expression flags change how the expression is interpreted. Click to edit.\",\n\tdesc:\"Expression flags change how the expression is interpreted. Flags follow the closing forward slash of the expression (ex. /.+/igm ).\",\n\ttarget:\"flags\",\n\tkids: [\n\t\t{\n\t\tid:\"caseinsensitive\",\n\t\tlabel: \"ignore case\",\n\t\tdesc:\"Makes the whole expression case-insensitive.\",\n\t\text:\" For example, /aBc/i would match AbC.\",\n\t\ttoken:\"i\"\n\t\t},\n\t\t{\n\t\tid:\"global\",\n\t\tlabel: \"global search\",\n\t\ttip: \"Retain the index of the last match, allowing iterative searches.\",\n\t\tdesc:\"Retain the index of the last match, allowing subsequent searches to start from the end of the previous match.\"+\n\t\t\t\"

    Without the global flag, subsequent searches will return the same match.


    \"+\n\t\t\t\"RegExr only searches for a single match when the global flag is disabled to avoid infinite match errors.\",\n\t\ttoken:\"g\"\n\t\t},\n\t\t{\n\t\tid:\"multiline\",\n\t\ttip:\"Beginning/end anchors (^/$) will match the start/end of a line.\",\n\t\tdesc:\"When the multiline flag is enabled, beginning and end anchors (^ and $) will match the start and end of a line, instead of the start and end of the whole string.\"+\n\t\t\t\"

    Note that patterns such as /^[\\\\s\\\\S]+$/m may return matches that span multiple lines because the anchors will match the start/end of any line.

    \",\n\t\ttoken:\"m\"\n\t\t},\n\t\t{\n\t\tid:\"unicode\",\n\t\ttip:\"Enables \\\\x{FFFFF} unicode escapes.\",\n\t\tdesc:\"When the unicode flag is enabled, you can use extended unicode escapes in the form \\\\x{FFFFF}.\"+\n\t\t\t\"

    It also makes other escapes stricter, causing unrecognized escapes (ex. \\\\j) to throw an error.

    \",\n\t\ttoken:\"u\"\n\t\t},\n\t\t{\n\t\tid:\"sticky\",\n\t\tdesc:\"The expression will only match from its lastIndex position and ignores the global (g) flag if set.\",\n\t\text:\" Because each search in RegExr is discrete, this flag has no further impact on the displayed results.\",\n\t\ttoken:\"y\"\n\t\t},\n\t\t{\n\t\tid:\"dotall\",\n\t\tdesc:\"Dot (.) will match any character, including newline.\",\n\t\ttoken:\"s\"\n\t\t},\n\t\t{\n\t\tid:\"extended\",\n\t\tdesc:\"Literal whitespace characters are ignored, except in character sets.\",\n\t\ttoken:\"x\"\n\t\t},\n\t\t{\n\t\tid:\"ungreedy\",\n\t\ttip:\"Makes quantifiers ungreedy (lazy) by default.\",\n\t\tdesc:\"Makes quantifiers ungreedy (lazy) by default. Quantifiers followed by ? will become greedy.\",\n\t\ttoken:\"U\"\n\t\t}\n\t]\n\t}\n];\n\n// content that isn't included in the Reference menu item:\no.misc = {\n\tkids:[\n\t\t{\n\t\tid:\"ignorews\",\n\t\tlabel:\"ignored whitespace\",\n\t\ttip:\"Whitespace character ignored due to the extended flag or mode.\"\n\t\t},\n\t\t{\n\t\tid:\"extnumref\", // alternative syntaxes.\n\t\tproxy:\"numref\"\n\t\t},\n\t\t{\n\t\tid:\"char\",\n\t\tlabel:\"character\",\n\t\ttip:\"Matches a {{getChar()}} character (char code {{code}}). {{getInsensitive()}}\"\n\t\t},\n\t\t{\n\t\tid:\"escchar\",\n\t\tlabel:\"escaped character\",\n\t\ttip:\"Matches a {{getChar()}} character (char code {{code}}).\"\n\t\t},\n\t\t{\n\t\tid:\"open\",\n\t\ttip:\"Indicates the start of a regular expression.\"\n\t\t},\n\t\t{\n\t\tid:\"close\",\n\t\ttip:\"Indicates the end of a regular expression and the start of expression flags.\"\n\t\t},\n\t\t{\n\t\tid:\"condition\",\n\t\ttip:\"The lookaround to match in resolving the enclosing conditional statement. See 'conditional' in the Reference for info.\"\n\t\t},\n\t\t{\n\t\tid:\"conditionalelse\",\n\t\tlabel:\"conditional else\",\n\t\ttip:\"Delimits the 'else' portion of the conditional.\"\n\t\t},\n\t\t{\n\t\tid:\"ERROR\",\n\t\ttip:\"Errors in the expression are underlined in red. Roll over errors for more info.\"\n\t\t},\n\t\t{\n\t\tid:\"PREG_INTERNAL_ERROR\",\n\t\ttip:\"Internal PCRE error\"\n\t\t},\n\t\t{\n\t\tid:\"PREG_BACKTRACK_LIMIT_ERROR\",\n\t\ttip:\"Backtrack limit was exhausted.\"\n\t\t},\n\t\t{\n\t\tid:\"PREG_RECURSION_LIMIT_ERROR\",\n\t\ttip:\"Recursion limit was exhausted\"\n\t\t},\n\t\t{\n\t\tid:\"PREG_BAD_UTF8_ERROR\",\n\t\ttip:\"Malformed UTF-8 data\"\n\t\t},\n\t\t{\n\t\tid:\"PREG_BAD_UTF8_OFFSET_ERROR\",\n\t\ttip:\"Malformed UTF-8 data\"\n\t\t}\n\t]\n};\n\no.errors = {\n\tgroupopen:\"Unmatched opening parenthesis.\",\n\tgroupclose:\"Unmatched closing parenthesis.\",\n\tsetopen:\"Unmatched opening square bracket.\",\n\trangerev:\"Range values reversed. Start char code is greater than end char code.\",\n\tquanttarg:\"Invalid target for quantifier.\",\n\tquantrev:\"Quantifier minimum is greater than maximum.\",\n\tesccharopen:\"Dangling backslash.\",\n\tesccharbad:\"Unrecognized or malformed escape character.\",\n\tunicodebad:\"Unrecognized unicode category or script.\",\n\tposixcharclassbad:\"Unrecognized POSIX character class.\",\n\tposixcharclassnoset:\"POSIX character class must be in a character set.\",\n\tnotsupported:\"The \\\"{{~getLabel()}}\\\" feature is not supported in this flavor of RegEx.\",\n\tfwdslash:\"Unescaped forward slash. This may cause issues if copying/pasting this expression into code.\",\n\tesccharbad:\"Invalid escape sequence.\",\n\tservercomm:\"An error occurred while communicating with the server.\",\n\textraelse:\"Extra else in conditional group.\",\n\tunmatchedref:\"Reference to non-existent group \\\"{{name}}\\\".\",\n\tmodebad:\"Unrecognized mode flag \\\"{{errmode}}\\\".\",\n\tbadname:\"Group name can not start with a digit.\",\n\tdupname:\"Duplicate group name.\",\n\tbranchreseterr:\"Branch Reset. Results will be ok, but RegExr's parser does not number branch reset groups correctly. Coming soon!\",\n\ttimeout:\"The expression took longer than 250ms to execute.\", // TODO: can we couple this to the help content somehow?\n\n\t// warnings:\n\tjsfuture:\"The \\\"{{~getLabel()}}\\\" feature may not be supported in all browsers.\",\n\tinfinite:\"The expression can return empty matches, and may match infinitely in some use cases.\", // TODO: can we couple this to the help content somehow?\n};\n\n/*\nclasses:\nquant\nset\nspecial\nref\nesc\nanchor\ncharclass\ngroup\ncomment\n */\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"../utils/Utils\";\n\nexport default class BrowserSolver {\n\n\tconstructor() {\n\t\tconst workerBlob = new Blob([\n\t\t\tdocument.querySelector('#regexWorker').textContent\n\t\t], { type: \"text/javascript\" });\n\t\tthis._workerObjectURL = URL.createObjectURL(workerBlob);\n\t}\n\n\tsolve(o, callback) {\n\t\tthis._callback = callback;\n\t\tthis._req = o;\n\n\t\tlet regex, text=o.text, tests=o.tests, mode = o.mode;\n\t\ttry {\n\t\t\tthis._regex = regex = new RegExp(o.pattern, o.flags);\n\t\t} catch(e) {\n\t\t\treturn this._onRegExComplete({id:\"regexparse\", name: e.name, message: e.message}, null, mode);\n\t\t}\n\n\t\tif (window.Worker) {\n\t\t\tconst worker = new Worker(this._workerObjectURL);\n\n\t\t\tworker.onmessage = (evt) => {\n\t\t\t\tif (evt.data === \"onload\") {\n\t\t\t\t\tthis._startTime = Utils.now();\n\t\t\t\t\tthis._timeoutId = setTimeout(() => {\n\t\t\t\t\t\tworker.terminate();\n\t\t\t\t\t\tthis._onRegExComplete({id: \"timeout\"}, null, mode); // TODO: make this a warning, and return all results so far.\n\t\t\t\t\t}, 250);\n\t\t\t\t} else {\n\t\t\t\t\tclearTimeout(this._timeoutId);\n\t\t\t\t\tworker.terminate();\n\t\t\t\t\tthis._onRegExComplete(evt.data.error, evt.data.matches, evt.data.mode);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// we need to pass the pattern and flags as text, because Safari strips the unicode flag when passing a RegExp to a Worker\n\t\t\tworker.postMessage({pattern:o.pattern, flags:o.flags, text, tests, mode});\n\t\t} else {\n\t\t\tthis._startTime = Utils.now();\n\n\t\t\t// shared between BrowserSolver & RegExWorker\n\t\t\tvar matches = [], match, index, error;\n\t\t\tif (mode === \"tests\") {\n\t\t\t\tfor (var i=0, l=tests.length; i source.length);\n\t\t\tif (index === -1) { break; }\n\t\t\trepl = source.replace(regex, str);\n\t\t\tresult += repl.substr(index, repl.length-ref.length+1);\n\t\t\tsource = ref.substr(index+(empty?2:1));\n\t\t} while (source.length);\n\t\tif (trimR) { result = result.substr(0,result.length-trimR); }\n\t\treturn result;\n\t}\n}\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Utils from \"../utils/Utils\";\nimport Server from \"../net/Server\";\n\nexport default class ServerSolver {\n\t\n\tsolve(o, callback) {\n\t\t// unescape tool input:\n\t\tif (o.tool && o.tool.input != null) { o.tool.input = Utils.unescSubstStr(o.tool.input); }\n\t\tif (this._serverPromise) { this._serverPromise.abort(); }\n\t\tUtils.defer(()=>this._solve(o, callback), \"ServerSolver._solve\", 250);\n\t}\n\t\n\t_solve(o, callback) {\n\t\tthis._callback = callback;\n\t\tthis._serverPromise = Server.solve(o).then((o) => this._onLoad(o)).catch((o) => this._onError(o));\n\t}\n\t\n\t_onLoad(data) {\n\t\tthis._callback(data);\n\t}\n\t\n\t_onError(msg) {\n\t\tthis._callback({error:{id:msg}});\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport Track from \"./utils/Track\";\n\nimport EventDispatcher from \"./events/EventDispatcher.js\";\nimport BrowserSolver from \"./helpers/BrowserSolver.js\";\nimport ServerSolver from \"./helpers/ServerSolver.js\";\nimport profiles from \"./profiles/profiles.js\";\n\nimport app from \"./app\";\n\nexport default class Flavor extends EventDispatcher {\n\t\n\tconstructor(flavor) {\n\t\tsuper();\n\t\tthis.value = app.prefs.read(\"flavor\");\n\t\tthis._browserSolver = new BrowserSolver();\n\t\tthis._serverSolver = new ServerSolver();\n\t}\n\t\n\tset value(id) {\n\t\tlet profile = profiles[(id && id.toLowerCase()) || \"js\"];\n\t\tif (!profile || profile === this._profile) { return; }\n\n\t\tthis._profile = profile;\n\t\tthis._buildSupportMap(profile);\n\t\tapp.prefs.write(\"flavor\", id);\n\t\tthis.dispatchEvent(\"change\");\n\t}\n\t\n\tget value() {\n\t\treturn this._profile.id;\n\t}\n\t\n\tget profile() {\n\t\treturn this._profile;\n\t}\n\t\n\tget profiles() {\n\t\treturn [profiles.js, profiles.pcre];\n\t}\n\t\n\tget solver() {\n\t\treturn this._profile.browser ? this._browserSolver : this._serverSolver;\n\t}\n\t\n\tisTokenSupported(id) {\n\t\treturn !!this._profile._supportMap[id];\n\t}\n\t\n\tgetDocs(id) {\n\t\treturn this._profile.docs[id];\n\t}\n\t\n\tvalidateFlags(list) {\n\t\tlet flags = this._profile.flags, dupes = {};\n\t\treturn list.filter((id)=>(!!flags[id] && !dupes[id] && (dupes[id] = true)));\n\t}\n\t\n\tvalidateFlagsStr(str) {\n\t\treturn this.validateFlags(str.split(\"\")).join(\"\");\n\t}\n\t\n\tisFlagSupported(id) {\n\t\treturn !!this._profile.flags[id];\n\t}\n\t\n\t_buildSupportMap(profile) {\n\t\tif (profile._supportMap) { return; }\n\t\tlet map = profile._supportMap = {}, props = Flavor.SUPPORT_MAP_PROPS, n;\n\t\tfor (n in props) { this._addToSupportMap(map, profile[n], !!props[n]); }\n\t\tlet o = profile.escCharCodes, esc = profile.escChars;\n\t\tfor (n in o) { map[\"esc_\"+o[n]] = true; }\n\t\tfor (n in esc) { map[\"esc_\"+esc[n]] = true; }\n\t}\n\t\n\t_addToSupportMap(map, o, rev) {\n\t\tif (rev) { for (let n in o) { map[o[n]] = true; } }\n\t\telse { for (let n in o) { map[n] = o[n]; } }\n\t}\n}\n\nFlavor.SUPPORT_MAP_PROPS = {\n\t// 1 = reverse, 0 - normal\n\tflags: 1,\n\t// escape is handled separately\n\t// escCharCodes is handled separately\n\tescCharTypes: 1,\n\tcharTypes: 1,\n\t// unquantifiables not included\n\t// unicodeScripts not included\n\t// unicodeCategories not included\n\t// posixCharClasses not included\n\t// modes not included\n\ttokens: 0,\n\tsubstTokens: 0\n\t// config not included\n\t// docs not included\n};","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport core from \"./profiles/core.js\";\nimport app from \"./app\";\n\nexport default class RefCoverage {\n\tconstructor() {\n\t\tapp.flavor._buildSupportMap(core);\n\t\tlet ref = app.reference._idMap, undoc=[], unused=[], all=core._supportMap;\n\t\tlet ignore = {\n\t\t\t\"escchar\": true, // literal char\n\t\t\t\"groupclose\": true,\n\t\t\t\"setclose\": true,\n\t\t\t\"condition\": true, // proxies to conditional\n\t\t\t\"conditionalelse\": true, // proxies to conditional\n\t\t\tsubst_$group: true, // resolved to subst_group\n\t\t\tsubst_$bgroup: true, // resolved to subst_group\n\t\t\tsubst_bsgroup: true, // resolved to subst_group\n\t\t\tescoctalo: true // resolved to escoctal\n\t\t}\n\t\t\n\t\tfor (let n in all) { if (!ref[n] && !ignore[n]) { undoc.push(n); } }\n\t\tfor (let n in ref) { if (!all[n] && !ref[n].kids) { unused.push(n); } }\n\t\t\n\t\tconsole.log(\"--- UNDOCUMENTED IDS ---\\n\"+undoc.join(\"\\n\")+\"\\n\\n--- UNUSED DOCS? ---\\n\"+unused.join(\"\\n\"));\n\t}\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\n\nexport default class Prefs {\n\tconstructor (el) {\n\t\tthis._load();\n\t}\n\n\tread(key) {\n\t\treturn this._data[key];\n\t}\n\n\twrite(key, value) {\n\t\tif (this._data[key] === value) { return; }\n\t\tthis._data[key] = value;\n\t\tthis._save();\n\t}\n\t\n\tclear(key) {\n\t\tdelete(this._data[key]);\n\t\tthis._save();\n\t}\n\t\n\t_load() {\n\t\tlet match = /(?:^|;\\s*)prefs=\\s*([^;]*)/.exec(document.cookie);\n\t\tif (match && match[1]) {\n\t\t\ttry {\n\t\t\t\tthis._data = JSON.parse(unescape(match[1]));\n\t\t\t\treturn;\n\t\t\t} catch (e) {}\n\t\t}\n\t\tthis._data = {};\n\t}\n\n\t_save() {\n\t\tlet str = escape(JSON.stringify(this._data));\n\t\tdocument.cookie = \"prefs=\"+str+\"; expires=Fri, 31 Dec 9999 23:59:59 GMT;\";\n\t}\n\n}","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport EventDispatcher from \"./events/EventDispatcher\";\n\nimport $ from \"./utils/DOMUtils\";\nimport Utils from \"./utils/Utils\";\n\nimport Tooltip from \"./controls/Tooltip\";\n\nimport Server from \"./net/Server\";\n\nimport Expression from \"./views/Expression\";\nimport Text from \"./views/Text\";\nimport Tools from \"./views/Tools\";\nimport Sidebar from \"./views/Sidebar\";\nimport Account from \"./views/Account\";\nimport Theme from \"./views/Theme\";\n\nimport Reference from \"./docs/Reference\";\nimport reference_content from \"./docs/reference_content\";\nimport Flavor from \"./Flavor\";\n\nimport RefCoverage from \"./RefCoverage\";\nimport Prefs from \"./helpers/Prefs\";\n\nexport default class RegExr extends EventDispatcher {\n\tconstructor () { super(); }\n\n\tinit(state, account, config={}) {\n\t\tthis.prefs = new Prefs();\n\t\tthis.flavor = new Flavor();\n\t\tthis.reference = new Reference(reference_content, this.flavor, config);\n\t\tthis._migrateFavorites();\n\t\tthis._initUI();\n\n\t\tthis.account.value = account;\n\t\tif (state === false) {\n\t\t\tthis._localInit();\n\t\t} else if (this.account.authenticated && !state) {\n\t\t\tthis.newDoc(false);\n\t\t} else {\n\t\t\tthis.state = state;\n\t\t}\n\t\tthis._savedHash = null;\n\n\t\tlet params = Utils.getUrlParams();\n\t\tif (Utils.isLocal && params.id) {\n\t\t\tServer.load(params.id).then((o) => this.state = o);\n\t\t\tparams = {};\n\t\t}\n\t\tif (params.engine) { this.flavor.value = params.engine; }\n\t\tif (params.expression) { this.expression.value = params.expression; }\n\t\tif (params.text) { this.text.value = params.text; }\n\t\tif (params.tool) { this.tools.value = {id:params.tool, input:params.input}; }\n\n\t\twindow.onbeforeunload = (e) => this.unsaved ? \"You have unsaved changes.\" : null;\n\t\tthis.resetUnsaved();\n\n\t\tsetTimeout(() => this._initAds(), 100);\n\t}\n\n\t_initAds() {\n\t\t_native && _native.init(\"CK7D65QM\", { // \"CK7D65QM\" use \"CK7D4KQE\" to test Carbon ads\n\t\t\tcarbonZoneKey: 'CK7DPKQU',\n\t\t\ttargetClass: 'native-js'\n\t\t});\n\t}\n\n\t_localInit() {\n\t\tconsole.log(\"local init\");\n\t\t//Server.verify().then((data) => this.account.value = data);\n\t\tnew RefCoverage();\n\t}\n\n// getter / setters:\n\tget state() {\n\t\tconsole.log(this.text.mode);\n\t\tlet o = {\n\t\t\texpression: this.expression.value,\n\t\t\ttext: this.text.value,\n\t\t\ttests: this.text.tests,\n\t\t\tflavor: this.flavor.value,\n\t\t\ttool: this.tools.value,\n\t\t\tmode: this.text.mode,\n\t\t};\n\t\t// copy share values onto the pattern object:\n\t\treturn Utils.copy(this.share.value, o);\n\t}\n\n\tset state(o) {\n\t\tif (!o) { return; }\n\t\tthis.flavor.value = o.flavor;\n\t\tthis.expression.value = o.expression;\n\t\tthis.text.value = o.text;\n\t\tthis.text.tests = o.tests;\n\t\tthis.text.mode = o.mode;\n\t\tthis.tools.value = o.tool;\n\t\tthis.share.pattern = o;\n\t\tthis.resetUnsaved();\n\t}\n\n\tget hash() {\n\t\tlet share = this.share;\n\t\treturn Utils.getHashCode(\n\t\t\tthis.expression.value+\"\\t\"\n\t\t\t+ this.text.value+\"\\t\"\n\t\t\t+ this.flavor.value+\"\\t\"\n\t\t\t+ share.author+\"\\t\" + share.name+\"\\t\" + share.description+\"\\t\" + share.keywords+\"\\t\"\n\t\t\t+ JSON.stringify(this.text.tests)+\"\\t\"\n\t\t\t//+ this.tools.value.input+\"\\t\"\n\t\t\t//+ this.tools.value.id+\"\\t\"\n\t\t)\n\t}\n\n\tget unsaved() {\n\t\treturn this.hash !== this._savedHash;\n\t}\n\n\tget isNarrow() {\n\t\treturn this._matchList.matches;\n\t}\n\n// public methods:\n\tresetUnsaved() {\n\t\tthis._savedHash = this.hash;\n\t}\n\n\tnewDoc(warn=true) {\n\t\tthis.load({flavor: this.flavor.value, expression: \".\", text:\"Text\"}, warn);\n\t\tthis.expression.selectAll();\n\t}\n\n\tload(state, warn=true) {\n\t\tif (warn === true) { warn = \"You have unsaved changes. Continue without saving?\"; }\n\t\tif (warn && this.unsaved && !confirm(warn)) { return; }\n\t\tthis.state = Utils.clone(state);\n\t}\n\n// private methods:\n\t_initUI() {\n\t\t// TODO: break into own Device class? Rename mobile.scss too?\n\t\t// mobile setup\n\t\t// keep synced with \"mobile.scss\":\n\t\tif (screen.width < 500) {\n\t\t\tdocument.getElementById(\"viewport\").setAttribute(\"content\", \"width=500, user-scalable=0\");\n\t\t}\n\t\tthis._matchList = window.matchMedia(\"(max-width: 900px)\");\n\t\tthis._matchList.addListener((q)=>this.dispatchEvent(\"narrow\")); // currently unused.\n\n\t\t// UI:\n\t\tthis.el = $.query(\".container\");\n\n\t\tthis.tooltip = {\n\t\t\thover: new Tooltip($.query(\"#library #tooltip\").cloneNode(true)),\n\t\t\ttoggle: new Tooltip($.query(\"#library #tooltip\"), true)\n\t\t};\n\n\t\tthis.theme = new Theme(this.el);\n\n\t\tlet el = this.docEl = $.query(\".app > .doc\", this.el);\n\t\tthis.expression = new Expression($.query(\"> section.expression\", el));\n\t\tthis.text = new Text($.query(\"> section.text\", el));\n\t\tthis.tools = new Tools($.query(\"> section.tools\", el));\n\n\t\tthis.account = new Account();\n\t\tthis.sidebar = new Sidebar($.query(\".app > .sidebar\", this.el));\n\t\tthis.share = this.sidebar.share;\n\n\t\tthis.expression.on(\"change\", ()=> this._change());\n\t\tthis.text.on(\"change\", ()=> this._change());\n\t\tthis.text.on(\"modechange\", ()=> this._modeChange());\n\t\tthis.flavor.on(\"change\", ()=> this._change());\n\t\tthis.tools.on(\"change\", ()=> this._change());\n\t\tthis.share.on(\"change\", ()=> this._change());\n\t}\n\n\t_migrateFavorites() {\n\t\tlet ls = window.localStorage, l=ls.length;\n\t\tif (!l || ls.getItem(\"f_v3\") >= \"1\") { return }\n\t\tlet ids = [];\n\t\tfor (let i=0; i ls.setItem(\"f_v3\", \"1\"));\n\t}\n\n\t_change() {\n\t\tthis.dispatchEvent(\"change\");\n\t\tlet solver = this.flavor.solver, exp = this.expression;\n\t\tlet o = {pattern:exp.pattern, flags:exp.flags, mode:this.text.mode};\n\t\tif (o.mode === \"tests\") {\n\t\t\to.tests = this.text.tests;\n\t\t} else {\n\t\t\to.text = this.text.value;\n\t\t\to.tool = this.tools.value;\n\t\t}\n\t\tsolver.solve(o, (result) => this._handleResult(result));\n\t}\n\n\t_modeChange() {\n\t\t$.toggleClass(this.docEl, \"tests-mode\", this.text.mode === \"tests\");\n\t\tthis._change();\n\t}\n\t\n\t_handleResult(result) {\n\t\tthis.result = this._processResult(result);\n\t\tthis.dispatchEvent(\"result\");\n\t}\n\n\t_processResult(result) {\n\t\tif (result.mode === \"text\") {\n\t\t\tresult.matches && result.matches.forEach((o, i)=>o.num=i);\n\t\t}\n\t\treturn result;\n\t}\n}\n","/*\nRegExr: Learn, Build, & Test RegEx\nCopyright (C) 2017 gskinner.com, inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n*/\n\nimport \"../lib/codemirror.js\";\nimport \"../lib/clipboard.js\";\nimport \"../lib/native.js\";\nimport RegExr from \"./RegExr\";\n\nlet app = new RegExr();\nexport default app;"],"names":["global","factory","exports","module","define","amd","CodeMirror","this","userAgent","navigator","platform","gecko","test","ie_upto10","ie_11up","exec","edge","ie","ie_version","document","documentMode","webkit","qtwebkit","chrome","presto","safari","vendor","mac_geMountainLion","phantom","ios","android","mobile","mac","chromeOS","windows","presto_version","match","Number","flipCtrlCmd","captureRightClick","classTest","cls","RegExp","rmClass","node","current","className","after","slice","index","length","removeChildren","e","count","childNodes","removeChild","firstChild","removeChildrenAndAdd","parent","appendChild","elt","tag","content","style","createElement","cssText","createTextNode","i","eltP","setAttribute","range","createRange","start","end","endNode","r","setEnd","setStart","body","createTextRange","moveToElementText","parentNode","collapse","moveEnd","moveStart","contains","child","nodeType","host","activeElt","activeElement","shadowRoot","addClass","joinClasses","a","b","as","split","selectInput","select","selectionStart","selectionEnd","value","_e","bind","f","args","Array","prototype","call","arguments","apply","copyObj","obj","target","overwrite","prop","hasOwnProperty","countColumn","string","tabSize","startIndex","startValue","search","n","nextTab","indexOf","Delayed","id","set","ms","clearTimeout","setTimeout","array","scrollerGap","Pass","toString","sel_dontScroll","scroll","sel_mouse","origin","sel_move","findColumn","goal","pos","col","skipped","Math","min","spaceStrs","spaceStr","push","lst","arr","map","out","insertSorted","score","priority","splice","nothing","createObj","base","props","inst","Object","create","nonASCIISingleCaseWordChar","isWordCharBasic","ch","toUpperCase","toLowerCase","isWordChar","helper","source","isEmpty","extendingChars","isExtendingChar","charCodeAt","skipExtendingChars","str","dir","charAt","findFirst","pred","from","to","abs","mid","floor","Display","place","doc","input","d","scrollbarFiller","gutterFiller","lineDiv","selectionDiv","cursorDiv","measure","lineMeasure","lineSpace","lines","mover","sizer","sizerWidth","heightForcer","gutters","lineGutter","scroller","wrapper","zIndex","paddingRight","draggable","viewFrom","viewTo","first","reportedViewFrom","reportedViewTo","view","renderedView","externalMeasured","viewOffset","lastWrapHeight","lastWrapWidth","updateLineNumbers","nativeBarWidth","barHeight","barWidth","scrollbarsClipped","lineNumWidth","lineNumInnerWidth","lineNumChars","alignWidgets","cachedCharWidth","cachedTextHeight","cachedPaddingH","maxLine","maxLineLength","maxLineChanged","wheelDX","wheelDY","wheelStartX","wheelStartY","shift","selForContextMenu","activeTouch","init","getLine","size","Error","chunk","children","sz","chunkSize","getBetween","line","iter","text","getLines","updateLineHeight","height","diff","lineNo","cur","no","lineAtHeight","h","outer","i$1","lh","isLine","l","lineNumberFor","options","String","lineNumberFormatter","firstLineNumber","Pos","sticky","cmp","equalCursorPos","copyPos","x","maxPos","minPos","clipLine","max","clipPos","last","clipToLen","linelen","clipPosArray","sawReadOnlySpans","sawCollapsedSpans","seeReadOnlySpans","seeCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","addMarkedSpan","markedSpans","concat","attachLine","markedSpansBefore","old","startCh","isInsert","nw","startsBefore","inclusiveLeft","type","insertLeft","endsAfter","inclusiveRight","markedSpansAfter","endCh","stretchSpansOverChange","change","full","oldFirst","oldLast","sameLine","offset","found","span$1","found$1","clearEmptySpans","newMarkers","gap","gapMarkers","i$2","i$3","clearWhenEmpty","removeReadOnlyRanges","markers","mark","readOnly","parts","mk","m","find","j","p","newParts","dfrom","dto","detachMarkedSpans","detachLine","attachMarkedSpans","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","conflictingCollapsedRange","visualLine","merged","visualLineEnd","visualLineContinued","visualLineNo","lineN","vis","visualLineEndNo","lastLine","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","len","findMaxLine","cm","display","iterateBidiSections","order","part","level","bidiOther","getBidiPartAt","bidiOrdering","lowTypes","arabicTypes","charType","code","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","BidiSpan","direction","outerType","types","prev","type$1","prev$1","type$2","i$4","type$3","replace","i$5","cur$1","type$4","i$6","end$1","before","replace$1","j$1","i$7","at","j$2","nstart","unshift","reverse","getOrder","moveCharLogically","moveLogically","endOfLine","visually","moveInStorageOrder","prep","prepareMeasureForLine","targetTop","measureCharPrepared","top","moveVisually","bidi","partPos","mv","getWrappedLineExtent","lineWrapping","begin","wrappedLineExtentChar","wrappedLineExtent","searchInVisualLine","getRes","res","nextCh","noHandlers","on","emitter","addEventListener","attachEvent","_handlers","getHandlers","off","removeEventListener","detachEvent","signal","handlers","signalDOMEvent","override","preventDefault","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","returnValue","e_stopPropagation","stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","which","button","ctrlKey","dragAndDrop","div","zwspSupported","zeroWidthElement","offsetHeight","offsetWidth","badBidiRects","hasBadBidiRects","txt","r0","getBoundingClientRect","r1","left","right","splitLinesAuto","result","nl","rt","hasSelection","window","getSelection","te","ownerDocument","selection","parentElement","compareEndPoints","hasCopyEvent","oncopy","badZoomedRects","hasBadZoomedRects","normal","fromRange","modes","mimeModes","defineMode","name","mode","dependencies","defineMIME","mime","spec","resolveMode","getMode","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","extendMode","properties","copyState","state","nstate","val","innerMode","info","startState","a1","a2","StringStream","lineOracle","lastColumnPos","lastColumnValue","lineStart","eol","sol","peek","undefined","next","eat","ok","eatWhile","eatSpace","this$1","skipToEnd","skipTo","backUp","column","indentation","pattern","consume","caseInsensitive","cased","substr","hideFirstChars","inner","lookAhead","oracle","SavedContext","Context","maxLookAhead","nextLine","fromSaved","saved","save","copy","highlightLine","context","forceToEnd","st","modeGen","lineClasses","runMode","loop","o","overlay","overlays","i_end","opaque","styles","classes","bgClass","textClass","getLineStyles","updateFrontier","getContextBefore","resetState","maxHighlightLength","stateAfter","styleClasses","highlightFrontier","modeFrontier","precise","findStartLine","processLine","startAt","stream","callBlankLine","readToken","blankLine","token","Token","takeToken","asArray","tokens","extractLineClasses","output","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","minindent","minline","lim","indented","retreatFrontier","Line","estimateHeight","updateLine","estHeight","cleanUpLine","styleToClassCache","styleToClassCacheWithMode","interpretTokenStyle","cache","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","getOption","rest","addToken","buildToken","buildTokenBadBidi","allowFrontierUpdate","insertLineContent","maps","caches","lastChild","querySelector","defaultSpecialCharPlaceholder","title","startStyle","endStyle","css","displayText","special","specialChars","mustWrap","createDocumentFragment","lastIndex","txt$1","tabWidth","specialCharPlaceholder","fullStyle","trailingBefore","spaceBefore","buildCollapsedSpan","ignoreWidget","widget","needsContentAttribute","setUneditable","allText","nextChange","spanStyle","spanEndStyle","spanStartStyle","Infinity","foundBookmarks","endStyles","upto","tokenText","LineView","hidden","buildViewArray","nextPos","operationGroup","pushOperation","op","ops","ownsGroup","delayedCallbacks","fireCallbacksForOps","group","callbacks","cursorActivityCalled","finishOperation","endCb","orphanDelayedCallbacks","signalLater","list","fireOrphanDelayed","delayed","updateLineForChanges","dims","changes","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","updateLineBackground","background","wrap","insertBefore","getLineContent","ext","built","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutterWidth","alignable","nextSibling","insertLineWidgets","buildLineElement","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","width","wrapperWidth","coverGutter","paddingLeft","position","marginLeft","widgetHeight","parentStyle","clientWidth","eventInWidget","getAttribute","paddingTop","offsetTop","paddingVert","paddingH","getComputedStyle","currentStyle","data","parseInt","isNaN","scrollGap","displayWidth","displayHeight","clientHeight","ensureLineHeights","rect","wrapping","curWidth","heights","rects","getClientRects","bottom","mapFromLineView","updateExternalMeasurement","measureChar","bias","findViewForLine","findViewIndex","getDimensions","forceUpdate","hasHeights","prepared","varHeight","key","measureCharInner","bogus","rtop","rbottom","nullRect","nodeAndOffsetInLineMap","mStart","mEnd","coverStart","coverEnd","getUsefulRect","maybeUpdateRectForZooming","rSpan","charWidth","rbot","bot","singleCursorHeightPerLine","screen","logicalXDPI","deviceXDPI","scaleX","scaleY","logicalYDPI","deviceYDPI","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","pageScrollX","pageXOffset","documentElement","scrollLeft","pageScrollY","marginTop","pageYOffset","scrollTop","intoCoordSystem","includeWidgets","yOff","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","get","getBidi","invert","other","estimateCoords","PosWithInfo","outside","xRel","coordsChar","y","coordsCharInner","mergedPos","assign","beginLeft","prevDiff","prevPos","steps","ceil","prevPos$1","diff_change_per_step","box","measureText","textHeight","anchor","clientLeft","offsetLeft","compensateForHScroll","th","perLine","widgetsHeight","estimateLineHeights","est","posFromMouse","liberal","forRect","space","clientX","clientY","colDiff","round","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","sel","ranges","primIndex","empty","showCursorWhenSelecting","drawSelectionCursor","head","drawSelectionRange","cursor","cursorHeight","otherCursor","fragment","padding","leftSide","rightSide","add","drawForLine","fromArg","toArg","lineLen","leftPos","rightPos","tmp","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","focused","clearInterval","blinker","visibility","cursorBlinkRate","setInterval","ensureFocus","focus","onFocus","delayBlurEvent","delayingBlurEvent","onBlur","reset","receivedFocus","updateHeightsInViewport","prevBottom","updateWidgetHeight","visibleLines","viewport","ensure","ensureFrom","ensureTo","alignHorizontally","comp","gutterW","align","maybeUpdateLineNumberWidth","innerW","updateGutterSpace","maybeScrollWindow","doScroll","innerHeight","scrollNode","scrollIntoView","scrollPosIntoView","margin","limit","changed","endCoords","scrollPos","calculateScrollPos","startTop","startLeft","updateScrollTop","setScrollLeft","snapMargin","screentop","docBottom","atTop","atBottom","newTop","screenleft","screenw","tooWide","addToScrollTop","resolveScrollToPos","ensureCursorVisible","getCursor","scrollToPos","cursorScrollMargin","scrollToCoords","scrollToRange","scrollToCoordsRange","sPos","updateDisplaySimple","setScrollTop","startWorker","forceScroll","scrollHeight","scrollbars","isScroller","scrollWidth","measureForScrollbars","docH","viewHeight","viewWidth","barLeft","docHeight","NativeScrollbars","vert","horiz","checkedZeroWidth","minHeight","minWidth","update","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","w","pointerEvents","bar","delay","maybeDisable","elementFromPoint","clear","NullScrollbars","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","paddingBottom","borderBottom","coverGutterNextToScrollbar","scrollbarModel","initScrollbars","scrollbarStyle","axis","nextOpId","startOperation","viewChanged","updateInput","typing","changeObjs","selectionChanged","updateMaxLine","endOperation","endOperations","endOperation_R1","endOperation_W1","endOperation_R2","endOperation_W2","endOperation_finish","maybeClipScrollbars","mustUpdate","DisplayUpdate","updatedDisplay","updateDisplayIfNeeded","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","hasFocus","setDocumentHeight","postUpdateDisplay","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","operation","methodOp","docMethodOp","regChange","lendiff","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","adjustView","countDirtyView","dirty","time","highlight","highlightWorker","Date","workTime","changedLines","oldStyles","highlighted","oldCls","newCls","ischange","workDelay","force","visible","editorIsHidden","wrapperHeight","oldDisplayWidth","events","marginBottom","borderRightWidth","selectionSnapshot","active","anchorNode","extend","anchorOffset","focusNode","focusOffset","restoreSelection","snapshot","removeAllRanges","addRange","viewportMargin","different","toUpdate","selSnapshot","patchDisplay","updateNumbersFrom","container","rm","currentWheelTarget","updateNumber","updateGutters","specs","gElt","setGuttersForLineNumbers","wheelSamples","wheelPixelsPerUnit","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","delta","onScrollWheel","canScrollX","canScrollY","pixels","movedX","movedY","sample","Selection","equals","here","there","deepCopy","Range","somethingSelected","normalizeSelection","prim","sort","inv","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","computeReplacedSel","hint","oldPrev","newPrev","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","spansFor","linesFor","firstLine","lastText","lastSpans","nlines","insert","remove","added","added$1","added$2","linkedDocs","sharedHistOnly","propagate","skip","sharedHist","linked","rel","shared","attachDoc","setDirectionClass","directionChanged","History","startGen","done","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","pop","lastChangeEvent","hist","addChangeToHistory","selAfter","opId","history","historyEventDelay","pushSelectionToHistory","selectionEventCanBeMerged","addSelectionToHistory","clearRedo","dest","existing","removeClearedSpans","explicitlyCleared","getOldSpans","mergeOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","event","newChanges","extendRange","posBefore","extendSelection","setSelection","extendSelections","heads","newSel","replaceOneSelection","setSimpleSelection","filterSelectionChange","setSelectionReplaceHistory","setSelectionNoUndo","NaN","setSelectionInner","skipAtomicInSelection","reCheckSelection","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","cancel","makeChange","ignoreReadOnly","suppressEdits","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","antiChanges","filter","returned","v","shiftDoc","distance","removed","makeChangeSingleDocInEditor","recomputeMaxLength","checkWidthStart","changesHandler","changeHandler","replaceRange","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","copied","changeLine","handle","changeType","LeafChunk","removeInner","insertInner","iterN","BranchChunk","oldHeight","remaining","leaf","maybeSpill","me","spilled","sibling","myIndex","used","LineWidget","opt","adjustScrollWhenAboveVisible","oldH","addLineWidget","insertAt","aboveVisible","nextMarkerId","TextMarker","withOp","visual","side","dHeight","markText","markTextShared","replacedWith","addToHistory","curLine","clearOnEnter","clearHistory","SharedTextMarker","cloneNode","isParent","findSharedMarkers","findMarks","copySharedMarkers","mFrom","mTo","subMark","detachSharedMarkers","subMarker","nextDocId","Doc","lineSep","cleanGeneration","constructor","getValue","join","lineSeparator","setValue","getRange","getLineHandle","getLineNumber","getLineHandleVisualStart","lineCount","listSelections","setCursor","extendSelectionsBy","setSelections","addSelection","getSelections","replaceSelection","dup","replaceSelections","undo","redo","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","setGutterMarker","gutterID","clearGutter","lineInfo","addLineClass","where","removeLineClass","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","unlinkDoc","link","splitIds","iterLinkedDocs","getEditor","setDirection","eachLine","lastDrop","onDrop","clearDragCursor","files","dataTransfer","isReadOnly","FileReader","File","read","loadFile","file","allowDropFileTypes","reader","onload","readAsText","draggingText","text$1","getData","selected","onDragStart","setData","effectAllowed","setDragImage","img","src","_top","onDragOver","frag","dragCursor","forEachCodeMirror","getElementsByClassName","byClass","globalsRegistered","ensureGlobalHandlers","registerGlobalHandlers","resizeTimer","onResize","setSize","keyNames","fromCharCode","keyMap","basic","pcDefault","fallthrough","emacsy","macDefault","normalizeKeyName","alt","ctrl","cmd","mod","normalizeKeyMap","keymap","keyname","keys","lookupKey","getKeyMap","isModifierKey","keyCode","addModifierNames","noShift","altKey","metaKey","shiftKey","keyName","altGraphKey","deleteNearSelection","compute","kill","toKill","replaced","commands","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","goDocStart","goDocEnd","goLineStart","goLineStartSmart","lineStartSmart","goLineEnd","lineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","moveV","goLineDown","goPageUp","goPageDown","goCharLeft","moveH","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","deleteH","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentSelection","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","execCommand","transposeChars","newlineAndIndent","sels","indentLine","openLine","toggleOverwrite","firstNonWS","inWS","doHandleBinding","bound","dropShift","ensurePolled","prevShift","lookupKeyForEditor","keyMaps","extraKeys","stopSeq","dispatchKey","seq","keySeq","handleKeyBinding","motion","handleCharBinding","lastStoppedKey","onKeyDown","handled","showCrossHair","up","onKeyUp","onKeyPress","charCode","DOUBLECLICK_DELAY","PastClick","compare","lastClick","lastDoubleClick","clickRepeat","now","onMouseDown","supportsTouch","clickInGutter","repeat","selectingText","handleMappedButton","leftButtonDown","onContextMenu","configureMouse","option","unit","addNew","moveOnDrag","behavior","contained","dragDrop","leftButtonStartDrag","leftButtonSelect","moved","dragEnd","mouseMove","dragStart","e2","rangeForUnit","findWordAt","ourRange","ourIndex","startSel","lastPos","extendTo","startCol","posCol","oldRange","ranges$1","editorSize","counter","curCount","move","gutterEvent","prevent","mX","mY","lineBox","g","contextMenuInGutter","themeChanged","theme","Init","defaults","optionHandlers","defineOptions","deflt","notOnInit","defineOption","newBreaks","refresh","getInputField","spellcheck","guttersChanged","detach","attach","wrappingChanged","integer","blur","readOnlyChanged","dragDropChanged","resetPosition","getField","tabIndex","wasOn","funcs","dragFunctions","toggle","enter","over","leave","drop","inputStyles","inputStyle","pasteIncoming","cutIncoming","autofocus","registerEventHandlers","finishInit","initHooks","textRendering","word","touchFinished","prevTouch","finishTouch","isMouseLikeTouchEvent","touches","touch","radiusX","radiusY","farAway","pageX","pageY","inp","defineInitHook","how","aggressive","indent","curSpace","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","lastCopied","setLastCopied","newLastCopied","applyTextInput","inserted","deleted","paste","textLines","multiPaste","pasteLinesPerSelection","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","disableBrowserMagic","field","hiddenTextarea","border","addEditorMethods","helpers","setOption","getDoc","addKeyMap","removeKeyMap","addOverlay","modeSpec","removeOverlay","newRanges","getTokenAt","getLineTokens","getTokenTypeAt","getHelper","getHelpers","help","_global","getStateAfter","defaultTextHeight","defaultCharWidth","getViewport","addWidget","vspace","hspace","triggerOnKeyDown","triggerOnKeyPress","triggerOnKeyUp","triggerOnMouseDown","findPosH","amount","hitSide","rtlMoveVisually","findPosV","goalColumn","goals","headPos","startChar","check","scrollTo","getScrollInfo","interpret","swapDoc","getWrapperElement","getScrollerElement","getGutterElement","registerHelper","registerGlobalHelper","predicate","origDir","findNextLine","moveOnce","boundToLine","sawType","pageSize","moveAmount","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","composing","gracePeriod","readDOMTimeout","updateFromDOM","readFromDOMSoon","forceCompositionEnd","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","showMultipleSelections","curAnchor","domToPos","curFocus","bad","posToDOM","rangeCount","getRangeAt","rng","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","pollSelection","poll","pollInterval","isInGutter","pollContent","fromIndex","fromNode","toIndex","toNode","previousSibling","newText","domTextBetween","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","contentEditable","scan","badPos","closing","recognizeMarker","close","addText","walk","cmText","textContent","markerID","isBlock","nodeName","nodeValue","lineNode","locateNodeInLineView","textNode","topNode","curNode","dist","dist$1","TextareaInput","prevInput","pollingFast","textarea","fastPoll","prepareCopyCut","moveInputWithCursor","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","slowPoll","missed","same","resetSelectionOnContextMenu","oldCSS","oldWrapperCSS","wrapperBox","oldScrollY","scrollY","detectingSelectAll","prepareSelectAllHack","extval","rehide","mouseup","disabled","fromTextArea","tabindex","placeholder","realSubmit","form","leaveSubmitMethodAlone","submit","wrappedSubmit","getTextArea","toTextArea","addLegacyProps","cmpPos","dontDelegate","method","defineExtension","func","defineDocExtension","version","self","Clipboard","t","s","u","require","DOCUMENT_NODE_TYPE","Element","matches","proto","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","closest","element","selector","delegate","callback","useCapture","listenerFn","listener","destroy","delegateTarget","HTMLElement","SVGElement","nodeList","fn","is","listen","TypeError","listenNode","listenNodeList","listenSelector","forEach","selectedText","hasAttribute","setSelectionRange","removeAttribute","selectNodeContents","E","ctx","once","_","emit","evtArr","evts","liveEvents","clipboardAction","_select","_select2","_interopRequireDefault","__esModule","default","_typeof","Symbol","iterator","_classCallCheck","instance","Constructor","_createClass","defineProperties","descriptor","enumerable","configurable","writable","defineProperty","protoProps","staticProps","ClipboardAction","resolveOptions","initSelection","action","trigger","selectFake","selectTarget","_this","isRTL","removeFake","fakeHandlerCallback","fakeHandler","fakeElem","fontSize","yPosition","copyText","succeeded","err","handleResult","clearSelection","_action","_target","tinyEmitter","goodListener","clipboard","_clipboardAction","_tinyEmitter","_goodListener","_clipboardAction2","_tinyEmitter2","_goodListener2","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","setPrototypeOf","__proto__","_Emitter","getPrototypeOf","listenClick","defaultAction","defaultTarget","defaultText","_this2","onClick","currentTarget","getAttributeValue","isSupported","actions","support","queryCommandSupported","suffix","attribute","_native","_options","_construct","defaultOptions","carbonZoneKey","fallback","ignore","placement","prefix","targetClass","zone","jsonUrl","srv","getElementsByTagName","carbon","sanitize","ads","ad","pixel","timestamp","c","_native_go","json","selectedClass","querySelectorAll","selectedTarget","innerHTML","adElement","adInnerHtml","Event","bubbles","cancelable","eventPhase","timeStamp","getTime","propagationStopped","immediatePropagationStopped","stopImmediatePropagation","clone","EventDispatcher","_listeners","_captureListeners","removeAllEventListeners","hasEventListener","dispatchEvent","_dispatchEvent","willTrigger","listeners","scope","handleEvent","evt","eventObj","captureListeners","DOMUtils","$","query","_childQuery","queryAll","removeClass","_runOnNodeList","re","classList","names","toggleClass","curValue","hasClass","swapClass","oldClass","newClass","getEl","togglePanel","openEl","closedEl","open","el1","el2","isOpen","transition","then","template","strings","getCSSValue","el","getPropertyValue","nodelist","Utils","prepMenuContent","idMap","__next_id","kids","findIndex","JSON","parse","stringify","searchRank","searchTest","access","keywords","description","author","label","desc","weight","htmlSafe","shorten","unescSubstStr","SUBST_ESC_RE","SUBST_ESC_CHARS","getRegExp","regex","decomposeRegEx","delim","flags","isMac","getCtrlKey","performance","getUrlParams","params","url","location","decodeURIComponent","deferIds","defer","getHashCode","hash","getPatternURL","isLocal","hostname","getPatternURLStr","getForkName","num","Tooltip","contentEl","tipEl","hideF","_showT","handleBodyClick","curId","autohide","hide","show","toggleOn","showOn","toggleEl","elStyle","opacity","pad","wh","ww","innerWidth","marginRight","Server","solve","req","_getRequest","flavor","communitySearch","_processPatternList","load","patternId","_processPattern","fork","community","_prepPattern","rate","rating","userRating","delete","favorite","private","setAccess","multiFavorite","ids","patternIds","login","service","logout","verify","patterns","results","dateAdded","tool","parentId","userId","tests","postprocess","XMLHttpRequest","ServerPromise","setRequestHeader","timeout","useBeta","encodeURIComponent","console","log","send","_req","_postprocess","_load","_error","cf","ff","_loadF","catch","_data","finally","_errorF","_err","_finallyF","_complete","abort","response","responseText","success","error","message","CMUtils","opts","enforceMaxLength","enforceSingleLine","getCharIndexAt","winX","winY","getCharRect","maxLength","calcRangePos","startPos","endPos","Track","GA_ID","page","path","gtag","category","event_category","event_label","List","multi","addItem","els","dataset","selectedIndex","selectedEl","selectedItem","item","handleClick","removeItem","scrollEl","ExpressionLexer","profile","_profile","errors","captureGroups","namedGroups","_modes","capgroups","namedgroups","brgroups","branchResetGroups","groups","refs","charset","prv","unquantifiable","charTypes","closeIndex","lastIndexOf","parseFlag","parseParen","depth","capture","addCaptureGroup","parseSquareBracket","clss","possessive","related","parseQuant","parseBackSlash","parseChar","curGroup","curGroupNum","inGroupNum","validateRange","addJSWarnings","addError","matchRefs","warning","brgroup","getRef","relIndex","indexes","sign","refToOctal","config","reftooctalalways","char","mergeNext","parseEscChar","ANCHOR_TYPES","posixcharclass","posixCharClasses","isCond","behind","negative","condition","namedgroupalt","parseMode","namedref","parseRef","unicodecat","parseUnicode","escsequence","escunicodeub","escunicodeu","escunicodexb","ctrlcodeerr","escoctalo","escCharTypes","escCharCodes","badEscChars","escchar","escChars","isRef","not","unicodeScripts","unicodeCategories","unicodenegated","supModes","errmode","substring","proxy","ExpressionHighlighter","_activeMarks","_hoverMarks","_hoverToken","marks","draw","CSS_PREFIX","groupClasses","GROUP_CLASS_BY_TYPE","endToken","_calcTokenPos","hoverToken","_drawSelect","setnot","lookaround","ExpressionHover","editor","highlighter","isMouseDown","_handleMouseMove","_handleMouseOut","_handleMouseDown","app","tooltip","hover","reference","tipForToken","core","reduce","substTokens","docs","pcre","browser","expr","flag","testFlag","unicodeFlag","stickyFlag","dotallFlag","lookbehind","namedgroup","javascript","notunicodecat","unicodescript","notunicodescript","profiles","merge","js","p1","p2","Expression","lexer","_initUI","_onFlavorChange","expression","DEFAULT_EXPRESSION","_deferUpdate","validateFlagsStr","showFlags","flagsList","flagsEl","flagsBtn","toggleFlag","showFlavors","flavorEl","flavorBtn","editorEl","singleLine","_onEditorMouseDown","_onEditorChange","_onEditorKeyDown","errorEl","_onMouseError","_setInitialExpression","_initTooltips","_update","flavorData","flavorList","_onFlavorListChange","sidebar","goto","_onFlagListChange","innerText","supported","FLAGS","labels","FLAG_LABELS","tt","errs","getError","UID","_next","TextHighlighter","canvas","fill","stroke","lineSpacing","capWidth","lastBottom","lastRight","_matches","hoverMatch","_hoverMatch","selectedMatch","_selectedMatch","redraw","getContext","fillStyle","strokeStyle","lineWidth","emphasis","startRect","endRect","drawHighlight","lw","startCap","endCap","capW","globalAlpha","fillRect","strokeRect","TextHover","_x","_y","getMatchAt","tip","tipForMatch","Text","_initTestUI","_setResult","_handleThemeChange","testsEl","_tests","testList","_testMatches","_reselectTest","modeList","_handleModeChange","getMatchValue","inclusive","_result","getEmptyTest","resultEl","_mouseResult","modeListEl","textEl","_change","_updateSelected","detector","win","contentWindow","onresize","_startResize","_handleResize","_updateTests","_updateEmptyCount","_updateResult","_emptyCount","_showResult","parseFloat","toFixed","_errorText","_testFails","i0","i1","typeLabels","testItemEl","testListEl","_testItemTemplate","_handleTestChange","_addTest","typesEl","typesList","_handleTypesChange","fails","pass","_updateSelTest","_testMark","testEditor","typeBtn","_showTypes","delBtn","_deleteTest","nameFld","_handleTestNameChange","_updateTestHeader","edit","typeLbl","_selTest","_getTestEditor","fld","_handleTestTextChange","Explain","_bound_handleEvent","_handleEvent","cleanup","_divs","set0","set2","_handleMouseEvent","_insertApplied","divs","insertAdjacentElement","_handleHoverChange","_findDiv","showToken","Details","_addMatch","textVal","matchVal","_getMatchVal","extStr","groupTokens","tableEl","matchEl","_getRangeStr","inGroups","inGroup","ge","tr","Replace","SubstLexer","capGroups","subst","parseDollar","subst_bsgroup","_getRef","$_TYPES","numStr","substdecomposeref","Tools","_toolValues","DEFAULT_VALUES","_toolId","hasInput","toolList","_tool","_updateHighlights","headerEl","_handleHeaderClick","toolListEl","_handleListChange","_handleEditorChange","home","LinkRow","_pattern","showMessage","onclick","_onClick","copyBtn","Example","ex","example","_example","exp","CommunityContent","_rate","_favorite","linkRow","_share","_updateRating","_updateFavorite","_handleRate","share","_handleFavorite","Status","_showTooltip","_hideTooltip","distract","_show","_clearTimeout","_timeoutId","_hide","msg","_ttMsg","Account","_value","_updateUI","username","authenticated","showTooltip","tooltipEl","signinBtn","signinEl","signoutEl","_doSignout","signinList","_signinListChange","auth","_handleSignout","_cleanSignout","Share","_handleAppChange","_handleAppLoad","account","_handleAccountChange","_pushHistory","hNameFld","authorFld","descriptionFld","keywordsFld","mainEl","comEl","communityEl","hEl","hNewBtn","hForkBtn","hSaveBtn","_doSave","_doNew","_defaultName","_privateRow","_doPrivate","_privateStatus","_favoritesRow","_doFavorite","_favoritesStatus","_communityRow","_showCommunity","_deleteRow","_doDelete","_deleteStatus","_doSignin","_linkRow","saveEl","saveBtn","forkBtn","saveStatus","saveMessage","infoEl","_handleChange","comInputsEl","_doComSave","comSaveStatus","_comNameFld","_comAuthorFld","_comDescriptionFld","_comKeywordsFld","_handleKey","isChanged","_isChanged","isNew","_isNew","isOwned","_isOwned","_canFork","_canSave","_setSaveText","unsaved","replaceState","pushState","_handleSave","_handleSaveErr","isFork","_getErrMsg","newDoc","_handlePrivate","_handleErr","confirm","_handleDelete","status","_handleComSave","_handleComSaveErr","acc","rowEl","Sidebar","itemEl","openReq","_content","_prepContent","minList","prefs","_idMap","isNarrow","minimize","track","_minimized","idForToken","_isInReference","write","searchMode","curItem","selItem","menuList","_showContent","_resetFull","titleEl","_showEl","fullEl","communityListTemplate","_onSearchSubmit","_loadFavorites","back","menuListTemplate","searchEl","searchFld","_onSearchChange","searchBtn","listEl","lastId","_onDblClick","minEl","Community","_prepCheatsheet","_abortReq","ref","getContent","fillTags","_isIn","_searchReference","_searchFavorites","rank","search_term","_showListMsg","_showServerResults","_reqCleanup","Theme","urlTemplate","targetNode","_node","_dark","dark","themeBtn","_toggleTheme","_id","tmpl","href","Reference","_config","_flavor","_flavorChange","_injectEscChars","_misc","misc","searchStr","srch","kid","points","__searchPoints","errId","getChar","chr","NONPRINTING_CHARS","getQuant","getUniCat","UNICODE_CATEGORIES","getModes","getInsensitive","getDotAll","getLabel","getNodeForToken","getDesc","getVal","getLazy","U","getLazyFew","getPHPVersion","PHPVersion","getPCREVersion","PCREVersion","getEscChars","functs","safe","match2","pDocs","getDocs","pRef","getNode","more","_updateHide","isTokenSupported","chars","_getEscCharDocs","reference_content","groupopen","groupclose","setopen","rangerev","quanttarg","quantrev","esccharopen","esccharbad","unicodebad","posixcharclassbad","posixcharclassnoset","notsupported","fwdslash","servercomm","extraelse","unmatchedref","modebad","badname","dupname","branchreseterr","jsfuture","infinite","BrowserSolver","workerBlob","Blob","_workerObjectURL","URL","createObjectURL","_callback","_regex","_onRegExComplete","Worker","worker","onmessage","_startTime","terminate","postMessage","_getReplace","_getList","repl","trimR","ServerSolver","_serverPromise","_solve","_onLoad","_onError","Flavor","_browserSolver","_serverSolver","_buildSupportMap","solver","_supportMap","validateFlags","dupes","isFlagSupported","SUPPORT_MAP_PROPS","_addToSupportMap","esc","rev","RefCoverage","undoc","unused","all","subst_$group","subst_$bgroup","Prefs","_save","cookie","unescape","escape","RegExr","_migrateFavorites","_localInit","_savedHash","engine","tools","onbeforeunload","resetUnsaved","_initAds","_matchList","warn","getElementById","matchMedia","addListener","q","docEl","_modeChange","ls","localStorage","getItem","setItem","_handleResult","_processResult"],"mappings":";;;EAAA;EACA;;EAEA;EACA;EACA;EACA;EACA;;EAEC,WAAUA,MAAM,EAAEC,OAAO,EAAE;IAC1B,OAAOC,OAAO,KAAK,QAAQ,IAAI,OAAOC,MAAM,KAAK,WAAW,GAAGA,MAAM,CAACD,OAAO,GAAGD,OAAO,EAAE,GACzF,OAAOG,MAAM,KAAK,UAAU,IAAIA,MAAM,CAACC,GAAG,GAAGD,MAAM,CAACH,OAAO,CAAC,GAC3DD,MAAM,CAACM,UAAU,GAAGL,OAAO,EAAG;EACj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AAC;EACH,CAAC;;EC9GD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AACA,EAAe,MAAMG,KAAK,CAAC;IAG1BtqB,WAAWA,CAACvhC,IAAI,EAAE8rD,OAAO,EAAEC,UAAU,EAAE;;;EAGxC;EACA;EACA;EACA;MACE,IAAI,CAAC/rD,IAAI,GAAGA,IAAI;;;EAGlB;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACzM,MAAM,GAAG,IAAI;;;EAGpB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACi2D,aAAa,GAAG,IAAI;;;EAG3B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACwC,UAAU,GAAG,CAAC;;;EAGrB;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACF,OAAO,GAAG,CAAC,CAACA,OAAO;;;EAG1B;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACC,UAAU,GAAG,CAAC,CAACA,UAAU;;;EAGhC;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACE,SAAS,GAAI,IAAIj7B,IAAI,EAAE,CAAEk7B,OAAO,EAAE;;;EAGzC;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACziD,gBAAgB,GAAG,KAAK;;;EAG/B;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAAC0iD,kBAAkB,GAAG,KAAK;;;EAGjC;EACA;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAACC,2BAA2B,GAAG,KAAK;;;EAG1C;EACA;EACA;EACA;EACA;EACA;MACE,IAAI,CAAC7uB,OAA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CAAC,CAAC;;IAGxD41E,WAAWA,GAAG;MACbp0B,QAAC,CAACS,WAAW,CAAC,IAAI,CAAC0zB,KAAK,EAAE,YAAY,EAAE,IAAI,CAACjlF,IAAI,CAAC2Q,IAAI,KAAK,OAAO,CAAC;MACnE,IAAI,CAACy6D,OAAO,EAAE;;IAGfma,aAAaA,CAACj2E,MAAM,EAAE;MACrB,IAAI,CAACA,MAAM,GAAG,IAAI,CAACk2E,cAAc,CAACl2E,MAAM,CAAC;MACzC,IAAI,CAAC8gD,aAAa,CAAC,QAAQ,CAAC;;IAG7Bo1B,cAAcA,CAACl2E,MAAM,EAAE;MACtB,IAAIA,MAAM,CAACqB,IAAI,KAAK,MAAM,EAAE;QAC3BrB,MAAM,CAAC82C,OAAO,IAAI92C,MAAM,CAAC82C,OAAO,CAAC2B,OAAO,CAAC,CAAC9yC,CAAC,EAAEjhB,CAAC,KAAGihB,CAAC,CAACygD,GAAG,GAAC1hE,CAAC,CAAC;;MAE1D,OAAOsb,MAAM;;EAEf;;EC3OA;EACA;EACA;AACA;EACA;EACA;EACA;EACA;AACA;EACA;EACA;EACA;EACA;AACA;EACA;EACA;EACA;EAOA,IAAIk0D,GAAG,GAAG,IAAI0gB,MAAM,EAAE;;;;;;;;"} \ No newline at end of file diff --git a/generate.py b/generate.py index 45ac735..1f50994 100755 --- a/generate.py +++ b/generate.py @@ -167,7 +167,11 @@ def pop_hidden_data(): index = randint(0, len(hidden_data) - 1) return hidden_data.pop(index) -def generate_text(number_of_lines = 200): +def generate_text(number_of_lines = 200, language = None): + """ language can be None (both), "en" or "de". + """ + do_german = not language or language == "de" + do_english = not language or language == "en" result = "" for i in range(number_of_lines): emissions, _ = network.choose() @@ -181,10 +185,13 @@ def generate_text(number_of_lines = 200): case both: german += both english += both - result += german + "\n" - result += english + "\n" + if do_german: result += german + "\n" + if do_english: result += english + "\n" if random() < len(hidden_data) / (number_of_lines - i): - result += pop_hidden_data() + "\n" + hidden_line = pop_hidden_data() + german, english = hidden_line.split("\n") + if do_german: result += german + "\n" + if do_english: result += english + "\n" return result def read_template(filename = "./template.html"): @@ -197,10 +204,11 @@ def write_index(text, filename = "./deploy/index.html"): def main(): template = read_template() - generated = generate_text() - generated = greeting + "\n" + generated - text = template.replace("", generated) - write_index(text) + for language in ["", "de", "en"]: + generated = generate_text(language = language) + generated = greeting + "\n" + generated + text = template.replace("", generated) + write_index(text, filename = f"./deploy/{language}/index.html") if __name__ == "__main__": main() From efd21469622273faf9524f2abf07eea23f9ddded Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Wed, 5 Jun 2024 12:14:19 +0200 Subject: [PATCH 02/10] add german- and english-only versions of greeting --- generate.py | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/generate.py b/generate.py index 1f50994..64c3eaf 100755 --- a/generate.py +++ b/generate.py @@ -15,7 +15,7 @@ def get_names(filename, pad = " "): ] return names -greeting = """ +greeting = {"": """ Re: AW: Studierendenabfrage von: Prüfungsverwaltung --------- @@ -39,6 +39,7 @@ Viel Spaß === ENGLISCH VERSION === Hi, + there is no database for this exam, so I added our digitized notes below, always with the auto-generated english translation. Maybe you can filter it with regular expressions? @@ -46,12 +47,48 @@ They are like normal text-search but more flexible: E.g.: (Erst|Zweit)versuch would select both words: 'Erstversuch' (first attempt) and 'Zweitversuch' (second attempt). .+ will accept any text, you can add it at the start of the expression -(top of page) -to see the whole line in the menu 'List' (bottom right). +(top of page) to see the whole line in the menu 'List' (bottom right). You should find approximately 5 students. Good Luck -""" +""", "de": """ +Re: AW: Studierendenabfrage +von: Prüfungsverwaltung +--------- + +Hallo, + +Zur angefragten Prüfung gibt es leider noch keine Datenbank, +daher unten angefügt unsere Notizen aus Prüfungsakten und Personendatenbank. +Vielleicht können Sie die ja mit regulären Ausdrücken filtern. +Das funktioniert wie normale Text-Suche, nur etwas flexibler: +(Erst|Zweit)versuch z.B. würde sowohl 'Erstversuch' +als auch 'Zweitversuch' markieren. +.+ akzeptiert alle Zeichen, das können Sie an die 'Expression' +(oben auf der Seite) vorn anfügen, +um im Menü 'List' unten rechts den Anfang der Zeile zu sehen. +Sie sollten etwa 5 Studierende finden. + +Viel Spaß + +""", "en": """ +Re: AW: Student data request +von: Exam management +--------- + +Hi, + +there is no database for this exam, so I added our digitized notes below . +Maybe you can filter it with regular expressions? +They are like normal text-search but more flexible: +E.g.: (Erst|Zweit)versuch would select both words: +'Erstversuch' (first attempt) and 'Zweitversuch' (second attempt). +.+ will accept any text, you can add it at the start of the expression +(top of page) to see the whole line in the menu 'List' (bottom right). +You should find approximately 5 students. + +Good Luck +"""} # fünf Tatverdächtige # Uhrzeiten, siehe Infos von Verantwortlichen @@ -206,7 +243,7 @@ def main(): template = read_template() for language in ["", "de", "en"]: generated = generate_text(language = language) - generated = greeting + "\n" + generated + generated = greeting[language] + "\n" + generated text = template.replace("", generated) write_index(text, filename = f"./deploy/{language}/index.html") From 1f52d02ddad64803a0b031bab00d1ccc70c192a8 Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Wed, 5 Jun 2024 12:19:38 +0200 Subject: [PATCH 03/10] add english deefault regex and fix in text --- deploy/en/regexr.js | 2 +- generate.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/en/regexr.js b/deploy/en/regexr.js index 6111932..0ca96d6 100644 --- a/deploy/en/regexr.js +++ b/deploy/en/regexr.js @@ -16659,7 +16659,7 @@ var regexr = (function () { tt.showOn("error", "" + label + ": " + str, this.errorEl); } } - Expression.DEFAULT_EXPRESSION = "/(Erst|Zweit)versuch/g"; + Expression.DEFAULT_EXPRESSION = "/(first|second) attempt/g"; Expression.FLAGS = "gimsuxyU"; // for flag order Expression.FLAG_LABELS = { "g": "global", diff --git a/generate.py b/generate.py index 64c3eaf..6e809fc 100755 --- a/generate.py +++ b/generate.py @@ -81,8 +81,8 @@ Hi, there is no database for this exam, so I added our digitized notes below . Maybe you can filter it with regular expressions? They are like normal text-search but more flexible: -E.g.: (Erst|Zweit)versuch would select both words: -'Erstversuch' (first attempt) and 'Zweitversuch' (second attempt). +E.g.: /(first|second) attempt/ would select both: +'first attempt' and 'second attempt'. .+ will accept any text, you can add it at the start of the expression (top of page) to see the whole line in the menu 'List' (bottom right). You should find approximately 5 students. From b4104d171720316398386c223dd43f3bec764e6d Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Wed, 5 Jun 2024 12:22:41 +0200 Subject: [PATCH 04/10] reference the single-language version in the greeting --- generate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generate.py b/generate.py index 6e809fc..204f9f9 100755 --- a/generate.py +++ b/generate.py @@ -19,7 +19,8 @@ greeting = {"": """ Re: AW: Studierendenabfrage von: Prüfungsverwaltung --------- -Englisch version below. +English-only version at cc.ifsr.de/en, this page is bilingual. +Eine nur auf deutsch formulierte Variante ist unter cc.ifsr.de/de Hallo, From e71e30ce86daa73f6b32b7c376397f6f10df40cd Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Wed, 5 Jun 2024 12:38:35 +0200 Subject: [PATCH 05/10] do single-language only and link both --- .gitignore | 1 - deploy/index.html | 8 ++++++++ generate.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 deploy/index.html diff --git a/.gitignore b/.gitignore index 07f8ce0..4081fc1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ *.swo __pycache__ -deploy/index.html deploy/*/index.html diff --git a/deploy/index.html b/deploy/index.html new file mode 100644 index 0000000..dc208d2 --- /dev/null +++ b/deploy/index.html @@ -0,0 +1,8 @@ + + + + Deutsch +
    + English + + diff --git a/generate.py b/generate.py index 204f9f9..b1a5001 100755 --- a/generate.py +++ b/generate.py @@ -242,7 +242,7 @@ def write_index(text, filename = "./deploy/index.html"): def main(): template = read_template() - for language in ["", "de", "en"]: + for language in ["de", "en"]: generated = generate_text(language = language) generated = greeting[language] + "\n" + generated text = template.replace("", generated) From c6d2415271a48fa43ca7c06996424e55920f2a0d Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Wed, 5 Jun 2024 12:47:02 +0200 Subject: [PATCH 06/10] fix data generation: hidden data is local otherwise, the first data generation emties the data and the second get none --- generate.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/generate.py b/generate.py index b1a5001..d7ed699 100755 --- a/generate.py +++ b/generate.py @@ -200,14 +200,10 @@ network = Network( ), ) -def pop_hidden_data(): - global hidden_data - index = randint(0, len(hidden_data) - 1) - return hidden_data.pop(index) - def generate_text(number_of_lines = 200, language = None): """ language can be None (both), "en" or "de". """ + local_hidden_data = hidden_data[:] do_german = not language or language == "de" do_english = not language or language == "en" result = "" @@ -225,8 +221,9 @@ def generate_text(number_of_lines = 200, language = None): english += both if do_german: result += german + "\n" if do_english: result += english + "\n" - if random() < len(hidden_data) / (number_of_lines - i): - hidden_line = pop_hidden_data() + if random() < len(local_hidden_data) / (number_of_lines - i): + index = randint(0, len(local_hidden_data) - 1) + hidden_line = local_hidden_data.pop(index) german, english = hidden_line.split("\n") if do_german: result += german + "\n" if do_english: result += english + "\n" From 428d549b911c470d491b21d646c17f966e809359 Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Wed, 5 Jun 2024 12:48:01 +0200 Subject: [PATCH 07/10] use '.*' instead of '.+' in tips --- generate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generate.py b/generate.py index d7ed699..c0a32b1 100755 --- a/generate.py +++ b/generate.py @@ -31,7 +31,7 @@ Vielleicht können Sie die ja mit regulären Ausdrücken filtern. Das funktioniert wie normale Text-Suche, nur etwas flexibler: (Erst|Zweit)versuch z.B. würde sowohl 'Erstversuch' als auch 'Zweitversuch' markieren. -.+ akzeptiert alle Zeichen, das können Sie an die 'Expression' +.* akzeptiert alle Zeichen, das können Sie an die 'Expression' (oben auf der Seite) vorn anfügen, um im Menü 'List' unten rechts den Anfang der Zeile zu sehen. Sie sollten etwa 5 Studierende finden. @@ -47,7 +47,7 @@ Maybe you can filter it with regular expressions? They are like normal text-search but more flexible: E.g.: (Erst|Zweit)versuch would select both words: 'Erstversuch' (first attempt) and 'Zweitversuch' (second attempt). -.+ will accept any text, you can add it at the start of the expression +.* will accept any text, you can add it at the start of the expression (top of page) to see the whole line in the menu 'List' (bottom right). You should find approximately 5 students. @@ -65,7 +65,7 @@ Vielleicht können Sie die ja mit regulären Ausdrücken filtern. Das funktioniert wie normale Text-Suche, nur etwas flexibler: (Erst|Zweit)versuch z.B. würde sowohl 'Erstversuch' als auch 'Zweitversuch' markieren. -.+ akzeptiert alle Zeichen, das können Sie an die 'Expression' +.* akzeptiert alle Zeichen, das können Sie an die 'Expression' (oben auf der Seite) vorn anfügen, um im Menü 'List' unten rechts den Anfang der Zeile zu sehen. Sie sollten etwa 5 Studierende finden. @@ -84,7 +84,7 @@ Maybe you can filter it with regular expressions? They are like normal text-search but more flexible: E.g.: /(first|second) attempt/ would select both: 'first attempt' and 'second attempt'. -.+ will accept any text, you can add it at the start of the expression +.* will accept any text, you can add it at the start of the expression (top of page) to see the whole line in the menu 'List' (bottom right). You should find approximately 5 students. From 6345a765d8d96d3bd4b4442d8950d49721eb9d6a Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Wed, 5 Jun 2024 12:49:32 +0200 Subject: [PATCH 08/10] fix translation --- generate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate.py b/generate.py index c0a32b1..016af0d 100755 --- a/generate.py +++ b/generate.py @@ -74,7 +74,7 @@ Viel Spaß """, "en": """ Re: AW: Student data request -von: Exam management +from: Exam management --------- Hi, From 742843cc78636e5ffc18129f85050c75fc099ce6 Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Wed, 5 Jun 2024 12:59:17 +0200 Subject: [PATCH 09/10] use relative path for redirect --- deploy/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/index.html b/deploy/index.html index dc208d2..2cf739c 100644 --- a/deploy/index.html +++ b/deploy/index.html @@ -1,8 +1,8 @@ - Deutsch + Deutsch
    - English + English From a3d057d5b090b727d64fd059575afb9026c03e7c Mon Sep 17 00:00:00 2001 From: AntonObersteiner Date: Wed, 5 Jun 2024 13:58:09 +0200 Subject: [PATCH 10/10] remove date from texts --- generate.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/generate.py b/generate.py index 016af0d..b3b3a4f 100755 --- a/generate.py +++ b/generate.py @@ -94,7 +94,7 @@ Good Luck # fünf Tatverdächtige # Uhrzeiten, siehe Infos von Verantwortlichen # Groß-Klein-Schreibung -date = "05.06.2024" +date = "06.06.2024" hidden_data = [ "Anna Bartel: Zweitversuch nicht bestanden.\n" "Anna Bartel: second attempt not passed.", @@ -106,16 +106,16 @@ hidden_data = [ "Dennis Meier: 2nd attempt not passed.", "Elisa Menniz: Zweitversuch nicht bestanden.\n" "Elisa Menniz: second attempt not passed.", - f"Anna Bartel: Prüfung am {date} um 13:00.\n" - f"Anna Bartel: exam on {date}, 13:00.", - f"Boris Parsch: Prüfung am {date} um 14:00.\n" - f"Boris Parsch: exam on {date}, 14:00.", - f"Charlotte Winter: Prüfung am {date} um 13:30.\n" - f"Charlotte Winter: exam on {date}, 13:30.", - f"Dennis Meier: Prüfung am {date} um 10:00.\n" - f"Dennis Meier: exam on {date}, 10:00.", - f"Elisa Menniz: Prüfung am {date} um 14:30.\n" - f"Elisa Menniz: exam on {date}, 14:30.", + f"Anna Bartel: Prüfung um 13:00.\n" + f"Anna Bartel: exam, 13:00.", + f"Boris Parsch: Prüfung um 14:00.\n" + f"Boris Parsch: exam, 14:00.", + f"Charlotte Winter: Prüfung um 13:30.\n" + f"Charlotte Winter: exam, 13:30.", + f"Dennis Meier: Prüfung um 10:00.\n" + f"Dennis Meier: exam, 10:00.", + f"Elisa Menniz: Prüfung um 14:30.\n" + f"Elisa Menniz: exam, 14:30.", f"Anna Bartel: blaue Augen.\n" f"Anna Bartel: blue eyes.", f"Boris Parsch: blaue Augen.\n" @@ -143,7 +143,7 @@ network = Network( ), hat_den = Choice( versuch = [": ",], - prüfungszeit = [(f": Prüfung am {date} um ", f": exam on {date}, ")], + prüfungszeit = [(f": Prüfung um ", f": exam, ")], augenfarbe = [": ",], ), augenfarbe = Choice(