├── LICENSE ├── README.md ├── active-time ├── index.html ├── index.js └── sql-wasm.wasm ├── img ├── example0.png └── example1.png ├── index.html ├── index.js ├── lib ├── bootstrap-material-design.min.css ├── codemirror │ ├── lib │ │ ├── codemirror.css │ │ └── codemirror.js │ └── mode │ │ └── sql │ │ └── sql.js ├── filesaver.min.js ├── metrics-graphics │ ├── metricsgraphics.css │ └── metricsgraphics.min.js └── sql-memory-growth.js ├── sql-wasm.js ├── sql-wasm.wasm └── tables.sql /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 PincongBot 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Pincong SQL 3 | 4 | > 新品葱(WeCenter)数据库在线查询,使用 SQL (sqlite) 语句,支持导出为 JSON 格式 5 | 6 | ## 数据来源 7 | 8 | https://github.com/pin-cong/data/blob/master/pink.sql 9 | 10 | ## 浏览器支持 11 | 12 | * Chrome >= 57 13 | * Firefox >= 53 14 | * Edge >= 16 15 | * Opera >= 44 16 | * Safari >= 11 17 | 18 | 已使用 Chrome 71 测试通过 19 | 20 | ## 使用示例 21 | 22 | #### 按浏览数排序文章 23 | 24 | ```sql 25 | SELECT id, title, views FROM aws_article ORDER BY views DESC; 26 | ``` 27 | 28 | ![](img/example0.png) 29 | 30 | #### 查询 "品葱备份" 话题下的全部文章 31 | 32 | ```sql 33 | SELECT id, title, views, comments, votes FROM aws_article 34 | WHERE id IN ( 35 | SELECT item_id FROM aws_topic_relation 36 | WHERE topic_id == (SELECT topic_id FROM aws_topic WHERE "topic_title" == "品葱备份") AND type == "article" 37 | ) 38 | ORDER BY id DESC; 39 | ``` 40 | 41 | ![](img/example1.png) 42 | 43 | #### 查询 @一只鹿兒 发表的全部文章 44 | 45 | ```sql 46 | SELECT id, title, message AS content FROM aws_article 47 | WHERE uid == (SELECT uid FROM aws_users WHERE "user_name" == "一只鹿兒") 48 | ORDER BY id DESC; 49 | ``` 50 | 51 | ## 许可证 52 | 53 | 根据 MIT 许可证开源。 54 | -------------------------------------------------------------------------------- /active-time/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 新品葱活跃用户时间分析 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 | 22 |
23 | 24 |
25 |
新品葱用户活跃时间分析
26 | 27 |
28 |
29 |
30 |
31 | 32 |
33 | 加载中  34 | 0/27 35 |
36 |
37 | 38 | 59 | 60 |
61 | 62 |
63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /active-time/index.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | (async function () { 4 | 5 | /** 6 | * @param {string} url 7 | */ 8 | const getText = async url => { 9 | const r = await fetch(url, { cache: "no-cache" }); 10 | return await r.text(); 11 | }; 12 | 13 | /** 14 | * 转义 15 | * @param {string} sql 16 | */ 17 | const escapeSQLite = sql => { 18 | return sql.replace(/\\'/g, "''"); 19 | }; 20 | 21 | const InitSQLJS = async () => { 22 | try { 23 | // @ts-ignore 24 | return await initSqlJs(); 25 | } catch (e) { 26 | await new Promise(resolve => { 27 | const script = document.createElement("script"); 28 | script.src = "../lib/sql-memory-growth.js"; 29 | script.onload = () => { 30 | resolve(); 31 | }; 32 | document.body.appendChild(script); 33 | }); 34 | // @ts-ignore 35 | return SQL; 36 | } 37 | }; 38 | 39 | const getTime = timestamp => { 40 | return new Date(timestamp * 1000) 41 | .toISOString() 42 | .match(/T(\d{2}:\d{2}:\d{2})/)[1]; 43 | }; 44 | 45 | const SQLJS = await InitSQLJS(); 46 | const db = new SQLJS.Database(); 47 | db.create_function("getTime", getTime); 48 | 49 | /** 50 | * @param {string} userName 51 | */ 52 | const getData = userName => { 53 | const uid = db.exec( 54 | `SELECT uid FROM aws_users WHERE "user_name" == "${userName}"` 55 | )[0].values[0][0]; 56 | 57 | const results = db.exec(` 58 | SELECT getTime(add_time) FROM aws_article 59 | WHERE uid == ${uid} 60 | UNION ALL 61 | SELECT getTime(add_time) FROM aws_article_comments 62 | WHERE uid == ${uid} 63 | UNION ALL 64 | SELECT getTime(add_time) FROM aws_question 65 | WHERE published_uid == ${uid} 66 | UNION ALL 67 | SELECT getTime(time) FROM aws_question_comments 68 | WHERE uid == ${uid} 69 | UNION ALL 70 | SELECT getTime(add_time) FROM aws_answer 71 | WHERE uid == ${uid} 72 | UNION ALL 73 | SELECT getTime(time) FROM aws_answer_comments 74 | WHERE uid == ${uid} 75 | ORDER BY getTime(add_time); 76 | `); 77 | 78 | /** @type {string[][]} */ 79 | const data = results[0].values; 80 | 81 | return data.reduce((p, c) => { 82 | return p.concat(c); 83 | }, []); 84 | }; 85 | 86 | let results; 87 | let userName = ""; 88 | const resultEl = document.getElementById("result"); 89 | const input = document.getElementById("username-input"); 90 | const resultContainer = document.getElementById("result-container"); 91 | const execute = () => { 92 | userName = input.value.trim(); 93 | results = getData(userName); 94 | 95 | const data = results 96 | .map(time => { 97 | return new Date(`2019-01-01T${time}Z`); 98 | }) 99 | .sort((a, b) => { 100 | return +a - +b; 101 | }) 102 | .map((time, index, arr) => { 103 | return { 104 | time: time, 105 | value: index / (arr.length - 1) 106 | }; 107 | }); 108 | 109 | resultEl.style.display = ""; 110 | 111 | // @ts-ignore 112 | MG.data_graphic({ 113 | area: false, 114 | interpolate: d3.curveStep, 115 | data: data, 116 | full_width: true, 117 | height: 300, 118 | top: 5, 119 | bottom: 50, 120 | right: 40, 121 | target: resultContainer, 122 | utc_time: true, 123 | min_x: new Date("2019-01-01T00:00Z"), 124 | max_x: new Date("2019-01-01T24:00Z"), 125 | max_y: 1.1, 126 | x_label: "小时(UTC)", 127 | y_label: "F(x)", 128 | xax_format: d3.utcFormat("%H"), 129 | show_secondary_x_label: false, 130 | rollover_time_format: "%H:%M:%S", 131 | y_mouseover: () => "", 132 | xax_count: 25, 133 | yax_count: 10, 134 | x_accessor: "time", 135 | y_accessor: "value" 136 | }); 137 | }; 138 | 139 | const exportJson = () => { 140 | if (!results) return; 141 | const json = JSON.stringify(results); 142 | const blob = new Blob([json], { type: "application/json;charset=utf-8" }); 143 | // @ts-ignore 144 | saveAs(blob, "results.json"); 145 | }; 146 | 147 | const exportSVG = async () => { 148 | 149 | /** @type {SVGSVGElement} */ 150 | const svgElement = resultContainer.querySelector("svg").cloneNode(true); 151 | svgElement.setAttribute("xmlns", "http://www.w3.org/2000/svg"); 152 | 153 | const css = await getText("../lib/metrics-graphics/metricsgraphics.css"); 154 | const style = document.createElement("style"); 155 | style.innerHTML = css; 156 | 157 | svgElement.prepend(style); 158 | svgElement.style.marginLeft = svgElement.style.marginTop = "10px"; 159 | 160 | const svg = svgElement.outerHTML; 161 | const blob = new Blob([svg], { type: "image/svg+xml;charset=utf-8" }); 162 | // @ts-ignore 163 | saveAs(blob, userName + ".svg"); 164 | 165 | }; 166 | 167 | const executeBtn = document.getElementById("execute-btn"); 168 | executeBtn.onclick = () => execute(); 169 | const exportJsonBtn = document.getElementById("export-json-btn"); 170 | exportJsonBtn.onclick = () => exportJson(); 171 | const exportSvgBtn = document.getElementById("export-svg-btn"); 172 | exportSvgBtn.onclick = () => exportSVG(); 173 | 174 | let resourceLoaded = 0; 175 | const resourceNumberEl = document.getElementById("resource-number"); 176 | const resourceNumber = +resourceNumberEl.textContent; 177 | const resourceLoadedEl = document.getElementById("resource-loaded"); 178 | const progressBarEl = document.getElementById("progress-bar"); 179 | const resourceLoadedAdd = () => { 180 | resourceLoaded++; 181 | resourceLoadedEl.innerText = "" + resourceLoaded; 182 | progressBarEl.style.width = `${(resourceLoaded / resourceNumber) * 100}%`; 183 | 184 | if (resourceLoaded >= resourceNumber) { 185 | const loadingEl = document.getElementById("loading"); 186 | loadingEl.style.display = "none"; 187 | 188 | const loadedEl = document.getElementById("loaded"); 189 | loadedEl.style.display = ""; 190 | } 191 | }; 192 | 193 | const fullSQL = await getText( 194 | "https://raw.githubusercontent.com/pin-cong/data/master/pink.sql" 195 | ); 196 | resourceLoadedAdd(); 197 | 198 | const tables = await getText("../tables.sql"); 199 | const tableList = tables.split(/(?:\r?\n){2}/); 200 | resourceLoadedAdd(); 201 | 202 | const exp = /\nLOCK TABLES `.+` WRITE;\n|\nUNLOCK TABLES;\n/; 203 | const dataList = fullSQL.split(exp).filter((data, index) => index % 2 == 1); 204 | dataList.forEach((data, index) => { 205 | const sql = tableList[index] + "\n" + data; 206 | 207 | const sqlLines = escapeSQLite(sql).split(/;\r?\n/); 208 | sqlLines.forEach(s => { 209 | db.run(s); 210 | }); 211 | 212 | resourceLoadedAdd(); 213 | }); 214 | })(); 215 | -------------------------------------------------------------------------------- /active-time/sql-wasm.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PincongBot/Pincong-SQL/a678e45e39d1c7a2b2ea0ea6c4a3b1f88d1c91e8/active-time/sql-wasm.wasm -------------------------------------------------------------------------------- /img/example0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PincongBot/Pincong-SQL/a678e45e39d1c7a2b2ea0ea6c4a3b1f88d1c91e8/img/example0.png -------------------------------------------------------------------------------- /img/example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PincongBot/Pincong-SQL/a678e45e39d1c7a2b2ea0ea6c4a3b1f88d1c91e8/img/example1.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Pincong SQL 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 |
22 |
Pincong SQL
23 | 24 |
25 |
26 |
27 |
28 | 29 |
30 | 加载中  31 | 0/27 32 |
33 |
34 | 35 | 48 | 49 |
50 | 51 |
52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | (async function () { 4 | 5 | /** 6 | * @param {string} url 7 | */ 8 | const getText = async url => { 9 | const r = await fetch(url, { cache: "no-cache" }); 10 | return await r.text(); 11 | }; 12 | 13 | /** 14 | * 转义 15 | * @param {string} sql 16 | */ 17 | const escapeSQLite = sql => { 18 | return sql.replace(/\\'/g, "''"); 19 | }; 20 | 21 | let editor; 22 | let results; 23 | 24 | const resultEl = document.getElementById("result"); 25 | const tableContainer = document.getElementById("table-container"); 26 | const execute = (sql = editor.getValue() + ';', showIndex = false) => { 27 | results = db.exec(sql); 28 | 29 | let html = ""; 30 | 31 | results.forEach(result => { 32 | const { columns, values } = result; 33 | 34 | html += "
"; 35 | html += ""; 36 | 37 | html += ""; 38 | if (showIndex) { 39 | html += ""; 40 | } 41 | columns.forEach(header => { 42 | html += ``; 43 | }); 44 | html += ""; 45 | 46 | values.forEach((x, index) => { 47 | html += ""; 48 | if (showIndex) { 49 | html += ``; 50 | } 51 | x.forEach(v => { 52 | html += ""; 53 | }); 54 | html += ""; 55 | }); 56 | 57 | html += "
#${header}
${index}" + JSON.stringify(v) + "
"; 58 | html += "
"; 59 | }); 60 | 61 | tableContainer.innerHTML = html; 62 | 63 | resultEl.style.display = ""; 64 | }; 65 | 66 | const exportJson = () => { 67 | if (!results) return; 68 | const json = JSON.stringify(results); 69 | const blob = new Blob([json], { type: "application/json;charset=utf-8" }); 70 | // @ts-ignore 71 | saveAs(blob, "results.json"); 72 | }; 73 | 74 | const executeBtn = document.getElementById("execute-btn"); 75 | executeBtn.onclick = () => execute(); 76 | const exportBtn = document.getElementById("export-btn"); 77 | exportBtn.onclick = () => exportJson(); 78 | 79 | const CodeMirrorInit = () => { 80 | // @ts-ignore 81 | editor = CodeMirror.fromTextArea(document.getElementById('code'), { 82 | mode: 'text/x-mysql', 83 | viewportMargin: Infinity, 84 | indentWithTabs: true, 85 | smartIndent: true, 86 | lineNumbers: true, 87 | matchBrackets: true, 88 | autofocus: true, 89 | extraKeys: { 90 | "Ctrl-Enter": execute 91 | } 92 | }); 93 | }; 94 | 95 | const InitSQLJS = async () => { 96 | try { 97 | // @ts-ignore 98 | return await initSqlJs(); 99 | } catch (e) { 100 | await new Promise((resolve) => { 101 | const script = document.createElement("script"); 102 | script.src = "./lib/sql-memory-growth.js"; 103 | script.onload = () =>{ 104 | resolve(); 105 | }; 106 | document.body.appendChild(script); 107 | }); 108 | // @ts-ignore 109 | return SQL 110 | } 111 | }; 112 | 113 | const SQLJS = await InitSQLJS(); 114 | const db = new SQLJS.Database(); 115 | 116 | let resourceLoaded = 0; 117 | const resourceNumberEl = document.getElementById("resource-number"); 118 | const resourceNumber = +resourceNumberEl.textContent; 119 | const resourceLoadedEl = document.getElementById("resource-loaded"); 120 | const progressBarEl = document.getElementById("progress-bar"); 121 | const resourceLoadedAdd = () => { 122 | resourceLoaded++; 123 | resourceLoadedEl.innerText = "" + resourceLoaded; 124 | progressBarEl.style.width = `${resourceLoaded / resourceNumber * 100}%`; 125 | 126 | if (resourceLoaded >= resourceNumber) { 127 | const loadingEl = document.getElementById("loading"); 128 | loadingEl.style.display = "none"; 129 | 130 | const loadedEl = document.getElementById("loaded"); 131 | loadedEl.style.display = ""; 132 | 133 | CodeMirrorInit(); 134 | } 135 | }; 136 | 137 | const fullSQL = await getText("https://raw.githubusercontent.com/pin-cong/data/master/pink.sql"); 138 | resourceLoadedAdd(); 139 | 140 | const tables = await getText("./tables.sql"); 141 | const tableList = tables.split(/(?:\r?\n){2}/); 142 | resourceLoadedAdd(); 143 | 144 | const exp = /\nLOCK TABLES `.+` WRITE;\n|\nUNLOCK TABLES;\n/; 145 | const dataList = fullSQL.split(exp).filter((data, index) => index % 2 == 1); 146 | dataList.forEach((data, index) => { 147 | const sql = tableList[index] + "\n" + data; 148 | 149 | const sqlLines = escapeSQLite(sql).split(/;\r?\n/); 150 | sqlLines.forEach(s => { 151 | db.run(s); 152 | }); 153 | 154 | resourceLoadedAdd(); 155 | }); 156 | 157 | })(); 158 | -------------------------------------------------------------------------------- /lib/codemirror/lib/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 | } 8 | .CodeMirror-scroll { 9 | /* Set scrolling behaviour here */ 10 | overflow: auto; 11 | } 12 | 13 | /* PADDING */ 14 | 15 | .CodeMirror-lines { 16 | padding: 4px 0; /* Vertical padding around content */ 17 | } 18 | .CodeMirror pre { 19 | padding: 0 4px; /* Horizontal padding of content */ 20 | } 21 | 22 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 23 | background-color: white; /* The little square between H and V scrollbars */ 24 | } 25 | 26 | /* GUTTER */ 27 | 28 | .CodeMirror-gutters { 29 | border-right: 1px solid #ddd; 30 | background-color: #f7f7f7; 31 | white-space: nowrap; 32 | } 33 | .CodeMirror-linenumbers {} 34 | .CodeMirror-linenumber { 35 | padding: 0 3px 0 5px; 36 | min-width: 20px; 37 | text-align: right; 38 | color: #999; 39 | -moz-box-sizing: content-box; 40 | box-sizing: content-box; 41 | } 42 | 43 | /* CURSOR */ 44 | 45 | .CodeMirror div.CodeMirror-cursor { 46 | border-left: 1px solid black; 47 | } 48 | /* Shown when moving in bi-directional text */ 49 | .CodeMirror div.CodeMirror-secondarycursor { 50 | border-left: 1px solid silver; 51 | } 52 | .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { 53 | width: auto; 54 | border: 0; 55 | background: #7e7; 56 | } 57 | /* Can style cursor different in overwrite (non-insert) mode */ 58 | div.CodeMirror-overwrite div.CodeMirror-cursor {} 59 | 60 | .cm-tab { display: inline-block; } 61 | 62 | .CodeMirror-ruler { 63 | border-left: 1px solid #ccc; 64 | position: absolute; 65 | } 66 | 67 | /* DEFAULT THEME */ 68 | 69 | .cm-s-default .cm-keyword {color: #708;} 70 | .cm-s-default .cm-atom {color: #219;} 71 | .cm-s-default .cm-number {color: #164;} 72 | .cm-s-default .cm-def {color: #00f;} 73 | .cm-s-default .cm-variable, 74 | .cm-s-default .cm-punctuation, 75 | .cm-s-default .cm-property, 76 | .cm-s-default .cm-operator {} 77 | .cm-s-default .cm-variable-2 {color: #05a;} 78 | .cm-s-default .cm-variable-3 {color: #085;} 79 | .cm-s-default .cm-comment {color: #a50;} 80 | .cm-s-default .cm-string {color: #a11;} 81 | .cm-s-default .cm-string-2 {color: #f50;} 82 | .cm-s-default .cm-meta {color: #555;} 83 | .cm-s-default .cm-qualifier {color: #555;} 84 | .cm-s-default .cm-builtin {color: #30a;} 85 | .cm-s-default .cm-bracket {color: #997;} 86 | .cm-s-default .cm-tag {color: #170;} 87 | .cm-s-default .cm-attribute {color: #00c;} 88 | .cm-s-default .cm-header {color: blue;} 89 | .cm-s-default .cm-quote {color: #090;} 90 | .cm-s-default .cm-hr {color: #999;} 91 | .cm-s-default .cm-link {color: #00c;} 92 | 93 | .cm-negative {color: #d44;} 94 | .cm-positive {color: #292;} 95 | .cm-header, .cm-strong {font-weight: bold;} 96 | .cm-em {font-style: italic;} 97 | .cm-link {text-decoration: underline;} 98 | 99 | .cm-s-default .cm-error {color: #f00;} 100 | .cm-invalidchar {color: #f00;} 101 | 102 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} 103 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} 104 | .CodeMirror-activeline-background {background: #e8f2ff;} 105 | 106 | /* STOP */ 107 | 108 | /* The rest of this file contains styles related to the mechanics of 109 | the editor. You probably shouldn't touch them. */ 110 | 111 | .CodeMirror { 112 | line-height: 1; 113 | position: relative; 114 | overflow: hidden; 115 | background: white; 116 | color: black; 117 | } 118 | 119 | .CodeMirror-scroll { 120 | /* 30px is the magic margin used to hide the element's real scrollbars */ 121 | /* See overflow: hidden in .CodeMirror */ 122 | margin-bottom: -30px; margin-right: -30px; 123 | padding-bottom: 30px; 124 | height: 100%; 125 | outline: none; /* Prevent dragging from highlighting the element */ 126 | position: relative; 127 | -moz-box-sizing: content-box; 128 | box-sizing: content-box; 129 | } 130 | .CodeMirror-sizer { 131 | position: relative; 132 | border-right: 30px solid transparent; 133 | -moz-box-sizing: content-box; 134 | box-sizing: content-box; 135 | } 136 | 137 | /* The fake, visible scrollbars. Used to force redraw during scrolling 138 | before actuall scrolling happens, thus preventing shaking and 139 | flickering artifacts. */ 140 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 141 | position: absolute; 142 | z-index: 6; 143 | display: none; 144 | } 145 | .CodeMirror-vscrollbar { 146 | right: 0; top: 0; 147 | overflow-x: hidden; 148 | overflow-y: scroll; 149 | } 150 | .CodeMirror-hscrollbar { 151 | bottom: 0; left: 0; 152 | overflow-y: hidden; 153 | overflow-x: scroll; 154 | } 155 | .CodeMirror-scrollbar-filler { 156 | right: 0; bottom: 0; 157 | } 158 | .CodeMirror-gutter-filler { 159 | left: 0; bottom: 0; 160 | } 161 | 162 | .CodeMirror-gutters { 163 | position: absolute; left: 0; top: 0; 164 | padding-bottom: 30px; 165 | z-index: 3; 166 | } 167 | .CodeMirror-gutter { 168 | white-space: normal; 169 | height: 100%; 170 | -moz-box-sizing: content-box; 171 | box-sizing: content-box; 172 | padding-bottom: 30px; 173 | margin-bottom: -32px; 174 | display: inline-block; 175 | /* Hack to make IE7 behave */ 176 | *zoom:1; 177 | *display:inline; 178 | } 179 | .CodeMirror-gutter-elt { 180 | position: absolute; 181 | cursor: default; 182 | z-index: 4; 183 | } 184 | 185 | .CodeMirror-lines { 186 | cursor: text; 187 | } 188 | .CodeMirror pre { 189 | /* Reset some styles that the rest of the page might have set */ 190 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; 191 | border-width: 0; 192 | background: transparent; 193 | font-family: inherit; 194 | font-size: inherit; 195 | margin: 0; 196 | white-space: pre; 197 | word-wrap: normal; 198 | line-height: inherit; 199 | color: inherit; 200 | z-index: 2; 201 | position: relative; 202 | overflow: visible; 203 | } 204 | .CodeMirror-wrap pre { 205 | word-wrap: break-word; 206 | white-space: pre-wrap; 207 | word-break: normal; 208 | } 209 | 210 | .CodeMirror-linebackground { 211 | position: absolute; 212 | left: 0; right: 0; top: 0; bottom: 0; 213 | z-index: 0; 214 | } 215 | 216 | .CodeMirror-linewidget { 217 | position: relative; 218 | z-index: 2; 219 | overflow: auto; 220 | } 221 | 222 | .CodeMirror-widget {} 223 | 224 | .CodeMirror-wrap .CodeMirror-scroll { 225 | overflow-x: hidden; 226 | } 227 | 228 | .CodeMirror-measure { 229 | position: absolute; 230 | width: 100%; 231 | height: 0; 232 | overflow: hidden; 233 | visibility: hidden; 234 | } 235 | .CodeMirror-measure pre { position: static; } 236 | 237 | .CodeMirror div.CodeMirror-cursor { 238 | position: absolute; 239 | border-right: none; 240 | width: 0; 241 | } 242 | 243 | div.CodeMirror-cursors { 244 | visibility: hidden; 245 | position: relative; 246 | z-index: 1; 247 | } 248 | .CodeMirror-focused div.CodeMirror-cursors { 249 | visibility: visible; 250 | } 251 | 252 | .CodeMirror-selected { background: #d9d9d9; } 253 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } 254 | .CodeMirror-crosshair { cursor: crosshair; } 255 | 256 | .cm-searching { 257 | background: #ffa; 258 | background: rgba(255, 255, 0, .4); 259 | } 260 | 261 | /* IE7 hack to prevent it from returning funny offsetTops on the spans */ 262 | .CodeMirror span { *vertical-align: text-bottom; } 263 | 264 | /* Used to force a border model for a node */ 265 | .cm-force-border { padding-right: .1px; } 266 | 267 | @media print { 268 | /* Hide the cursor when printing */ 269 | .CodeMirror div.CodeMirror-cursors { 270 | visibility: hidden; 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /lib/codemirror/mode/sql/sql.js: -------------------------------------------------------------------------------- 1 | (function(mod) { 2 | if (typeof exports == "object" && typeof module == "object") // CommonJS 3 | mod(require("../../lib/codemirror")); 4 | else if (typeof define == "function" && define.amd) // AMD 5 | define(["../../lib/codemirror"], mod); 6 | else // Plain browser env 7 | mod(CodeMirror); 8 | })(function(CodeMirror) { 9 | "use strict"; 10 | 11 | CodeMirror.defineMode("sql", function(config, parserConfig) { 12 | "use strict"; 13 | 14 | var client = parserConfig.client || {}, 15 | atoms = parserConfig.atoms || {"false": true, "true": true, "null": true}, 16 | builtin = parserConfig.builtin || {}, 17 | keywords = parserConfig.keywords || {}, 18 | operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/, 19 | support = parserConfig.support || {}, 20 | hooks = parserConfig.hooks || {}, 21 | dateSQL = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true}; 22 | 23 | function tokenBase(stream, state) { 24 | var ch = stream.next(); 25 | 26 | // call hooks from the mime type 27 | if (hooks[ch]) { 28 | var result = hooks[ch](stream, state); 29 | if (result !== false) return result; 30 | } 31 | 32 | if (support.hexNumber == true && 33 | ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) 34 | || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) { 35 | // hex 36 | // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html 37 | return "number"; 38 | } else if (support.binaryNumber == true && 39 | (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/)) 40 | || (ch == "0" && stream.match(/^b[01]+/)))) { 41 | // bitstring 42 | // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html 43 | return "number"; 44 | } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) { 45 | // numbers 46 | // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html 47 | stream.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/); 48 | support.decimallessFloat == true && stream.eat('.'); 49 | return "number"; 50 | } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) { 51 | // placeholders 52 | return "variable-3"; 53 | } else if (ch == "'" || (ch == '"' && support.doubleQuote)) { 54 | // strings 55 | // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html 56 | state.tokenize = tokenLiteral(ch); 57 | return state.tokenize(stream, state); 58 | } else if ((((support.nCharCast == true && (ch == "n" || ch == "N")) 59 | || (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i))) 60 | && (stream.peek() == "'" || stream.peek() == '"'))) { 61 | // charset casting: _utf8'str', N'str', n'str' 62 | // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html 63 | return "keyword"; 64 | } else if (/^[\(\),\;\[\]]/.test(ch)) { 65 | // no highlightning 66 | return null; 67 | } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) { 68 | // 1-line comment 69 | stream.skipToEnd(); 70 | return "comment"; 71 | } else if ((support.commentHash && ch == "#") 72 | || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) { 73 | // 1-line comments 74 | // ref: https://kb.askmonty.org/en/comment-syntax/ 75 | stream.skipToEnd(); 76 | return "comment"; 77 | } else if (ch == "/" && stream.eat("*")) { 78 | // multi-line comments 79 | // ref: https://kb.askmonty.org/en/comment-syntax/ 80 | state.tokenize = tokenComment; 81 | return state.tokenize(stream, state); 82 | } else if (ch == ".") { 83 | // .1 for 0.1 84 | if (support.zerolessFloat == true && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) { 85 | return "number"; 86 | } 87 | // .table_name (ODBC) 88 | // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html 89 | if (support.ODBCdotTable == true && stream.match(/^[a-zA-Z_]+/)) { 90 | return "variable-2"; 91 | } 92 | } else if (operatorChars.test(ch)) { 93 | // operators 94 | stream.eatWhile(operatorChars); 95 | return null; 96 | } else if (ch == '{' && 97 | (stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))) { 98 | // dates (weird ODBC syntax) 99 | // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html 100 | return "number"; 101 | } else { 102 | stream.eatWhile(/^[_\w\d]/); 103 | var word = stream.current().toLowerCase(); 104 | // dates (standard SQL syntax) 105 | // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html 106 | if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+"[^"]*"/))) 107 | return "number"; 108 | if (atoms.hasOwnProperty(word)) return "atom"; 109 | if (builtin.hasOwnProperty(word)) return "builtin"; 110 | if (keywords.hasOwnProperty(word)) return "keyword"; 111 | if (client.hasOwnProperty(word)) return "string-2"; 112 | return null; 113 | } 114 | } 115 | 116 | // 'string', with char specified in quote escaped by '\' 117 | function tokenLiteral(quote) { 118 | return function(stream, state) { 119 | var escaped = false, ch; 120 | while ((ch = stream.next()) != null) { 121 | if (ch == quote && !escaped) { 122 | state.tokenize = tokenBase; 123 | break; 124 | } 125 | escaped = !escaped && ch == "\\"; 126 | } 127 | return "string"; 128 | }; 129 | } 130 | function tokenComment(stream, state) { 131 | while (true) { 132 | if (stream.skipTo("*")) { 133 | stream.next(); 134 | if (stream.eat("/")) { 135 | state.tokenize = tokenBase; 136 | break; 137 | } 138 | } else { 139 | stream.skipToEnd(); 140 | break; 141 | } 142 | } 143 | return "comment"; 144 | } 145 | 146 | function pushContext(stream, state, type) { 147 | state.context = { 148 | prev: state.context, 149 | indent: stream.indentation(), 150 | col: stream.column(), 151 | type: type 152 | }; 153 | } 154 | 155 | function popContext(state) { 156 | state.indent = state.context.indent; 157 | state.context = state.context.prev; 158 | } 159 | 160 | return { 161 | startState: function() { 162 | return {tokenize: tokenBase, context: null}; 163 | }, 164 | 165 | token: function(stream, state) { 166 | if (stream.sol()) { 167 | if (state.context && state.context.align == null) 168 | state.context.align = false; 169 | } 170 | if (stream.eatSpace()) return null; 171 | 172 | var style = state.tokenize(stream, state); 173 | if (style == "comment") return style; 174 | 175 | if (state.context && state.context.align == null) 176 | state.context.align = true; 177 | 178 | var tok = stream.current(); 179 | if (tok == "(") 180 | pushContext(stream, state, ")"); 181 | else if (tok == "[") 182 | pushContext(stream, state, "]"); 183 | else if (state.context && state.context.type == tok) 184 | popContext(state); 185 | return style; 186 | }, 187 | 188 | indent: function(state, textAfter) { 189 | var cx = state.context; 190 | if (!cx) return 0; 191 | var closing = textAfter.charAt(0) == cx.type; 192 | if (cx.align) return cx.col + (closing ? 0 : 1); 193 | else return cx.indent + (closing ? 0 : config.indentUnit); 194 | }, 195 | 196 | blockCommentStart: "/*", 197 | blockCommentEnd: "*/", 198 | lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : null 199 | }; 200 | }); 201 | 202 | (function() { 203 | "use strict"; 204 | 205 | // `identifier` 206 | function hookIdentifier(stream) { 207 | // MySQL/MariaDB identifiers 208 | // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html 209 | var ch; 210 | while ((ch = stream.next()) != null) { 211 | if (ch == "`" && !stream.eat("`")) return "variable-2"; 212 | } 213 | return null; 214 | } 215 | 216 | // variable token 217 | function hookVar(stream) { 218 | // variables 219 | // @@prefix.varName @varName 220 | // varName can be quoted with ` or ' or " 221 | // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html 222 | if (stream.eat("@")) { 223 | stream.match(/^session\./); 224 | stream.match(/^local\./); 225 | stream.match(/^global\./); 226 | } 227 | 228 | if (stream.eat("'")) { 229 | stream.match(/^.*'/); 230 | return "variable-2"; 231 | } else if (stream.eat('"')) { 232 | stream.match(/^.*"/); 233 | return "variable-2"; 234 | } else if (stream.eat("`")) { 235 | stream.match(/^.*`/); 236 | return "variable-2"; 237 | } else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) { 238 | return "variable-2"; 239 | } 240 | return null; 241 | }; 242 | 243 | // short client keyword token 244 | function hookClient(stream) { 245 | // \N means NULL 246 | // ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html 247 | if (stream.eat("N")) { 248 | return "atom"; 249 | } 250 | // \g, etc 251 | // ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html 252 | return stream.match(/^[a-zA-Z.#!?]/) ? "variable-2" : null; 253 | } 254 | 255 | // these keywords are used by all SQL dialects (however, a mode can still overwrite it) 256 | var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where "; 257 | 258 | // turn a space-separated list into an array 259 | function set(str) { 260 | var obj = {}, words = str.split(" "); 261 | for (var i = 0; i < words.length; ++i) obj[words[i]] = true; 262 | return obj; 263 | } 264 | 265 | // A generic SQL Mode. It's not a standard, it just try to support what is generally supported 266 | CodeMirror.defineMIME("text/x-sql", { 267 | name: "sql", 268 | keywords: set(sqlKeywords + "begin"), 269 | builtin: set("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"), 270 | atoms: set("false true null unknown"), 271 | operatorChars: /^[*+\-%<>!=]/, 272 | dateSQL: set("date time timestamp"), 273 | support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") 274 | }); 275 | 276 | CodeMirror.defineMIME("text/x-mssql", { 277 | name: "sql", 278 | client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), 279 | keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"), 280 | builtin: set("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "), 281 | atoms: set("false true null unknown"), 282 | operatorChars: /^[*+\-%<>!=]/, 283 | dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"), 284 | hooks: { 285 | "@": hookVar 286 | } 287 | }); 288 | 289 | CodeMirror.defineMIME("text/x-mysql", { 290 | name: "sql", 291 | client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), 292 | keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), 293 | builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), 294 | atoms: set("false true null unknown"), 295 | operatorChars: /^[*+\-%<>!=&|^]/, 296 | dateSQL: set("date time timestamp"), 297 | support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), 298 | hooks: { 299 | "@": hookVar, 300 | "`": hookIdentifier, 301 | "\\": hookClient 302 | } 303 | }); 304 | 305 | CodeMirror.defineMIME("text/x-mariadb", { 306 | name: "sql", 307 | client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), 308 | keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), 309 | builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), 310 | atoms: set("false true null unknown"), 311 | operatorChars: /^[*+\-%<>!=&|^]/, 312 | dateSQL: set("date time timestamp"), 313 | support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), 314 | hooks: { 315 | "@": hookVar, 316 | "`": hookIdentifier, 317 | "\\": hookClient 318 | } 319 | }); 320 | 321 | // the query language used by Apache Cassandra is called CQL, but this mime type 322 | // is called Cassandra to avoid confusion with Contextual Query Language 323 | CodeMirror.defineMIME("text/x-cassandra", { 324 | name: "sql", 325 | client: { }, 326 | keywords: set("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"), 327 | builtin: set("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"), 328 | atoms: set("false true"), 329 | operatorChars: /^[<>=]/, 330 | dateSQL: { }, 331 | support: set("commentSlashSlash decimallessFloat"), 332 | hooks: { } 333 | }); 334 | 335 | // this is based on Peter Raganitsch's 'plsql' mode 336 | CodeMirror.defineMIME("text/x-plsql", { 337 | name: "sql", 338 | client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"), 339 | keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), 340 | builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"), 341 | operatorChars: /^[*+\-%<>!=~]/, 342 | dateSQL: set("date time timestamp"), 343 | support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber") 344 | }); 345 | 346 | // Created to support specific hive keywords 347 | CodeMirror.defineMIME("text/x-hive", { 348 | name: "sql", 349 | keywords: set("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"), 350 | builtin: set("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"), 351 | atoms: set("false true null unknown"), 352 | operatorChars: /^[*+\-%<>!=]/, 353 | dateSQL: set("date timestamp"), 354 | support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") 355 | }); 356 | }()); 357 | 358 | }); 359 | 360 | /* 361 | How Properties of Mime Types are used by SQL Mode 362 | ================================================= 363 | 364 | keywords: 365 | A list of keywords you want to be highlighted. 366 | functions: 367 | A list of function names you want to be highlighted. 368 | builtin: 369 | A list of builtin types you want to be highlighted (if you want types to be of class "builtin" instead of "keyword"). 370 | operatorChars: 371 | All characters that must be handled as operators. 372 | client: 373 | Commands parsed and executed by the client (not the server). 374 | support: 375 | A list of supported syntaxes which are not common, but are supported by more than 1 DBMS. 376 | * ODBCdotTable: .tableName 377 | * zerolessFloat: .1 378 | * doubleQuote 379 | * nCharCast: N'string' 380 | * charsetCast: _utf8'string' 381 | * commentHash: use # char for comments 382 | * commentSlashSlash: use // for comments 383 | * commentSpaceRequired: require a space after -- for comments 384 | atoms: 385 | Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others: 386 | UNKNOWN, INFINITY, UNDERFLOW, NaN... 387 | dateSQL: 388 | Used for date/time SQL standard syntax, because not all DBMS's support same temporal types. 389 | */ 390 | -------------------------------------------------------------------------------- /lib/filesaver.min.js: -------------------------------------------------------------------------------- 1 | (function(a,b){if("function"==typeof define&&define.amd)define([],b);else if("undefined"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Depricated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open("GET",b),e.responseType="blob",e.onload=function(){a(e.response,c,d)},e.onerror=function(){console.error("could not download file")},e.send()}function d(a){var b=new XMLHttpRequest;return b.open("HEAD",a,!1),b.send(),200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i)})}}:function(a,b,d,e){if(e=e||open("","_blank"),e&&(e.document.title=e.document.body.innerText="downloading..."),"string"==typeof a)return c(a,b,d);var g="application/octet-stream"===a.type,h=/constructor/i.test(f.HTMLElement)||f.safari,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||g&&h)&&"object"==typeof FileReader){var j=new FileReader;j.onloadend=function(){var a=j.result;a=i?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),e?e.location.href=a:location=a,e=null},j.readAsDataURL(a)}else{var k=f.URL||f.webkitURL,l=k.createObjectURL(a);e?e.location=l:location.href=l,e=null,setTimeout(function(){k.revokeObjectURL(l)},4E4)}});f.saveAs=a.saveAs=a,"undefined"!=typeof module&&(module.exports=a)}); 2 | -------------------------------------------------------------------------------- /lib/metrics-graphics/metricsgraphics.css: -------------------------------------------------------------------------------- 1 | .mg-active-datapoint { 2 | fill: black; 3 | font-size: 0.9rem; 4 | font-weight: 400; 5 | opacity: 0.8; 6 | } 7 | 8 | .mg-area-color { 9 | fill: #000; 10 | } 11 | 12 | .mg-area1-color { 13 | fill: #0000ff; 14 | } 15 | 16 | .mg-area2-color { 17 | fill: #05b378; 18 | } 19 | 20 | .mg-area3-color { 21 | fill: #db4437; 22 | } 23 | 24 | .mg-area4-color { 25 | fill: #f8b128; 26 | } 27 | 28 | .mg-area5-color { 29 | fill: #5c5c5c; 30 | } 31 | 32 | .mg-area6-color { 33 | fill: steelblue; 34 | } 35 | 36 | .mg-area7-color { 37 | fill: #f673bf; 38 | } 39 | 40 | .mg-area8-color { 41 | fill: #0b73b0; 42 | } 43 | 44 | .mg-area9-color { 45 | fill: #006400; 46 | } 47 | 48 | .mg-area10-color { 49 | fill: #92514f; 50 | } 51 | 52 | text.mg-barplot-group-label { 53 | font-weight:900; 54 | } 55 | 56 | .mg-barplot rect.mg-bar { 57 | shape-rendering: auto; 58 | } 59 | 60 | .mg-barplot rect.mg-bar.default-bar { 61 | fill: #b6b6fc; 62 | } 63 | 64 | .mg-barplot rect.mg-bar.default-active { 65 | fill: #9e9efc; 66 | } 67 | 68 | .mg-barplot .mg-bar-prediction { 69 | fill: #5b5b5b; 70 | } 71 | 72 | .mg-barplot .mg-bar-baseline { 73 | stroke: #5b5b5b; 74 | stroke-width: 2; 75 | } 76 | 77 | .mg-bar-target-element { 78 | font-size:11px; 79 | padding-left:5px; 80 | padding-right:5px; 81 | font-weight:300; 82 | } 83 | 84 | .mg-baselines line { 85 | opacity: 1; 86 | shape-rendering: auto; 87 | stroke: #b3b2b2; 88 | stroke-width: 1px; 89 | } 90 | 91 | .mg-baselines text { 92 | fill: black; 93 | font-size: 0.9rem; 94 | opacity: 0.6; 95 | stroke: none; 96 | } 97 | 98 | .mg-baselines-small text { 99 | font-size: 0.6rem; 100 | } 101 | 102 | .mg-category-guides line { 103 | stroke: #b3b2b2; 104 | } 105 | 106 | .mg-header { 107 | cursor: default; 108 | font-size: 1.2rem; 109 | } 110 | 111 | .mg-header .mg-chart-description { 112 | fill: #ccc; 113 | font-family: FontAwesome; 114 | font-size: 1.2rem; 115 | } 116 | 117 | .mg-header .mg-warning { 118 | fill: #ccc; 119 | font-family: FontAwesome; 120 | font-size: 1.2rem; 121 | } 122 | 123 | .mg-points circle { 124 | opacity: 0.65; 125 | } 126 | 127 | .mg-popover { 128 | font-size: 0.95rem; 129 | } 130 | 131 | .mg-popover-content { 132 | cursor: auto; 133 | line-height: 17px; 134 | } 135 | 136 | .mg-data-table { 137 | margin-top: 30px; 138 | } 139 | 140 | .mg-data-table thead tr th { 141 | border-bottom: 1px solid darkgray; 142 | cursor: default; 143 | font-size: 1.1rem; 144 | font-weight: normal; 145 | padding: 5px 5px 8px 5px; 146 | text-align: right; 147 | } 148 | 149 | .mg-data-table thead tr th .fa { 150 | color: #ccc; 151 | padding-left: 4px; 152 | } 153 | 154 | .mg-data-table thead tr th .popover { 155 | font-size: 1rem; 156 | font-weight: normal; 157 | } 158 | 159 | .mg-data-table .secondary-title { 160 | color: darkgray; 161 | } 162 | 163 | .mg-data-table tbody tr td { 164 | margin: 2px; 165 | padding: 5px; 166 | vertical-align: top; 167 | } 168 | 169 | .mg-data-table tbody tr td.table-text { 170 | opacity: 0.8; 171 | padding-left: 30px; 172 | } 173 | 174 | .mg-y-axis line.mg-extended-yax-ticks { 175 | opacity: 0.4; 176 | } 177 | 178 | .mg-x-axis line.mg-extended-xax-ticks { 179 | opacity: 0.4; 180 | } 181 | 182 | .mg-histogram .axis path, 183 | .mg-histogram .axis line { 184 | fill: none; 185 | opacity: 0.7; 186 | shape-rendering: auto; 187 | stroke: #ccc; 188 | } 189 | 190 | tspan.hist-symbol { 191 | fill: #9e9efc; 192 | } 193 | 194 | .mg-histogram .mg-bar rect { 195 | fill: #b6b6fc; 196 | shape-rendering: auto; 197 | } 198 | 199 | .mg-histogram .mg-bar rect.active { 200 | fill: #9e9efc; 201 | } 202 | 203 | .mg-least-squares-line { 204 | stroke: red; 205 | stroke-width: 1px; 206 | } 207 | 208 | .mg-lowess-line { 209 | fill: none; 210 | stroke: red; 211 | } 212 | 213 | .mg-rollover-rect * { 214 | -webkit-touch-callout: none; 215 | -webkit-user-select: none; 216 | -khtml-user-select: none; 217 | -moz-user-select: none; 218 | -ms-user-select: none; 219 | user-select: none; 220 | } 221 | 222 | .mg-line-color { 223 | stroke: #000; 224 | } 225 | 226 | .mg-hover-line-color { 227 | fill: #000; 228 | } 229 | 230 | .mg-line1-color { 231 | stroke: #4040e8; 232 | } 233 | 234 | .mg-hover-line1-color { 235 | fill: #4040e8; 236 | } 237 | 238 | .mg-line2-color { 239 | stroke: #05b378; 240 | } 241 | 242 | .mg-hover-line2-color { 243 | fill: #05b378; 244 | } 245 | 246 | .mg-line3-color { 247 | stroke: #db4437; 248 | } 249 | 250 | .mg-hover-line3-color { 251 | fill: #db4437; 252 | } 253 | 254 | .mg-line4-color { 255 | stroke: #f8b128; 256 | } 257 | 258 | .mg-hover-line4-color { 259 | fill: #f8b128; 260 | } 261 | 262 | .mg-line5-color { 263 | stroke: #5c5c5c; 264 | } 265 | 266 | .mg-hover-line5-color { 267 | fill: #5c5c5c; 268 | } 269 | 270 | .mg-line6-color { 271 | stroke: steelblue; 272 | } 273 | 274 | .mg-hover-line6-color { 275 | fill: steelblue; 276 | } 277 | 278 | .mg-line7-color { 279 | stroke: #f673bf; 280 | } 281 | 282 | .mg-hover-line7-color { 283 | fill: #f673bf; 284 | } 285 | 286 | .mg-line8-color { 287 | stroke: #0b73b0; 288 | } 289 | 290 | .mg-hover-line8-color { 291 | fill: #0b73b0; 292 | } 293 | 294 | .mg-line9-color { 295 | stroke: #006400; 296 | } 297 | 298 | .mg-hover-line9-color { 299 | fill: #006400; 300 | } 301 | 302 | .mg-line10-color { 303 | stroke: #92514f; 304 | } 305 | 306 | .mg-hover-line10-color { 307 | fill: #92514f ; 308 | } 309 | 310 | .mg-line-legend text { 311 | font-size: 0.9rem; 312 | font-weight: 300; 313 | stroke: none; 314 | } 315 | 316 | .mg-line-legend-color { 317 | color: #000; 318 | fill: #000; 319 | } 320 | 321 | .mg-line1-legend-color { 322 | color: #4040e8; 323 | fill: #4040e8; 324 | } 325 | 326 | .mg-line2-legend-color { 327 | color: #05b378; 328 | fill: #05b378; 329 | } 330 | 331 | .mg-line3-legend-color { 332 | color: #db4437; 333 | fill: #db4437; 334 | } 335 | 336 | .mg-line4-legend-color { 337 | color: #f8b128; 338 | fill: #f8b128; 339 | } 340 | 341 | .mg-line5-legend-color { 342 | color: #5c5c5c; 343 | fill: #5c5c5c; 344 | } 345 | 346 | .mg-line6-legend-color { 347 | color: steelblue; 348 | fill: steelblue; 349 | } 350 | 351 | .mg-line7-legend-color { 352 | color: #f673bf; 353 | fill: #f673bf; 354 | } 355 | 356 | .mg-line8-legend-color { 357 | color: #0b73b0; 358 | fill: #0b73b0; 359 | } 360 | 361 | .mg-line9-legend-color { 362 | color: #006400; 363 | fill: #006400; 364 | } 365 | 366 | .mg-line10-legend-color { 367 | color: #92514f; 368 | fill: #92514f; 369 | } 370 | 371 | .mg-main-area-solid svg .mg-main-area { 372 | fill: #ccccff; 373 | opacity: 1; 374 | } 375 | 376 | .mg-markers line { 377 | opacity: 1; 378 | shape-rendering: auto; 379 | stroke: #b3b2b2; 380 | stroke-width: 1px; 381 | } 382 | 383 | .mg-markers text { 384 | fill: black; 385 | font-size: 0.8rem; 386 | opacity: 0.6; 387 | } 388 | 389 | .mg-missing-text { 390 | opacity: 0.9; 391 | } 392 | 393 | .mg-missing-background { 394 | stroke: blue; 395 | fill: none; 396 | stroke-dasharray: 10,5; 397 | stroke-opacity: 0.05; 398 | stroke-width: 2; 399 | } 400 | 401 | .mg-missing .mg-main-line { 402 | opacity: 0.1; 403 | } 404 | 405 | .mg-missing .mg-main-area { 406 | opacity: 0.03; 407 | } 408 | 409 | path.mg-main-area { 410 | opacity: 0.2; 411 | stroke: none; 412 | } 413 | 414 | path.mg-confidence-band { 415 | fill: #ccc; 416 | opacity: 0.4; 417 | stroke: none; 418 | } 419 | 420 | path.mg-main-line { 421 | fill: none; 422 | opacity: 0.8; 423 | stroke-width: 1.1px; 424 | } 425 | 426 | .mg-points circle { 427 | fill-opacity: 0.4; 428 | stroke-opacity: 1; 429 | } 430 | 431 | circle.mg-points-mono { 432 | fill: #0000ff; 433 | stroke: #0000ff; 434 | } 435 | 436 | tspan.mg-points-mono { 437 | fill: #0000ff; 438 | stroke: #0000ff; 439 | } 440 | 441 | /* a selected point in a scatterplot */ 442 | .mg-points circle.selected { 443 | fill-opacity: 1; 444 | stroke-opacity: 1; 445 | } 446 | 447 | .mg-voronoi path { 448 | fill: none; 449 | pointer-events: all; 450 | stroke: none; 451 | stroke-opacity: 0.1; 452 | -webkit-touch-callout: none; 453 | -webkit-user-select: none; 454 | -khtml-user-select: none; 455 | -moz-user-select: none; 456 | -ms-user-select: none; 457 | user-select: none; 458 | } 459 | 460 | .mg-x-rug-mono, 461 | .mg-y-rug-mono { 462 | stroke: black; 463 | } 464 | 465 | .mg-x-axis line, 466 | .mg-y-axis line { 467 | opacity: 1; 468 | shape-rendering: auto; 469 | stroke: #b3b2b2; 470 | stroke-width: 1px; 471 | } 472 | 473 | .mg-x-axis text, 474 | .mg-y-axis text, 475 | .mg-histogram .axis text { 476 | fill: black; 477 | font-size: 0.9rem; 478 | opacity: 0.6; 479 | } 480 | 481 | .mg-x-axis .label, 482 | .mg-y-axis .label, 483 | .mg-axis .label { 484 | font-size: 0.8rem; 485 | text-transform: uppercase; 486 | font-weight: 400; 487 | } 488 | 489 | .mg-x-axis-small text, 490 | .mg-y-axis-small text, 491 | .mg-active-datapoint-small { 492 | font-size: 0.6rem; 493 | } 494 | 495 | .mg-x-axis-small .label, 496 | .mg-y-axis-small .label { 497 | font-size: 0.65rem; 498 | } 499 | 500 | .mg-european-hours { 501 | } 502 | 503 | .mg-year-marker text { 504 | fill: black; 505 | font-size: 0.7rem; 506 | opacity: 0.6; 507 | } 508 | 509 | .mg-year-marker line { 510 | opacity: 1; 511 | shape-rendering: auto; 512 | stroke: #b3b2b2; 513 | stroke-width: 1px; 514 | } 515 | 516 | .mg-year-marker-small text { 517 | font-size: 0.6rem; 518 | } 519 | 520 | .mg-brush-container { 521 | cursor: crosshair; 522 | } 523 | 524 | .mg-brush-container .mg-brushing { 525 | cursor: ew-resize; 526 | } 527 | 528 | .mg-brushed, .mg-brushed * { 529 | cursor: zoom-out; 530 | } 531 | 532 | .mg-brush rect.mg-extent { 533 | fill: rgba(0, 0, 0, 0.3); 534 | } 535 | 536 | .mg-brushing-in-progress { 537 | -webkit-touch-callout: none; 538 | -webkit-user-select: none; 539 | -khtml-user-select: none; 540 | -moz-user-select: none; 541 | -ms-user-select: none; 542 | user-select: none; 543 | } 544 | -------------------------------------------------------------------------------- /sql-wasm.js: -------------------------------------------------------------------------------- 1 | 2 | // We are modularizing this manually because the current modularize setting in Emscripten has some issues: 3 | // https://github.com/kripken/emscripten/issues/5820 4 | // In addition, When you use emcc's modularization, it still expects to export a global object called `Module`, 5 | // which is able to be used/called before the WASM is loaded. 6 | // The modularization below exports a promise that loads and resolves to the actual sql.js module. 7 | // That way, this module can't be used before the WASM is finished loading. 8 | 9 | // We are going to define a function that a user will call to start loading initializing our Sql.js library 10 | // However, that function might be called multiple times, and on subsequent calls, we don't actually want it to instantiate a new instance of the Module 11 | // Instead, we want to return the previously loaded module 12 | 13 | // TODO: Make this not declare a global if used in the browser 14 | var initSqlJsPromise = undefined; 15 | 16 | var initSqlJs = function (moduleConfig) { 17 | 18 | if (initSqlJsPromise){ 19 | return initSqlJsPromise; 20 | } 21 | // If we're here, we've never called this function before 22 | initSqlJsPromise = new Promise((resolveModule, reject) => { 23 | 24 | // We are modularizing this manually because the current modularize setting in Emscripten has some issues: 25 | // https://github.com/kripken/emscripten/issues/5820 26 | 27 | // The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add 28 | // properties to it, like `preRun`, `postRun`, etc 29 | // We are using that to get notified when the WASM has finished loading. 30 | // Only then will we return our promise 31 | 32 | // If they passed in a moduleConfig object, use that 33 | // Otherwise, initialize Module to the empty object 34 | var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {}; 35 | 36 | // EMCC only allows for a single onAbort function (not an array of functions) 37 | // So if the user defined their own onAbort function, we remember it and call it 38 | var originalOnAbortFunction = Module['onAbort']; 39 | Module['onAbort'] = function (errorThatCausedAbort) { 40 | reject(new Error(errorThatCausedAbort)); 41 | if (originalOnAbortFunction){ 42 | originalOnAbortFunction(errorThatCausedAbort); 43 | } 44 | }; 45 | 46 | Module['postRun'] = Module['postRun'] || []; 47 | Module['postRun'].push(function () { 48 | // When Emscripted calls postRun, this promise resolves with the built Module 49 | resolveModule(Module); 50 | }); 51 | 52 | // There is a section of code in the emcc-generated code below that looks like this: 53 | // (Note that this is lowercase `module`) 54 | // if (typeof module !== 'undefined') { 55 | // module['exports'] = Module; 56 | // } 57 | // When that runs, it's going to overwrite our own modularization export efforts in shell-post.js! 58 | // The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags, 59 | // but that carries with it additional unnecessary baggage/bugs we don't want either. 60 | // So, we have three options: 61 | // 1) We undefine `module` 62 | // 2) We remember what `module['exports']` was at the beginning of this function and we restore it later 63 | // 3) We write a script to remove those lines of code as part of the Make process. 64 | // 65 | // Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward 66 | // of the options, and has the side effect of reducing emcc's efforts to modify the module if its output were to change in the future. 67 | // That's a nice side effect since we're handling the modularization efforts ourselves 68 | module = undefined; 69 | 70 | // The emcc-generated code and shell-post.js code goes below, 71 | // meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort 72 | var f;f||(f=typeof Module !== 'undefined' ? Module : {}); 73 | var va=function(){var a;var b=h(4);var c={};var d=function(){function a(a,b){this.j=a;this.db=b;this.C=1;this.ba=[]}a.prototype.bind=function(a){if(!this.j)throw"Statement closed";this.reset();return Array.isArray(a)?this.Ia(a):this.Ja(a)};a.prototype.step=function(){var a;if(!this.j)throw"Statement closed";this.C=1;switch(a=fc(this.j)){case c.Ca:return!0;case c.DONE:return!1;default:return this.db.handleError(a)}};a.prototype.Qa=function(a){null==a&&(a=this.C++);return hc(this.j,a)};a.prototype.Ra= 74 | function(a){null==a&&(a=this.C++);return ic(this.j,a)};a.prototype.getBlob=function(a){var b;null==a&&(a=this.C++);var c=jc(this.j,a);var d=kc(this.j,a);var e=new Uint8Array(c);for(a=b=0;0<=c?bc;a=0<=c?++b:--b)e[a]=k[d+a];return e};a.prototype.get=function(a){var b,d;null!=a&&this.bind(a)&&this.step();var e=[];a=b=0;for(d=vb(this.j);0<=d?bd;a=0<=d?++b:--b)switch(lc(this.j,a)){case c.Ba:case c.FLOAT:e.push(this.Qa(a));break;case c.Da:e.push(this.Ra(a));break;case c.ya:e.push(this.getBlob(a)); 75 | break;default:e.push(null)}return e};a.prototype.getColumnNames=function(){var a,b;var c=[];var d=a=0;for(b=vb(this.j);0<=b?ab;d=0<=b?++a:--a)c.push(mc(this.j,d));return c};a.prototype.getAsObject=function(a){var b,c;var d=this.get(a);var e=this.getColumnNames();var g={};a=b=0;for(c=e.length;b>>0);if(null!=a){var c=this.filename,d=c?m("/",c):"/";c=ea(!0,!0);d=fa(d,(void 0!==c?c:438)&4095|32768,0);if(a){if("string"===typeof a){for(var e=Array(a.length),l=0,n=a.length;lc;e=0<=c?++g:--g){var n=q(d+4*e,"i32");var w=uc(n);e=function(){switch(!1){case 1!==w:return vc;case 2!==w:return wc; 83 | case 3!==w:return xc;case 4!==w:return function(a){var b,c;var d=yc(a);var e=zc(a);a=new Uint8Array(d);for(b=c=0;0<=d?cd;b=0<=d?++c:--c)a[b]=k[e+b];return a};default:return function(){return null}}}();e=e(n);l.push(e)}if(c=b.apply(null,l))switch(typeof c){case "number":return Ac(a,c);case "string":return Bc(a,c,-1,-1)}else return Cc(a)});this.handleError(Dc(this.db,a,b.length,c.Ea,0,d,0,0,0));return this};return a}();var g=f.cwrap("sqlite3_open","number",["string","number"]);var l=f.cwrap("sqlite3_close_v2", 84 | "number",["number"]);var n=f.cwrap("sqlite3_exec","number",["number","string","number","number","number"]);f.cwrap("sqlite3_free","",["number"]);var v=f.cwrap("sqlite3_changes","number",["number"]);var A=f.cwrap("sqlite3_prepare_v2","number",["number","string","number","number","number"]);var w=f.cwrap("sqlite3_prepare_v2","number",["number","number","number","number","number"]);var O=f.cwrap("sqlite3_bind_text","number",["number","number","number","number","number"]);var Qa=f.cwrap("sqlite3_bind_blob", 85 | "number",["number","number","number","number","number"]);var wb=f.cwrap("sqlite3_bind_double","number",["number","number","number"]);var Ra=f.cwrap("sqlite3_bind_int","number",["number","number","number"]);var nc=f.cwrap("sqlite3_bind_parameter_index","number",["number","string"]);var fc=f.cwrap("sqlite3_step","number",["number"]);var sc=f.cwrap("sqlite3_errmsg","string",["number"]);var vb=f.cwrap("sqlite3_data_count","number",["number"]);var hc=f.cwrap("sqlite3_column_double","number",["number", 86 | "number"]);var ic=f.cwrap("sqlite3_column_text","string",["number","number"]);var kc=f.cwrap("sqlite3_column_blob","number",["number","number"]);var jc=f.cwrap("sqlite3_column_bytes","number",["number","number"]);var lc=f.cwrap("sqlite3_column_type","number",["number","number"]);var mc=f.cwrap("sqlite3_column_name","string",["number","number"]);var pc=f.cwrap("sqlite3_reset","number",["number"]);var oc=f.cwrap("sqlite3_clear_bindings","number",["number"]);var qc=f.cwrap("sqlite3_finalize","number", 87 | ["number"]);var Dc=f.cwrap("sqlite3_create_function_v2","number","number string number number number number number number number".split(" "));var uc=f.cwrap("sqlite3_value_type","number",["number"]);var yc=f.cwrap("sqlite3_value_bytes","number",["number"]);var xc=f.cwrap("sqlite3_value_text","string",["number"]);var vc=f.cwrap("sqlite3_value_int","number",["number"]);var zc=f.cwrap("sqlite3_value_blob","number",["number"]);var wc=f.cwrap("sqlite3_value_double","number",["number"]);var Ac=f.cwrap("sqlite3_result_double", 88 | "",["number","number"]);var Cc=f.cwrap("sqlite3_result_null","",["number"]);var Bc=f.cwrap("sqlite3_result_text","",["number","string","number","number"]);var rc=f.cwrap("RegisterExtensionFunctions","number",["number"]);this.SQL={Database:e};for(a in this.SQL)f[a]=this.SQL[a];var ka=0;c.V=0;c.Pc=1;c.hd=2;c.sd=3;c.$a=4;c.bb=5;c.ld=6;c.NOMEM=7;c.vd=8;c.jd=9;c.kd=10;c.fb=11;c.NOTFOUND=12;c.gd=13;c.cb=14;c.td=15;c.EMPTY=16;c.wd=17;c.xd=18;c.eb=19;c.md=20;c.nd=21;c.od=22;c.ab=23;c.ed=24;c.ud=25;c.pd=26; 89 | c.qd=27;c.yd=28;c.Ca=100;c.DONE=101;c.Ba=1;c.FLOAT=2;c.Da=3;c.ya=4;c.rd=5;c.Ea=1}.bind(this);f.preRun=f.preRun||[];f.preRun.push(va);var wa={},r;for(r in f)f.hasOwnProperty(r)&&(wa[r]=f[r]);f.arguments=[];f.thisProgram="./this.program";f.quit=function(a,b){throw b;};f.preRun=[];f.postRun=[];var xa=!1,t=!1,u=!1,ya=!1;xa="object"===typeof window;t="function"===typeof importScripts;u="object"===typeof process&&"function"===typeof require&&!xa&&!t;ya=!xa&&!u&&!t;var x=""; 90 | function za(a){return f.locateFile?f.locateFile(a,x):x+a} 91 | if(u){x=__dirname+"/";var Aa,Ba;f.read=function(a,b){Aa||(Aa=require("fs"));Ba||(Ba=require("path"));a=Ba.normalize(a);a=Aa.readFileSync(a);return b?a:a.toString()};f.readBinary=function(a){a=f.read(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer);return a};1>2];a=b+a+15&-16;C[D>>2]=a;return a>=E&&!Fa()?(C[D>>2]=b,0):b}function Ga(a){var b;b||(b=16);return Math.ceil(a/b)*b}var Ha={"f64-rem":function(a,b){return a%b},"debugger":function(){debugger}},Ia=1,F=Array(64);function ua(a){for(var b=0;64>b;b++)if(!F[b])return F[b]=a,Ia+b;throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.";}var Ja=!1;function assert(a,b){a||y("Assertion failed: "+b)} 96 | function Ka(a){var b=f["_"+a];assert(b,"Cannot call unknown function "+a+", make sure it is exported");return b}var La={stackSave:function(){la()},stackRestore:function(){pa()},arrayToC:function(a){var b=h(a.length);k.set(a,b);return b},stringToC:function(a){var b=0;if(null!==a&&void 0!==a&&0!==a){var c=(a.length<<2)+1;b=h(c);na(a,G,b,c)}return b}},Ma={string:La.stringToC,array:La.arrayToC}; 97 | function oa(a){var b="i32";"*"===b.charAt(b.length-1)&&(b="i32");switch(b){case "i1":k[a>>0]=0;break;case "i8":k[a>>0]=0;break;case "i16":Na[a>>1]=0;break;case "i32":C[a>>2]=0;break;case "i64":tempI64=[0,(tempDouble=0,1<=+Oa(tempDouble)?0>>0:~~+Ta((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)];C[a>>2]=tempI64[0];C[a+4>>2]=tempI64[1];break;case "float":Ua[a>>2]=0;break;case "double":Va[a>>3]=0;break;default:y("invalid type for setValue: "+ 98 | b)}}function q(a,b){b=b||"i8";"*"===b.charAt(b.length-1)&&(b="i32");switch(b){case "i1":return k[a>>0];case "i8":return k[a>>0];case "i16":return Na[a>>1];case "i32":return C[a>>2];case "i64":return C[a>>2];case "float":return Ua[a>>2];case "double":return Va[a>>3];default:y("invalid type for getValue: "+b)}return null}var ca=0,Wa=2,Xa=4; 99 | function ba(a,b){if("number"===typeof a){var c=!0;var d=a}else c=!1,d=a.length;b=b==Xa?e:["function"===typeof Ya?Ya:Da,h,Da,Ea][void 0===b?Wa:b](Math.max(d,1));if(c){var e=b;assert(0==(b&3));for(a=b+(d&-4);e>2]=0;for(a=b+d;e>0]=0;return b}a.subarray||a.slice?G.set(a,b):G.set(new Uint8Array(a),b);return b} 100 | function H(a){var b;if(0===b||!a)return"";for(var c=0,d,e=0;;){d=G[a+e>>0];c|=d;if(0==d&&!b)break;e++;if(b&&e==b)break}b||(b=e);d="";if(128>c){for(;0d?c+=String.fromCharCode(d):(d-= 102 | 65536,c+=String.fromCharCode(55296|d>>10,56320|d&1023))}}else c+=String.fromCharCode(d)}} 103 | function na(a,b,c,d){if(!(0=l){var n=a.charCodeAt(++g);l=65536+((l&1023)<<10)|n&1023}if(127>=l){if(c>=d)break;b[c++]=l}else{if(2047>=l){if(c+1>=d)break;b[c++]=192|l>>6}else{if(65535>=l){if(c+2>=d)break;b[c++]=224|l>>12}else{if(2097151>=l){if(c+3>=d)break;b[c++]=240|l>>18}else{if(67108863>=l){if(c+4>=d)break;b[c++]=248|l>>24}else{if(c+5>=d)break;b[c++]=252|l>>30;b[c++]=128|l>>24&63}b[c++]=128|l>>18&63}b[c++]= 104 | 128|l>>12&63}b[c++]=128|l>>6&63}b[c++]=128|l&63}}b[c]=0;return c-e}function ma(a){for(var b=0,c=0;c=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++c)&1023);127>=d?++b:b=2047>=d?b+2:65535>=d?b+3:2097151>=d?b+4:67108863>=d?b+5:b+6}return b}"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");function $a(a){return a.replace(/__Z[\w\d_]+/g,function(a){return a===a?a:a+" ["+a+"]"})}var ab=65536,bb=16777216,cb=16777216; 105 | function db(a,b){0>2]>b)return!1;var c=E;for(E=Math.max(E,cb);E>2];)536870912>=E?E=db(2*E,a):E=Math.min(db((3*E+2147483648)/4,a),b);a=f.reallocBuffer(E);if(!a||a.byteLength!=E)return E=c,!1;f.buffer=buffer=a;eb();return!0}var mb; 107 | try{mb=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),mb(new ArrayBuffer(4))}catch(a){mb=function(b){return b.byteLength}}var nb=f.TOTAL_STACK||5242880,E=f.TOTAL_MEMORY||16777216;E>2];var c=C[b>>2]}else Cb.H=!0,J.USER=J.LOGNAME="web_user",J.PATH="/",J.PWD="/",J.HOME="/home/web_user",J.LANG="C.UTF-8",J._=f.thisProgram,c=gb?ub?Ya(1024):Ea(1024):Da(1024),b=gb?ub?Ya(256):Ea(256):Da(256),C[b>>2]=c,C[a>>2]=b;a=[];var d=0,e;for(e in J)if("string"===typeof J[e]){var g=e+"="+J[e];a.push(g);d+=g.length}if(1024>0]=d.charCodeAt(n); 117 | k[l>>0]=0;C[b+4*e>>2]=c;c+=g.length+1}C[b+4*a.length>>2]=0} 118 | var K={B:1,A:2,Sc:3,Nb:4,R:5,ma:6,gb:7,lc:8,m:9,ub:10,ia:11,bd:11,ka:12,L:13,Gb:14,xc:15,M:16,ja:17,cd:18,S:19,T:20,N:21,h:22,fc:23,za:24,Cc:25,Zc:26,Hb:27,tc:28,U:29,Oc:30,Zb:31,Ic:32,Db:33,Aa:34,pc:42,Kb:43,vb:44,Qb:45,Rb:46,Sb:47,Yb:48,$c:49,jc:50,Pb:51,Ab:35,mc:37,mb:52,pb:53,dd:54,hc:55,qb:56,rb:57,Bb:35,sb:59,vc:60,kc:61,Wc:62,uc:63,qc:64,rc:65,Nc:66,nc:67,jb:68,Tc:69,wb:70,Jc:71,ac:72,Eb:73,ob:74,Dc:76,nb:77,Mc:78,Tb:79,Ub:80,Xb:81,Wb:82,Vb:83,wc:38,la:39,bc:36,$:40,Ec:95,Hc:96,zb:104,ic:105, 119 | kb:97,Lc:91,Ac:88,sc:92,Qc:108,yb:111,hb:98,xb:103,ec:101,cc:100,Xc:110,Ib:112,Jb:113,Mb:115,lb:114,Cb:89,$b:90,Kc:93,Rc:94,ib:99,dc:102,Ob:106,yc:107,Yc:109,ad:87,Fb:122,Uc:116,Bc:95,oc:123,Lb:84,Fc:75,tb:125,zc:131,Gc:130,Vc:86},Db={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core", 120 | 13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable", 121 | 35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor", 122 | 54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message", 123 | 75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket", 124 | 92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown", 125 | 109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function Eb(a){f.___errno_location&&(C[f.___errno_location()>>2]=a);return a} 126 | function Fb(a,b){for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a}function Gb(a){var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=Fb(a.split("/").filter(function(a){return!!a}),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a} 127 | function Hb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function Ib(a){if("/"===a)return"/";var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)}function Jb(){var a=Array.prototype.slice.call(arguments,0);return Gb(a.join("/"))}function m(a,b){return Gb(a+"/"+b)} 128 | function Kb(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:"/";if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=Fb(a.split("/").filter(function(a){return!!a}),!b).join("/");return(b?"/":"")+a||"."}var Lb=[];function Mb(a,b){Lb[a]={input:[],output:[],K:b};Nb(a,Ob)} 129 | var Ob={open:function(a){var b=Lb[a.node.rdev];if(!b)throw new L(K.S);a.tty=b;a.seekable=!1},close:function(a){a.tty.K.flush(a.tty)},flush:function(a){a.tty.K.flush(a.tty)},read:function(a,b,c,d){if(!a.tty||!a.tty.K.va)throw new L(K.ma);for(var e=0,g=0;ga.b.length&&(a.b=M.Pa(a),a.i=a.b.length);if(!a.b||a.b.subarray){var c=a.b?a.b.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)|0),0!=c&&(b=Math.max(b,256)),c=a.b,a.b=new Uint8Array(b),0b)a.b.length=b;else for(;a.b.length=a.node.i)return 0;a=Math.min(a.node.i-e,d);assert(0<=a);if(8b)throw new L(K.h);return b},na:function(a,b,c){M.ra(a.node,b+c);a.node.i=Math.max(a.node.i, 139 | b+c)},X:function(a,b,c,d,e,g,l){if(32768!==(a.node.mode&61440))throw new L(K.S);c=a.node.b;if(l&2||c.buffer!==b&&c.buffer!==b.buffer){if(0>2)}catch(c){if(!c.code)throw c; 141 | throw new L(K[c.code]);}return b.mode},s:function(a){for(var b=[];a.parent!==a;)b.push(a.name),a=a.parent;b.push(a.o.fa.root);b.reverse();return Jb.apply(null,b)},Na:function(a){a&=-2656257;var b=0,c;for(c in Q.sa)a&c&&(b|=Q.sa[c],a^=c);if(a)throw new L(K.h);return b},c:{u:function(a){a=Q.s(a);try{var b=fs.lstatSync(a)}catch(c){if(!c.code)throw c;throw new L(K[c.code]);}Q.W&&!b.F&&(b.F=4096);Q.W&&!b.blocks&&(b.blocks=(b.size+b.F-1)/b.F|0);return{dev:b.dev,ino:b.ino,mode:b.mode,nlink:b.nlink,uid:b.uid, 142 | gid:b.gid,rdev:b.rdev,size:b.size,atime:b.atime,mtime:b.mtime,ctime:b.ctime,F:b.F,blocks:b.blocks}},l:function(a,b){var c=Q.s(a);try{void 0!==b.mode&&(fs.chmodSync(c,b.mode),a.mode=b.mode),void 0!==b.size&&fs.truncateSync(c,b.size)}catch(d){if(!d.code)throw d;throw new L(K[d.code]);}},lookup:function(a,b){var c=m(Q.s(a),b);c=Q.ua(c);return Q.createNode(a,b,c)},O:function(a,b,c,d){a=Q.createNode(a,b,c,d);b=Q.s(a);try{N(a.mode)?fs.mkdirSync(b,a.mode):fs.writeFileSync(b,"",{mode:a.mode})}catch(e){if(!e.code)throw e; 143 | throw new L(K[e.code]);}return a},rename:function(a,b,c){a=Q.s(a);b=m(Q.s(b),c);try{fs.renameSync(a,b)}catch(d){if(!d.code)throw d;throw new L(K[d.code]);}},unlink:function(a,b){a=m(Q.s(a),b);try{fs.unlinkSync(a)}catch(c){if(!c.code)throw c;throw new L(K[c.code]);}},rmdir:function(a,b){a=m(Q.s(a),b);try{fs.rmdirSync(a)}catch(c){if(!c.code)throw c;throw new L(K[c.code]);}},readdir:function(a){a=Q.s(a);try{return fs.readdirSync(a)}catch(b){if(!b.code)throw b;throw new L(K[b.code]);}},symlink:function(a, 144 | b,c){a=m(Q.s(a),b);try{fs.symlinkSync(c,a)}catch(d){if(!d.code)throw d;throw new L(K[d.code]);}},readlink:function(a){var b=Q.s(a);try{return b=fs.readlinkSync(b),b=Ub.relative(Ub.resolve(a.o.fa.root),b)}catch(c){if(!c.code)throw c;throw new L(K[c.code]);}}},f:{open:function(a){var b=Q.s(a.node);try{32768===(a.node.mode&61440)&&(a.P=fs.openSync(b,Q.Na(a.flags)))}catch(c){if(!c.code)throw c;throw new L(K[c.code]);}},close:function(a){try{32768===(a.node.mode&61440)&&a.P&&fs.closeSync(a.P)}catch(b){if(!b.code)throw b; 145 | throw new L(K[b.code]);}},read:function(a,b,c,d,e){if(0===d)return 0;try{return fs.readSync(a.P,Q.pa(b.buffer),c,d,e)}catch(g){throw new L(K[g.code]);}},write:function(a,b,c,d,e){try{return fs.writeSync(a.P,Q.pa(b.buffer),c,d,e)}catch(g){throw new L(K[g.code]);}},D:function(a,b,c){if(1===c)b+=a.position;else if(2===c&&32768===(a.node.mode&61440))try{b+=fs.fstatSync(a.P).size}catch(d){throw new L(K[d.code]);}if(0>b)throw new L(K.h);return b}}};B+=16;B+=16;B+=16; 146 | var Vb=null,Wb={},R=[],Xb=1,S=null,Yb=!0,T={},L=null,Tb={}; 147 | function U(a,b){a=Kb("/",a);b=b||{};if(!a)return{path:"",node:null};var c={ta:!0,ha:0},d;for(d in c)void 0===b[d]&&(b[d]=c[d]);if(8>>0)%S.length}function bc(a){var b=ac(a.parent.id,a.name);a.J=S[b];S[b]=a}function cc(a){var b=ac(a.parent.id,a.name);if(S[b]===a)S[b]=a.J;else for(b=S[b];b;){if(b.J===a){b.J=a.J;break}b=b.J}} 149 | function P(a,b){var c;if(c=(c=dc(a,"x"))?c:a.c.lookup?0:K.L)throw new L(c,a);for(c=S[ac(a.id,b)];c;c=c.J){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.c.lookup(a,b)} 150 | function Sb(a,b,c,d){ec||(ec=function(a,b,c,d){a||(a=this);this.parent=a;this.o=a.o;this.I=null;this.id=Xb++;this.name=b;this.mode=c;this.c={};this.f={};this.rdev=d},ec.prototype={},Object.defineProperties(ec.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}}}));a=new ec(a,b,c,d);bc(a);return a}function N(a){return 16384===(a&61440)} 151 | var tc={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Ec(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b}function dc(a,b){if(Yb)return 0;if(-1===b.indexOf("r")||a.mode&292){if(-1!==b.indexOf("w")&&!(a.mode&146)||-1!==b.indexOf("x")&&!(a.mode&73))return K.L}else return K.L;return 0}function Fc(a,b){try{return P(a,b),K.ja}catch(c){}return dc(a,"wx")} 152 | function Gc(a,b,c){try{var d=P(a,b)}catch(e){return e.g}if(a=dc(a,"wx"))return a;if(c){if(!N(d.mode))return K.T;if(d===d.parent||"/"===$b(d))return K.M}else if(N(d.mode))return K.N;return 0}function Hc(a){var b=4096;for(a=a||0;a<=b;a++)if(!R[a])return a;throw new L(K.za);} 153 | function Ic(a,b){Jc||(Jc=function(){},Jc.prototype={},Object.defineProperties(Jc.prototype,{object:{get:function(){return this.node},set:function(a){this.node=a}}}));var c=new Jc,d;for(d in a)c[d]=a[d];a=c;b=Hc(b);a.fd=b;return R[b]=a}var Rb={open:function(a){a.f=Wb[a.node.rdev].f;a.f.open&&a.f.open(a)},D:function(){throw new L(K.U);}};function Nb(a,b){Wb[a]={f:b}} 154 | function Kc(a,b){var c="/"===b,d=!b;if(c&&Vb)throw new L(K.M);if(!c&&!d){var e=U(b,{ta:!1});b=e.path;e=e.node;if(e.I)throw new L(K.M);if(!N(e.mode))throw new L(K.T);}b={type:a,fa:{},wa:b,Ua:[]};a=a.o(b);a.o=b;b.root=a;c?Vb=a:e&&(e.I=b,e.o&&e.o.Ua.push(b))}function fa(a,b,c){var d=U(a,{parent:!0}).node;a=Ib(a);if(!a||"."===a||".."===a)throw new L(K.h);var e=Fc(d,a);if(e)throw new L(e);if(!d.c.O)throw new L(K.B);return d.c.O(d,a,b,c)}function V(a,b){fa(a,(void 0!==b?b:511)&1023|16384,0)} 155 | function Lc(a,b,c){"undefined"===typeof c&&(c=b,b=438);fa(a,b|8192,c)}function Mc(a,b){if(!Kb(a))throw new L(K.A);var c=U(b,{parent:!0}).node;if(!c)throw new L(K.A);b=Ib(b);var d=Fc(c,b);if(d)throw new L(d);if(!c.c.symlink)throw new L(K.B);c.c.symlink(c,b,a)} 156 | function ta(a){var b=U(a,{parent:!0}).node,c=Ib(a),d=P(b,c),e=Gc(b,c,!1);if(e)throw new L(e);if(!b.c.unlink)throw new L(K.B);if(d.I)throw new L(K.M);try{T.willDeletePath&&T.willDeletePath(a)}catch(g){console.log("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+g.message)}b.c.unlink(b,c);cc(d);try{if(T.onDeletePath)T.onDeletePath(a)}catch(g){console.log("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}} 157 | function Zb(a){a=U(a).node;if(!a)throw new L(K.A);if(!a.c.readlink)throw new L(K.h);return Kb($b(a.parent),a.c.readlink(a))}function qa(a,b){a=U(a,{G:!b}).node;if(!a)throw new L(K.A);if(!a.c.u)throw new L(K.B);return a.c.u(a)}function Nc(a){return qa(a,!0)}function ha(a,b){var c;"string"===typeof a?c=U(a,{G:!0}).node:c=a;if(!c.c.l)throw new L(K.B);c.c.l(c,{mode:b&4095|c.mode&-4096,timestamp:Date.now()})} 158 | function Oc(a){var b;"string"===typeof a?b=U(a,{G:!0}).node:b=a;if(!b.c.l)throw new L(K.B);b.c.l(b,{timestamp:Date.now()})}function Pc(a,b){if(0>b)throw new L(K.h);var c;"string"===typeof a?c=U(a,{G:!0}).node:c=a;if(!c.c.l)throw new L(K.B);if(N(c.mode))throw new L(K.N);if(32768!==(c.mode&61440))throw new L(K.h);if(a=dc(c,"w"))throw new L(a);c.c.l(c,{size:b,timestamp:Date.now()})} 159 | function p(a,b,c,d){if(""===a)throw new L(K.A);if("string"===typeof b){var e=tc[b];if("undefined"===typeof e)throw Error("Unknown file open mode: "+b);b=e}c=b&64?("undefined"===typeof c?438:c)&4095|32768:0;if("object"===typeof a)var g=a;else{a=Gb(a);try{g=U(a,{G:!(b&131072)}).node}catch(n){}}e=!1;if(b&64)if(g){if(b&128)throw new L(K.ja);}else g=fa(a,c,0),e=!0;if(!g)throw new L(K.A);8192===(g.mode&61440)&&(b&=-513);if(b&65536&&!N(g.mode))throw new L(K.T);if(!e){var l=g?40960===(g.mode&61440)?K.$:N(g.mode)&& 160 | ("r"!==Ec(b)||b&512)?K.N:dc(g,Ec(b)):K.A;if(l)throw new L(l);}b&512&&Pc(g,0);b&=-641;c=Ic({node:g,path:$b(g),flags:b,seekable:!0,position:0,f:g.f,Za:[],error:!1},d);c.f.open&&c.f.open(c);!f.logReadFiles||b&1||(Qc||(Qc={}),a in Qc||(Qc[a]=1,l("read file: "+a)));try{T.onOpenFile&&(l=0,1!==(b&2097155)&&(l|=1),0!==(b&2097155)&&(l|=2),T.onOpenFile(a,l))}catch(n){console.log("FS.trackingDelegate['onOpenFile']('"+a+"', flags) threw an exception: "+n.message)}return c} 161 | function ja(a){if(null===a.fd)throw new L(K.m);a.ea&&(a.ea=null);try{a.f.close&&a.f.close(a)}catch(b){throw b;}finally{R[a.fd]=null}a.fd=null}function Rc(a,b,c){if(null===a.fd)throw new L(K.m);if(!a.seekable||!a.f.D)throw new L(K.U);a.position=a.f.D(a,b,c);a.Za=[]} 162 | function ra(a,b,c,d,e){if(0>d||0>e)throw new L(K.h);if(null===a.fd)throw new L(K.m);if(1===(a.flags&2097155))throw new L(K.m);if(N(a.node.mode))throw new L(K.N);if(!a.f.read)throw new L(K.h);var g="undefined"!==typeof e;if(!g)e=a.position;else if(!a.seekable)throw new L(K.U);b=a.f.read(a,b,c,d,e);g||(a.position+=b);return b} 163 | function ia(a,b,c,d,e,g){if(0>d||0>e)throw new L(K.h);if(null===a.fd)throw new L(K.m);if(0===(a.flags&2097155))throw new L(K.m);if(N(a.node.mode))throw new L(K.N);if(!a.f.write)throw new L(K.h);a.flags&1024&&Rc(a,0,2);var l="undefined"!==typeof e;if(!l)e=a.position;else if(!a.seekable)throw new L(K.U);b=a.f.write(a,b,c,d,e,g);l||(a.position+=b);try{if(a.path&&T.onWriteToFile)T.onWriteToFile(a.path)}catch(n){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+n.message)}return b} 164 | function Sc(){L||(L=function(a,b){this.node=b;this.Xa=function(a){this.g=a;for(var b in K)if(K[b]===a){this.code=b;break}};this.Xa(a);this.message=Db[a];this.stack&&Object.defineProperty(this,"stack",{value:Error().stack,writable:!0})},L.prototype=Error(),L.prototype.constructor=L,[K.A].forEach(function(a){Tb[a]=new L(a);Tb[a].stack=""}))}var Tc;function ea(a,b){var c=0;a&&(c|=365);b&&(c|=146);return c} 165 | function Uc(a,b,c){a=m("/dev",a);var d=ea(!!b,!!c);Vc||(Vc=64);var e=Vc++<<8|0;Nb(e,{open:function(a){a.seekable=!1},close:function(){c&&c.buffer&&c.buffer.length&&c(10)},read:function(a,c,d,e){for(var g=0,l=0;l>2]=d.dev;C[c+4>>2]=0;C[c+8>>2]=d.ino;C[c+12>>2]=d.mode;C[c+16>>2]=d.nlink;C[c+20>>2]=d.uid;C[c+24>>2]=d.gid;C[c+28>>2]=d.rdev;C[c+32>>2]=0;C[c+36>>2]=d.size;C[c+40>>2]=4096;C[c+44>>2]=d.blocks;C[c+48>>2]=d.atime.getTime()/1E3|0;C[c+52>>2]=0;C[c+56>>2]=d.mtime.getTime()/1E3|0;C[c+60>>2]=0;C[c+64>>2]=d.ctime.getTime()/1E3|0;C[c+68>>2]=0;C[c+72>>2]=d.ino;return 0}var W=0; 168 | function X(){W+=4;return C[W-4>>2]}function Y(){return H(X())}function Yc(){var a=R[X()];if(!a)throw new L(K.m);return a}function Zc(a,b){W=b;return 0}function $c(a){if(0===a)return 0;a=H(a);if(!J.hasOwnProperty(a))return 0;$c.H&&da($c.H);a=J[a];var b=ma(a)+1,c=Ya(b);c&&na(a,k,c,b);$c.H=c;return $c.H}function ad(a){return Math.log(a)/Math.LN10}var Z=B;B+=48;ba(aa("GMT"),Wa); 169 | function bd(){function a(a){return(a=a.toTimeString().match(/\(([A-Za-z ]+)\)$/))?a[1]:"GMT"}if(!cd){cd=!0;C[dd()>>2]=60*(new Date).getTimezoneOffset();var b=new Date(2E3,0,1),c=new Date(2E3,6,1);C[ed()>>2]=Number(b.getTimezoneOffset()!=c.getTimezoneOffset());var d=a(b),e=a(c);d=ba(aa(d),ca);e=ba(aa(e),ca);c.getTimezoneOffset()>2]=d,C[fd()+4>>2]=e):(C[fd()>>2]=e,C[fd()+4>>2]=d)}}var cd; 170 | function gd(a){a/=1E3;if((xa||t)&&self.performance&&self.performance.now)for(var b=self.performance.now();self.performance.now()-b>2]=kb;gb=!0; 175 | function aa(a,b){var c=Array(ma(a)+1);a=na(a,c,0,c.length);b&&(c.length=a);return c}f.wasmTableSize=2560;f.wasmMaxTableSize=2560;f.Fa={}; 176 | f.Ga={abort:y,enlargeMemory:Fa,getTotalMemory:function(){return E},abortOnCannotGrowMemory:function(){y("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+E+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")},jsCall_i:function(a){return F[a]()},jsCall_ii:function(a,b){return F[a](b)},jsCall_iii:function(a, 177 | b,c){return F[a](b,c)},jsCall_iiii:function(a,b,c,d){return F[a](b,c,d)},jsCall_iiiii:function(a,b,c,d,e){return F[a](b,c,d,e)},jsCall_iiiiii:function(a,b,c,d,e,g){return F[a](b,c,d,e,g)},jsCall_iiiiiii:function(a,b,c,d,e,g,l){return F[a](b,c,d,e,g,l)},jsCall_iiiij:function(a,b,c,d,e){return F[a](b,c,d,e)},jsCall_iij:function(a,b,c){return F[a](b,c)},jsCall_iiji:function(a,b,c,d){return F[a](b,c,d)},jsCall_iijii:function(a,b,c,d,e){return F[a](b,c,d,e)},jsCall_vi:function(a,b){F[a](b)},jsCall_vii:function(a, 178 | b,c){F[a](b,c)},jsCall_viii:function(a,b,c,d){F[a](b,c,d)},jsCall_viiii:function(a,b,c,d,e){F[a](b,c,d,e)},jsCall_viiiij:function(a,b,c,d,e,g){F[a](b,c,d,e,g)},jsCall_viij:function(a,b,c,d){F[a](b,c,d)},jsCall_viji:function(a,b,c,d){F[a](b,c,d)},___assert_fail:function(a,b,c,d){y("Assertion failed: "+H(a)+", at: "+[b?H(b):"unknown filename",c,d?H(d):"unknown function"])},___buildEnvironment:Cb,___setErrNo:Eb,___syscall10:function(a,b){W=b;try{var c=Y();ta(c);return 0}catch(d){return"undefined"!== 179 | typeof FS&&d instanceof L||y(d),-d.g}},___syscall118:function(a,b){W=b;try{return Yc(),0}catch(c){return"undefined"!==typeof FS&&c instanceof L||y(c),-c.g}},___syscall140:function(a,b){W=b;try{var c=Yc();X();var d=X(),e=X(),g=X();Rc(c,d,g);C[e>>2]=c.position;c.ea&&0===d&&0===g&&(c.ea=null);return 0}catch(l){return"undefined"!==typeof FS&&l instanceof L||y(l),-l.g}},___syscall15:function(a,b){W=b;try{var c=Y(),d=X();ha(c,d);return 0}catch(e){return"undefined"!==typeof FS&&e instanceof L||y(e),-e.g}}, 180 | ___syscall183:function(a,b){W=b;try{var c=X(),d=X();if(0===d)return-K.h;if(dd?-K.h:p(c.path,c.flags,0,d).fd;case 1:case 2:return 0;case 3:return c.flags;case 4:return d=X(),c.flags|=d,0;case 12:case 12:return d=X(),Na[d+0>>1]=2,0;case 13:case 14:case 13:case 14:return 0;case 16:case 8:return-K.h;case 9:return Eb(K.h), 184 | -1;default:return-K.h}}catch(e){return"undefined"!==typeof FS&&e instanceof L||y(e),-e.g}},___syscall3:function(a,b){W=b;try{var c=Yc(),d=X(),e=X();return ra(c,k,d,e)}catch(g){return"undefined"!==typeof FS&&g instanceof L||y(g),-g.g}},___syscall33:function(a,b){W=b;try{var c=Y();var d=X();if(d&-8)var e=-K.h;else{var g=U(c,{G:!0}).node;a="";d&4&&(a+="r");d&2&&(a+="w");d&1&&(a+="x");e=a&&dc(g,a)?-K.L:0}return e}catch(l){return"undefined"!==typeof FS&&l instanceof L||y(l),-l.g}},___syscall39:function(a, 185 | b){W=b;try{var c=Y(),d=X();a=c;a=Gb(a);"/"===a[a.length-1]&&(a=a.substr(0,a.length-1));V(a,d);return 0}catch(e){return"undefined"!==typeof FS&&e instanceof L||y(e),-e.g}},___syscall4:function(a,b){W=b;try{var c=Yc(),d=X(),e=X();return ia(c,k,d,e)}catch(g){return"undefined"!==typeof FS&&g instanceof L||y(g),-g.g}},___syscall40:function(a,b){W=b;try{var c=Y(),d=U(c,{parent:!0}).node,e=Ib(c),g=P(d,e),l=Gc(d,e,!0);if(l)throw new L(l);if(!d.c.rmdir)throw new L(K.B);if(g.I)throw new L(K.M);try{T.willDeletePath&& 186 | T.willDeletePath(c)}catch(n){console.log("FS.trackingDelegate['willDeletePath']('"+c+"') threw an exception: "+n.message)}d.c.rmdir(d,e);cc(g);try{if(T.onDeletePath)T.onDeletePath(c)}catch(n){console.log("FS.trackingDelegate['onDeletePath']('"+c+"') threw an exception: "+n.message)}return 0}catch(n){return"undefined"!==typeof FS&&n instanceof L||y(n),-n.g}},___syscall5:function(a,b){W=b;try{var c=Y(),d=X(),e=X();return p(c,d,e).fd}catch(g){return"undefined"!==typeof FS&&g instanceof L||y(g),-g.g}}, 187 | ___syscall6:function(a,b){W=b;try{var c=Yc();ja(c);return 0}catch(d){return"undefined"!==typeof FS&&d instanceof L||y(d),-d.g}},___syscall85:function(a,b){W=b;try{var c=Y(),d=X();var e=X();if(0>=e)var g=-K.h;else{var l=Zb(c),n=Math.min(e,ma(l)),v=k[d+n];na(l,G,d,e+1);k[d+n]=v;g=n}return g}catch(A){return"undefined"!==typeof FS&&A instanceof L||y(A),-A.g}},___syscall91:function(a,b){W=b;try{var c=X(),d=X(),e=Wc[c];if(!e)return 0;if(d===e.Sa){var g=R[e.fd],l=e.flags,n=new Uint8Array(G.subarray(c,c+ 188 | d));g&&g.f.Y&&g.f.Y(g,n,0,d,l);Wc[c]=null;e.aa&&da(e.Ta)}return 0}catch(v){return"undefined"!==typeof FS&&v instanceof L||y(v),-v.g}},___syscall94:function(a,b){W=b;try{var c=X(),d=X(),e=R[c];if(!e)throw new L(K.m);ha(e.node,d);return 0}catch(g){return"undefined"!==typeof FS&&g instanceof L||y(g),-g.g}},_emscripten_memcpy_big:function(a,b,c){G.set(G.subarray(b,b+c),a);return a},_getenv:$c,_gettimeofday:function(a){var b=Date.now();C[a>>2]=b/1E3|0;C[a+4>>2]=b%1E3*1E3|0;return 0},_llvm_log10_f64:function(){return ad.apply(null, 189 | arguments)},_llvm_trap:function(){y("trap!")},_localtime:function(a){bd();a=new Date(1E3*C[a>>2]);C[Z>>2]=a.getSeconds();C[Z+4>>2]=a.getMinutes();C[Z+8>>2]=a.getHours();C[Z+12>>2]=a.getDate();C[Z+16>>2]=a.getMonth();C[Z+20>>2]=a.getFullYear()-1900;C[Z+24>>2]=a.getDay();var b=new Date(a.getFullYear(),0,1);C[Z+28>>2]=(a.getTime()-b.getTime())/864E5|0;C[Z+36>>2]=-(60*a.getTimezoneOffset());var c=(new Date(2E3,6,1)).getTimezoneOffset();b=b.getTimezoneOffset();a=(c!=b&&a.getTimezoneOffset()==Math.min(b, 190 | c))|0;C[Z+32>>2]=a;a=C[fd()+(a?4:0)>>2];C[Z+40>>2]=a;return Z},_nanosleep:function(a,b){var c=C[a>>2];a=C[a+4>>2];0!==b&&(C[b>>2]=0,C[b+4>>2]=0);return gd(1E6*c+a/1E3)},_sysconf:function(a){switch(a){case 30:return 16384;case 85:return 131068;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809; 191 | case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32; 192 | case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1E3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"===typeof navigator?navigator.hardwareConcurrency||1:1}Eb(K.h);return-1}, 193 | _time:function(a){var b=Date.now()/1E3|0;a&&(C[a>>2]=b);return b},_utimes:function(a,b){if(b){var c=1E3*C[b+8>>2];c+=C[b+12>>2]/1E3}else c=Date.now();a=H(a);try{b=c;var d=U(a,{G:!0}).node;d.c.l(d,{timestamp:Math.max(b,c)});return 0}catch(e){a=e;if(!(a instanceof L)){a+=" : ";a:{d=Error();if(!d.stack){try{throw Error(0);}catch(g){d=g}if(!d.stack){d="(no stack trace available)";break a}}d=d.stack.toString()}f.extraStackTrace&&(d+="\n"+f.extraStackTrace());d=$a(d);throw a+d;}Eb(a.g);return-1}},DYNAMICTOP_PTR:D, 194 | STACKTOP:ib};var jd=f.asm(f.Fa,f.Ga,buffer);f.asm=jd;f._RegisterExtensionFunctions=function(){return f.asm._RegisterExtensionFunctions.apply(null,arguments)};var Bb=f.___emscripten_environ_constructor=function(){return f.asm.___emscripten_environ_constructor.apply(null,arguments)};f.___errno_location=function(){return f.asm.___errno_location.apply(null,arguments)}; 195 | var ed=f.__get_daylight=function(){return f.asm.__get_daylight.apply(null,arguments)},dd=f.__get_timezone=function(){return f.asm.__get_timezone.apply(null,arguments)},fd=f.__get_tzname=function(){return f.asm.__get_tzname.apply(null,arguments)},lb=f._emscripten_replace_memory=function(){return f.asm._emscripten_replace_memory.apply(null,arguments)},da=f._free=function(){return f.asm._free.apply(null,arguments)},Ya=f._malloc=function(){return f.asm._malloc.apply(null,arguments)},hd=f._memalign=function(){return f.asm._memalign.apply(null, 196 | arguments)},id=f._memset=function(){return f.asm._memset.apply(null,arguments)};f._sqlite3_bind_blob=function(){return f.asm._sqlite3_bind_blob.apply(null,arguments)};f._sqlite3_bind_double=function(){return f.asm._sqlite3_bind_double.apply(null,arguments)};f._sqlite3_bind_int=function(){return f.asm._sqlite3_bind_int.apply(null,arguments)};f._sqlite3_bind_parameter_index=function(){return f.asm._sqlite3_bind_parameter_index.apply(null,arguments)}; 197 | f._sqlite3_bind_text=function(){return f.asm._sqlite3_bind_text.apply(null,arguments)};f._sqlite3_changes=function(){return f.asm._sqlite3_changes.apply(null,arguments)};f._sqlite3_clear_bindings=function(){return f.asm._sqlite3_clear_bindings.apply(null,arguments)};f._sqlite3_close_v2=function(){return f.asm._sqlite3_close_v2.apply(null,arguments)};f._sqlite3_column_blob=function(){return f.asm._sqlite3_column_blob.apply(null,arguments)}; 198 | f._sqlite3_column_bytes=function(){return f.asm._sqlite3_column_bytes.apply(null,arguments)};f._sqlite3_column_double=function(){return f.asm._sqlite3_column_double.apply(null,arguments)};f._sqlite3_column_name=function(){return f.asm._sqlite3_column_name.apply(null,arguments)};f._sqlite3_column_text=function(){return f.asm._sqlite3_column_text.apply(null,arguments)};f._sqlite3_column_type=function(){return f.asm._sqlite3_column_type.apply(null,arguments)}; 199 | f._sqlite3_create_function_v2=function(){return f.asm._sqlite3_create_function_v2.apply(null,arguments)};f._sqlite3_data_count=function(){return f.asm._sqlite3_data_count.apply(null,arguments)};f._sqlite3_errmsg=function(){return f.asm._sqlite3_errmsg.apply(null,arguments)};f._sqlite3_exec=function(){return f.asm._sqlite3_exec.apply(null,arguments)};f._sqlite3_finalize=function(){return f.asm._sqlite3_finalize.apply(null,arguments)}; 200 | f._sqlite3_free=function(){return f.asm._sqlite3_free.apply(null,arguments)};f._sqlite3_open=function(){return f.asm._sqlite3_open.apply(null,arguments)};f._sqlite3_prepare_v2=function(){return f.asm._sqlite3_prepare_v2.apply(null,arguments)};f._sqlite3_reset=function(){return f.asm._sqlite3_reset.apply(null,arguments)};f._sqlite3_result_double=function(){return f.asm._sqlite3_result_double.apply(null,arguments)};f._sqlite3_result_null=function(){return f.asm._sqlite3_result_null.apply(null,arguments)}; 201 | f._sqlite3_result_text=function(){return f.asm._sqlite3_result_text.apply(null,arguments)};f._sqlite3_step=function(){return f.asm._sqlite3_step.apply(null,arguments)};f._sqlite3_value_blob=function(){return f.asm._sqlite3_value_blob.apply(null,arguments)};f._sqlite3_value_bytes=function(){return f.asm._sqlite3_value_bytes.apply(null,arguments)};f._sqlite3_value_double=function(){return f.asm._sqlite3_value_double.apply(null,arguments)}; 202 | f._sqlite3_value_int=function(){return f.asm._sqlite3_value_int.apply(null,arguments)};f._sqlite3_value_text=function(){return f.asm._sqlite3_value_text.apply(null,arguments)};f._sqlite3_value_type=function(){return f.asm._sqlite3_value_type.apply(null,arguments)};var h=f.stackAlloc=function(){return f.asm.stackAlloc.apply(null,arguments)},pa=f.stackRestore=function(){return f.asm.stackRestore.apply(null,arguments)},la=f.stackSave=function(){return f.asm.stackSave.apply(null,arguments)}; 203 | f.dynCall_vi=function(){return f.asm.dynCall_vi.apply(null,arguments)};f.asm=jd;f.cwrap=function(a,b,c,d){c=c||[];var e=c.every(function(a){return"number"===a});return"string"!==b&&e&&!d?Ka(a):function(){var d=c,e=arguments,n=Ka(a),v=[],A=0;if(e)for(var w=0;w