78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/web/js/respond.min.js:
--------------------------------------------------------------------------------
1 | /*! Respond.js v1.4.2: min/max-width media query polyfill
2 | * Copyright 2014 Scott Jehl
3 | * Licensed under MIT
4 | * https://j.mp/respondjs */
5 |
6 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){v(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},g=function(a){return a.replace(c.regex.minmaxwh,"").match(c.regex.other)};if(c.ajax=f,c.queue=d,c.unsupportedmq=g,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var h,i,j,k=a.document,l=k.documentElement,m=[],n=[],o=[],p={},q=30,r=k.getElementsByTagName("head")[0]||l,s=k.getElementsByTagName("base")[0],t=r.getElementsByTagName("link"),u=function(){var a,b=k.createElement("div"),c=k.body,d=l.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=k.createElement("body"),c.style.background="none"),l.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&l.insertBefore(c,l.firstChild),a=b.offsetWidth,f?l.removeChild(c):c.removeChild(b),l.style.fontSize=d,e&&(c.style.fontSize=e),a=j=parseFloat(a)},v=function(b){var c="clientWidth",d=l[c],e="CSS1Compat"===k.compatMode&&d||k.body[c]||d,f={},g=t[t.length-1],p=(new Date).getTime();if(b&&h&&q>p-h)return a.clearTimeout(i),i=a.setTimeout(v,q),void 0;h=p;for(var s in m)if(m.hasOwnProperty(s)){var w=m[s],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?j||u():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?j||u():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(n[w.rules]))}for(var C in o)o.hasOwnProperty(C)&&o[C]&&o[C].parentNode===r&&r.removeChild(o[C]);o.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=k.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,r.insertBefore(E,g.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(k.createTextNode(F)),o.push(E)}},w=function(a,b,d){var e=a.replace(c.regex.comments,"").replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},i=!f&&d;b.length&&(b+="/"),i&&(f=1);for(var j=0;f>j;j++){var k,l,o,p;i?(k=d,n.push(h(a))):(k=e[j].match(c.regex.findStyles)&&RegExp.$1,n.push(RegExp.$2&&h(RegExp.$2))),o=k.split(","),p=o.length;for(var q=0;p>q;q++)l=o[q],g(l)||m.push({media:l.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:n.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}v()},x=function(){if(d.length){var b=d.shift();f(b.href,function(c){w(c,b.href,b.media),p[b.href]=!0,a.setTimeout(function(){x()},0)})}},y=function(){for(var b=0;b 0\n' +
22 | ' IDHU EPADI IRUKU X\n' +
23 | ' KATHAM, KATHAM\n' +
24 | ' X+1 SOLRAN X SEIRAN\n' +
25 | 'MAGIZHCHI',
26 | 'Fizz Buzz':
27 | 'MEHHH! FIZZU...BUZZU...\n' +
28 | '1 SOLRAN X SEIRAN\n' +
29 | 'NOORU THADAVA SONNA MAADIRI X < 20\n' +
30 | ' MALAI DA ANNAMALAI X % 3 == 0\n' +
31 | ' IDHU EPADI IRUKU "Fizz"\n' +
32 | ' KATHAM, KATHAM\n' +
33 | ' MALAI DA ANNAMALAI X % 5 == 0\n' +
34 | ' IDHU EPADI IRUKU "Buzz"\n' +
35 | ' KATHAM, KATHAM \n' +
36 | ' MALAI DA ANNAMALAI (X % 3) * (X % 5) <> 0\n' +
37 | ' IDHU EPADI IRUKU X\n' +
38 | ' KATHAM, KATHAM\n' +
39 | ' X+1 SOLRAN X SEIRAN\n' +
40 | 'MAGIZHCHI',
41 | 'Magic 8-Ball':
42 | 'MEHHH! SIMPLER MAGIC 8-BALL\n' +
43 | 'IDHU EPADI IRUKU "Think of a question before reading the next line: "\n' +
44 | 'BILLA % 3 SOLRAN DICE SEIRAN\n' +
45 | 'MALAI DA ANNAMALAI DICE == 0\n' +
46 | ' IDHU EPADI IRUKU "Outlook not so good."\n' +
47 | 'KATHAM, KATHAM\n' +
48 | 'MALAI DA ANNAMALAI DICE == 1\n' +
49 | ' IDHU EPADI IRUKU "Concentrate and ask again."\n' +
50 | 'KATHAM, KATHAM\n' +
51 | 'MALAI DA ANNAMALAI DICE == 2\n' +
52 | ' IDHU EPADI IRUKU "As I see it, yes."\n' +
53 | 'KATHAM, KATHAM',
54 | };
55 |
56 |
57 | function init () {
58 | // If Service worker is not supported, then abort!
59 | if (!('serviceWorker' in navigator)) {
60 | alert("Your browser does not seem to support Webworkers. Try Firefox, Chrome or IE10+.");
61 | return;
62 | }
63 | var input=document.getElementById ("input");
64 | code_editor = CodeMirror.fromTextArea(input, {
65 | lineNumbers: true,
66 | theme: "lesser-dark",
67 | mode: "punchscript"
68 | });
69 | $("#output-area").hide(0);
70 |
71 | /* Handling clicking the Run button */
72 | $('#runbutton').click(function(e) {
73 | go();
74 | return false;
75 | });
76 |
77 | /* Populate drop-down with examples */
78 | var dropdown = $("#inputExamples");
79 | $.each(examples, function(k,v) { dropdown[0].add(new Option(k,k)); } );
80 | dropdown.change(function() {
81 | var title = $('option:selected', this).text();
82 | code_editor.setValue(examples[title]);
83 | });
84 | }
85 |
86 | // Run the input code
87 | function go () {
88 | var input = $("#input");
89 | var output_area = $("#output-area");
90 | var output = $("#output");
91 | var error = $("#errorarea");
92 | var inputcode = code_editor.getValue();
93 | var lines = inputcode.split(/\r|\r\n|\n/);
94 | var linecount = lines.length;
95 |
96 | console.log("Executing " + linecount + " lines of Punchscript...");
97 | if (worker) {
98 | worker.terminate();
99 | }
100 | worker = new Worker ("js/punch.bc.js");
101 |
102 | /* Handle response from OCaml */
103 | worker.onmessage = function (m) {
104 | if (typeof m.data == 'string') {
105 | var result_code = m.data.slice(0,1);
106 | var result_body = m.data.slice(2,-1);
107 |
108 | if(result_code == "0") {
109 | output_area.show("fast", function() {
110 | output_area[0].scrollIntoView();
111 | output.val(result_body);
112 | error.hide();
113 | });
114 | }
115 | else {
116 | var parts = result_body.split(":", 3);
117 | var line = parseInt(parts[0]);
118 | var col = parseInt(parts[1]);
119 | var msg = parts[2];
120 |
121 | output_area.show("fast", function() {
122 | output_area[0].scrollIntoView();
123 | output.val("");
124 | error.html("Line:" + line + " Column:" + col + "
" + msg + "");
125 | error.show();
126 | })
127 |
128 | }
129 | }
130 | }
131 |
132 | /* Send Punchscript code to OCaml */
133 | worker.postMessage({"input": inputcode});
134 | /* Prevent scroll */
135 | return false;
136 | }
137 |
138 | jQuery(function($) {
139 | init();
140 | });
141 |
--------------------------------------------------------------------------------
/web/css/codemirror.css:
--------------------------------------------------------------------------------
1 | /* BASICS */
2 |
3 | .CodeMirror {
4 | /* Set height, width, borders, and global font properties here */
5 | font-family: monospace;
6 | height: 300px;
7 | color: black;
8 | direction: ltr;
9 | }
10 |
11 | /* PADDING */
12 |
13 | .CodeMirror-lines {
14 | padding: 4px 0; /* Vertical padding around content */
15 | }
16 | .CodeMirror pre {
17 | padding: 0 4px; /* Horizontal padding of content */
18 | }
19 |
20 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
21 | background-color: white; /* The little square between H and V scrollbars */
22 | }
23 |
24 | /* GUTTER */
25 |
26 | .CodeMirror-gutters {
27 | border-right: 1px solid #ddd;
28 | background-color: #f7f7f7;
29 | white-space: nowrap;
30 | }
31 | .CodeMirror-linenumbers {}
32 | .CodeMirror-linenumber {
33 | padding: 0 3px 0 5px;
34 | min-width: 20px;
35 | text-align: right;
36 | color: #999;
37 | white-space: nowrap;
38 | }
39 |
40 | .CodeMirror-guttermarker { color: black; }
41 | .CodeMirror-guttermarker-subtle { color: #999; }
42 |
43 | /* CURSOR */
44 |
45 | .CodeMirror-cursor {
46 | border-left: 1px solid black;
47 | border-right: none;
48 | width: 0;
49 | }
50 | /* Shown when moving in bi-directional text */
51 | .CodeMirror div.CodeMirror-secondarycursor {
52 | border-left: 1px solid silver;
53 | }
54 | .cm-fat-cursor .CodeMirror-cursor {
55 | width: auto;
56 | border: 0 !important;
57 | background: #7e7;
58 | }
59 | .cm-fat-cursor div.CodeMirror-cursors {
60 | z-index: 1;
61 | }
62 | .cm-fat-cursor-mark {
63 | background-color: rgba(20, 255, 20, 0.5);
64 | -webkit-animation: blink 1.06s steps(1) infinite;
65 | -moz-animation: blink 1.06s steps(1) infinite;
66 | animation: blink 1.06s steps(1) infinite;
67 | }
68 | .cm-animate-fat-cursor {
69 | width: auto;
70 | border: 0;
71 | -webkit-animation: blink 1.06s steps(1) infinite;
72 | -moz-animation: blink 1.06s steps(1) infinite;
73 | animation: blink 1.06s steps(1) infinite;
74 | background-color: #7e7;
75 | }
76 | @-moz-keyframes blink {
77 | 0% {}
78 | 50% { background-color: transparent; }
79 | 100% {}
80 | }
81 | @-webkit-keyframes blink {
82 | 0% {}
83 | 50% { background-color: transparent; }
84 | 100% {}
85 | }
86 | @keyframes blink {
87 | 0% {}
88 | 50% { background-color: transparent; }
89 | 100% {}
90 | }
91 |
92 | /* Can style cursor different in overwrite (non-insert) mode */
93 | .CodeMirror-overwrite .CodeMirror-cursor {}
94 |
95 | .cm-tab { display: inline-block; text-decoration: inherit; }
96 |
97 | .CodeMirror-rulers {
98 | position: absolute;
99 | left: 0; right: 0; top: -50px; bottom: -20px;
100 | overflow: hidden;
101 | }
102 | .CodeMirror-ruler {
103 | border-left: 1px solid #ccc;
104 | top: 0; bottom: 0;
105 | position: absolute;
106 | }
107 |
108 | /* DEFAULT THEME */
109 |
110 | .cm-s-default .cm-header {color: blue;}
111 | .cm-s-default .cm-quote {color: #090;}
112 | .cm-negative {color: #d44;}
113 | .cm-positive {color: #292;}
114 | .cm-header, .cm-strong {font-weight: bold;}
115 | .cm-em {font-style: italic;}
116 | .cm-link {text-decoration: underline;}
117 | .cm-strikethrough {text-decoration: line-through;}
118 |
119 | .cm-s-default .cm-keyword {color: #708;}
120 | .cm-s-default .cm-atom {color: #219;}
121 | .cm-s-default .cm-number {color: #164;}
122 | .cm-s-default .cm-def {color: #00f;}
123 | .cm-s-default .cm-variable,
124 | .cm-s-default .cm-punctuation,
125 | .cm-s-default .cm-property,
126 | .cm-s-default .cm-operator {}
127 | .cm-s-default .cm-variable-2 {color: #05a;}
128 | .cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
129 | .cm-s-default .cm-comment {color: #a50;}
130 | .cm-s-default .cm-string {color: #a11;}
131 | .cm-s-default .cm-string-2 {color: #f50;}
132 | .cm-s-default .cm-meta {color: #555;}
133 | .cm-s-default .cm-qualifier {color: #555;}
134 | .cm-s-default .cm-builtin {color: #30a;}
135 | .cm-s-default .cm-bracket {color: #997;}
136 | .cm-s-default .cm-tag {color: #170;}
137 | .cm-s-default .cm-attribute {color: #00c;}
138 | .cm-s-default .cm-hr {color: #999;}
139 | .cm-s-default .cm-link {color: #00c;}
140 |
141 | .cm-s-default .cm-error {color: #f00;}
142 | .cm-invalidchar {color: #f00;}
143 |
144 | .CodeMirror-composing { border-bottom: 2px solid; }
145 |
146 | /* Default styles for common addons */
147 |
148 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
149 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
150 | .CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
151 | .CodeMirror-activeline-background {background: #e8f2ff;}
152 |
153 | /* STOP */
154 |
155 | /* The rest of this file contains styles related to the mechanics of
156 | the editor. You probably shouldn't touch them. */
157 |
158 | .CodeMirror {
159 | position: relative;
160 | overflow: hidden;
161 | background: white;
162 | }
163 |
164 | .CodeMirror-scroll {
165 | overflow: scroll !important; /* Things will break if this is overridden */
166 | /* 30px is the magic margin used to hide the element's real scrollbars */
167 | /* See overflow: hidden in .CodeMirror */
168 | margin-bottom: -30px; margin-right: -30px;
169 | padding-bottom: 30px;
170 | height: 100%;
171 | outline: none; /* Prevent dragging from highlighting the element */
172 | position: relative;
173 | }
174 | .CodeMirror-sizer {
175 | position: relative;
176 | border-right: 30px solid transparent;
177 | }
178 |
179 | /* The fake, visible scrollbars. Used to force redraw during scrolling
180 | before actual scrolling happens, thus preventing shaking and
181 | flickering artifacts. */
182 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
183 | position: absolute;
184 | z-index: 6;
185 | display: none;
186 | }
187 | .CodeMirror-vscrollbar {
188 | right: 0; top: 0;
189 | overflow-x: hidden;
190 | overflow-y: scroll;
191 | }
192 | .CodeMirror-hscrollbar {
193 | bottom: 0; left: 0;
194 | overflow-y: hidden;
195 | overflow-x: scroll;
196 | }
197 | .CodeMirror-scrollbar-filler {
198 | right: 0; bottom: 0;
199 | }
200 | .CodeMirror-gutter-filler {
201 | left: 0; bottom: 0;
202 | }
203 |
204 | .CodeMirror-gutters {
205 | position: absolute; left: 0; top: 0;
206 | min-height: 100%;
207 | z-index: 3;
208 | }
209 | .CodeMirror-gutter {
210 | white-space: normal;
211 | height: 100%;
212 | display: inline-block;
213 | vertical-align: top;
214 | margin-bottom: -30px;
215 | }
216 | .CodeMirror-gutter-wrapper {
217 | position: absolute;
218 | z-index: 4;
219 | background: none !important;
220 | border: none !important;
221 | }
222 | .CodeMirror-gutter-background {
223 | position: absolute;
224 | top: 0; bottom: 0;
225 | z-index: 4;
226 | }
227 | .CodeMirror-gutter-elt {
228 | position: absolute;
229 | cursor: default;
230 | z-index: 4;
231 | }
232 | .CodeMirror-gutter-wrapper ::selection { background-color: transparent }
233 | .CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
234 |
235 | .CodeMirror-lines {
236 | cursor: text;
237 | min-height: 1px; /* prevents collapsing before first draw */
238 | }
239 | .CodeMirror pre {
240 | /* Reset some styles that the rest of the page might have set */
241 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
242 | border-width: 0;
243 | background: transparent;
244 | font-family: inherit;
245 | font-size: inherit;
246 | margin: 0;
247 | white-space: pre;
248 | word-wrap: normal;
249 | line-height: inherit;
250 | color: inherit;
251 | z-index: 2;
252 | position: relative;
253 | overflow: visible;
254 | -webkit-tap-highlight-color: transparent;
255 | -webkit-font-variant-ligatures: contextual;
256 | font-variant-ligatures: contextual;
257 | }
258 | .CodeMirror-wrap pre {
259 | word-wrap: break-word;
260 | white-space: pre-wrap;
261 | word-break: normal;
262 | }
263 |
264 | .CodeMirror-linebackground {
265 | position: absolute;
266 | left: 0; right: 0; top: 0; bottom: 0;
267 | z-index: 0;
268 | }
269 |
270 | .CodeMirror-linewidget {
271 | position: relative;
272 | z-index: 2;
273 | padding: 0.1px; /* Force widget margins to stay inside of the container */
274 | }
275 |
276 | .CodeMirror-widget {}
277 |
278 | .CodeMirror-rtl pre { direction: rtl; }
279 |
280 | .CodeMirror-code {
281 | outline: none;
282 | }
283 |
284 | /* Force content-box sizing for the elements where we expect it */
285 | .CodeMirror-scroll,
286 | .CodeMirror-sizer,
287 | .CodeMirror-gutter,
288 | .CodeMirror-gutters,
289 | .CodeMirror-linenumber {
290 | -moz-box-sizing: content-box;
291 | box-sizing: content-box;
292 | }
293 |
294 | .CodeMirror-measure {
295 | position: absolute;
296 | width: 100%;
297 | height: 0;
298 | overflow: hidden;
299 | visibility: hidden;
300 | }
301 |
302 | .CodeMirror-cursor {
303 | position: absolute;
304 | pointer-events: none;
305 | }
306 | .CodeMirror-measure pre { position: static; }
307 |
308 | div.CodeMirror-cursors {
309 | visibility: hidden;
310 | position: relative;
311 | z-index: 3;
312 | }
313 | div.CodeMirror-dragcursors {
314 | visibility: visible;
315 | }
316 |
317 | .CodeMirror-focused div.CodeMirror-cursors {
318 | visibility: visible;
319 | }
320 |
321 | .CodeMirror-selected { background: #d9d9d9; }
322 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
323 | .CodeMirror-crosshair { cursor: crosshair; }
324 | .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
325 | .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
326 |
327 | .cm-searching {
328 | background-color: #ffa;
329 | background-color: rgba(255, 255, 0, .4);
330 | }
331 |
332 | /* Used to force a border model for a node */
333 | .cm-force-border { padding-right: .1px; }
334 |
335 | @media print {
336 | /* Hide the cursor when printing */
337 | .CodeMirror div.CodeMirror-cursors {
338 | visibility: hidden;
339 | }
340 | }
341 |
342 | /* See issue #2901 */
343 | .cm-tab-wrap-hack:after { content: ''; }
344 |
345 | /* Help users use markselection to safely style text background */
346 | span.CodeMirror-selectedtext { background: none; }
347 |
--------------------------------------------------------------------------------
/web/js/lib/mode/punchscript/punchscript.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: https://codemirror.net/LICENSE
3 | // Derived from Python mode by Arun Ravindran, 2018
4 |
5 | (function(mod) {
6 | if (typeof exports == "object" && typeof module == "object") // CommonJS
7 | mod(require("../../lib/codemirror"));
8 | else if (typeof define == "function" && define.amd) // AMD
9 | define(["../../lib/codemirror"], mod);
10 | else // Plain browser env
11 | mod(CodeMirror);
12 | })(function(CodeMirror) {
13 | "use strict";
14 |
15 | function wordRegexp(words) {
16 | return new RegExp("^((" + words.join(")|(") + "))\\b");
17 | }
18 |
19 | var wordOperators = wordRegexp(["and", "or", "not", "is"]);
20 | var commonKeywords = ['SOLRAN', 'SEIRAN', 'I AM CHITTI',
21 | 'MALAI DA ANNAMALAI', 'EN VAZHI THANI VAZHI', 'KATHAM, KATHAM',
22 | 'NOORU THADAVA SONNA MAADIRI', 'MAGIZHCHI'];
23 |
24 | var commonBuiltins = ['IDHU EPADI IRUKU', 'GURU', 'SISHYAN', 'BILLA'];
25 | CodeMirror.registerHelper("hintWords", "punchscript", commonKeywords.concat(commonBuiltins));
26 |
27 | function top(state) {
28 | return state.scopes[state.scopes.length - 1];
29 | }
30 |
31 | CodeMirror.defineMode("punchscript", function(conf, parserConf) {
32 | var ERRORCLASS = "error";
33 |
34 | var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:=;\.\\]/;
35 | // (Backwards-compatiblity with old, cumbersome config system)
36 | var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,
37 | parserConf.operators || /^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/]
38 | for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)
39 |
40 | var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
41 |
42 | var myKeywords = commonKeywords, myBuiltins = commonBuiltins;
43 | if (parserConf.extra_keywords != undefined)
44 | myKeywords = myKeywords.concat(parserConf.extra_keywords);
45 |
46 | if (parserConf.extra_builtins != undefined)
47 | myBuiltins = myBuiltins.concat(parserConf.extra_builtins);
48 |
49 | // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
50 | var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
51 | var stringPrefixes = new RegExp("^(([rbuf]|(br)|(fr))?('{3}|\"{3}|['\"]))", "i");
52 | var keywords = wordRegexp(myKeywords);
53 | var builtins = wordRegexp(myBuiltins);
54 |
55 | // tokenizers
56 | function tokenBase(stream, state) {
57 | var sol = stream.sol() && state.lastToken != "\\"
58 | if (sol) state.indent = stream.indentation()
59 | // Handle scope changes
60 | if (sol && top(state).type == "py") {
61 | var scopeOffset = top(state).offset;
62 | if (stream.eatSpace()) {
63 | var lineOffset = stream.indentation();
64 | if (lineOffset > scopeOffset)
65 | pushPyScope(state);
66 | else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != "#")
67 | state.errorToken = true;
68 | return null;
69 | } else {
70 | var style = tokenBaseInner(stream, state);
71 | if (scopeOffset > 0 && dedent(stream, state))
72 | style += " " + ERRORCLASS;
73 | return style;
74 | }
75 | }
76 | return tokenBaseInner(stream, state);
77 | }
78 |
79 | function tokenBaseInner(stream, state) {
80 | if (stream.eatSpace()) return null;
81 |
82 | // Handle Comments
83 | if (stream.match(/^MEHHH!.*/)) return "comment";
84 |
85 | // Handle Number Literals
86 | if (stream.match(/^[0-9]+/i)) {
87 | return "number";
88 | }
89 |
90 | // Handle Strings
91 | if (stream.match(stringPrefixes)) {
92 | var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;
93 | if (!isFmtString) {
94 | state.tokenize = tokenStringFactory(stream.current());
95 | return state.tokenize(stream, state);
96 | } else {
97 | state.tokenize = formatStringFactory(stream.current(), state.tokenize);
98 | return state.tokenize(stream, state);
99 | }
100 | }
101 |
102 | for (var i = 0; i < operators.length; i++)
103 | if (stream.match(operators[i])) return "operator"
104 |
105 | if (stream.match(delimiters)) return "punctuation";
106 |
107 | if (state.lastToken == "." && stream.match(identifiers))
108 | return "property";
109 |
110 | if (stream.match(keywords) || stream.match(wordOperators))
111 | return "keyword";
112 |
113 | if (stream.match(builtins))
114 | return "builtin";
115 |
116 | if (stream.match(/^(self|cls)\b/))
117 | return "variable-2";
118 |
119 | if (stream.match(identifiers)) {
120 | if (state.lastToken == "def" || state.lastToken == "class")
121 | return "def";
122 | return "variable";
123 | }
124 |
125 | // Handle non-detected items
126 | stream.next();
127 | return ERRORCLASS;
128 | }
129 |
130 | function formatStringFactory(delimiter, tokenOuter) {
131 | while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
132 | delimiter = delimiter.substr(1);
133 |
134 | var singleline = delimiter.length == 1;
135 | var OUTCLASS = "string";
136 |
137 | function tokenFString(stream, state) {
138 | // inside f-str Expression
139 | if (stream.match(delimiter)) {
140 | // expression ends pre-maturally, but very common in editing
141 | // Could show error to remind users to close brace here
142 | state.tokenize = tokenString
143 | return OUTCLASS;
144 | } else if (stream.match('{')) {
145 | // starting brace, if not eaten below
146 | return "punctuation";
147 | } else if (stream.match('}')) {
148 | // return to regular inside string state
149 | state.tokenize = tokenString
150 | return "punctuation";
151 | } else {
152 | // use tokenBaseInner to parse the expression
153 | return tokenBaseInner(stream, state);
154 | }
155 | }
156 |
157 | function tokenString(stream, state) {
158 | while (!stream.eol()) {
159 | stream.eatWhile(/[^'"\{\}\\]/);
160 | if (stream.eat("\\")) {
161 | stream.next();
162 | if (singleline && stream.eol())
163 | return OUTCLASS;
164 | } else if (stream.match(delimiter)) {
165 | state.tokenize = tokenOuter;
166 | return OUTCLASS;
167 | } else if (stream.match('{{')) {
168 | // ignore {{ in f-str
169 | return OUTCLASS;
170 | } else if (stream.match('{', false)) {
171 | // switch to nested mode
172 | state.tokenize = tokenFString
173 | if (stream.current()) {
174 | return OUTCLASS;
175 | } else {
176 | // need to return something, so eat the starting {
177 | stream.next();
178 | return "punctuation";
179 | }
180 | } else if (stream.match('}}')) {
181 | return OUTCLASS;
182 | } else if (stream.match('}')) {
183 | // single } in f-string is an error
184 | return ERRORCLASS;
185 | } else {
186 | stream.eat(/['"]/);
187 | }
188 | }
189 | if (singleline) {
190 | if (parserConf.singleLineStringErrors)
191 | return ERRORCLASS;
192 | else
193 | state.tokenize = tokenOuter;
194 | }
195 | return OUTCLASS;
196 | }
197 | tokenString.isString = true;
198 | return tokenString;
199 | }
200 |
201 | function tokenStringFactory(delimiter) {
202 | while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
203 | delimiter = delimiter.substr(1);
204 |
205 | var singleline = delimiter.length == 1;
206 | var OUTCLASS = "string";
207 |
208 | function tokenString(stream, state) {
209 | while (!stream.eol()) {
210 | stream.eatWhile(/[^'"\\]/);
211 | if (stream.eat("\\")) {
212 | stream.next();
213 | if (singleline && stream.eol())
214 | return OUTCLASS;
215 | } else if (stream.match(delimiter)) {
216 | state.tokenize = tokenBase;
217 | return OUTCLASS;
218 | } else {
219 | stream.eat(/['"]/);
220 | }
221 | }
222 | if (singleline) {
223 | if (parserConf.singleLineStringErrors)
224 | return ERRORCLASS;
225 | else
226 | state.tokenize = tokenBase;
227 | }
228 | return OUTCLASS;
229 | }
230 | tokenString.isString = true;
231 | return tokenString;
232 | }
233 |
234 | function pushPyScope(state) {
235 | while (top(state).type != "py") state.scopes.pop()
236 | state.scopes.push({offset: top(state).offset + conf.indentUnit,
237 | type: "py",
238 | align: null})
239 | }
240 |
241 | function pushBracketScope(stream, state, type) {
242 | var align = stream.match(/^([\s\[\{\(]|#.*)*$/, false) ? null : stream.column() + 1
243 | state.scopes.push({offset: state.indent + hangingIndent,
244 | type: type,
245 | align: align})
246 | }
247 |
248 | function dedent(stream, state) {
249 | var indented = stream.indentation();
250 | while (state.scopes.length > 1 && top(state).offset > indented) {
251 | if (top(state).type != "py") return true;
252 | state.scopes.pop();
253 | }
254 | return top(state).offset != indented;
255 | }
256 |
257 | function tokenLexer(stream, state) {
258 | if (stream.sol()) state.beginningOfLine = true;
259 |
260 | var style = state.tokenize(stream, state);
261 | var current = stream.current();
262 |
263 | if (/\S/.test(current)) state.beginningOfLine = false;
264 |
265 | if ((style == "variable" || style == "builtin")
266 | && state.lastToken == "meta")
267 | style = "meta";
268 |
269 | // Handle scope changes.
270 | if (current == "pass" || current == "return")
271 | state.dedent += 1;
272 |
273 | if (current == "lambda") state.lambda = true;
274 | if (current == ":" && !state.lambda && top(state).type == "py")
275 | pushPyScope(state);
276 |
277 | if (current.length == 1 && !/string|comment/.test(style)) {
278 | var delimiter_index = "[({".indexOf(current);
279 | if (delimiter_index != -1)
280 | pushBracketScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1));
281 |
282 | delimiter_index = "])}".indexOf(current);
283 | if (delimiter_index != -1) {
284 | if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent
285 | else return ERRORCLASS;
286 | }
287 | }
288 | if (state.dedent > 0 && stream.eol() && top(state).type == "py") {
289 | if (state.scopes.length > 1) state.scopes.pop();
290 | state.dedent -= 1;
291 | }
292 |
293 | return style;
294 | }
295 |
296 | var external = {
297 | startState: function(basecolumn) {
298 | return {
299 | tokenize: tokenBase,
300 | scopes: [{offset: basecolumn || 0, type: "py", align: null}],
301 | indent: basecolumn || 0,
302 | lastToken: null,
303 | lambda: false,
304 | dedent: 0
305 | };
306 | },
307 |
308 | token: function(stream, state) {
309 | var addErr = state.errorToken;
310 | if (addErr) state.errorToken = false;
311 | var style = tokenLexer(stream, state);
312 |
313 | if (style && style != "comment")
314 | state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style;
315 | if (style == "punctuation") style = null;
316 |
317 | if (stream.eol() && state.lambda)
318 | state.lambda = false;
319 | return addErr ? style + " " + ERRORCLASS : style;
320 | },
321 |
322 | indent: function(state, textAfter) {
323 | if (state.tokenize != tokenBase)
324 | return state.tokenize.isString ? CodeMirror.Pass : 0;
325 |
326 | var scope = top(state), closing = scope.type == textAfter.charAt(0)
327 | if (scope.align != null)
328 | return scope.align - (closing ? 1 : 0)
329 | else
330 | return scope.offset - (closing ? hangingIndent : 0)
331 | },
332 |
333 | electricInput: /^\s*[\}\]\)]$/,
334 | closeBrackets: {triples: "'\""},
335 | lineComment: "MEHHH!",
336 | fold: "indent"
337 | };
338 | return external;
339 | });
340 |
341 | CodeMirror.defineMIME("text/x-punchscript", "punchscript");
342 |
343 | var words = function(str) { return str.split(" "); };
344 |
345 | CodeMirror.defineMIME("text/x-cython", {
346 | name: "punchscript",
347 | extra_keywords: words("")
348 | });
349 |
350 | });
351 |
--------------------------------------------------------------------------------
/web/js/lib/mode/python/python.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: https://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | "use strict";
13 |
14 | function wordRegexp(words) {
15 | return new RegExp("^((" + words.join(")|(") + "))\\b");
16 | }
17 |
18 | var wordOperators = wordRegexp(["and", "or", "not", "is"]);
19 | var commonKeywords = ["as", "assert", "break", "class", "continue",
20 | "def", "del", "elif", "else", "except", "finally",
21 | "for", "from", "global", "if", "import",
22 | "lambda", "pass", "raise", "return",
23 | "try", "while", "with", "yield", "in"];
24 | var commonBuiltins = ["abs", "all", "any", "bin", "bool", "bytearray", "callable", "chr",
25 | "classmethod", "compile", "complex", "delattr", "dict", "dir", "divmod",
26 | "enumerate", "eval", "filter", "float", "format", "frozenset",
27 | "getattr", "globals", "hasattr", "hash", "help", "hex", "id",
28 | "input", "int", "isinstance", "issubclass", "iter", "len",
29 | "list", "locals", "map", "max", "memoryview", "min", "next",
30 | "object", "oct", "open", "ord", "pow", "property", "range",
31 | "repr", "reversed", "round", "set", "setattr", "slice",
32 | "sorted", "staticmethod", "str", "sum", "super", "tuple",
33 | "type", "vars", "zip", "__import__", "NotImplemented",
34 | "Ellipsis", "__debug__"];
35 | CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins));
36 |
37 | function top(state) {
38 | return state.scopes[state.scopes.length - 1];
39 | }
40 |
41 | CodeMirror.defineMode("python", function(conf, parserConf) {
42 | var ERRORCLASS = "error";
43 |
44 | var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.\\]/;
45 | // (Backwards-compatiblity with old, cumbersome config system)
46 | var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,
47 | parserConf.operators || /^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/]
48 | for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)
49 |
50 | var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
51 |
52 | var myKeywords = commonKeywords, myBuiltins = commonBuiltins;
53 | if (parserConf.extra_keywords != undefined)
54 | myKeywords = myKeywords.concat(parserConf.extra_keywords);
55 |
56 | if (parserConf.extra_builtins != undefined)
57 | myBuiltins = myBuiltins.concat(parserConf.extra_builtins);
58 |
59 | var py3 = !(parserConf.version && Number(parserConf.version) < 3)
60 | if (py3) {
61 | // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
62 | var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
63 | myKeywords = myKeywords.concat(["nonlocal", "False", "True", "None", "async", "await"]);
64 | myBuiltins = myBuiltins.concat(["ascii", "bytes", "exec", "print"]);
65 | var stringPrefixes = new RegExp("^(([rbuf]|(br)|(fr))?('{3}|\"{3}|['\"]))", "i");
66 | } else {
67 | var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;
68 | myKeywords = myKeywords.concat(["exec", "print"]);
69 | myBuiltins = myBuiltins.concat(["apply", "basestring", "buffer", "cmp", "coerce", "execfile",
70 | "file", "intern", "long", "raw_input", "reduce", "reload",
71 | "unichr", "unicode", "xrange", "False", "True", "None"]);
72 | var stringPrefixes = new RegExp("^(([rubf]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i");
73 | }
74 | var keywords = wordRegexp(myKeywords);
75 | var builtins = wordRegexp(myBuiltins);
76 |
77 | // tokenizers
78 | function tokenBase(stream, state) {
79 | var sol = stream.sol() && state.lastToken != "\\"
80 | if (sol) state.indent = stream.indentation()
81 | // Handle scope changes
82 | if (sol && top(state).type == "py") {
83 | var scopeOffset = top(state).offset;
84 | if (stream.eatSpace()) {
85 | var lineOffset = stream.indentation();
86 | if (lineOffset > scopeOffset)
87 | pushPyScope(state);
88 | else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != "#")
89 | state.errorToken = true;
90 | return null;
91 | } else {
92 | var style = tokenBaseInner(stream, state);
93 | if (scopeOffset > 0 && dedent(stream, state))
94 | style += " " + ERRORCLASS;
95 | return style;
96 | }
97 | }
98 | return tokenBaseInner(stream, state);
99 | }
100 |
101 | function tokenBaseInner(stream, state) {
102 | if (stream.eatSpace()) return null;
103 |
104 | // Handle Comments
105 | if (stream.match(/^#.*/)) return "comment";
106 |
107 | // Handle Number Literals
108 | if (stream.match(/^[0-9\.]/, false)) {
109 | var floatLiteral = false;
110 | // Floats
111 | if (stream.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; }
112 | if (stream.match(/^[\d_]+\.\d*/)) { floatLiteral = true; }
113 | if (stream.match(/^\.\d+/)) { floatLiteral = true; }
114 | if (floatLiteral) {
115 | // Float literals may be "imaginary"
116 | stream.eat(/J/i);
117 | return "number";
118 | }
119 | // Integers
120 | var intLiteral = false;
121 | // Hex
122 | if (stream.match(/^0x[0-9a-f_]+/i)) intLiteral = true;
123 | // Binary
124 | if (stream.match(/^0b[01_]+/i)) intLiteral = true;
125 | // Octal
126 | if (stream.match(/^0o[0-7_]+/i)) intLiteral = true;
127 | // Decimal
128 | if (stream.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)) {
129 | // Decimal literals may be "imaginary"
130 | stream.eat(/J/i);
131 | // TODO - Can you have imaginary longs?
132 | intLiteral = true;
133 | }
134 | // Zero by itself with no other piece of number.
135 | if (stream.match(/^0(?![\dx])/i)) intLiteral = true;
136 | if (intLiteral) {
137 | // Integer literals may be "long"
138 | stream.eat(/L/i);
139 | return "number";
140 | }
141 | }
142 |
143 | // Handle Strings
144 | if (stream.match(stringPrefixes)) {
145 | var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;
146 | if (!isFmtString) {
147 | state.tokenize = tokenStringFactory(stream.current());
148 | return state.tokenize(stream, state);
149 | } else {
150 | state.tokenize = formatStringFactory(stream.current(), state.tokenize);
151 | return state.tokenize(stream, state);
152 | }
153 | }
154 |
155 | for (var i = 0; i < operators.length; i++)
156 | if (stream.match(operators[i])) return "operator"
157 |
158 | if (stream.match(delimiters)) return "punctuation";
159 |
160 | if (state.lastToken == "." && stream.match(identifiers))
161 | return "property";
162 |
163 | if (stream.match(keywords) || stream.match(wordOperators))
164 | return "keyword";
165 |
166 | if (stream.match(builtins))
167 | return "builtin";
168 |
169 | if (stream.match(/^(self|cls)\b/))
170 | return "variable-2";
171 |
172 | if (stream.match(identifiers)) {
173 | if (state.lastToken == "def" || state.lastToken == "class")
174 | return "def";
175 | return "variable";
176 | }
177 |
178 | // Handle non-detected items
179 | stream.next();
180 | return ERRORCLASS;
181 | }
182 |
183 | function formatStringFactory(delimiter, tokenOuter) {
184 | while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
185 | delimiter = delimiter.substr(1);
186 |
187 | var singleline = delimiter.length == 1;
188 | var OUTCLASS = "string";
189 |
190 | function tokenFString(stream, state) {
191 | // inside f-str Expression
192 | if (stream.match(delimiter)) {
193 | // expression ends pre-maturally, but very common in editing
194 | // Could show error to remind users to close brace here
195 | state.tokenize = tokenString
196 | return OUTCLASS;
197 | } else if (stream.match('{')) {
198 | // starting brace, if not eaten below
199 | return "punctuation";
200 | } else if (stream.match('}')) {
201 | // return to regular inside string state
202 | state.tokenize = tokenString
203 | return "punctuation";
204 | } else {
205 | // use tokenBaseInner to parse the expression
206 | return tokenBaseInner(stream, state);
207 | }
208 | }
209 |
210 | function tokenString(stream, state) {
211 | while (!stream.eol()) {
212 | stream.eatWhile(/[^'"\{\}\\]/);
213 | if (stream.eat("\\")) {
214 | stream.next();
215 | if (singleline && stream.eol())
216 | return OUTCLASS;
217 | } else if (stream.match(delimiter)) {
218 | state.tokenize = tokenOuter;
219 | return OUTCLASS;
220 | } else if (stream.match('{{')) {
221 | // ignore {{ in f-str
222 | return OUTCLASS;
223 | } else if (stream.match('{', false)) {
224 | // switch to nested mode
225 | state.tokenize = tokenFString
226 | if (stream.current()) {
227 | return OUTCLASS;
228 | } else {
229 | // need to return something, so eat the starting {
230 | stream.next();
231 | return "punctuation";
232 | }
233 | } else if (stream.match('}}')) {
234 | return OUTCLASS;
235 | } else if (stream.match('}')) {
236 | // single } in f-string is an error
237 | return ERRORCLASS;
238 | } else {
239 | stream.eat(/['"]/);
240 | }
241 | }
242 | if (singleline) {
243 | if (parserConf.singleLineStringErrors)
244 | return ERRORCLASS;
245 | else
246 | state.tokenize = tokenOuter;
247 | }
248 | return OUTCLASS;
249 | }
250 | tokenString.isString = true;
251 | return tokenString;
252 | }
253 |
254 | function tokenStringFactory(delimiter) {
255 | while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
256 | delimiter = delimiter.substr(1);
257 |
258 | var singleline = delimiter.length == 1;
259 | var OUTCLASS = "string";
260 |
261 | function tokenString(stream, state) {
262 | while (!stream.eol()) {
263 | stream.eatWhile(/[^'"\\]/);
264 | if (stream.eat("\\")) {
265 | stream.next();
266 | if (singleline && stream.eol())
267 | return OUTCLASS;
268 | } else if (stream.match(delimiter)) {
269 | state.tokenize = tokenBase;
270 | return OUTCLASS;
271 | } else {
272 | stream.eat(/['"]/);
273 | }
274 | }
275 | if (singleline) {
276 | if (parserConf.singleLineStringErrors)
277 | return ERRORCLASS;
278 | else
279 | state.tokenize = tokenBase;
280 | }
281 | return OUTCLASS;
282 | }
283 | tokenString.isString = true;
284 | return tokenString;
285 | }
286 |
287 | function pushPyScope(state) {
288 | while (top(state).type != "py") state.scopes.pop()
289 | state.scopes.push({offset: top(state).offset + conf.indentUnit,
290 | type: "py",
291 | align: null})
292 | }
293 |
294 | function pushBracketScope(stream, state, type) {
295 | var align = stream.match(/^([\s\[\{\(]|#.*)*$/, false) ? null : stream.column() + 1
296 | state.scopes.push({offset: state.indent + hangingIndent,
297 | type: type,
298 | align: align})
299 | }
300 |
301 | function dedent(stream, state) {
302 | var indented = stream.indentation();
303 | while (state.scopes.length > 1 && top(state).offset > indented) {
304 | if (top(state).type != "py") return true;
305 | state.scopes.pop();
306 | }
307 | return top(state).offset != indented;
308 | }
309 |
310 | function tokenLexer(stream, state) {
311 | if (stream.sol()) state.beginningOfLine = true;
312 |
313 | var style = state.tokenize(stream, state);
314 | var current = stream.current();
315 |
316 | // Handle decorators
317 | if (state.beginningOfLine && current == "@")
318 | return stream.match(identifiers, false) ? "meta" : py3 ? "operator" : ERRORCLASS;
319 |
320 | if (/\S/.test(current)) state.beginningOfLine = false;
321 |
322 | if ((style == "variable" || style == "builtin")
323 | && state.lastToken == "meta")
324 | style = "meta";
325 |
326 | // Handle scope changes.
327 | if (current == "pass" || current == "return")
328 | state.dedent += 1;
329 |
330 | if (current == "lambda") state.lambda = true;
331 | if (current == ":" && !state.lambda && top(state).type == "py")
332 | pushPyScope(state);
333 |
334 | if (current.length == 1 && !/string|comment/.test(style)) {
335 | var delimiter_index = "[({".indexOf(current);
336 | if (delimiter_index != -1)
337 | pushBracketScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1));
338 |
339 | delimiter_index = "])}".indexOf(current);
340 | if (delimiter_index != -1) {
341 | if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent
342 | else return ERRORCLASS;
343 | }
344 | }
345 | if (state.dedent > 0 && stream.eol() && top(state).type == "py") {
346 | if (state.scopes.length > 1) state.scopes.pop();
347 | state.dedent -= 1;
348 | }
349 |
350 | return style;
351 | }
352 |
353 | var external = {
354 | startState: function(basecolumn) {
355 | return {
356 | tokenize: tokenBase,
357 | scopes: [{offset: basecolumn || 0, type: "py", align: null}],
358 | indent: basecolumn || 0,
359 | lastToken: null,
360 | lambda: false,
361 | dedent: 0
362 | };
363 | },
364 |
365 | token: function(stream, state) {
366 | var addErr = state.errorToken;
367 | if (addErr) state.errorToken = false;
368 | var style = tokenLexer(stream, state);
369 |
370 | if (style && style != "comment")
371 | state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style;
372 | if (style == "punctuation") style = null;
373 |
374 | if (stream.eol() && state.lambda)
375 | state.lambda = false;
376 | return addErr ? style + " " + ERRORCLASS : style;
377 | },
378 |
379 | indent: function(state, textAfter) {
380 | if (state.tokenize != tokenBase)
381 | return state.tokenize.isString ? CodeMirror.Pass : 0;
382 |
383 | var scope = top(state), closing = scope.type == textAfter.charAt(0)
384 | if (scope.align != null)
385 | return scope.align - (closing ? 1 : 0)
386 | else
387 | return scope.offset - (closing ? hangingIndent : 0)
388 | },
389 |
390 | electricInput: /^\s*[\}\]\)]$/,
391 | closeBrackets: {triples: "'\""},
392 | lineComment: "#",
393 | fold: "indent"
394 | };
395 | return external;
396 | });
397 |
398 | CodeMirror.defineMIME("text/x-python", "python");
399 |
400 | var words = function(str) { return str.split(" "); };
401 |
402 | CodeMirror.defineMIME("text/x-cython", {
403 | name: "python",
404 | extra_keywords: words("by cdef cimport cpdef ctypedef enum except "+
405 | "extern gil include nogil property public "+
406 | "readonly struct union DEF IF ELIF ELSE")
407 | });
408 |
409 | });
410 |
--------------------------------------------------------------------------------
/COPYING:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/web/js/bootstrap.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v4.1.3 (https://getbootstrap.com/)
3 | * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 | */
6 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e(t.bootstrap={},t.jQuery,t.Popper)}(this,function(t,e,h){"use strict";function i(t,e){for(var n=0;nthis._items.length-1||t<0))if(this._isSliding)P(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=ndocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right',trigger:"hover focus",title:"",delay:0,html:!(Ie={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"}),selector:!(Se={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)"}),placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},we="out",Ne={HIDE:"hide"+Ee,HIDDEN:"hidden"+Ee,SHOW:(De="show")+Ee,SHOWN:"shown"+Ee,INSERTED:"inserted"+Ee,CLICK:"click"+Ee,FOCUSIN:"focusin"+Ee,FOCUSOUT:"focusout"+Ee,MOUSEENTER:"mouseenter"+Ee,MOUSELEAVE:"mouseleave"+Ee},Oe="fade",ke="show",Pe=".tooltip-inner",je=".arrow",He="hover",Le="focus",Re="click",xe="manual",We=function(){function i(t,e){if("undefined"==typeof h)throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=pe(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),pe(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(pe(this.getTipElement()).hasClass(ke))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),pe.removeData(this.element,this.constructor.DATA_KEY),pe(this.element).off(this.constructor.EVENT_KEY),pe(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&pe(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===pe(this.element).css("display"))throw new Error("Please use show on visible elements");var t=pe.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){pe(this.element).trigger(t);var n=pe.contains(this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!n)return;var i=this.getTipElement(),r=Fn.getUID(this.constructor.NAME);i.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&pe(i).addClass(Oe);var o="function"==typeof this.config.placement?this.config.placement.call(this,i,this.element):this.config.placement,s=this._getAttachment(o);this.addAttachmentClass(s);var a=!1===this.config.container?document.body:pe(document).find(this.config.container);pe(i).data(this.constructor.DATA_KEY,this),pe.contains(this.element.ownerDocument.documentElement,this.tip)||pe(i).appendTo(a),pe(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new h(this.element,i,{placement:s,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:je},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),pe(i).addClass(ke),"ontouchstart"in document.documentElement&&pe(document.body).children().on("mouseover",null,pe.noop);var l=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,pe(e.element).trigger(e.constructor.Event.SHOWN),t===we&&e._leave(null,e)};if(pe(this.tip).hasClass(Oe)){var c=Fn.getTransitionDurationFromElement(this.tip);pe(this.tip).one(Fn.TRANSITION_END,l).emulateTransitionEnd(c)}else l()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=pe.Event(this.constructor.Event.HIDE),r=function(){e._hoverState!==De&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),pe(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(pe(this.element).trigger(i),!i.isDefaultPrevented()){if(pe(n).removeClass(ke),"ontouchstart"in document.documentElement&&pe(document.body).children().off("mouseover",null,pe.noop),this._activeTrigger[Re]=!1,this._activeTrigger[Le]=!1,this._activeTrigger[He]=!1,pe(this.tip).hasClass(Oe)){var o=Fn.getTransitionDurationFromElement(n);pe(n).one(Fn.TRANSITION_END,r).emulateTransitionEnd(o)}else r();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){pe(this.getTipElement()).addClass(Te+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||pe(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(pe(t.querySelectorAll(Pe)),this.getTitle()),pe(t).removeClass(Oe+" "+ke)},t.setElementContent=function(t,e){var n=this.config.html;"object"==typeof e&&(e.nodeType||e.jquery)?n?pe(e).parent().is(t)||t.empty().append(e):t.text(pe(e).text()):t[n?"html":"text"](e)},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getAttachment=function(t){return Ie[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)pe(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==xe){var e=t===He?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===He?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;pe(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}pe(i.element).closest(".modal").on("hide.bs.modal",function(){return i.hide()})}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||pe(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),pe(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Le:He]=!0),pe(e.getTipElement()).hasClass(ke)||e._hoverState===De?e._hoverState=De:(clearTimeout(e._timeout),e._hoverState=De,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===De&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||pe(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),pe(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Le:He]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=we,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===we&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){return"number"==typeof(t=l({},this.constructor.Default,pe(this.element).data(),"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),Fn.typeCheckConfig(ve,t,this.constructor.DefaultType),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=pe(this.getTipElement()),e=t.attr("class").match(be);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(pe(t).removeClass(Oe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=pe(this).data(ye),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),pe(this).data(ye,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.1.3"}},{key:"Default",get:function(){return Ae}},{key:"NAME",get:function(){return ve}},{key:"DATA_KEY",get:function(){return ye}},{key:"Event",get:function(){return Ne}},{key:"EVENT_KEY",get:function(){return Ee}},{key:"DefaultType",get:function(){return Se}}]),i}(),pe.fn[ve]=We._jQueryInterface,pe.fn[ve].Constructor=We,pe.fn[ve].noConflict=function(){return pe.fn[ve]=Ce,We._jQueryInterface},We),Jn=(qe="popover",Ke="."+(Fe="bs.popover"),Me=(Ue=e).fn[qe],Qe="bs-popover",Be=new RegExp("(^|\\s)"+Qe+"\\S+","g"),Ve=l({},zn.Default,{placement:"right",trigger:"click",content:"",template:'
'}),Ye=l({},zn.DefaultType,{content:"(string|element|function)"}),ze="fade",Ze=".popover-header",Ge=".popover-body",$e={HIDE:"hide"+Ke,HIDDEN:"hidden"+Ke,SHOW:(Je="show")+Ke,SHOWN:"shown"+Ke,INSERTED:"inserted"+Ke,CLICK:"click"+Ke,FOCUSIN:"focusin"+Ke,FOCUSOUT:"focusout"+Ke,MOUSEENTER:"mouseenter"+Ke,MOUSELEAVE:"mouseleave"+Ke},Xe=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var r=i.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){Ue(this.getTipElement()).addClass(Qe+"-"+t)},r.getTipElement=function(){return this.tip=this.tip||Ue(this.config.template)[0],this.tip},r.setContent=function(){var t=Ue(this.getTipElement());this.setElementContent(t.find(Ze),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(Ge),e),t.removeClass(ze+" "+Je)},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=Ue(this.getTipElement()),e=t.attr("class").match(Be);null!==e&&0=this._offsets[r]&&("undefined"==typeof this._offsets[r+1]||t li > .active",xn='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',Wn=".dropdown-toggle",Un="> .dropdown-menu .active",qn=function(){function i(t){this._element=t}var t=i.prototype;return t.show=function(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&bn(this._element).hasClass(Nn)||bn(this._element).hasClass(On))){var t,i,e=bn(this._element).closest(Hn)[0],r=Fn.getSelectorFromElement(this._element);if(e){var o="UL"===e.nodeName?Rn:Ln;i=(i=bn.makeArray(bn(e).find(o)))[i.length-1]}var s=bn.Event(Dn.HIDE,{relatedTarget:this._element}),a=bn.Event(Dn.SHOW,{relatedTarget:i});if(i&&bn(i).trigger(s),bn(this._element).trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){r&&(t=document.querySelector(r)),this._activate(this._element,e);var l=function(){var t=bn.Event(Dn.HIDDEN,{relatedTarget:n._element}),e=bn.Event(Dn.SHOWN,{relatedTarget:i});bn(i).trigger(t),bn(n._element).trigger(e)};t?this._activate(t,t.parentNode,l):l()}}},t.dispose=function(){bn.removeData(this._element,Sn),this._element=null},t._activate=function(t,e,n){var i=this,r=("UL"===e.nodeName?bn(e).find(Rn):bn(e).children(Ln))[0],o=n&&r&&bn(r).hasClass(kn),s=function(){return i._transitionComplete(t,r,n)};if(r&&o){var a=Fn.getTransitionDurationFromElement(r);bn(r).one(Fn.TRANSITION_END,s).emulateTransitionEnd(a)}else s()},t._transitionComplete=function(t,e,n){if(e){bn(e).removeClass(Pn+" "+Nn);var i=bn(e.parentNode).find(Un)[0];i&&bn(i).removeClass(Nn),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}if(bn(t).addClass(Nn),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),Fn.reflow(t),bn(t).addClass(Pn),t.parentNode&&bn(t.parentNode).hasClass(wn)){var r=bn(t).closest(jn)[0];if(r){var o=[].slice.call(r.querySelectorAll(Wn));bn(o).addClass(Nn)}t.setAttribute("aria-expanded",!0)}n&&n()},i._jQueryInterface=function(n){return this.each(function(){var t=bn(this),e=t.data(Sn);if(e||(e=new i(this),t.data(Sn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.1.3"}}]),i}(),bn(document).on(Dn.CLICK_DATA_API,xn,function(t){t.preventDefault(),qn._jQueryInterface.call(bn(this),"show")}),bn.fn.tab=qn._jQueryInterface,bn.fn.tab.Constructor=qn,bn.fn.tab.noConflict=function(){return bn.fn.tab=An,qn._jQueryInterface},qn);!function(t){if("undefined"==typeof t)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1===e[0]&&9===e[1]&&e[2]<1||4<=e[0])throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(e),t.Util=Fn,t.Alert=Kn,t.Button=Mn,t.Carousel=Qn,t.Collapse=Bn,t.Dropdown=Vn,t.Modal=Yn,t.Popover=Jn,t.Scrollspy=Zn,t.Tab=Gn,t.Tooltip=zn,Object.defineProperty(t,"__esModule",{value:!0})});
7 | //# sourceMappingURL=bootstrap.min.js.map
--------------------------------------------------------------------------------