├── .gitignore
├── .npmignore
├── .vscode
└── settings.json
├── Dockerfile
├── LICENSE
├── README.md
├── lib
└── ramda.min.js
├── package-lock.json
├── package.json
├── scripts
├── install.js
└── uninstall.js
├── src
├── commands
│ ├── exec.ts
│ ├── modules.ts
│ └── version.ts
├── core
│ ├── logger.ts
│ └── rpsconfig.default.json
├── doc-content.ts
├── format
│ └── error_msg.ts
├── rps-actions.ts
├── rps-install.ts
├── rps-module.ts
├── rps-modules.ts
├── rps-remove.ts
├── rps-verify.ts
└── rps.ts
├── templates
├── c3-chart.html
└── index.html
└── tsconfig.json
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Dependency directories
3 | node_modules/
4 |
5 | src/*.d.ts
6 | src/*.js
7 |
8 |
9 | src/commands/*.d.ts
10 | src/commands/*.js
11 |
12 | build
13 |
14 | .rpscript
15 |
16 | *.rps
17 | *.csv
18 | *.yaml
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | example
2 | src
3 | test
4 | .vscode
5 | .rpscript
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "mocha.files.glob": "test/**.ts",
3 | "mocha.options": {
4 | "compilers": "ts:ts-node/register"
5 | },
6 | "mocha.requires": [
7 | "ts-node/register"
8 | ],
9 | "mocha.files.ignore": []
10 | }
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:8.11.3-slim
2 |
3 | RUN npm install -g rpscript
4 | RUN rps install basic
5 | RUN echo "log 'hello world'" > test.rps
6 |
7 | CMD rps test.rps
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RPSCRIPT
2 |
3 | [](https://badge.fury.io/js/rpscript)
4 |
5 |
6 | A simple scripting language to automate the boring stuff.
7 |
8 | RPScript provides a framework that simplifies automation. The syntax is designed to be intuitive and straightforward, allowing you to write scripts without the need for in-depth programming knowledge.
9 |
10 | In short, it allows you to replace this:
11 | ```
12 | var R = require('ramda');
13 |
14 | console.log( R.repeat("Hello world",3) );
15 | ```
16 |
17 | with this:
18 | ```
19 | log repeat "Hello world" 3
20 | ```
21 |
22 | This:
23 | ```
24 | var download = require('download');
25 | var csvParse = require('csv-parse/lib/sync');
26 | var AdmZip = require('adm-zip');
27 | var R = require('ramda');
28 | var fs = require('fs');
29 |
30 | download('https://data.gov.sg/dataset/dba9594b-fb5c-41c5-bb7c-92860ee31aeb/download', '.').then(() => {
31 | var zip = new AdmZip("./download.zip");
32 |
33 | zip.extractAllTo("./temp/");
34 |
35 | var content = fs.readFileSync('temp/data-gov-sg-dataset-listing.csv');
36 |
37 | var orgs = csvParse(content , {columns:true});
38 |
39 | var orgList = R.uniq(R.pluck('organisation',orgs));
40 |
41 | console.log(orgList); //print out the list of organisations
42 | });
43 |
44 | ```
45 | with this:
46 | ```
47 | download "https://data.gov.sg/dataset/dba9594b-fb5c-41c5-bb7c-92860ee31aeb/download"
48 |
49 | extract "download.zip" "./temp/"
50 |
51 | csv-to-data --columns=true read-file "temp/data-gov-sg-dataset-listing.csv" | as "dataset"
52 |
53 | log uniq pluck 'organisation' $dataset
54 | ```
55 |
56 |
57 |
58 | ## Installation
59 |
60 | Prerequisite: NodeJS
61 |
62 | ```
63 | npm i -g rpscript
64 | ```
65 | This will install a global command line in your machine.
66 |
67 | Module installation.
68 | ```
69 | rps install basic
70 | ```
71 |
72 | Create a file "helloworld.rps" and add this line:
73 | ```
74 | log repeat "hello world " 3
75 | ```
76 |
77 | Go to the terminal, and run the command:
78 | ```
79 | rps helloworld.rps
80 | ```
81 |
82 | ## Getting Started
83 |
84 | Getting started guide is available at [Getting Started](http://www.rpscript.com/tutorial-gettingstarted.html).
85 |
86 | ## Usage
87 |
88 | Usage guide is available at [Usage](http://www.rpscript.com/tutorial-usage.html)
89 |
90 | ## Usage
91 |
92 | [Hello world](http://www.rpscript.com/tutorial-helloworld.html)
93 |
94 | [Ascii Art with Figlet](http://www.rpscript.com/tutorial-asciiart.html)
95 |
96 | [Compression](http://www.rpscript.com/tutorial-compression.html)
97 |
98 | [Table generation from CSV file](http://www.rpscript.com/tutorial-table.html)
99 |
100 | [Data Analysis from CSV file](http://www.rpscript.com/tutorial-datasetanalysis.html)
101 |
102 | ## Modules
103 |
104 | Name | Status | Description | Doc
105 | --- | --- | --- | ---
106 | [Basic](https://github.com/TYPECASTINGSG/rpscript-api-basic) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-basic) | Basic operation and data manipulation. | [Here](http://www.rpscript.com/Basic.html)
107 | [Beeper](https://github.com/TYPECASTINGSG/rpscript-api-beeper) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-beeper) | Make terminal beeps. | [Here](http://www.rpscript.com/Beeper.html)
108 | [CSV](https://github.com/TYPECASTINGSG/rpscript-api-csv) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-csv) | CSV utility. | [Here](http://www.rpscript.com/CSV.html)
109 | [Date](https://github.com/TYPECASTINGSG/rpscript-api-date) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-date) | Date utility. | [Here](http://www.rpscript.com/Date.html)
110 | [Downloading](https://github.com/TYPECASTINGSG/rpscript-api-download) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-downloading) | File Download. | [Here](http://www.rpscript.com/Download.html)
111 | [Figlet](https://github.com/TYPECASTINGSG/rpscript-api-figlet) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-figlet) | Ascii Art. | [Here](http://www.rpscript.com/Figlet.html)
112 | [File](https://github.com/TYPECASTINGSG/rpscript-api-file) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-file) | File system. | [Here](http://www.rpscript.com/File.html)
113 | [Hogan](https://github.com/TYPECASTINGSG/rpscript-api-hogan) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-hogan) | Moustache Templating. | [Here](http://www.rpscript.com/Hogan.html)
114 | [Notifier](https://github.com/TYPECASTINGSG/rpscript-api-notifier) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-notifier) | Desktop Notification. | [Here](http://www.rpscript.com/Notifier.html)
115 | [Open](https://github.com/TYPECASTINGSG/rpscript-api-open) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-open) | Open a file or url in the user's preferred application. | [Here](http://www.rpscript.com/Open.html)
116 | [Zip](https://github.com/TYPECASTINGSG/rpscript-api-adm-zip) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-zip) | File compression and extraction. | [Here](http://www.rpscript.com/Zip.html)
117 | [Request](https://github.com/TYPECASTINGSG/rpscript-api-request) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-request) | Http call. | [Here](http://www.rpscript.com/Request.html)
118 | [Cheerio](https://github.com/TYPECASTINGSG/rpscript-api-cheerio) | [](https://badge.fury.io/js/%40typecasting%2Frpscript-api-cheerio) | jQuery style traversal and manipulation. | [Here](http://www.rpscript.com/Cheerio.html)
119 | _ | _| More coming soon | _
120 |
121 | ## FAQ
122 |
123 | **What is RPScript?**
124 |
125 | RPScript is a scripting language for process automation.
126 |
127 | **Why do I need RPScript if I can use Python, Javascript for automation?**
128 |
129 | Unlike general purpose languages such as Python and Javascript, RPScript has only one specific goal, process automation.
130 |
131 | General purpose languages are powerful and flexible. However, it tends to compensate by having complicated syntax and language features. In the end, you have to deal with boilerplates and unnecessary steps, making it hard to perform even a simple task.
132 |
133 | RPScript goal is to make the syntax compact. Ideally, every action models as close to a single process as possible.
134 |
135 | **Is it stable?**
136 |
137 | It is currently in Alpha; I will appreciate if you can give it a try and provide your valuable feedback.
138 |
139 | **Is rpscript a node.js library?**
140 |
141 | RPScript is a transpiler that transpiles to javascript. It runs on top of Node.JS.
142 |
143 | Most, if not, all the modules are wrappers that utilize what that the npm ecosystem already provided.
144 |
145 | ## Creator
146 |
147 | **James Chong (@wei3hua2)**
148 | [Github](https://github.com/wei3hua2)
149 | [Twitter](https://twitter.com/wei3hua2)
150 | [Email](mailto:james.chong@typecasting.sg)
151 |
152 | ## Changelog
153 |
154 | 0.3.1 - Fixes: #1 #2
155 |
156 | 0.3.0 - Initial alpha release
157 |
158 | ## Copyright and Licence
159 |
160 | Code released under Apache 2.0
161 |
162 | Image created by Freepik
--------------------------------------------------------------------------------
/lib/ramda.min.js:
--------------------------------------------------------------------------------
1 | !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.R={})}(this,function(t){"use strict";function n(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function r(t){return function r(e){return 0===arguments.length||n(e)?r:t.apply(this,arguments)}}function e(t){return function e(u,i){switch(arguments.length){case 0:return e;case 1:return n(u)?e:r(function(n){return t(u,n)});default:return n(u)&&n(i)?e:n(u)?r(function(n){return t(n,i)}):n(i)?r(function(n){return t(u,n)}):t(u,i)}}}function u(t,n){t=t||[],n=n||[];var r,e=t.length,u=n.length,i=[];for(r=0;e>r;)i[i.length]=t[r],r+=1;for(r=0;u>r;)i[i.length]=n[r],r+=1;return i}function i(t,n){switch(t){case 0:return function(){return n.apply(this,arguments)};case 1:return function(t){return n.apply(this,arguments)};case 2:return function(t,r){return n.apply(this,arguments)};case 3:return function(t,r,e){return n.apply(this,arguments)};case 4:return function(t,r,e,u){return n.apply(this,arguments)};case 5:return function(t,r,e,u,i){return n.apply(this,arguments)};case 6:return function(t,r,e,u,i,o){return n.apply(this,arguments)};case 7:return function(t,r,e,u,i,o,c){return n.apply(this,arguments)};case 8:return function(t,r,e,u,i,o,c,a){return n.apply(this,arguments)};case 9:return function(t,r,e,u,i,o,c,a,s){return n.apply(this,arguments)};case 10:return function(t,r,e,u,i,o,c,a,s,f){return n.apply(this,arguments)};default:throw Error("First argument to _arity must be a non-negative integer no greater than ten")}}function o(t,r,e){return function(){for(var u=[],c=0,a=t,s=0;r.length>s||arguments.length>c;){var f;s>=r.length||n(r[s])&&arguments.length>c?(f=arguments[c],c+=1):f=r[s],u[s]=f,n(f)||(a-=1),s+=1}return a>0?i(a,o(t,u,e)):e.apply(this,u)}}function c(t){return function u(i,o,c){switch(arguments.length){case 0:return u;case 1:return n(i)?u:e(function(n,r){return t(i,n,r)});case 2:return n(i)&&n(o)?u:n(i)?e(function(n,r){return t(n,o,r)}):n(o)?e(function(n,r){return t(i,n,r)}):r(function(n){return t(i,o,n)});default:return n(i)&&n(o)&&n(c)?u:n(i)&&n(o)?e(function(n,r){return t(n,r,c)}):n(i)&&n(c)?e(function(n,r){return t(n,o,r)}):n(o)&&n(c)?e(function(n,r){return t(i,n,r)}):n(i)?r(function(n){return t(n,o,c)}):n(o)?r(function(n){return t(i,n,c)}):n(c)?r(function(n){return t(i,o,n)}):t(i,o,c)}}}function a(t){return"function"==typeof t["@@transducer/step"]}function s(t,n,r){return function(){if(0===arguments.length)return r();var e=Array.prototype.slice.call(arguments,0),u=e.pop();if(!At(u)){for(var i=0;t.length>i;){if("function"==typeof u[t[i]])return u[t[i]].apply(u,e);i+=1}if(a(u))return n.apply(null,e)(u)}return r.apply(this,arguments)}}function f(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}function l(t,n){this.xf=n,this.f=t,this.all=!0}function p(t,n){for(var r=0,e=n.length,u=Array(e);e>r;)u[r]=t(n[r]),r+=1;return u}function h(t){return"[object String]"===Object.prototype.toString.call(t)}function y(t){this.f=t}function d(t){return new y(t)}function g(t,n,r){for(var e=0,u=r.length;u>e;){if((n=t["@@transducer/step"](n,r[e]))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e+=1}return t["@@transducer/result"](n)}function v(t,n,r){for(var e=r.next();!e.done;){if((n=t["@@transducer/step"](n,e.value))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e=r.next()}return t["@@transducer/result"](n)}function m(t,n,r,e){return t["@@transducer/result"](r[e](qt(t["@@transducer/step"],t),n))}function b(t,n,r){if("function"==typeof t&&(t=d(t)),_t(r))return g(t,n,r);if("function"==typeof r["fantasy-land/reduce"])return m(t,n,r,"fantasy-land/reduce");if(null!=r[kt])return v(t,n,r[kt]());if("function"==typeof r.next)return v(t,n,r);if("function"==typeof r.reduce)return m(t,n,r,"reduce");throw new TypeError("reduce: list must be array or iterable")}function x(t,n){this.xf=n,this.f=t}function w(t,n){return Object.prototype.hasOwnProperty.call(n,t)}function j(t,n){this.xf=n,this.f=t,this.any=!1}function A(t,n){this.xf=n,this.pos=0,this.full=!1,this.acc=Array(t)}function O(t){return"[object Function]"===Object.prototype.toString.call(t)}function S(t){return function n(r){for(var e,u,i,o=[],c=0,a=r.length;a>c;){if(_t(r[c]))for(i=0,u=(e=t?n(r[c]):r[c]).length;u>i;)o[o.length]=e[i],i+=1;else o[o.length]=r[c];c+=1}return o}}function E(t){return{"@@transducer/value":t,"@@transducer/reduced":!0}}function _(t){return RegExp(t.source,(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":""))}function q(t,n,r,e){var u=function(u){for(var i=n.length,o=0;i>o;){if(t===n[o])return r[o];o+=1}n[o+1]=t,r[o+1]=u;for(var c in t)u[c]=e?q(t[c],n,r,!0):t[c];return u};switch(mn(t)){case"Object":return u({});case"Array":return u([]);case"Date":return new Date(t.valueOf());case"RegExp":return _(t);default:return t}}function k(t,n){return function(){return n.call(this,t.apply(this,arguments))}}function N(t,n){return function(){var r=arguments.length;if(0===r)return n();var e=arguments[r-1];return At(e)||"function"!=typeof e[t]?n.apply(this,arguments):e[t].apply(e,Array.prototype.slice.call(arguments,0,r-1))}}function I(){if(0===arguments.length)throw Error("pipe requires at least one argument");return i(arguments[0].length,Mt(k,arguments[0],On(arguments)))}function W(){if(0===arguments.length)throw Error("compose requires at least one argument");return I.apply(this,Sn(arguments))}function P(){if(0===arguments.length)throw Error("composeK requires at least one argument");var t=Array.prototype.slice.call(arguments),n=t.pop();return W(W.apply(this,Rt(gn,t)),n)}function C(t,n){return function(){var r=this;return t.apply(r,arguments).then(function(t){return n.call(r,t)})}}function T(){if(0===arguments.length)throw Error("pipeP requires at least one argument");return i(arguments[0].length,Mt(C,arguments[0],On(arguments)))}function B(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}function F(t,n,r){for(var e=0,u=r.length;u>e;){if(t(n,r[e]))return!0;e+=1}return!1}function R(t){var n=(t+"").match(/^function (\w*)/);return null==n?"":n[1]}function U(t,n,r,e){function u(t,n){return D(t,n,r.slice(),e.slice())}var i=B(t);return!F(function(t,n){return!F(u,n,t)},B(n),i)}function D(t,n,r,e){if(En(t,n))return!0;var u=mn(t);if(u!==mn(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===R(t.constructor))return t===n;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof n||!En(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!En(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var i=r.length-1;i>=0;){if(r[i]===t)return e[i]===n;i-=1}switch(u){case"Map":return t.size===n.size&&U(t.entries(),n.entries(),r.concat([t]),e.concat([n]));case"Set":return t.size===n.size&&U(t.values(),n.values(),r.concat([t]),e.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var o=Ft(t);if(o.length!==Ft(n).length)return!1;var c=r.concat([t]),a=e.concat([n]);for(i=o.length-1;i>=0;){var s=o[i];if(!w(s,n)||!D(n[s],t[s],c,a))return!1;i-=1}return!0}function z(t,n,r){var e,u;if("function"==typeof t.indexOf)switch(typeof n){case"number":if(0===n){for(e=1/n;t.length>r;){if(0===(u=t[r])&&1/u===e)return r;r+=1}return-1}if(n!==n){for(;t.length>r;){if("number"==typeof(u=t[r])&&u!==u)return r;r+=1}return-1}return t.indexOf(n,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(n,r);case"object":if(null===n)return t.indexOf(n,r)}for(;t.length>r;){if(_n(t[r],n))return r;r+=1}return-1}function M(t,n){return z(n,t,0)>=0}function L(t){return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}function K(t){return function(){return!t.apply(this,arguments)}}function V(t,n){for(var r=0,e=n.length,u=[];e>r;)t(n[r])&&(u[u.length]=n[r]),r+=1;return u}function $(t){return"[object Object]"===Object.prototype.toString.call(t)}function H(t,n){this.xf=n,this.f=t}function J(t,n){var r=function(r){var e=n.concat([t]);return M(r,e)?"":J(r,e)},e=function(t,n){return p(function(n){return L(n)+": "+r(t[n])},n.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+p(r,t).join(", ")+"))";case"[object Array]":return"["+p(r,t).concat(e(t,In(function(t){return/^\d+$/.test(t)},Ft(t)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof t?"new Boolean("+r(t.valueOf())+")":""+t;case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):L(kn(t)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof t?"new Number("+r(t.valueOf())+")":1/t==-1/0?"-0":t.toString(10);case"[object String]":return"object"==typeof t?"new String("+r(t.valueOf())+")":L(t);case"[object Undefined]":return"undefined";default:if("function"==typeof t.toString){var u=""+t;if("[object Object]"!==u)return u}return"{"+e(t,Ft(t)).join(", ")+"}"}}function X(t,n,r,e){this.valueFn=t,this.valueAcc=n,this.keyFn=r,this.xf=e,this.inputs={}}function Y(t,n){this.xf=n,this.n=t}function Z(t,n){this.xf=n,this.n=t,this.i=0}function G(t,n){this.xf=n,this.pos=0,this.full=!1,this.acc=Array(t)}function Q(t,n){this.f=t,this.retained=[],this.xf=n}function tt(t,n){this.xf=n,this.pred=t,this.lastValue=void 0,this.seenFirstValue=!1}function nt(t,n){this.xf=n,this.f=t}function rt(t,n){this.xf=n,this.f=t,this.found=!1}function et(t,n){this.xf=n,this.f=t,this.idx=-1,this.found=!1}function ut(t,n){this.xf=n,this.f=t}function it(t,n){this.xf=n,this.f=t,this.idx=-1,this.lastIdx=-1}function ot(t){return t}function ct(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}function at(t,n,r){var e,u=typeof t;switch(u){case"string":case"number":return 0===t&&1/t==-1/0?!!r._items["-0"]||(n&&(r._items["-0"]=!0),!1):null!==r._nativeSet?n?(e=r._nativeSet.size,r._nativeSet.add(t),r._nativeSet.size===e):r._nativeSet.has(t):u in r._items?t in r._items[u]||(n&&(r._items[u][t]=!0),!1):(n&&(r._items[u]={},r._items[u][t]=!0),!1);case"boolean":if(u in r._items){var i=t?1:0;return!!r._items[u][i]||(n&&(r._items[u][i]=!0),!1)}return n&&(r._items[u]=t?[!1,!0]:[!0,!1]),!1;case"function":return null!==r._nativeSet?n?(e=r._nativeSet.size,r._nativeSet.add(t),r._nativeSet.size===e):r._nativeSet.has(t):u in r._items?!!M(t,r._items[u])||(n&&r._items[u].push(t),!1):(n&&(r._items[u]=[t]),!1);case"undefined":return!!r._items[u]||(n&&(r._items[u]=!0),!1);case"object":if(null===t)return!!r._items.null||(n&&(r._items.null=!0),!1);default:return(u=Object.prototype.toString.call(t))in r._items?!!M(t,r._items[u])||(n&&r._items[u].push(t),!1):(n&&(r._items[u]=[t]),!1)}}function st(t){if(a(t))return t;if(_t(t))return $r;if("string"==typeof t)return Hr;if("object"==typeof t)return Jr;throw Error("Cannot create transformer for "+t)}function ft(t){return"[object Number]"===Object.prototype.toString.call(t)}function lt(t){return e(function(n,r){return i(Math.max(0,n.length-r.length),function(){return n.apply(this,t(r,arguments))})})}function pt(t,n){this.xf=n,this.f=t}function ht(t,n){this.xf=n,this.f=t}function yt(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var dt=r(function(t){return function(){return t}}),gt=dt(!1),vt=dt(!0),mt={"@@functional/placeholder":!0},bt=e(function(t,n){return+t+ +n}),xt=e(function(t,n){return 1===t?r(n):i(t,o(t,[],n))}),wt=r(function(t){return xt(t.length,function(){var n=0,r=arguments[0],e=arguments[arguments.length-1],i=Array.prototype.slice.call(arguments,0);return i[0]=function(){var t=r.apply(this,u(arguments,[n,e]));return n+=1,t},t.apply(this,i)})}),jt=c(function(t,n,r){if(n>=r.length||-r.length>n)return r;var e=(0>n?r.length:0)+n,i=u(r);return i[e]=t(r[e]),i}),At=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},Ot={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};l.prototype["@@transducer/init"]=Ot.init,l.prototype["@@transducer/result"]=function(t){return this.all&&(t=this.xf["@@transducer/step"](t,!0)),this.xf["@@transducer/result"](t)},l.prototype["@@transducer/step"]=function(t,n){return this.f(n)||(this.all=!1,t=f(this.xf["@@transducer/step"](t,!1))),t};var St=e(s(["all"],e(function(t,n){return new l(t,n)}),function(t,n){for(var r=0;n.length>r;){if(!t(n[r]))return!1;r+=1}return!0})),Et=e(function(t,n){return n>t?n:t}),_t=r(function(t){return!!At(t)||!!t&&("object"==typeof t&&(!h(t)&&(1===t.nodeType?!!t.length:0===t.length||t.length>0&&(t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1)))))});y.prototype["@@transducer/init"]=function(){throw Error("init not implemented on XWrap")},y.prototype["@@transducer/result"]=function(t){return t},y.prototype["@@transducer/step"]=function(t,n){return this.f(t,n)};var qt=e(function(t,n){return i(t.length,function(){return t.apply(n,arguments)})}),kt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";x.prototype["@@transducer/init"]=Ot.init,x.prototype["@@transducer/result"]=Ot.result,x.prototype["@@transducer/step"]=function(t,n){return this.xf["@@transducer/step"](t,this.f(n))};var Nt=e(function(t,n){return new x(t,n)}),It=Object.prototype.toString,Wt=function(){return"[object Arguments]"===It.call(arguments)?function(t){return"[object Arguments]"===It.call(t)}:function(t){return w("callee",t)}},Pt=!{toString:null}.propertyIsEnumerable("toString"),Ct=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Tt=function(){return arguments.propertyIsEnumerable("length")}(),Bt=function(t,n){for(var r=0;t.length>r;){if(t[r]===n)return!0;r+=1}return!1},Ft=r("function"!=typeof Object.keys||Tt?function(t){if(Object(t)!==t)return[];var n,r,e=[],u=Tt&&Wt(t);for(n in t)!w(n,t)||u&&"length"===n||(e[e.length]=n);if(Pt)for(r=6;r>=0;)w(n=Ct[r],t)&&!Bt(e,n)&&(e[e.length]=n),r-=1;return e}:function(t){return Object(t)!==t?[]:Object.keys(t)}),Rt=e(s(["fantasy-land/map","map"],Nt,function(t,n){switch(Object.prototype.toString.call(n)){case"[object Function]":return xt(n.length,function(){return t.call(this,n.apply(this,arguments))});case"[object Object]":return b(function(r,e){return r[e]=t(n[e]),r},{},Ft(n));default:return p(t,n)}})),Ut=e(function(t,n){for(var r=n,e=0;t.length>e;){if(null==r)return;r=r[t[e]],e+=1}return r}),Dt=e(function(t,n){return Ut([t],n)}),zt=e(function(t,n){return Rt(Dt(t),n)}),Mt=c(b),Lt=r(function(t){return xt(Mt(Et,0,zt("length",t)),function(){for(var n=0,r=t.length;r>n;){if(!t[n].apply(this,arguments))return!1;n+=1}return!0})}),Kt=e(function(t,n){return t&&n});j.prototype["@@transducer/init"]=Ot.init,j.prototype["@@transducer/result"]=function(t){return this.any||(t=this.xf["@@transducer/step"](t,!1)),this.xf["@@transducer/result"](t)},j.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.any=!0,t=f(this.xf["@@transducer/step"](t,!0))),t};var Vt=e(function(t,n){return new j(t,n)}),$t=e(s(["any"],Vt,function(t,n){for(var r=0;n.length>r;){if(t(n[r]))return!0;r+=1}return!1})),Ht=r(function(t){return xt(Mt(Et,0,zt("length",t)),function(){for(var n=0,r=t.length;r>n;){if(t[n].apply(this,arguments))return!0;n+=1}return!1})}),Jt=e(function(t,n){return"function"==typeof n["fantasy-land/ap"]?n["fantasy-land/ap"](t):"function"==typeof t.ap?t.ap(n):"function"==typeof t?function(r){return t(r)(n(r))}:b(function(t,r){return u(t,Rt(r,n))},[],t)});A.prototype["@@transducer/init"]=Ot.init,A.prototype["@@transducer/result"]=function(t){return this.acc=null,this.xf["@@transducer/result"](t)},A.prototype["@@transducer/step"]=function(t,n){return this.store(n),this.full?this.xf["@@transducer/step"](t,this.getCopy()):t},A.prototype.store=function(t){this.acc[this.pos]=t,(this.pos+=1)===this.acc.length&&(this.pos=0,this.full=!0)},A.prototype.getCopy=function(){return u(Array.prototype.slice.call(this.acc,this.pos),Array.prototype.slice.call(this.acc,0,this.pos))};var Xt=e(s([],e(function(t,n){return new A(t,n)}),function(t,n){for(var r=0,e=n.length-(t-1),u=Array(0>e?0:e);e>r;)u[r]=Array.prototype.slice.call(n,r,r+t),r+=1;return u})),Yt=e(function(t,n){return u(n,[t])}),Zt=e(function(t,n){return t.apply(this,n)}),Gt=r(function(t){for(var n=Ft(t),r=n.length,e=[],u=0;r>u;)e[u]=t[n[u]],u+=1;return e}),Qt=r(function t(n){return n=Rt(function(n){return"function"==typeof n?n:t(n)},n),xt(Mt(Et,0,zt("length",Gt(n))),function(){var t=arguments;return Rt(function(n){return Zt(n,t)},n)})}),tn=e(function(t,n){return n(t)}),nn=c(function(t,n,r){var e=t(n),u=t(r);return u>e?-1:e>u?1:0}),rn=c(function(t,n,r){var e={};for(var u in r)e[u]=r[u];return e[t]=n,e}),en=Number.isInteger||function(t){return t<<0===t},un=r(function(t){return null==t}),on=c(function t(n,r,e){if(0===n.length)return r;var u=n[0];if(n.length>1){var i=!un(e)&&w(u,e)?e[u]:en(n[1])?[]:{};r=t(Array.prototype.slice.call(n,1),r,i)}if(en(u)&&At(e)){var o=[].concat(e);return o[u]=r,o}return rn(u,r,e)}),cn=e(function(t,n){switch(t){case 0:return function(){return n.call(this)};case 1:return function(t){return n.call(this,t)};case 2:return function(t,r){return n.call(this,t,r)};case 3:return function(t,r,e){return n.call(this,t,r,e)};case 4:return function(t,r,e,u){return n.call(this,t,r,e,u)};case 5:return function(t,r,e,u,i){return n.call(this,t,r,e,u,i)};case 6:return function(t,r,e,u,i,o){return n.call(this,t,r,e,u,i,o)};case 7:return function(t,r,e,u,i,o,c){return n.call(this,t,r,e,u,i,o,c)};case 8:return function(t,r,e,u,i,o,c,a){return n.call(this,t,r,e,u,i,o,c,a)};case 9:return function(t,r,e,u,i,o,c,a,s){return n.call(this,t,r,e,u,i,o,c,a,s)};case 10:return function(t,r,e,u,i,o,c,a,s,f){return n.call(this,t,r,e,u,i,o,c,a,s,f)};default:throw Error("First argument to nAry must be a non-negative integer no greater than ten")}}),an=r(function(t){return cn(2,t)}),sn=e(function(t,n){var r=xt(t,n);return xt(t,function(){return b(Jt,Rt(r,arguments[0]),Array.prototype.slice.call(arguments,1))})}),fn=r(function(t){return sn(t.length,t)}),ln=e(function(t,n){return O(t)?function(){return t.apply(this,arguments)&&n.apply(this,arguments)}:fn(Kt)(t,n)}),pn=r(function(t){return xt(t.length,t)}),hn=pn(function(t){return t.apply(this,Array.prototype.slice.call(arguments,1))}),yn=function(t){return{"@@transducer/init":Ot.init,"@@transducer/result":function(n){return t["@@transducer/result"](n)},"@@transducer/step":function(n,r){var e=t["@@transducer/step"](n,r);return e["@@transducer/reduced"]?E(e):e}}},dn=function(t){var n=yn(t);return{"@@transducer/init":Ot.init,"@@transducer/result":function(t){return n["@@transducer/result"](t)},"@@transducer/step":function(t,r){return _t(r)?b(n,t,r):b(n,t,[r])}}},gn=e(s(["fantasy-land/chain","chain"],e(function(t,n){return Rt(t,dn(n))}),function(t,n){return"function"==typeof n?function(r){return t(n(r))(r)}:S(!1)(Rt(t,n))})),vn=c(function(t,n,r){if(t>n)throw Error("min must not be greater than max in clamp(min, max, value)");return t>r?t:r>n?n:r}),mn=r(function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),bn=r(function(t){return null!=t&&"function"==typeof t.clone?t.clone():q(t,[],[],!0)}),xn=r(function(t){return function(n,r){return t(n,r)?-1:t(r,n)?1:0}}),wn=r(function(t){return!t}),jn=fn(wn),An=c(N("slice",function(t,n,r){return Array.prototype.slice.call(r,t,n)})),On=r(N("tail",An(1,1/0))),Sn=r(function(t){return h(t)?t.split("").reverse().join(""):Array.prototype.slice.call(t,0).reverse()}),En=e(function(t,n){return t===n?0!==t||1/t==1/n:t!==t&&n!==n}),_n=e(function(t,n){return D(t,n,[],[])}),qn=function(t){return(10>t?"0":"")+t},kn="function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+qn(t.getUTCMonth()+1)+"-"+qn(t.getUTCDate())+"T"+qn(t.getUTCHours())+":"+qn(t.getUTCMinutes())+":"+qn(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};H.prototype["@@transducer/init"]=Ot.init,H.prototype["@@transducer/result"]=Ot.result,H.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):t};var Nn=e(s(["filter"],e(function(t,n){return new H(t,n)}),function(t,n){return $(n)?b(function(r,e){return t(n[e])&&(r[e]=n[e]),r},{},Ft(n)):V(t,n)})),In=e(function(t,n){return Nn(K(t),n)}),Wn=r(function(t){return J(t,[])}),Pn=e(function(t,n){if(At(t)){if(At(n))return t.concat(n);throw new TypeError(Wn(n)+" is not an array")}if(h(t)){if(h(n))return t+n;throw new TypeError(Wn(n)+" is not a string")}if(null!=t&&O(t["fantasy-land/concat"]))return t["fantasy-land/concat"](n);if(null!=t&&O(t.concat))return t.concat(n);throw new TypeError(Wn(t)+' does not have a method named "concat" or "fantasy-land/concat"')}),Cn=r(function(t){return i(Mt(Et,0,Rt(function(t){return t[0].length},t)),function(){for(var n=0;t.length>n;){if(t[n][0].apply(this,arguments))return t[n][1].apply(this,arguments);n+=1}})}),Tn=e(function(t,n){if(t>10)throw Error("Constructor with greater than ten arguments");return 0===t?function(){return new n}:pn(cn(t,function(t,r,e,u,i,o,c,a,s,f){switch(arguments.length){case 1:return new n(t);case 2:return new n(t,r);case 3:return new n(t,r,e);case 4:return new n(t,r,e,u);case 5:return new n(t,r,e,u,i);case 6:return new n(t,r,e,u,i,o);case 7:return new n(t,r,e,u,i,o,c);case 8:return new n(t,r,e,u,i,o,c,a);case 9:return new n(t,r,e,u,i,o,c,a,s);case 10:return new n(t,r,e,u,i,o,c,a,s,f)}}))}),Bn=r(function(t){return Tn(t.length,t)}),Fn=e(M),Rn=e(function(t,n){return xt(Mt(Et,0,zt("length",n)),function(){var r=arguments,e=this;return t.apply(e,p(function(t){return t.apply(e,r)},n))})});X.prototype["@@transducer/init"]=Ot.init,X.prototype["@@transducer/result"]=function(t){var n;for(n in this.inputs)if(w(n,this.inputs)&&(t=this.xf["@@transducer/step"](t,this.inputs[n]))["@@transducer/reduced"]){t=t["@@transducer/value"];break}return this.inputs=null,this.xf["@@transducer/result"](t)},X.prototype["@@transducer/step"]=function(t,n){var r=this.keyFn(n);return this.inputs[r]=this.inputs[r]||[r,this.valueAcc],this.inputs[r][1]=this.valueFn(this.inputs[r][1],n),t};var Un=o(4,[],s([],o(4,[],function(t,n,r,e){return new X(t,n,r,e)}),function(t,n,r,e){return b(function(e,u){var i=r(u);return e[i]=t(w(i,e)?e[i]:n,u),e},{},e)})),Dn=Un(function(t,n){return t+1},0),zn=bt(-1),Mn=e(function(t,n){return null==n||n!==n?t:n}),Ln=c(function(t,n,r){var e=t(n),u=t(r);return e>u?-1:u>e?1:0}),Kn=e(function(t,n){for(var r=[],e=0,u=t.length;u>e;)M(t[e],n)||M(t[e],r)||(r[r.length]=t[e]),e+=1;return r}),Vn=c(function(t,n,r){for(var e=[],u=0,i=n.length;i>u;)F(t,n[u],r)||F(t,n[u],e)||e.push(n[u]),u+=1;return e}),$n=e(function(t,n){var r={};for(var e in n)r[e]=n[e];return delete r[t],r}),Hn=c(function(t,n,r){var e=Array.prototype.slice.call(r,0);return e.splice(t,n),e}),Jn=c(function(t,n,r){return jt(dt(n),t,r)}),Xn=e(function t(n,r){switch(n.length){case 0:return r;case 1:return en(n[0])?Hn(n[0],1,r):$n(n[0],r);default:var e=n[0],u=Array.prototype.slice.call(n,1);return null==r[e]?r:en(n[0])?Jn(e,t(u,r[e]),r):rn(e,t(u,r[e]),r)}}),Yn=e(function(t,n){return t/n});Y.prototype["@@transducer/init"]=Ot.init,Y.prototype["@@transducer/result"]=Ot.result,Y.prototype["@@transducer/step"]=function(t,n){return this.n>0?(this.n-=1,t):this.xf["@@transducer/step"](t,n)};var Zn=e(s(["drop"],e(function(t,n){return new Y(t,n)}),function(t,n){return An(Math.max(0,t),1/0,n)}));Z.prototype["@@transducer/init"]=Ot.init,Z.prototype["@@transducer/result"]=Ot.result,Z.prototype["@@transducer/step"]=function(t,n){this.i+=1;var r=0===this.n?t:this.xf["@@transducer/step"](t,n);return 0>this.n||this.n>this.i?r:f(r)};var Gn=e(s(["take"],e(function(t,n){return new Z(t,n)}),function(t,n){return An(0,0>t?1/0:t,n)}));G.prototype["@@transducer/init"]=Ot.init,G.prototype["@@transducer/result"]=function(t){return this.acc=null,this.xf["@@transducer/result"](t)},G.prototype["@@transducer/step"]=function(t,n){return this.full&&(t=this.xf["@@transducer/step"](t,this.acc[this.pos])),this.store(n),t},G.prototype.store=function(t){this.acc[this.pos]=t,(this.pos+=1)===this.acc.length&&(this.pos=0,this.full=!0)};var Qn=e(s([],e(function(t,n){return new G(t,n)}),function(t,n){return Gn(n.length>t?n.length-t:0,n)}));Q.prototype["@@transducer/init"]=Ot.init,Q.prototype["@@transducer/result"]=function(t){return this.retained=null,this.xf["@@transducer/result"](t)},Q.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.retain(t,n):this.flush(t,n)},Q.prototype.flush=function(t,n){return t=b(this.xf["@@transducer/step"],t,this.retained),this.retained=[],this.xf["@@transducer/step"](t,n)},Q.prototype.retain=function(t,n){return this.retained.push(n),t};var tr=e(s([],e(function(t,n){return new Q(t,n)}),function(t,n){for(var r=n.length-1;r>=0&&t(n[r]);)r-=1;return An(0,r+1,n)}));tt.prototype["@@transducer/init"]=Ot.init,tt.prototype["@@transducer/result"]=Ot.result,tt.prototype["@@transducer/step"]=function(t,n){var r=!1;return this.seenFirstValue?this.pred(this.lastValue,n)&&(r=!0):this.seenFirstValue=!0,this.lastValue=n,r?t:this.xf["@@transducer/step"](t,n)};var nr=e(function(t,n){return new tt(t,n)}),rr=e(function(t,n){var r=0>t?n.length+t:t;return h(n)?n.charAt(r):n[r]}),er=rr(-1),ur=e(s([],nr,function(t,n){var r=[],e=1,u=n.length;if(0!==u)for(r[0]=n[0];u>e;)t(er(r),n[e])||(r[r.length]=n[e]),e+=1;return r})),ir=r(s([],nr(_n),ur(_n)));nt.prototype["@@transducer/init"]=Ot.init,nt.prototype["@@transducer/result"]=Ot.result,nt.prototype["@@transducer/step"]=function(t,n){if(this.f){if(this.f(n))return t;this.f=null}return this.xf["@@transducer/step"](t,n)};var or=e(s(["dropWhile"],e(function(t,n){return new nt(t,n)}),function(t,n){for(var r=0,e=n.length;e>r&&t(n[r]);)r+=1;return An(r,1/0,n)})),cr=e(function(t,n){return t||n}),ar=e(function(t,n){return O(t)?function(){return t.apply(this,arguments)||n.apply(this,arguments)}:fn(cr)(t,n)}),sr=r(function(t){return null!=t&&"function"==typeof t["fantasy-land/empty"]?t["fantasy-land/empty"]():null!=t&&null!=t.constructor&&"function"==typeof t.constructor["fantasy-land/empty"]?t.constructor["fantasy-land/empty"]():null!=t&&"function"==typeof t.empty?t.empty():null!=t&&null!=t.constructor&&"function"==typeof t.constructor.empty?t.constructor.empty():At(t)?[]:h(t)?"":$(t)?{}:Wt(t)?function(){return arguments}():void 0}),fr=e(function(t,n){return Zn(0>t?0:n.length-t,n)}),lr=e(function(t,n){return _n(fr(t.length,n),t)}),pr=c(function(t,n,r){return _n(t(n),t(r))}),hr=c(function(t,n,r){return _n(n[t],r[t])}),yr=e(function t(n,r){var e,u,i,o={};for(u in r)i=typeof(e=n[u]),o[u]="function"===i?e(r[u]):e&&"object"===i?t(e,r[u]):r[u];return o});rt.prototype["@@transducer/init"]=Ot.init,rt.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,void 0)),this.xf["@@transducer/result"](t)},rt.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.found=!0,t=f(this.xf["@@transducer/step"](t,n))),t};var dr=e(s(["find"],e(function(t,n){return new rt(t,n)}),function(t,n){for(var r=0,e=n.length;e>r;){if(t(n[r]))return n[r];r+=1}}));et.prototype["@@transducer/init"]=Ot.init,et.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,-1)),this.xf["@@transducer/result"](t)},et.prototype["@@transducer/step"]=function(t,n){return this.idx+=1,this.f(n)&&(this.found=!0,t=f(this.xf["@@transducer/step"](t,this.idx))),t};var gr=e(s([],e(function(t,n){return new et(t,n)}),function(t,n){for(var r=0,e=n.length;e>r;){if(t(n[r]))return r;r+=1}return-1}));ut.prototype["@@transducer/init"]=Ot.init,ut.prototype["@@transducer/result"]=function(t){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](t,this.last))},ut.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.last=n),t};var vr=e(s([],e(function(t,n){return new ut(t,n)}),function(t,n){for(var r=n.length-1;r>=0;){if(t(n[r]))return n[r];r-=1}}));it.prototype["@@transducer/init"]=Ot.init,it.prototype["@@transducer/result"]=function(t){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](t,this.lastIdx))},it.prototype["@@transducer/step"]=function(t,n){return this.idx+=1,this.f(n)&&(this.lastIdx=this.idx),t};var mr=e(s([],e(function(t,n){return new it(t,n)}),function(t,n){for(var r=n.length-1;r>=0;){if(t(n[r]))return r;r-=1}return-1})),br=r(S(!0)),xr=r(function(t){return xt(t.length,function(n,r){var e=Array.prototype.slice.call(arguments,0);return e[0]=r,e[1]=n,t.apply(this,e)})}),wr=e(N("forEach",function(t,n){for(var r=n.length,e=0;r>e;)t(n[e]),e+=1;return n})),jr=e(function(t,n){for(var r=Ft(n),e=0;r.length>e;){var u=r[e];t(n[u],u,n),e+=1}return n}),Ar=r(function(t){for(var n={},r=0;t.length>r;)n[t[r][0]]=t[r][1],r+=1;return n}),Or=e(N("groupBy",Un(function(t,n){return null==t&&(t=[]),t.push(n),t},null))),Sr=e(function(t,n){for(var r=[],e=0,u=n.length;u>e;){for(var i=e+1;u>i&&t(n[i-1],n[i]);)i+=1;r.push(n.slice(e,i)),e=i}return r}),Er=e(function(t,n){return t>n}),_r=e(function(t,n){return t>=n}),qr=e(w),kr=e(function(t,n){return t in n}),Nr=rr(0),Ir=r(ot),Wr=c(function(t,n,r){return xt(Math.max(t.length,n.length,r.length),function(){return t.apply(this,arguments)?n.apply(this,arguments):r.apply(this,arguments)})}),Pr=bt(1),Cr=Un(function(t,n){return n},null),Tr=e(function(t,n){return"function"!=typeof n.indexOf||At(n)?z(n,t,0):n.indexOf(t)}),Br=An(0,-1),Fr=c(function(t,n,r){return V(function(n){return F(t,n,r)},n)}),Rr=c(function(t,n,r){t=r.length>t&&t>=0?t:r.length;var e=Array.prototype.slice.call(r,0);return e.splice(t,0,n),e}),Ur=c(function(t,n,r){return t=r.length>t&&t>=0?t:r.length,[].concat(Array.prototype.slice.call(r,0,t),n,Array.prototype.slice.call(r,t))});ct.prototype.add=function(t){return!at(t,!0,this)},ct.prototype.has=function(t){return at(t,!1,this)};var Dr=e(function(t,n){for(var r,e,u=new ct,i=[],o=0;n.length>o;)r=t(e=n[o]),u.add(r)&&i.push(e),o+=1;return i}),zr=Dr(Ir),Mr=e(function(t,n){var r,e;return t.length>n.length?(r=t,e=n):(r=n,e=t),zr(V(xr(M)(r),e))}),Lr=e(N("intersperse",function(t,n){for(var r=[],e=0,u=n.length;u>e;)e===u-1?r.push(n[e]):r.push(n[e],t),e+=1;return r})),Kr="function"==typeof Object.assign?Object.assign:function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,e=arguments.length;e>r;){var u=arguments[r];if(null!=u)for(var i in u)w(i,u)&&(n[i]=u[i]);r+=1}return n},Vr=e(function(t,n){var r={};return r[t]=n,r}),$r={"@@transducer/init":Array,"@@transducer/step":function(t,n){return t.push(n),t},"@@transducer/result":ot},Hr={"@@transducer/init":String,"@@transducer/step":function(t,n){return t+n},"@@transducer/result":ot},Jr={"@@transducer/init":Object,"@@transducer/step":function(t,n){return Kr(t,_t(n)?Vr(n[0],n[1]):n)},"@@transducer/result":ot},Xr=c(function(t,n,r){return a(t)?b(n(t),t["@@transducer/init"](),r):b(n(st(t)),q(t,[],[],!1),r)}),Yr=r(function(t){for(var n=Ft(t),r=n.length,e=0,u={};r>e;){var i=n[e],o=t[i],c=w(o,u)?u[o]:u[o]=[];c[c.length]=i,e+=1}return u}),Zr=r(function(t){for(var n=Ft(t),r=n.length,e=0,u={};r>e;){var i=n[e];u[t[i]]=i,e+=1}return u}),Gr=e(function(t,n){return xt(t+1,function(){var r=arguments[t];if(null!=r&&O(r[n]))return r[n].apply(r,Array.prototype.slice.call(arguments,0,t));throw new TypeError(Wn(r)+' does not have a method named "'+n+'"')})}),Qr=e(function(t,n){return null!=n&&n.constructor===t||n instanceof t}),te=r(function(t){return null!=t&&_n(t,sr(t))}),ne=Gr(1,"join"),re=r(function(t){return Rn(function(){return Array.prototype.slice.call(arguments,0)},t)}),ee=r(function(t){var n,r=[];for(n in t)r[r.length]=n;return r}),ue=e(function(t,n){if("function"!=typeof n.lastIndexOf||At(n)){for(var r=n.length-1;r>=0;){if(_n(n[r],t))return r;r-=1}return-1}return n.lastIndexOf(t)}),ie=r(function(t){return null!=t&&ft(t.length)?t.length:NaN}),oe=e(function(t,n){return function(r){return function(e){return Rt(function(t){return n(t,e)},r(t(e)))}}}),ce=r(function(t){return oe(rr(t),Jn(t))}),ae=r(function(t){return oe(Ut(t),on(t))}),se=r(function(t){return oe(Dt(t),rn(t))}),fe=e(function(t,n){return n>t}),le=e(function(t,n){return n>=t}),pe=c(function(t,n,r){for(var e=0,u=r.length,i=[],o=[n];u>e;)o=t(o[0],r[e]),i[e]=o[1],e+=1;return[o[0],i]}),he=c(function(t,n,r){for(var e=r.length-1,u=[],i=[n];e>=0;)i=t(r[e],i[0]),u[e]=i[1],e-=1;return[u,i[0]]}),ye=e(function(t,n){return b(function(r,e){return r[e]=t(n[e],e,n),r},{},Ft(n))}),de=e(function(t,n){return n.match(t)||[]}),ge=e(function(t,n){return en(t)?!en(n)||1>n?NaN:(t%n+n)%n:NaN}),ve=c(function(t,n,r){return t(r)>t(n)?r:n}),me=Mt(bt,0),be=r(function(t){return me(t)/t.length}),xe=r(function(t){var n=t.length;if(0===n)return NaN;var r=2-n%2,e=(n-r)/2;return be(Array.prototype.slice.call(t,0).sort(function(t,n){return n>t?-1:t>n?1:0}).slice(e,e+r))}),we=e(function(t,n){var r={};return i(n.length,function(){var e=t.apply(this,arguments);return w(e,r)||(r[e]=n.apply(this,arguments)),r[e]})}),je=we(function(){return Wn(arguments)}),Ae=e(function(t,n){return Kr({},t,n)}),Oe=r(function(t){return Kr.apply(null,[{}].concat(t))}),Se=c(function(t,n,r){var e,u={};for(e in n)w(e,n)&&(u[e]=w(e,r)?t(e,n[e],r[e]):n[e]);for(e in r)w(e,r)&&!w(e,u)&&(u[e]=r[e]);return u}),Ee=c(function t(n,r,e){return Se(function(r,e,u){return $(e)&&$(u)?t(n,e,u):n(r,e,u)},r,e)}),_e=e(function(t,n){return Ee(function(t,n,r){return n},t,n)}),qe=e(function(t,n){return Ee(function(t,n,r){return r},t,n)}),ke=c(function(t,n,r){return Ee(function(n,r,e){return t(r,e)},n,r)}),Ne=c(function(t,n,r){return Se(function(n,r,e){return t(r,e)},n,r)}),Ie=e(function(t,n){return t>n?n:t}),We=c(function(t,n,r){return t(r)t?1:t+1,function(){return rr(t,arguments)})}),Re=c(function(t,n,r){return t(n(r))}),Ue=r(function(t){return[t]}),De=e(function(t,n){for(var r={},e={},u=0,i=t.length;i>u;)e[t[u]]=1,u+=1;for(var o in n)e.hasOwnProperty(o)||(r[o]=n[o]);return r}),ze=r(function(t){var n,r=!1;return i(t.length,function(){return r?n:(r=!0,n=t.apply(this,arguments))})}),Me=function(t){return{value:t,map:function(n){return Me(n(t))}}},Le=c(function(t,n,r){return t(function(t){return Me(n(t))})(r).value}),Ke=e(function(t,n){return[t,n]}),Ve=lt(u),$e=lt(xr(u)),He=re([Nn,In]),Je=c(function(t,n,r){return _n(Ut(t,r),n)}),Xe=c(function(t,n,r){return Mn(t,Ut(n,r))}),Ye=c(function(t,n,r){return n.length>0&&t(Ut(n,r))}),Ze=e(function(t,n){for(var r={},e=0;t.length>e;)t[e]in n&&(r[t[e]]=n[t[e]]),e+=1;return r}),Ge=e(function(t,n){for(var r={},e=0,u=t.length;u>e;){var i=t[e];r[i]=n[i],e+=1}return r}),Qe=e(function(t,n){var r={};for(var e in n)t(n[e],e,n)&&(r[e]=n[e]);return r}),tu=e(function(t,n){return u([t],n)}),nu=Mt(Ce,1),ru=e(function(t,n){return xt(n.length,function(){for(var r=[],e=0;n.length>e;)r.push(n[e].call(this,arguments[e])),e+=1;return t.apply(this,r.concat(Array.prototype.slice.call(arguments,n.length)))})}),eu=ru(p,[Ge,Ir]),uu=c(function(t,n,r){return _n(n,r[t])}),iu=c(function(t,n,r){return Qr(t,r[n])}),ou=c(function(t,n,r){return null!=r&&w(n,r)?r[n]:t}),cu=c(function(t,n,r){return t(r[n])}),au=e(function(t,n){for(var r=t.length,e=[],u=0;r>u;)e[u]=n[t[u]],u+=1;return e}),su=e(function(t,n){if(!ft(t)||!ft(n))throw new TypeError("Both arguments to range must be numbers");for(var r=[],e=t;n>e;)r.push(e),e+=1;return r}),fu=c(function(t,n,r){for(var e=r.length-1;e>=0;)n=t(r[e],n),e-=1;return n}),lu=o(4,[],function(t,n,r,e){return b(function(r,e){return t(r,e)?n(r,e):f(r)},r,e)}),pu=r(f),hu=e(function(t,n){var r,e=+n,u=0;if(0>e||isNaN(e))throw new RangeError("n must be a non-negative number");for(r=Array(e);e>u;)r[u]=t(u),u+=1;return r}),yu=e(function(t,n){return hu(dt(t),n)}),du=c(function(t,n,r){return r.replace(t,n)}),gu=c(function(t,n,r){for(var e=0,u=r.length,i=[n];u>e;)n=t(n,r[e]),i[e+1]=n,e+=1;return i}),vu=e(function(t,n){return"function"==typeof n.sequence?n.sequence(t):fu(function(t,n){return Jt(Rt(tu,t),n)},t([]),n)}),mu=c(function(t,n,r){return Le(t,dt(n),r)}),bu=e(function(t,n){return Array.prototype.slice.call(n,0).sort(t)}),xu=e(function(t,n){return Array.prototype.slice.call(n,0).sort(function(n,r){var e=t(n),u=t(r);return u>e?-1:e>u?1:0})}),wu=e(function(t,n){return Array.prototype.slice.call(n,0).sort(function(n,r){for(var e=0,u=0;0===e&&t.length>u;)e=t[u](n,r),u+=1;return e})}),ju=Gr(1,"split"),Au=e(function(t,n){return[An(0,t,n),An(t,ie(n),n)]}),Ou=e(function(t,n){if(0>=t)throw Error("First argument to splitEvery must be a positive integer");for(var r=[],e=0;n.length>e;)r.push(An(e,e+=t,n));return r}),Su=e(function(t,n){for(var r=0,e=n.length,u=[];e>r&&!t(n[r]);)u.push(n[r]),r+=1;return[u,Array.prototype.slice.call(n,r)]}),Eu=e(function(t,n){return _n(Gn(t.length,n),t)}),_u=e(function(t,n){return+t-+n}),qu=e(function(t,n){return Pn(Kn(t,n),Kn(n,t))}),ku=c(function(t,n,r){return Pn(Vn(t,n,r),Vn(t,r,n))}),Nu=e(function(t,n){for(var r=n.length-1;r>=0&&t(n[r]);)r-=1;return An(r+1,1/0,n)});pt.prototype["@@transducer/init"]=Ot.init,pt.prototype["@@transducer/result"]=Ot.result,pt.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):f(t)};var Iu=e(s(["takeWhile"],e(function(t,n){return new pt(t,n)}),function(t,n){for(var r=0,e=n.length;e>r&&t(n[r]);)r+=1;return An(0,r,n)}));ht.prototype["@@transducer/init"]=Ot.init,ht.prototype["@@transducer/result"]=Ot.result,ht.prototype["@@transducer/step"]=function(t,n){return this.f(n),this.xf["@@transducer/step"](t,n)};var Wu=e(s([],e(function(t,n){return new ht(t,n)}),function(t,n){return t(n),n})),Pu=e(function(t,n){if(!yt(t))throw new TypeError("‘test’ requires a value of type RegExp as its first argument; received "+Wn(t));return _(t).test(n)}),Cu=Gr(0,"toLowerCase"),Tu=r(function(t){var n=[];for(var r in t)w(r,t)&&(n[n.length]=[r,t[r]]);return n}),Bu=r(function(t){var n=[];for(var r in t)n[n.length]=[r,t[r]];return n}),Fu=Gr(0,"toUpperCase"),Ru=xt(4,function(t,n,r,e){return b(t("function"==typeof n?d(n):n),r,e)}),Uu=r(function(t){for(var n=0,r=[];t.length>n;){for(var e=t[n],u=0;e.length>u;)void 0===r[u]&&(r[u]=[]),r[u].push(e[u]),u+=1;n+=1}return r}),Du=c(function(t,n,r){return"function"==typeof r["fantasy-land/traverse"]?r["fantasy-land/traverse"](n,t):vu(t,Rt(n,r))}),zu="\t\n\v\f\r \u2028\u2029\ufeff",Mu=r(!("function"==typeof String.prototype.trim)||zu.trim()?function(t){var n=RegExp("^["+zu+"]["+zu+"]*"),r=RegExp("["+zu+"]["+zu+"]*$");return t.replace(n,"").replace(r,"")}:function(t){return t.trim()}),Lu=e(function(t,n){return i(t.length,function(){try{return t.apply(this,arguments)}catch(t){return n.apply(this,u([t],arguments))}})}),Ku=r(function(t){return function(){return t(Array.prototype.slice.call(arguments,0))}}),Vu=r(function(t){return cn(1,t)}),$u=e(function(t,n){return xt(t,function(){for(var r,e=1,u=n,i=0;t>=e&&"function"==typeof u;)r=e===t?arguments.length:i+u.length,u=u.apply(this,Array.prototype.slice.call(arguments,i,r)),e+=1,i=r;return u})}),Hu=e(function(t,n){for(var r=t(n),e=[];r&&r.length;)e[e.length]=r[0],r=t(r[1]);return e}),Ju=e(W(zr,u)),Xu=e(function(t,n){for(var r,e=0,u=n.length,i=[];u>e;)F(t,r=n[e],i)||(i[i.length]=r),e+=1;return i}),Yu=c(function(t,n,r){return Xu(t,u(n,r))}),Zu=c(function(t,n,r){return t(r)?r:n(r)}),Gu=gn(ot),Qu=c(function(t,n,r){for(var e=r;!t(e);)e=n(e);return e}),ti=r(function(t){var n,r=[];for(n in t)r[r.length]=t[n];return r}),ni=function(t){return{value:t,"fantasy-land/map":function(){return this}}},ri=e(function(t,n){return t(ni)(n).value}),ei=c(function(t,n,r){return t(r)?n(r):r}),ui=e(function(t,n){for(var r in t)if(w(r,t)&&!t[r](n[r]))return!1;return!0}),ii=e(function(t,n){return ui(Rt(_n,t),n)}),oi=e(function(t,n){return In(xr(M)(t),n)}),ci=e(function(t,n){for(var r,e=0,u=t.length,i=n.length,o=[];u>e;){for(r=0;i>r;)o[o.length]=[t[e],n[r]],r+=1;e+=1}return o}),ai=e(function(t,n){for(var r=[],e=0,u=Math.min(t.length,n.length);u>e;)r[e]=[t[e],n[e]],e+=1;return r}),si=e(function(t,n){for(var r=0,e=Math.min(t.length,n.length),u={};e>r;)u[t[r]]=n[r],r+=1;return u}),fi=c(function(t,n,r){for(var e=[],u=0,i=Math.min(n.length,r.length);i>u;)e[u]=t(n[u],r[u]),u+=1;return e});t.F=gt,t.T=vt,t.__=mt,t.add=bt,t.addIndex=wt,t.adjust=jt,t.all=St,t.allPass=Lt,t.always=dt,t.and=Kt,t.any=$t,t.anyPass=Ht,t.ap=Jt,t.aperture=Xt,t.append=Yt,t.apply=Zt,t.applySpec=Qt,t.applyTo=tn,t.ascend=nn,t.assoc=rn,t.assocPath=on,t.binary=an,t.bind=qt,t.both=ln,t.call=hn,t.chain=gn,t.clamp=vn,t.clone=bn,t.comparator=xn,t.complement=jn,t.compose=W,t.composeK=P,t.composeP=function(){if(0===arguments.length)throw Error("composeP requires at least one argument");return T.apply(this,Sn(arguments))},t.concat=Pn,t.cond=Cn,t.construct=Bn,t.constructN=Tn,t.contains=Fn,t.converge=Rn,t.countBy=Dn,t.curry=pn,t.curryN=xt,t.dec=zn,t.defaultTo=Mn,t.descend=Ln,t.difference=Kn,t.differenceWith=Vn,t.dissoc=$n,t.dissocPath=Xn,t.divide=Yn,t.drop=Zn,t.dropLast=Qn,t.dropLastWhile=tr,t.dropRepeats=ir,t.dropRepeatsWith=ur,t.dropWhile=or,t.either=ar,t.empty=sr,t.endsWith=lr,t.eqBy=pr,t.eqProps=hr,t.equals=_n,t.evolve=yr,t.filter=Nn,t.find=dr,t.findIndex=gr,t.findLast=vr,t.findLastIndex=mr,t.flatten=br,t.flip=xr,t.forEach=wr,t.forEachObjIndexed=jr,t.fromPairs=Ar,t.groupBy=Or,t.groupWith=Sr,t.gt=Er,t.gte=_r,t.has=qr,t.hasIn=kr,t.head=Nr,t.identical=En,t.identity=Ir,t.ifElse=Wr,t.inc=Pr,t.indexBy=Cr,t.indexOf=Tr,t.init=Br,t.innerJoin=Fr,t.insert=Rr,t.insertAll=Ur,t.intersection=Mr,t.intersperse=Lr,t.into=Xr,t.invert=Yr,t.invertObj=Zr,t.invoker=Gr,t.is=Qr,t.isEmpty=te,t.isNil=un,t.join=ne,t.juxt=re,t.keys=Ft,t.keysIn=ee,t.last=er,t.lastIndexOf=ue,t.length=ie,t.lens=oe,t.lensIndex=ce,t.lensPath=ae,t.lensProp=se,t.lift=fn,t.liftN=sn,t.lt=fe,t.lte=le,t.map=Rt,t.mapAccum=pe,t.mapAccumRight=he,t.mapObjIndexed=ye,t.match=de,t.mathMod=ge,t.max=Et,t.maxBy=ve,t.mean=be,t.median=xe,t.memoize=je,t.memoizeWith=we,t.merge=Ae,t.mergeAll=Oe,t.mergeDeepLeft=_e,t.mergeDeepRight=qe,t.mergeDeepWith=ke,t.mergeDeepWithKey=Ee,t.mergeWith=Ne,t.mergeWithKey=Se,t.min=Ie,t.minBy=We,t.modulo=Pe,t.multiply=Ce,t.nAry=cn,t.negate=Te,t.none=Be,t.not=wn,t.nth=rr,t.nthArg=Fe,t.o=Re,t.objOf=Vr,t.of=Ue,t.omit=De,t.once=ze,t.or=cr,t.over=Le,t.pair=Ke,t.partial=Ve,t.partialRight=$e,t.partition=He,t.path=Ut,t.pathEq=Je,t.pathOr=Xe,t.pathSatisfies=Ye,t.pick=Ze,t.pickAll=Ge,t.pickBy=Qe,t.pipe=I,t.pipeK=function(){if(0===arguments.length)throw Error("pipeK requires at least one argument");return P.apply(this,Sn(arguments))},t.pipeP=T,t.pluck=zt,t.prepend=tu,t.product=nu,t.project=eu,t.prop=Dt,t.propEq=uu,t.propIs=iu,t.propOr=ou,t.propSatisfies=cu,t.props=au,t.range=su,t.reduce=Mt,t.reduceBy=Un,t.reduceRight=fu,t.reduceWhile=lu,t.reduced=pu,t.reject=In,t.remove=Hn,t.repeat=yu,t.replace=du,t.reverse=Sn,t.scan=gu,t.sequence=vu,t.set=mu,t.slice=An,t.sort=bu,t.sortBy=xu,t.sortWith=wu,t.split=ju,t.splitAt=Au,t.splitEvery=Ou,t.splitWhen=Su,t.startsWith=Eu,t.subtract=_u,t.sum=me,t.symmetricDifference=qu,t.symmetricDifferenceWith=ku,t.tail=On,t.take=Gn,t.takeLast=fr,t.takeLastWhile=Nu,t.takeWhile=Iu,t.tap=Wu,t.test=Pu,t.times=hu,t.toLower=Cu,t.toPairs=Tu,t.toPairsIn=Bu,t.toString=Wn,t.toUpper=Fu,t.transduce=Ru,t.transpose=Uu,t.traverse=Du,t.trim=Mu,t.tryCatch=Lu,t.type=mn,t.unapply=Ku,t.unary=Vu,t.uncurryN=$u,t.unfold=Hu,t.union=Ju,t.unionWith=Yu,t.uniq=zr,t.uniqBy=Dr,t.uniqWith=Xu,t.unless=Zu,t.unnest=Gu,t.until=Qu,t.update=Jn,t.useWith=ru,t.values=Gt,t.valuesIn=ti,t.view=ri,t.when=ei,t.where=ui,t.whereEq=ii,t.without=oi,t.xprod=ci,t.zip=ai,t.zipObj=si,t.zipWith=fi,Object.defineProperty(t,"__esModule",{value:!0})});
2 |
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rpscript",
3 | "version": "0.3.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "@types/chai": {
8 | "version": "4.1.3",
9 | "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.3.tgz",
10 | "integrity": "sha512-f5dXGzOJycyzSMdaXVhiBhauL4dYydXwVpavfQ1mVCaGjR56a9QfklXObUxlIY9bGTmCPHEEZ04I16BZ/8w5ww==",
11 | "dev": true
12 | },
13 | "@types/cli-color": {
14 | "version": "0.3.29",
15 | "resolved": "https://registry.npmjs.org/@types/cli-color/-/cli-color-0.3.29.tgz",
16 | "integrity": "sha1-yDpx/gLIx+HM7ASN1qJFjR9sluo=",
17 | "dev": true
18 | },
19 | "@types/cli-table": {
20 | "version": "0.3.0",
21 | "resolved": "https://registry.npmjs.org/@types/cli-table/-/cli-table-0.3.0.tgz",
22 | "integrity": "sha512-QnZUISJJXyhyD6L1e5QwXDV/A5i2W1/gl6D6YMc8u0ncPepbv/B4w3S+izVvtAg60m6h+JP09+Y/0zF2mojlFQ==",
23 | "dev": true
24 | },
25 | "@types/commander": {
26 | "version": "2.12.2",
27 | "resolved": "https://registry.npmjs.org/@types/commander/-/commander-2.12.2.tgz",
28 | "integrity": "sha512-0QEFiR8ljcHp9bAbWxecjVRuAMr16ivPiGOw6KFQBVrVd0RQIcM3xKdRisH2EDWgVWujiYtHwhSkSUoAAGzH7Q==",
29 | "dev": true,
30 | "requires": {
31 | "commander": "2.15.1"
32 | }
33 | },
34 | "@types/node": {
35 | "version": "10.5.2",
36 | "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.2.tgz",
37 | "integrity": "sha512-m9zXmifkZsMHZBOyxZWilMwmTlpC8x5Ty360JKTiXvlXZfBWYpsg9ZZvP/Ye+iZUh+Q+MxDLjItVTWIsfwz+8Q==",
38 | "dev": true
39 | },
40 | "antlr4ts": {
41 | "version": "0.4.1-alpha.0",
42 | "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.4.1-alpha.0.tgz",
43 | "integrity": "sha1-rFcX8w8++jYXsATo/0+GC5x9TSA="
44 | },
45 | "arrify": {
46 | "version": "1.0.1",
47 | "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
48 | "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
49 | "dev": true
50 | },
51 | "async": {
52 | "version": "2.6.1",
53 | "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
54 | "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
55 | "requires": {
56 | "lodash": "4.17.10"
57 | }
58 | },
59 | "balanced-match": {
60 | "version": "1.0.0",
61 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
62 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
63 | },
64 | "bindings": {
65 | "version": "1.2.1",
66 | "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz",
67 | "integrity": "sha1-FK1hE4EtLTfXLme0ystLtyZQXxE="
68 | },
69 | "brace-expansion": {
70 | "version": "1.1.11",
71 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
72 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
73 | "requires": {
74 | "balanced-match": "1.0.0",
75 | "concat-map": "0.0.1"
76 | }
77 | },
78 | "browser-stdout": {
79 | "version": "1.3.1",
80 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
81 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
82 | "dev": true
83 | },
84 | "buffer-from": {
85 | "version": "1.1.0",
86 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz",
87 | "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==",
88 | "dev": true
89 | },
90 | "cli-table": {
91 | "version": "0.3.1",
92 | "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz",
93 | "integrity": "sha1-9TsFJmqLGguTSz0IIebi3FkUriM=",
94 | "requires": {
95 | "colors": "1.0.3"
96 | }
97 | },
98 | "color": {
99 | "version": "0.8.0",
100 | "resolved": "https://registry.npmjs.org/color/-/color-0.8.0.tgz",
101 | "integrity": "sha1-iQwHw/1OZJU3Y4kRz2keVFi2/KU=",
102 | "requires": {
103 | "color-convert": "0.5.3",
104 | "color-string": "0.3.0"
105 | },
106 | "dependencies": {
107 | "color-convert": {
108 | "version": "0.5.3",
109 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz",
110 | "integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0="
111 | }
112 | }
113 | },
114 | "color-name": {
115 | "version": "1.1.1",
116 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz",
117 | "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok="
118 | },
119 | "color-string": {
120 | "version": "0.3.0",
121 | "resolved": "https://registry.npmjs.org/color-string/-/color-string-0.3.0.tgz",
122 | "integrity": "sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE=",
123 | "requires": {
124 | "color-name": "1.1.1"
125 | }
126 | },
127 | "colornames": {
128 | "version": "0.0.2",
129 | "resolved": "https://registry.npmjs.org/colornames/-/colornames-0.0.2.tgz",
130 | "integrity": "sha1-2BH9bIT1kClJmorEQ2ICk1uSvjE="
131 | },
132 | "colors": {
133 | "version": "1.0.3",
134 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
135 | "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs="
136 | },
137 | "colorspace": {
138 | "version": "1.0.1",
139 | "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.0.1.tgz",
140 | "integrity": "sha1-yZx5btMRKLmHalLh7l7gOkpxl0k=",
141 | "requires": {
142 | "color": "0.8.0",
143 | "text-hex": "0.0.0"
144 | }
145 | },
146 | "commander": {
147 | "version": "2.15.1",
148 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
149 | "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag=="
150 | },
151 | "concat-map": {
152 | "version": "0.0.1",
153 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
154 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
155 | },
156 | "configstore": {
157 | "version": "3.1.2",
158 | "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz",
159 | "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==",
160 | "requires": {
161 | "dot-prop": "4.2.0",
162 | "graceful-fs": "4.1.11",
163 | "make-dir": "1.3.0",
164 | "unique-string": "1.0.0",
165 | "write-file-atomic": "2.3.0",
166 | "xdg-basedir": "3.0.0"
167 | }
168 | },
169 | "core-util-is": {
170 | "version": "1.0.2",
171 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
172 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
173 | },
174 | "crypto-random-string": {
175 | "version": "1.0.0",
176 | "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz",
177 | "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4="
178 | },
179 | "dateformat": {
180 | "version": "3.0.3",
181 | "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz",
182 | "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q=="
183 | },
184 | "deasync": {
185 | "version": "0.1.13",
186 | "resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.13.tgz",
187 | "integrity": "sha512-/6ngYM7AapueqLtvOzjv9+11N2fHDSrkxeMF1YPE20WIfaaawiBg+HZH1E5lHrcJxlKR42t6XPOEmMmqcAsU1g==",
188 | "requires": {
189 | "bindings": "1.2.1",
190 | "nan": "2.10.0"
191 | }
192 | },
193 | "deasync-promise": {
194 | "version": "1.0.1",
195 | "resolved": "https://registry.npmjs.org/deasync-promise/-/deasync-promise-1.0.1.tgz",
196 | "integrity": "sha1-KyfeR4Fnr07zS6mYecUuwM7dYcI=",
197 | "requires": {
198 | "deasync": "0.1.13"
199 | }
200 | },
201 | "debug": {
202 | "version": "3.1.0",
203 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
204 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
205 | "dev": true,
206 | "requires": {
207 | "ms": "2.0.0"
208 | }
209 | },
210 | "diagnostics": {
211 | "version": "1.1.0",
212 | "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.0.tgz",
213 | "integrity": "sha1-4QkJALSVI+hSe+IPCBJ1IF8q42o=",
214 | "requires": {
215 | "colorspace": "1.0.1",
216 | "enabled": "1.0.2",
217 | "kuler": "0.0.0"
218 | }
219 | },
220 | "didyoumean2": {
221 | "version": "1.3.0",
222 | "resolved": "https://registry.npmjs.org/didyoumean2/-/didyoumean2-1.3.0.tgz",
223 | "integrity": "sha1-bjT0AUM1HJIGlulyO7oB/8C5ZAI=",
224 | "requires": {
225 | "leven": "2.1.0",
226 | "lodash": "4.17.10"
227 | }
228 | },
229 | "diff": {
230 | "version": "3.5.0",
231 | "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
232 | "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
233 | "dev": true
234 | },
235 | "dot-prop": {
236 | "version": "4.2.0",
237 | "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
238 | "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
239 | "requires": {
240 | "is-obj": "1.0.1"
241 | }
242 | },
243 | "enabled": {
244 | "version": "1.0.2",
245 | "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz",
246 | "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=",
247 | "requires": {
248 | "env-variable": "0.0.4"
249 | }
250 | },
251 | "env-variable": {
252 | "version": "0.0.4",
253 | "resolved": "https://registry.npmjs.org/env-variable/-/env-variable-0.0.4.tgz",
254 | "integrity": "sha512-+jpGxSWG4vr6gVxUHOc4p+ilPnql7NzZxOZBxNldsKGjCF+97df3CbuX7XMaDa5oAVkKQj4rKp38rYdC4VcpDg=="
255 | },
256 | "escape-string-regexp": {
257 | "version": "1.0.5",
258 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
259 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
260 | "dev": true
261 | },
262 | "fast-safe-stringify": {
263 | "version": "2.0.4",
264 | "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.4.tgz",
265 | "integrity": "sha512-mNlGUdKOeGNleyrmgbKYtbnCr9KZkZXU7eM89JRo8vY10f7Ul1Fbj07hUBW3N4fC0xM+fmfFfa2zM7mIizhpNQ=="
266 | },
267 | "fecha": {
268 | "version": "2.3.3",
269 | "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz",
270 | "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg=="
271 | },
272 | "fs.realpath": {
273 | "version": "1.0.0",
274 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
275 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
276 | },
277 | "glob": {
278 | "version": "7.1.2",
279 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
280 | "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
281 | "requires": {
282 | "fs.realpath": "1.0.0",
283 | "inflight": "1.0.6",
284 | "inherits": "2.0.3",
285 | "minimatch": "3.0.4",
286 | "once": "1.4.0",
287 | "path-is-absolute": "1.0.1"
288 | }
289 | },
290 | "graceful-fs": {
291 | "version": "4.1.11",
292 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
293 | "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
294 | },
295 | "growl": {
296 | "version": "1.10.5",
297 | "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
298 | "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
299 | "dev": true
300 | },
301 | "has-flag": {
302 | "version": "3.0.0",
303 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
304 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
305 | "dev": true
306 | },
307 | "he": {
308 | "version": "1.1.1",
309 | "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
310 | "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
311 | "dev": true
312 | },
313 | "imurmurhash": {
314 | "version": "0.1.4",
315 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
316 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
317 | },
318 | "inflight": {
319 | "version": "1.0.6",
320 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
321 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
322 | "requires": {
323 | "once": "1.4.0",
324 | "wrappy": "1.0.2"
325 | }
326 | },
327 | "inherits": {
328 | "version": "2.0.3",
329 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
330 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
331 | },
332 | "interpret": {
333 | "version": "1.1.0",
334 | "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
335 | "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ="
336 | },
337 | "is-obj": {
338 | "version": "1.0.1",
339 | "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
340 | "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8="
341 | },
342 | "is-stream": {
343 | "version": "1.1.0",
344 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
345 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
346 | },
347 | "isarray": {
348 | "version": "1.0.0",
349 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
350 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
351 | },
352 | "jasmine": {
353 | "version": "3.1.0",
354 | "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.1.0.tgz",
355 | "integrity": "sha1-K9Wf1+xuwOistk4J9Fpo7SrRlSo=",
356 | "dev": true,
357 | "requires": {
358 | "glob": "7.1.2",
359 | "jasmine-core": "3.1.0"
360 | }
361 | },
362 | "jasmine-core": {
363 | "version": "3.1.0",
364 | "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.1.0.tgz",
365 | "integrity": "sha1-pHheE11d9lAk38kiSVPfWFvSdmw=",
366 | "dev": true
367 | },
368 | "kuler": {
369 | "version": "0.0.0",
370 | "resolved": "https://registry.npmjs.org/kuler/-/kuler-0.0.0.tgz",
371 | "integrity": "sha1-tmu0a5NOVQ9Z2BiEjgq7pPf1VTw=",
372 | "requires": {
373 | "colornames": "0.0.2"
374 | }
375 | },
376 | "leven": {
377 | "version": "2.1.0",
378 | "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz",
379 | "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA="
380 | },
381 | "lodash": {
382 | "version": "4.17.10",
383 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
384 | "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
385 | },
386 | "logform": {
387 | "version": "1.9.0",
388 | "resolved": "https://registry.npmjs.org/logform/-/logform-1.9.0.tgz",
389 | "integrity": "sha512-H1gneJlqo1dwmXq52p/X57SztuX20aWQArp69u4x7DDmCkMZgMLtBTm2LMoTz0+wu7HdkICiPj6vBbX8WJFRig==",
390 | "requires": {
391 | "colors": "1.3.0",
392 | "fast-safe-stringify": "2.0.4",
393 | "fecha": "2.3.3",
394 | "ms": "2.1.1",
395 | "triple-beam": "1.3.0"
396 | },
397 | "dependencies": {
398 | "colors": {
399 | "version": "1.3.0",
400 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.0.tgz",
401 | "integrity": "sha512-EDpX3a7wHMWFA7PUHWPHNWqOxIIRSJetuwl0AS5Oi/5FMV8kWm69RTlgm00GKjBO1xFHMtBbL49yRtMMdticBw=="
402 | },
403 | "ms": {
404 | "version": "2.1.1",
405 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
406 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
407 | }
408 | }
409 | },
410 | "make-dir": {
411 | "version": "1.3.0",
412 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
413 | "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
414 | "requires": {
415 | "pify": "3.0.0"
416 | }
417 | },
418 | "make-error": {
419 | "version": "1.3.4",
420 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz",
421 | "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==",
422 | "dev": true
423 | },
424 | "minimatch": {
425 | "version": "3.0.4",
426 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
427 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
428 | "requires": {
429 | "brace-expansion": "1.1.11"
430 | }
431 | },
432 | "minimist": {
433 | "version": "1.2.0",
434 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
435 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
436 | "dev": true
437 | },
438 | "mkdirp": {
439 | "version": "0.5.1",
440 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
441 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
442 | "dev": true,
443 | "requires": {
444 | "minimist": "0.0.8"
445 | },
446 | "dependencies": {
447 | "minimist": {
448 | "version": "0.0.8",
449 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
450 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
451 | "dev": true
452 | }
453 | }
454 | },
455 | "mocha": {
456 | "version": "5.2.0",
457 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz",
458 | "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==",
459 | "dev": true,
460 | "requires": {
461 | "browser-stdout": "1.3.1",
462 | "commander": "2.15.1",
463 | "debug": "3.1.0",
464 | "diff": "3.5.0",
465 | "escape-string-regexp": "1.0.5",
466 | "glob": "7.1.2",
467 | "growl": "1.10.5",
468 | "he": "1.1.1",
469 | "minimatch": "3.0.4",
470 | "mkdirp": "0.5.1",
471 | "supports-color": "5.4.0"
472 | }
473 | },
474 | "ms": {
475 | "version": "2.0.0",
476 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
477 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
478 | "dev": true
479 | },
480 | "nan": {
481 | "version": "2.10.0",
482 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
483 | "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA=="
484 | },
485 | "once": {
486 | "version": "1.4.0",
487 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
488 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
489 | "requires": {
490 | "wrappy": "1.0.2"
491 | }
492 | },
493 | "one-time": {
494 | "version": "0.0.4",
495 | "resolved": "https://registry.npmjs.org/one-time/-/one-time-0.0.4.tgz",
496 | "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4="
497 | },
498 | "path-is-absolute": {
499 | "version": "1.0.1",
500 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
501 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
502 | },
503 | "path-parse": {
504 | "version": "1.0.5",
505 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
506 | "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME="
507 | },
508 | "pify": {
509 | "version": "3.0.0",
510 | "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
511 | "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
512 | },
513 | "process-nextick-args": {
514 | "version": "2.0.0",
515 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
516 | "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
517 | },
518 | "readable-stream": {
519 | "version": "2.3.6",
520 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
521 | "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
522 | "requires": {
523 | "core-util-is": "1.0.2",
524 | "inherits": "2.0.3",
525 | "isarray": "1.0.0",
526 | "process-nextick-args": "2.0.0",
527 | "safe-buffer": "5.1.2",
528 | "string_decoder": "1.1.1",
529 | "util-deprecate": "1.0.2"
530 | }
531 | },
532 | "rechoir": {
533 | "version": "0.6.2",
534 | "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
535 | "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
536 | "requires": {
537 | "resolve": "1.8.1"
538 | }
539 | },
540 | "resolve": {
541 | "version": "1.8.1",
542 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
543 | "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==",
544 | "requires": {
545 | "path-parse": "1.0.5"
546 | }
547 | },
548 | "rpscript-interface": {
549 | "version": "0.6.2",
550 | "resolved": "https://registry.npmjs.org/rpscript-interface/-/rpscript-interface-0.6.2.tgz",
551 | "integrity": "sha512-jMc3KiYzLIHcdXPRMAdgRmoMJ129NB8bOC8qde3cDhegiRCM8H/gMPZ8yTgmIfxXzbnPYQaxQZE0jv2BcTYnyg=="
552 | },
553 | "rpscript-parser": {
554 | "version": "0.5.35",
555 | "resolved": "https://registry.npmjs.org/rpscript-parser/-/rpscript-parser-0.5.35.tgz",
556 | "integrity": "sha512-y9CiSbwIaxxtKA4F3BgEVCCokPgOs6MQuJXLaCMoXL2M5t4fvSitGKcFEsw0GIKrDHDSSPqrEvdBiT1s5e2tIA==",
557 | "requires": {
558 | "antlr4ts": "0.4.1-alpha.0",
559 | "configstore": "3.1.2",
560 | "deasync-promise": "1.0.1",
561 | "didyoumean2": "1.3.0",
562 | "rpscript-interface": "0.6.2",
563 | "shelljs": "0.8.2",
564 | "ts-deferred": "1.0.4"
565 | }
566 | },
567 | "safe-buffer": {
568 | "version": "5.1.2",
569 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
570 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
571 | },
572 | "shelljs": {
573 | "version": "0.8.2",
574 | "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.2.tgz",
575 | "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==",
576 | "requires": {
577 | "glob": "7.1.2",
578 | "interpret": "1.1.0",
579 | "rechoir": "0.6.2"
580 | }
581 | },
582 | "signal-exit": {
583 | "version": "3.0.2",
584 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
585 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
586 | },
587 | "source-map": {
588 | "version": "0.6.1",
589 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
590 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
591 | "dev": true
592 | },
593 | "source-map-support": {
594 | "version": "0.5.6",
595 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz",
596 | "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==",
597 | "dev": true,
598 | "requires": {
599 | "buffer-from": "1.1.0",
600 | "source-map": "0.6.1"
601 | }
602 | },
603 | "stack-trace": {
604 | "version": "0.0.10",
605 | "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
606 | "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
607 | },
608 | "string_decoder": {
609 | "version": "1.1.1",
610 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
611 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
612 | "requires": {
613 | "safe-buffer": "5.1.2"
614 | }
615 | },
616 | "supports-color": {
617 | "version": "5.4.0",
618 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
619 | "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
620 | "dev": true,
621 | "requires": {
622 | "has-flag": "3.0.0"
623 | }
624 | },
625 | "text-hex": {
626 | "version": "0.0.0",
627 | "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-0.0.0.tgz",
628 | "integrity": "sha1-V4+8haapJjbkLdF7QdAhjM6esrM="
629 | },
630 | "triple-beam": {
631 | "version": "1.3.0",
632 | "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz",
633 | "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw=="
634 | },
635 | "ts-deferred": {
636 | "version": "1.0.4",
637 | "resolved": "https://registry.npmjs.org/ts-deferred/-/ts-deferred-1.0.4.tgz",
638 | "integrity": "sha1-WBReuu71uPKikLjOw9Bgg5+Uicc="
639 | },
640 | "ts-node": {
641 | "version": "6.1.1",
642 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.1.1.tgz",
643 | "integrity": "sha512-79FnymLGDBd/nXoiak1L6w6fd9Zz9Ge/x8/Aglaeh31KkqRLDzbfT1vBGlO5dqc76WzufTlW4IYl7e01CVUF5A==",
644 | "dev": true,
645 | "requires": {
646 | "arrify": "1.0.1",
647 | "diff": "3.5.0",
648 | "make-error": "1.3.4",
649 | "minimist": "1.2.0",
650 | "mkdirp": "0.5.1",
651 | "source-map-support": "0.5.6",
652 | "yn": "2.0.0"
653 | }
654 | },
655 | "typescript": {
656 | "version": "2.9.1",
657 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.1.tgz",
658 | "integrity": "sha512-h6pM2f/GDchCFlldnriOhs1QHuwbnmj6/v7499eMHqPeW4V2G0elua2eIc2nu8v2NdHV0Gm+tzX83Hr6nUFjQA==",
659 | "dev": true
660 | },
661 | "unique-string": {
662 | "version": "1.0.0",
663 | "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz",
664 | "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=",
665 | "requires": {
666 | "crypto-random-string": "1.0.0"
667 | }
668 | },
669 | "util-deprecate": {
670 | "version": "1.0.2",
671 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
672 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
673 | },
674 | "winston": {
675 | "version": "3.0.0",
676 | "resolved": "https://registry.npmjs.org/winston/-/winston-3.0.0.tgz",
677 | "integrity": "sha512-7QyfOo1PM5zGL6qma6NIeQQMh71FBg/8fhkSAePqtf5YEi6t+UrPDcUuHhuuUasgso49ccvMEsmqr0GBG2qaMQ==",
678 | "requires": {
679 | "async": "2.6.1",
680 | "diagnostics": "1.1.0",
681 | "is-stream": "1.1.0",
682 | "logform": "1.9.0",
683 | "one-time": "0.0.4",
684 | "readable-stream": "2.3.6",
685 | "stack-trace": "0.0.10",
686 | "triple-beam": "1.3.0",
687 | "winston-transport": "4.2.0"
688 | }
689 | },
690 | "winston-transport": {
691 | "version": "4.2.0",
692 | "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.2.0.tgz",
693 | "integrity": "sha512-0R1bvFqxSlK/ZKTH86nymOuKv/cT1PQBMuDdA7k7f0S9fM44dNH6bXnuxwXPrN8lefJgtZq08BKdyZ0DZIy/rg==",
694 | "requires": {
695 | "readable-stream": "2.3.6",
696 | "triple-beam": "1.3.0"
697 | }
698 | },
699 | "wrappy": {
700 | "version": "1.0.2",
701 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
702 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
703 | },
704 | "write-file-atomic": {
705 | "version": "2.3.0",
706 | "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz",
707 | "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==",
708 | "requires": {
709 | "graceful-fs": "4.1.11",
710 | "imurmurhash": "0.1.4",
711 | "signal-exit": "3.0.2"
712 | }
713 | },
714 | "xdg-basedir": {
715 | "version": "3.0.0",
716 | "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz",
717 | "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ="
718 | },
719 | "yn": {
720 | "version": "2.0.0",
721 | "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz",
722 | "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=",
723 | "dev": true
724 | }
725 | }
726 | }
727 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rpscript",
3 | "version": "0.3.0",
4 | "description": "RP Script",
5 | "keywords": [
6 | "api",
7 | "rpa",
8 | "rpscript"
9 | ],
10 | "license": "Apache-2.0",
11 | "author": "James Chong",
12 | "officialModules": [
13 | "basic",
14 | "open",
15 | "zip",
16 | "beeper",
17 | "notifier",
18 | "figlet",
19 | "file",
20 | "csv",
21 | "date",
22 | "hogan",
23 | "downloading",
24 | "request",
25 | "cheerio"
26 | ],
27 | "repository": {
28 | "type": "git",
29 | "url": "https://github.com/wei3hua2/rpscript.git"
30 | },
31 | "scripts": {
32 | "watch": "tsc -w",
33 | "build": "tsc",
34 | "start": "node ./build/rps.js",
35 | "test": "mocha -r ts-node/register test/**.ts",
36 | "postinstall": "scripts/install.js",
37 | "uninstall": "scripts/uninstall.js"
38 | },
39 | "bin": {
40 | "rps": "./build/rps.js"
41 | },
42 | "dependencies": {
43 | "cli-table": "^0.3.1",
44 | "commander": "^2.15.1",
45 | "dateformat": "^3.0.3",
46 | "rpscript-parser": "^0.5.35",
47 | "winston": "^3.0.0"
48 | },
49 | "devDependencies": {
50 | "@types/chai": "^4.1.3",
51 | "@types/cli-color": "^0.3.29",
52 | "@types/cli-table": "^0.3.0",
53 | "@types/commander": "^2.12.2",
54 | "@types/node": "^10.5.2",
55 | "jasmine": "^3.1.0",
56 | "mocha": "^5.2.0",
57 | "ts-node": "^6.0.5",
58 | "typescript": "^2.8.3"
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/scripts/install.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | // const { exec } = require('child_process');
3 | // exec('rps install basic ramda', (err, stdout, stderr) => {
4 | // if (err) {
5 | // console.log('Fail to install basic modules : ');
6 | // console.error(stderr);
7 | // return;
8 | // }
9 | // console.log(`stdout: ${stdout}`);
10 | // });
--------------------------------------------------------------------------------
/scripts/uninstall.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | console.log('uninstalled');
--------------------------------------------------------------------------------
/src/commands/exec.ts:
--------------------------------------------------------------------------------
1 | import {Runner} from 'rpscript-parser';
2 | import { EventEmitter } from 'events';
3 | import {Logger} from '../core/logger';
4 | import {ErrorMessage} from '../format/error_msg';
5 | import fs from 'fs';
6 | import * as R from '../../lib/ramda.min';
7 |
8 | export class ExecCommand {
9 |
10 | runner:Runner;
11 | logger:any;
12 |
13 | debug:boolean;
14 |
15 | constructor(config, event?:(evt:EventEmitter)=>void) {
16 | this.runner = new Runner(config);
17 | this.debug = config.debug;
18 |
19 | if(!event)
20 | this.registerDefaultEvents(this.runner);
21 | else
22 | event(this.runner);
23 | }
24 |
25 | async run(filename:string,args:any[]=[]) : Promise{
26 | this.logger = Logger.createRunnerLogger(filename,this.debug);
27 |
28 | try{
29 | let result = await this.runner.execute(filename,args);
30 |
31 | return result;
32 |
33 | }catch(er){
34 | console.error(er);
35 | }
36 | }
37 |
38 | async runStatement(content:string) : Promise{
39 | this.logger = Logger.createRunnerLogger('none',this.debug);
40 | try{
41 | let result = await this.runner.execute(null,[],content);
42 |
43 | return result;
44 |
45 | }catch(er){
46 | console.error(er);
47 | }
48 | }
49 |
50 | private printParams (params:any[]) : string{
51 |
52 | function genString (p) {
53 | if(typeof p === 'function') return '[function]';
54 | else if(typeof p === 'object'){
55 | try{
56 | return JSON.stringify(p);
57 | }catch(err){
58 | return "";
59 | }
60 | }
61 | else if(typeof p === 'symbol'){
62 | return p.toString();
63 | }
64 | else return p;
65 | }
66 |
67 | if(Array.isArray(params))
68 | return R.map(genString,params).join(' , ');
69 | else
70 | return genString(params);
71 | }
72 |
73 | registerDefaultEvents(evtEmt:EventEmitter) : void{
74 | evtEmt.on(Runner.COMPILE_START_EVT, params => {
75 | this.logger.debug('compilation - start for '+params);
76 | });
77 | evtEmt.on(Runner.COMPILED_EVT, params => {
78 | this.logger.debug('compilation - completed');
79 | // console.log(params.transpile);
80 | });
81 | evtEmt.on(Runner.LINT_EVT, params => {
82 | this.logger.debug('linting - completed');
83 | });
84 | evtEmt.on(Runner.TRANSPILE_EVT, params => {
85 | // console.log(params.fullContent);
86 | fs.writeFileSync('.rpscript/temp.ts',params.fullContent);
87 |
88 | this.logger.debug('transpilation completed. output save to .rpscript/temp.ts');
89 | });
90 | evtEmt.on(Runner.MOD_DISABLED_EVT, params => {
91 | this.logger.debug('module - disabled '+params);
92 | });
93 | evtEmt.on(Runner.MOD_LOADED_EVT, params => {
94 | this.logger.debug('module - loaded '+params);
95 | });
96 |
97 | evtEmt.on(Runner.TRANSPILE_ERR_EVT, params => {
98 | ErrorMessage.handleKeywordMessage(params);
99 | });
100 |
101 |
102 |
103 | evtEmt.on(Runner.START_EVT, params => {
104 | this.logger.debug('start of execution');
105 | });
106 | evtEmt.on(Runner.ACTION_EVT, (args) => {
107 | let arg = args[0];
108 | let modName = arg[0], actionName = arg[1], evt = arg[2], params = arg[3];
109 |
110 | this.logger.debug(`action - ${evt} execute : ${this.printParams(params)} `);
111 | if(evt==='error') {
112 | this.logger.error(`ERROR : ${params}`);
113 | }
114 | });
115 | evtEmt.on(Runner.END_EVT, params => {
116 | this.logger.debug('end of execution');
117 | });
118 |
119 | evtEmt.on(Runner.CTX_PRIOR_SET_EVT, params => {
120 | this.logger.debug(`Priority set => ${params}`);
121 | });
122 |
123 | }
124 |
125 |
126 | private getFileName (filepath:string) :string {
127 | let index = filepath.lastIndexOf('/');
128 | let dotIndex = filepath.lastIndexOf('.');
129 |
130 | return filepath.substring(index+1,dotIndex);
131 | }
132 |
133 | static parseProgramOpts (program) :Object{
134 | return R.pickBy((v,k)=> v !== undefined,
135 | {
136 | outputTS:program.skipOutputTS, linting:program.skipLinting,
137 | outputDir:program.outputDir,skipRun:program.skipRun,
138 | debug:program.debug,modules:program.modules
139 | })
140 | }
141 |
142 | }
143 |
--------------------------------------------------------------------------------
/src/commands/modules.ts:
--------------------------------------------------------------------------------
1 | import {ModuleMgr} from 'rpscript-parser';
2 | import Table from 'cli-table';
3 | import * as R from '../../lib/ramda.min';
4 | import {EventEmitter} from 'events';
5 | import {Logger} from '../core/logger';
6 |
7 | var pjson = require('../../package.json');
8 |
9 | export class ModuleCommand {
10 |
11 | modMgr:ModuleMgr;
12 | logger:any;
13 |
14 | constructor() {
15 | this.modMgr = new ModuleMgr;
16 | this.logger = Logger.createModuleLogger();
17 | this.registerDefaultEvents(this.modMgr.event);
18 | }
19 |
20 | async install(allowExternalModule:boolean,modName:string[]) :Promise{
21 |
22 | for(var i=0;i 0) return modName.substring(0,index);
36 | else return modName;
37 | }
38 |
39 | async remove(modName:string[]) :Promise{
40 | for(var i=0;i table.push([mod.name, mod.npmVersion] ));
58 | // installedModules.forEach(mod => table.push([
59 | // mod.name, mod.npmVersion, mod.enabled, !mod.description ? '' : mod.description] ));
60 |
61 | return table.toString();
62 | }
63 | listInstallModulesJson() : string {
64 | let installedModules = this.modMgr.listInstalledModules();
65 |
66 | return JSON.stringify(installedModules,null,2);
67 | }
68 | listAvailableModules() : string{
69 | return JSON.stringify(this.modMgr.listAvailableModules());
70 | }
71 | listModuleInfo(mod) : string {
72 | let iModules = this.modMgr.listInstalledModules();
73 | let module = iModules[mod];
74 | if(!module)
75 | return 'module '+mod+' is not installed';
76 | else {
77 | // let table = new Table({head:['action','params']});
78 | // let actions = module.actions;
79 | // let paramsStr = (paramsArr) => R.pluck( 'name', R.values(paramsArr) ).join(',');
80 |
81 | // var eachAction = (value, key) => {
82 | // table.push([value.verbName, paramsStr(value.params)]);
83 | // };
84 | // R.forEachObjIndexed(eachAction, actions);
85 | // let actionsTbl = table.toString();
86 |
87 | let v = R.pluck('verbName', R.values( R.prop('actions')(module)) );
88 |
89 | let modName = 'name : '+module.name;
90 | let modVersion = 'version : '+module.npmVersion;
91 | let allActions = 'actions : '+v.join(', ');
92 |
93 | return modName + '\n' + modVersion + '\n' + allActions;
94 | }
95 |
96 |
97 | }
98 | listDefaultKeywords() : string {
99 | let defaultMod = this.modMgr.listInstalledModules()['$DEFAULT'];
100 | let defKeywords = R.keys(defaultMod);
101 |
102 | let table = new Table({head:['keyword','modules']});
103 |
104 | let modList = (modActionList) => {
105 | return R.pluck('moduleName',modActionList).join(',');
106 | }
107 |
108 | R.forEachObjIndexed((val,key)=>{
109 | table.push([key,modList(val)]);
110 | }, defaultMod);
111 |
112 | return table.toString();
113 | }
114 |
115 |
116 | registerDefaultEvents(evtEmt:EventEmitter) : void{
117 |
118 | evtEmt.on(ModuleMgr.MOD_INSTALLED_NPM_EVT, params => {
119 | this.logger.info('module '+params.name+' installed');
120 | this.logger.info(params.npm.text);
121 | });
122 |
123 | evtEmt.on(ModuleMgr.MOD_INSTALLED_CONFIG_EVT, params => {
124 | this.logger.info('module '+params.name+' configured ');
125 | });
126 |
127 | evtEmt.on(ModuleMgr.MOD_INSTALLED_ERROR_EVT, params => {
128 | this.logger.error(params);
129 | });
130 |
131 |
132 | evtEmt.on(ModuleMgr.MOD_REMOVED_NPM_EVT, params => {
133 | this.logger.info('module removed : '+params+'');
134 | });
135 |
136 | evtEmt.on(ModuleMgr.MOD_REMOVED_CONFIG_EVT, params => {
137 | this.logger.info('module '+params.name+' removed configuration');
138 | });
139 |
140 | evtEmt.on(ModuleMgr.MOD_REMOVED_ERROR_EVT, params => {
141 | this.logger.error(params);
142 | });
143 |
144 |
145 |
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/src/commands/version.ts:
--------------------------------------------------------------------------------
1 | var pJson = require('../../package.json');
2 |
3 | export class VersionCommand {
4 |
5 | constructor() {}
6 |
7 | getVersions() : string {
8 | return pJson.version;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/core/logger.ts:
--------------------------------------------------------------------------------
1 | import winston from 'winston';
2 | import fs from 'fs';
3 | import df from 'dateformat';
4 | const HOMEDIR = require('os').homedir();
5 |
6 | const { combine, timestamp, label, printf } = winston.format;
7 |
8 | const runnerLogFormat = printf(info => {
9 | return `${info.timestamp} [${info.label}] ${info.level}: ${info.message}`;
10 | });
11 |
12 | const moduleLogFormat = printf(info => {
13 | return `${info.timestamp} ${info.level}: ${info.message}`;
14 | });
15 |
16 | export class Logger {
17 |
18 | constructor(){}
19 |
20 | static createModuleLogger () : any {
21 | let modLogDir = `${process.cwd()}/.rpscript/logs`;
22 | if(!fs.existsSync(modLogDir)) fs.mkdirSync(modLogDir);
23 |
24 | return winston.createLogger({
25 | level: 'debug',
26 | format: combine(timestamp({format: 'YYYY-MM-DD HH:mm:ss'}),moduleLogFormat),
27 | transports: [
28 | new winston.transports.File({ filename: `${modLogDir}/module_error.log`, level: 'error' }),
29 | new winston.transports.File({ filename: `${modLogDir}/module.log` }),
30 | new winston.transports.Console({format: combine(timestamp({format: 'YYYY-MM-DD HH:mm:ss'}),moduleLogFormat)})
31 | ]
32 | });
33 | }
34 | static createRunnerLogger (fileName:string,debug?:boolean) :any{
35 | let modLogDir = `${process.cwd()}/.rpscript/logs`;
36 | if(!fs.existsSync(modLogDir)) fs.mkdirSync(modLogDir);
37 |
38 | let runnerLogDir = `${process.cwd()}/.rpscript/logs/runner/`;
39 | if(!fs.existsSync(runnerLogDir)) fs.mkdirSync(runnerLogDir);
40 |
41 | let logFile:string = df('yy-mm-dd-HH-MM-ss')+'-run.log';
42 |
43 | if(!fs.existsSync(runnerLogDir)) fs.mkdirSync(runnerLogDir);
44 |
45 | let level = debug ? 'debug' : 'info';
46 |
47 | let log = winston.createLogger({
48 | level:level,
49 | format: combine(label({ label: fileName }),timestamp({format: 'YYYY-MM-DD HH:mm:ss'}),runnerLogFormat),
50 | transports: [
51 | new winston.transports.File({ filename: `${runnerLogDir}/${logFile}`})
52 | ]
53 | })
54 |
55 | // if(debug){
56 | log.add(
57 | new winston.transports.Console(
58 | {format: combine(timestamp({format: 'YYYY-MM-DD HH:mm:ss'}),moduleLogFormat)}));
59 | // }
60 |
61 | return log;
62 | }
63 |
64 | }
--------------------------------------------------------------------------------
/src/core/rpsconfig.default.json:
--------------------------------------------------------------------------------
1 | {
2 | "outputDir":".rpscript",
3 | "skipLinting":false,
4 | "skipOutputTS":false,
5 | "skipRun":false
6 | }
--------------------------------------------------------------------------------
/src/doc-content.ts:
--------------------------------------------------------------------------------
1 | let NEW_DESCRIPTION = `create a new project.`;
2 | let NEW_HELP = `
3 | `;
4 |
5 | let RUN_DESCRIPTION = `Run an RPS file`;
6 | let RUN_HELP = `Run an rps file`;
7 |
8 | let COMPILE_DESCRIPTION = `compile an RPS file`;
9 | let COMPILE_HELP = `compile an RPS file`;
10 |
11 | let REPL_DESCRIPTION = `REPL`;
12 | let REPL_HELP = `running repl`;
13 |
14 | export {NEW_DESCRIPTION, NEW_HELP, RUN_HELP, RUN_DESCRIPTION,COMPILE_DESCRIPTION,COMPILE_HELP,
15 | REPL_DESCRIPTION,REPL_HELP};
16 |
--------------------------------------------------------------------------------
/src/format/error_msg.ts:
--------------------------------------------------------------------------------
1 |
2 | export class ErrorMessage {
3 | static handleKeywordMessage (exception:any) : void {
4 | let errorType = exception.constructor.name;
5 | if(errorType === 'InvalidKeywordException')
6 | this.handleInvalidKeywordException(exception);
7 | else if(errorType === 'TypeError')
8 | this.handleTypeError(exception);
9 | else if(errorType === 'InputMismatchException')
10 | this.handleInputMismatchException(exception);
11 | else if(errorType === 'ReferenceError'){
12 | this.handleReferenceError(exception);
13 | }
14 |
15 | }
16 |
17 | private static handleReferenceError(exception:any){
18 | console.error('*** handleReferenceError ***');
19 | console.error(exception);
20 | }
21 |
22 | private static handleInputMismatchException(exception:any){
23 | console.error('*** handleInputMismatchException ***');
24 | console.error(exception);
25 | }
26 |
27 | private static handleTypeError(exception:any){
28 | console.error('*** Type Error ***');
29 | console.error(exception);
30 | }
31 |
32 | private static handleInvalidKeywordException (exception:any) {
33 | let ctx = exception.actionContext;
34 | let offendingToken = ctx.WORD();
35 | let offendingWord = offendingToken.text;
36 | let line = offendingToken.payload._line;
37 | let recommended = exception.recommended;
38 |
39 | let input = ctx.start.inputStream.toString();
40 | let lines = input.split('\n');
41 |
42 | console.log('');
43 | console.log(`Oops... Don't recognize keyword ${offendingWord}. Do you mean ${recommended} ?`);
44 | console.log('');
45 | console.log(`line ${line}:`);
46 | console.log(lines[line-1]);
47 |
48 | // console.log('');
49 | // console.log(`Oops... Don't recognize keyword ${clc.red(offendingWord)}. Do you mean ${clc.blue('_')} ?`);
50 | // console.log('');
51 | // console.log(`line ${line} : `+clc.white.bgBlack(rawLine));
52 | }
53 |
54 | private static underlineError (lines, offendingWord,line, pos) {
55 |
56 | // let errorLine = lines[line-1];
57 |
58 | // let start = offendingToken.startIndex;
59 | // let stop = offendingToken.stopIndex;
60 |
61 | // console.log(errorLine);
62 | // for(var i=0;i=0 && stop>=0) for(var i:number=start;i{
12 | let v = new VersionCommand();
13 | console.log(v.getVersions());
14 | })
15 | // .option('-o, --skipOutputTS', 'Output Typescript file')
16 | // .option('-l, --skipLinting', 'Lint Output Typescript file')
17 | // .option('-s, --skipRun', 'Skip running the program')
18 | // .option('-d, --outputDir ', 'Working directory path for logs and temp files')
19 | .description('******************************************** ' + '\n' +
20 | " ____ ____ ____ _ _" + '\n' +
21 | " | _ \\\| _ \\ / ___| ___ _ __(_)_ __ | |_ " + '\n' +
22 | " | |_) | |_) | \\___ \\ / __| '__| | '_ \\| __|" + '\n' +
23 | " | _ <| __/ ___) | (__| | | | |_) | |_ " + '\n' +
24 | " |_| \\_\\_| |____/ \\___|_| |_| .__/ \\__|" + '\n' +
25 | " |_| " + '\n' +
26 | ' ******************************************** ')
27 | .usage('[filename] [options]');
28 |
29 | program
30 | .option('-d, --debug', 'Show debugging information on console')
31 | .command('verify ', 'Verify if the rps script is valid')
32 | .command('install [modules]', 'Install one or more modules')
33 | .command('remove [modules]', 'Remove one or more modules')
34 | .command('modules', 'List modules information')
35 | .command('module ', 'Show module information')
36 | .command('actions', 'List installed actions');
37 |
38 | //modules --installed --available
39 | //actions --defaults
40 | //enable --module --action
41 | //disable --module --action
42 |
43 | dirSetup();
44 |
45 | program.parse(process.argv);
46 |
47 | let filename = undefined;
48 |
49 |
50 | let hasRpsFile:boolean = R.any(arg => arg.indexOf('.rps')>0, process.argv);
51 |
52 |
53 | if(process.argv.length < 3){
54 | program.help();
55 | }
56 |
57 | else if(process.argv[2].indexOf('.rps')>0) {
58 | import(`${__dirname}/commands/exec`).then(mod => {
59 | let ExecCommand = mod['ExecCommand'];
60 | let command = new ExecCommand( ExecCommand.parseProgramOpts(program) );
61 |
62 | filename = process.argv[2];
63 | let args = process.argv.slice(3);
64 | args = args.filter(a => !a.startsWith('-'));
65 |
66 | command.run(filename,args);
67 | });
68 |
69 | }else if (!hasRpsFile && program.exec){
70 | import(`${__dirname}/commands/exec`).then(mod => {
71 | let ExecCommand = mod['ExecCommand'];
72 | let command = new ExecCommand( ExecCommand.parseProgramOpts(program) );
73 |
74 | let commands:any = process.argv;
75 | commands = commands.join(' ');
76 |
77 | let exeCom = "";
78 |
79 | let indexOfFlag = commands.lastIndexOf('--exec');
80 | if(indexOfFlag > 0) exeCom = commands.substring(indexOfFlag+7);
81 | else {
82 | indexOfFlag = commands.lastIndexOf('-e');
83 | if(indexOfFlag > 0) exeCom = commands.substring(indexOfFlag+3);
84 | }
85 |
86 |
87 | command.runStatement(exeCom);
88 | });
89 | // console.log('an extension .rps is required for filename');
90 | }
91 |
92 | process.on('unhandledRejection', (reason, promise) => {
93 | console.log('RPscript : Unhandled Rejection at:', reason.stack || reason);
94 | // Recommended: send the information to sentry.io
95 | // or whatever crash reporting service you use
96 | })
97 |
98 | function dirSetup () {
99 |
100 | let config = {
101 | outputDir:'.rpscript'
102 | }
103 |
104 | if(!fs.existsSync(config['outputDir'])) {
105 | fs.mkdirSync(config['outputDir']);
106 | fs.mkdirSync(config['outputDir']+'/logs');
107 | }
108 |
109 | if(!fs.existsSync(`${HOMEDIR}/.rpscript/modules/node_modules`)){
110 | console.log('ALERT: No module detected.');
111 | console.log("Please install the basic module with the command 'rps install basic ramda'");
112 | }
113 |
114 | }
--------------------------------------------------------------------------------
/templates/c3-chart.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/templates/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
12 |
13 |
14 |
15 |
16 | count
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
125 |
126 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "include": [
3 | "src/**.ts"
4 | ],
5 | "exclude": [
6 | "node_modules", "test/**.ts"
7 | ],
8 | "compilerOptions": {
9 | "lib": [
10 | "es2017","es2015","dom","es6"
11 | ],
12 | "outDir": "build",
13 | "types":["node"],
14 | "target": "es2015",
15 | "skipLibCheck": true,
16 | "module": "commonjs",
17 | "declaration": true,
18 | "strict": false,
19 | "esModuleInterop": true,
20 | "experimentalDecorators":true
21 | }
22 | }
23 |
--------------------------------------------------------------------------------