blob: ab72fa0ef2deadfb880f65c3ef61d9b2957e513c [file] [log] [blame]
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07001/**
2 * swagger-ui - Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API
Jian Li1c94b9d2017-02-08 15:47:21 +09003 * @version v2.2.10
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004 * @link http://swagger.io
Jian Li83d87a72016-04-20 15:38:24 -07005 * @license Apache-2.0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006 */
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007(function(){/* jshint ignore:start */
8 {(function() {
9 var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
10templates['apikey_auth'] = template({"1":function(container,depth0,helpers,partials,data) {
11 var stack1;
12
Jian Li8afbbee2016-07-27 19:16:51 +090013 return " <span class=\"key_auth__value\">"
Jian Li7f6d0e9e2016-09-27 02:04:49 +090014 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.value : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
Jian Li8afbbee2016-07-27 19:16:51 +090015 + "</span>\n";
Jian Li7f6d0e9e2016-09-27 02:04:49 +090016},"3":function(container,depth0,helpers,partials,data) {
17 return " <input placeholder=\"api_key\" class=\"auth_input input_apiKey_entry\" name=\"apiKey\" type=\"text\"/>\n";
18},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
19 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
20
21 return "<div class=\"key_input_container\">\n <h3 class=\"auth__title\">Api key authorization</h3>\n <div class=\"auth__description\">"
22 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
Jian Li8afbbee2016-07-27 19:16:51 +090023 + "</div>\n <div>\n <div class=\"key_auth__field\">\n <span class=\"key_auth__label\">name:</span>\n <span class=\"key_auth__value\">"
Jian Li7f6d0e9e2016-09-27 02:04:49 +090024 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
Jian Li8afbbee2016-07-27 19:16:51 +090025 + "</span>\n </div>\n <div class=\"key_auth__field\">\n <span class=\"key_auth__label\">in:</span>\n <span class=\"key_auth__value\">"
Jian Li7f6d0e9e2016-09-27 02:04:49 +090026 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0["in"] : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
27 + "</span>\n </div>\n <div class=\"key_auth__field\">\n <span class=\"key_auth__label\">value:</span>\n"
28 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "")
29 + " </div>\n </div>\n</div>\n";
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070030},"useData":true});
Jian Li7f6d0e9e2016-09-27 02:04:49 +090031templates['auth_button'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
32 return "<a class='authorize__btn' href=\"#\">Authorize</a>\n";
33},"useData":true});
34templates['auth_button_operation'] = template({"1":function(container,depth0,helpers,partials,data) {
35 return " authorize__btn_operation_login\n";
36},"3":function(container,depth0,helpers,partials,data) {
37 return " authorize__btn_operation_logout\n";
38},"5":function(container,depth0,helpers,partials,data) {
39 var stack1;
40
41 return " <ul class=\"authorize-scopes\">\n"
42 + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.scopes : depth0),{"name":"each","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
43 + " </ul>\n";
44},"6":function(container,depth0,helpers,partials,data) {
45 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
46
Jian Li8afbbee2016-07-27 19:16:51 +090047 return " <li class=\"authorize__scope\" title=\""
Jian Li7f6d0e9e2016-09-27 02:04:49 +090048 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
Jian Li8afbbee2016-07-27 19:16:51 +090049 + "\">"
Jian Li7f6d0e9e2016-09-27 02:04:49 +090050 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.scope : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
Jian Li8afbbee2016-07-27 19:16:51 +090051 + "</li>\n";
Jian Li7f6d0e9e2016-09-27 02:04:49 +090052},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
53 var stack1, alias1=depth0 != null ? depth0 : {};
54
55 return "<div class=\"authorize__btn authorize__btn_operation\n"
56 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "")
57 + "\">\n"
58 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.scopes : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
59 + "</div>\n";
Jian Li8afbbee2016-07-27 19:16:51 +090060},"useData":true});
Jian Li7f6d0e9e2016-09-27 02:04:49 +090061templates['auth_view'] = template({"1":function(container,depth0,helpers,partials,data) {
62 return " <button type=\"button\" class=\"auth__button auth_submit__button\" data-sw-translate>Authorize</button>\n";
63},"3":function(container,depth0,helpers,partials,data) {
64 return " <button type=\"button\" class=\"auth__button auth_logout__button\" data-sw-translate>Logout</button>\n";
65},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
66 var stack1, alias1=depth0 != null ? depth0 : {};
67
68 return "<div class=\"auth_container\">\n\n <div class=\"auth_inner\"></div>\n <div class=\"auth_submit\">\n"
69 + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
70 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isAuthorized : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
71 + " </div>\n\n</div>\n";
Jian Li8afbbee2016-07-27 19:16:51 +090072},"useData":true});
Jian Li7f6d0e9e2016-09-27 02:04:49 +090073templates['basic_auth'] = template({"1":function(container,depth0,helpers,partials,data) {
74 return " - authorized";
75},"3":function(container,depth0,helpers,partials,data) {
76 var stack1;
77
Jian Li8afbbee2016-07-27 19:16:51 +090078 return " <span class=\"basic_auth__value\">"
Jian Li7f6d0e9e2016-09-27 02:04:49 +090079 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.username : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
Jian Li8afbbee2016-07-27 19:16:51 +090080 + "</span>\n";
Jian Li7f6d0e9e2016-09-27 02:04:49 +090081},"5":function(container,depth0,helpers,partials,data) {
82 return " <input required placeholder=\"username\" class=\"basic_auth__username auth_input\" name=\"username\" type=\"text\"/>\n";
83},"7":function(container,depth0,helpers,partials,data) {
84 return " <div class=\"auth_label\">\n <span class=\"basic_auth__label\" data-sw-translate>password:</span>\n <input required placeholder=\"password\" class=\"basic_auth__password auth_input\" name=\"password\" type=\"password\"/></label>\n </div>\n";
85},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
86 var stack1, alias1=depth0 != null ? depth0 : {};
87
88 return "<div class='basic_auth_container'>\n <h3 class=\"auth__title\">Basic authentication"
89 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
90 + "</h3>\n <form class=\"basic_input_container\">\n <div class=\"auth__description\">"
91 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
92 + "</div>\n <div class=\"auth_label\">\n <span class=\"basic_auth__label\" data-sw-translate>username:</span>\n"
93 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.program(5, data, 0),"data":data})) != null ? stack1 : "")
94 + " </div>\n"
95 + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"unless","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
96 + " </form>\n</div>\n";
Jian Li8afbbee2016-07-27 19:16:51 +090097},"useData":true});
Jian Li7f6d0e9e2016-09-27 02:04:49 +090098templates['content_type'] = template({"1":function(container,depth0,helpers,partials,data) {
99 var stack1;
100
101 return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.produces : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
102},"2":function(container,depth0,helpers,partials,data) {
103 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
104
Jian Li8afbbee2016-07-27 19:16:51 +0900105 return " <option value=\""
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900106 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
Jian Li8afbbee2016-07-27 19:16:51 +0900107 + "\">"
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900108 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
Jian Li8afbbee2016-07-27 19:16:51 +0900109 + "</option>\n";
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900110},"4":function(container,depth0,helpers,partials,data) {
111 return " <option value=\"application/json\">application/json</option>\n";
112},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
113 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
114
115 return "<label data-sw-translate for=\""
116 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.contentTypeId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -0700117 + "\">Response Content Type</label>\n<select name=\"contentType\" id=\""
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900118 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.contentTypeId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
119 + "\">\n"
120 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.produces : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "")
121 + "</select>\n";
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -0700122},"useData":true});
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900123templates['main'] = template({"1":function(container,depth0,helpers,partials,data) {
124 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
125
126 return " <div class=\"info_title\">"
127 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
128 + "</div>\n <div class=\"info_description markdown\">"
129 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.description : stack1),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
130 + "</div>\n"
131 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.externalDocs : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
132 + " "
133 + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
134 + "\n "
135 + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
136 + "\n "
137 + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
138 + "\n "
139 + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
140 + "\n "
141 + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
142 + "\n";
143},"2":function(container,depth0,helpers,partials,data) {
144 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
145
146 return " <p>"
147 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.description : stack1),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
148 + "</p>\n <a href=\""
149 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
150 + "\" target=\"_blank\">"
151 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
152 + "</a>\n";
153},"4":function(container,depth0,helpers,partials,data) {
154 var stack1;
155
156 return "<div class=\"info_tos\"><a target=\"_blank\" href=\""
157 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
158 + "\" data-sw-translate>Terms of service</a></div>";
159},"6":function(container,depth0,helpers,partials,data) {
160 var stack1;
161
162 return "<div><div class='info_name' style=\"display: inline\" data-sw-translate>Created by </div> "
163 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
164 + "</div>";
165},"8":function(container,depth0,helpers,partials,data) {
166 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
167
168 return "<div class='info_url' data-sw-translate>See more at <a href=\""
169 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
170 + "\">"
171 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
172 + "</a></div>";
173},"10":function(container,depth0,helpers,partials,data) {
174 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
175
176 return "<div class='info_email'><a target=\"_parent\" href=\"mailto:"
177 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
178 + "?subject="
179 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
180 + "\" data-sw-translate>Contact the developer</a></div>";
181},"12":function(container,depth0,helpers,partials,data) {
182 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
183
184 return "<div class='info_license'><a target=\"_blank\" href='"
185 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.url : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
186 + "'>"
187 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.name : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
188 + "</a></div>";
189},"14":function(container,depth0,helpers,partials,data) {
190 var stack1;
191
192 return " , <span style=\"font-variant: small-caps\" data-sw-translate>api version</span>: "
193 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
194 + "\n ";
195},"16":function(container,depth0,helpers,partials,data) {
196 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
197
198 return " <span style=\"float:right\"><a target=\"_blank\" href=\""
199 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.validatorUrl : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
200 + "/debug?url="
201 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.url : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
202 + "\"><img id=\"validator\" src=\""
203 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.validatorUrl : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
204 + "?url="
205 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.url : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
206 + "\"></a>\n </span>\n";
207},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
208 var stack1, alias1=depth0 != null ? depth0 : {};
209
210 return "<div class='info' id='api_info'>\n"
211 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.info : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
212 + "</div>\n<div class='container' id='resources_container'>\n <div class='authorize-wrapper'></div>\n\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: "
213 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.basePath : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
214 + "\n"
215 + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1),{"name":"if","hash":{},"fn":container.program(14, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
216 + "]\n"
217 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.validatorUrl : depth0),{"name":"if","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
218 + " </h4>\n </div>\n</div>\n";
219},"useData":true});
220templates['oauth2'] = template({"1":function(container,depth0,helpers,partials,data) {
Jian Li1c94b9d2017-02-08 15:47:21 +0900221 var stack1;
222
223 return "<p>Authorization URL: "
224 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.authorizationUrl : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
225 + "</p>";
226},"3":function(container,depth0,helpers,partials,data) {
227 var stack1;
228
229 return "<p>Token URL: "
230 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.tokenUrl : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
231 + "</p>";
232},"5":function(container,depth0,helpers,partials,data) {
233 return " <p>Please input username and password for password flow authorization</p>\n <fieldset>\n <div><label>Username: <input class=\"oauth-username\" type=\"text\" name=\"username\"></label></div>\n <div><label>Password: <input class=\"oauth-password\" type=\"password\" name=\"password\"></label></div>\n </fieldset>\n";
234},"7":function(container,depth0,helpers,partials,data) {
235 var stack1;
236
237 return " <p>Setup client authentication."
238 + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.requireClientAuthenticaiton : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
239 + "</p>\n <fieldset>\n <div><label>Type:\n <select class=\"oauth-client-authentication-type\" name=\"client-authentication-type\">\n <option value=\"none\" selected>None or other</option>\n <option value=\"basic\">Basic auth</option>\n <option value=\"request-body\">Request body</option>\n </select>\n </label></div>\n <div class=\"oauth-client-authentication\" hidden>\n <div><label>ClientId: <input class=\"oauth-client-id\" type=\"text\" name=\"client-id\"></label></div>\n <div><label>Secret: <input class=\"oauth-client-secret\" type=\"text\" name=\"client-secret\"></label></div>\n </div>\n </fieldset>\n";
240},"8":function(container,depth0,helpers,partials,data) {
241 return "(Required)";
242},"10":function(container,depth0,helpers,partials,data) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900243 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
244
245 return " <li>\n <input class=\"oauth-scope\" type=\"checkbox\" data-scope=\""
246 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.scope : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
247 + "\" oauthtype=\""
248 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.OAuthSchemeKey : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
249 + "\"/>\n <label>"
250 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.scope : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
251 + "</label><br/>\n <span class=\"api-scope-desc\">"
252 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
253 + "\n"
Jian Li1c94b9d2017-02-08 15:47:21 +0900254 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.OAuthSchemeKey : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900255 + " </span>\n </li>\n";
Jian Li1c94b9d2017-02-08 15:47:21 +0900256},"11":function(container,depth0,helpers,partials,data) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900257 var stack1;
258
259 return " ("
260 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.OAuthSchemeKey : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
261 + ")\n";
262},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
263 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
264
Jian Li1c94b9d2017-02-08 15:47:21 +0900265 return "<div>\n <h3 class=\"auth__title\">OAuth2.0</h3>\n <p>"
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900266 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
Jian Li1c94b9d2017-02-08 15:47:21 +0900267 + "</p>\n "
268 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.authorizationUrl : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
269 + "\n "
270 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tokenUrl : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
271 + "\n <p>flow: "
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900272 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.flow : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
Jian Li1c94b9d2017-02-08 15:47:21 +0900273 + "</p>\n"
274 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isPasswordFlow : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
275 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.clientAuthentication : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
276 + " <p><strong> "
277 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.appName : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
278 + " </strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>\n <p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\n <a href=\"#\">Learn how to use</a>\n </p>\n <ul class=\"api-popup-scopes\">\n"
279 + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.scopes : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900280 + " </ul>\n</div>";
281},"useData":true});
282templates['operation'] = template({"1":function(container,depth0,helpers,partials,data) {
283 return "deprecated";
284},"3":function(container,depth0,helpers,partials,data) {
285 return " <h4><span data-sw-translate>Warning: Deprecated</span></h4>\n";
286},"5":function(container,depth0,helpers,partials,data) {
287 var stack1;
288
289 return " <h4><span data-sw-translate>Implementation Notes</span></h4>\n <div class=\"markdown\">"
290 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
291 + "</div>\n";
292},"7":function(container,depth0,helpers,partials,data) {
293 return " <div class='authorize-wrapper authorize-wrapper_operation'></div>\n";
294},"9":function(container,depth0,helpers,partials,data) {
295 var stack1, alias1=depth0 != null ? depth0 : {};
296
297 return " <div class=\"response-class\">\n <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> "
298 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.successCode : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
299 + ")</h4>\n "
300 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.successDescription : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
301 + "\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n </div>\n";
302},"10":function(container,depth0,helpers,partials,data) {
303 var stack1;
304
305 return "<div class=\"markdown\">"
306 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.successDescription : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
307 + "</div>";
308},"12":function(container,depth0,helpers,partials,data) {
309 var stack1;
310
311 return " <h4 data-sw-translate>Headers</h4>\n <table class=\"headers\">\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Header</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Description</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Type</th>\n <th style=\"width: 320px; max-width: 320px\" data-sw-translate>Other</th>\n </tr>\n </thead>\n <tbody>\n"
312 + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.headers : depth0),{"name":"each","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
313 + " </tbody>\n </table>\n";
314},"13":function(container,depth0,helpers,partials,data) {
315 var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
316
317 return " <tr>\n <td>"
318 + container.escapeExpression(((helper = (helper = helpers.key || (data && data.key)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"key","hash":{},"data":data}) : helper)))
319 + "</td>\n <td>"
320 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
321 + "</td>\n <td>"
322 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.type : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
323 + "</td>\n <td>"
324 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.other : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
325 + "</td>\n </tr>\n";
326},"15":function(container,depth0,helpers,partials,data) {
327 return " <h4 data-sw-translate>Parameters</h4>\n <table class='fullwidth parameters'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Value</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Description</th>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\" data-sw-translate>Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n";
328},"17":function(container,depth0,helpers,partials,data) {
329 return " <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-sw-translate>Response Messages</h4>\n <table class='fullwidth response-messages'>\n <thead>\n <tr>\n <th data-sw-translate>HTTP Status Code</th>\n <th data-sw-translate>Reason</th>\n <th data-sw-translate>Response Model</th>\n <th data-sw-translate>Headers</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n </tbody>\n </table>\n";
330},"19":function(container,depth0,helpers,partials,data) {
331 return "";
332},"21":function(container,depth0,helpers,partials,data) {
333 return " <div class='sandbox_header'>\n <input class='submit' type='submit' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n";
334},"23":function(container,depth0,helpers,partials,data) {
335 return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n";
336},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
337 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3=container.escapeExpression;
338
339 return " <ul class='operations' >\n <li class='"
340 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.method : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
341 + " operation' id='"
342 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.parentId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
343 + "_"
344 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.nickname : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
345 + "'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/"
346 + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.encodedParentId : depth0),{"name":"sanitize","hash":{},"data":data}))
347 + "/"
348 + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.nickname : depth0),{"name":"sanitize","hash":{},"data":data}))
349 + "' class=\"toggleOperation\">"
350 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.method : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
351 + "</a>\n </span>\n <span class='path'>\n <a href='#!/"
352 + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.encodedParentId : depth0),{"name":"sanitize","hash":{},"data":data}))
353 + "/"
354 + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.nickname : depth0),{"name":"sanitize","hash":{},"data":data}))
355 + "' class=\"toggleOperation "
356 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.deprecated : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
357 + "\">"
358 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.path : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
359 + "</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/"
360 + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.encodedParentId : depth0),{"name":"sanitize","hash":{},"data":data}))
361 + "/"
362 + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.nickname : depth0),{"name":"sanitize","hash":{},"data":data}))
363 + "' class=\"toggleOperation\"><span class=\"markdown\">"
364 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.summary : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
365 + "</span></a>\n </li>\n </ul>\n </div>\n <div class='content' id='"
366 + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.encodedParentId : depth0),{"name":"sanitize","hash":{},"data":data}))
367 + "_"
368 + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.nickname : depth0),{"name":"sanitize","hash":{},"data":data}))
369 + "_content' style='display:none'>\n"
370 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.deprecated : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
371 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
372 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.security : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
373 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.type : depth0),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
374 + "\n"
375 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.headers : depth0),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
376 + "\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n"
377 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.parameters : depth0),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
378 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.responseMessages : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
379 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isReadOnly : depth0),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.program(21, data, 0),"data":data})) != null ? stack1 : "")
380 + " </form>\n <div class='response' style='display:none'>\n <h4 class='curl'>Curl</h4>\n <div class='block curl'></div>\n <h4 data-sw-translate>Request URL</h4>\n <div class='block request_url'></div>\n"
381 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.showRequestHeaders : depth0),{"name":"if","hash":{},"fn":container.program(23, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
382 + " <h4 data-sw-translate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-sw-translate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-sw-translate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";
383},"useData":true});
384templates['param'] = template({"1":function(container,depth0,helpers,partials,data) {
385 var stack1;
386
387 return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.isFile : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "");
388},"2":function(container,depth0,helpers,partials,data) {
389 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
390
391 return " <input type=\"file\" name='"
392 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
393 + "' id='"
394 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
395 + "'/>\n <div class=\"parameter-content-type\" />\n";
396},"4":function(container,depth0,helpers,partials,data) {
397 var stack1;
398
399 return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data})) != null ? stack1 : "");
400},"5":function(container,depth0,helpers,partials,data) {
401 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
402
403 return " <div class=\"editor_holder\"></div>\n <textarea class='body-textarea' name='"
404 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
405 + "' id='"
406 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
407 + "'>"
408 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0["default"] : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
409 + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
410},"7":function(container,depth0,helpers,partials,data) {
411 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
412
413 return " <textarea class='body-textarea' name='"
414 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
415 + "' id='"
416 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
417 + "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n";
418},"9":function(container,depth0,helpers,partials,data) {
419 var stack1;
420
421 return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.isFile : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(10, data, 0),"data":data})) != null ? stack1 : "");
422},"10":function(container,depth0,helpers,partials,data) {
423 var stack1;
424
425 return ((stack1 = (helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helpers.helperMissing).call(depth0 != null ? depth0 : {},depth0,{"name":"renderTextParam","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
426},"11":function(container,depth0,helpers,partials,data) {
427 return "";
428},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
429 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
430
431 return "<td class='code'><label for='"
432 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
433 + "'>"
434 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
435 + "</label></td>\n<td>\n\n"
436 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isBody : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(9, data, 0),"data":data})) != null ? stack1 : "")
437 + "\n</td>\n<td class=\"markdown\">"
438 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
439 + "</td>\n<td>"
440 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.paramType : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
441 + "</td>\n<td>\n <span class=\"model-signature\"></span>\n</td>\n";
442},"useData":true});
443templates['param_list'] = template({"1":function(container,depth0,helpers,partials,data) {
444 return " required";
445},"3":function(container,depth0,helpers,partials,data) {
446 return " multiple=\"multiple\"";
447},"5":function(container,depth0,helpers,partials,data) {
448 return " required ";
449},"7":function(container,depth0,helpers,partials,data) {
450 var stack1;
451
452 return " <option "
453 + ((stack1 = helpers.unless.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.hasDefault : depth0),{"name":"unless","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
454 + " value=''></option>\n";
455},"8":function(container,depth0,helpers,partials,data) {
456 return " selected=\"\" ";
457},"10":function(container,depth0,helpers,partials,data) {
458 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
459
460 return "\n <option "
461 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isDefault : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
462 + " value='"
463 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.value : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
464 + "'> "
465 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.value : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
466 + " "
467 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isDefault : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
468 + " </option>\n\n";
469},"11":function(container,depth0,helpers,partials,data) {
470 return " selected=\"\" ";
471},"13":function(container,depth0,helpers,partials,data) {
472 return " (default) ";
473},"15":function(container,depth0,helpers,partials,data) {
474 return "<strong>";
475},"17":function(container,depth0,helpers,partials,data) {
476 return "</strong>";
477},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
478 var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
479
480 return "<td class='code"
481 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.required : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
482 + "'><label for='"
483 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
484 + "'>"
485 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
486 + "</label></td>\n<td>\n <select "
487 + ((stack1 = (helpers.isArray || (depth0 && depth0.isArray) || alias2).call(alias1,depth0,{"name":"isArray","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
488 + " class=\"parameter "
489 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.required : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
490 + "\" name=\""
491 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
492 + "\" id=\""
493 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
494 + "\">\n\n"
495 + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.required : depth0),{"name":"unless","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
496 + "\n"
497 + ((stack1 = helpers.each.call(alias1,((stack1 = (depth0 != null ? depth0.allowableValues : depth0)) != null ? stack1.descriptiveValues : stack1),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
498 + "\n </select>\n</td>\n<td class=\"markdown\">"
499 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.required : depth0),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
500 + ((stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"description","hash":{},"data":data}) : helper))) != null ? stack1 : "")
501 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.required : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
502 + "</td>\n<td>"
503 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.paramType : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
504 + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
505},"useData":true});
506templates['param_readonly'] = template({"1":function(container,depth0,helpers,partials,data) {
507 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
508
509 return " <textarea class='body-textarea' readonly='readonly' name='"
510 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
511 + "' id='"
512 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
513 + "'>"
514 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0["default"] : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
515 + "</textarea>\n <div class=\"parameter-content-type\" />\n";
516},"3":function(container,depth0,helpers,partials,data) {
517 var stack1;
518
519 return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(6, data, 0),"data":data})) != null ? stack1 : "");
520},"4":function(container,depth0,helpers,partials,data) {
521 var stack1;
522
523 return " "
524 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
525 + "\n";
526},"6":function(container,depth0,helpers,partials,data) {
527 return " (empty)\n";
528},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
529 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
530
531 return "<td class='code'><label for='"
532 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
533 + "'>"
534 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
535 + "</label></td>\n<td>\n"
536 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isBody : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "")
537 + "</td>\n<td class=\"markdown\">"
538 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
539 + "</td>\n<td>"
540 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.paramType : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
541 + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
542},"useData":true});
543templates['param_readonly_required'] = template({"1":function(container,depth0,helpers,partials,data) {
544 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
545
546 return " <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='"
547 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
548 + "' id='"
549 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
550 + "'>"
551 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0["default"] : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
552 + "</textarea>\n";
553},"3":function(container,depth0,helpers,partials,data) {
554 var stack1;
555
556 return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(6, data, 0),"data":data})) != null ? stack1 : "");
557},"4":function(container,depth0,helpers,partials,data) {
558 var stack1;
559
560 return " "
561 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
562 + "\n";
563},"6":function(container,depth0,helpers,partials,data) {
564 return " (empty)\n";
565},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
566 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
567
568 return "<td class='code required'><label for='"
569 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
570 + "'>"
571 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
572 + "</label></td>\n<td>\n"
573 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isBody : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "")
574 + "</td>\n<td class=\"markdown\">"
575 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
576 + "</td>\n<td>"
577 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.paramType : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
578 + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
579},"useData":true});
580templates['param_required'] = template({"1":function(container,depth0,helpers,partials,data) {
581 var stack1;
582
583 return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.isFile : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "");
584},"2":function(container,depth0,helpers,partials,data) {
585 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
586
587 return " <input type=\"file\" name='"
588 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
589 + "' id='"
590 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
591 + "'/>\n";
592},"4":function(container,depth0,helpers,partials,data) {
593 var stack1;
594
595 return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data})) != null ? stack1 : "");
596},"5":function(container,depth0,helpers,partials,data) {
597 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
598
599 return " <div class=\"editor_holder\"></div>\n <textarea class='body-textarea required' placeholder='(required)' name='"
600 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
601 + "' id=\""
602 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
603 + "\">"
604 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0["default"] : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
605 + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
606},"7":function(container,depth0,helpers,partials,data) {
607 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
608
609 return " <textarea class='body-textarea required' placeholder='(required)' name='"
610 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
611 + "' id='"
612 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
613 + "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n";
614},"9":function(container,depth0,helpers,partials,data) {
615 var stack1;
616
617 return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.isFile : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.program(12, data, 0),"data":data})) != null ? stack1 : "");
618},"10":function(container,depth0,helpers,partials,data) {
619 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
620
Jian Li1c94b9d2017-02-08 15:47:21 +0900621 return " <input class='parameter required' type='file' name='"
Jian Li7f6d0e9e2016-09-27 02:04:49 +0900622 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
623 + "' id='"
624 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
625 + "'/>\n";
626},"12":function(container,depth0,helpers,partials,data) {
627 var stack1;
628
629 return ((stack1 = (helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helpers.helperMissing).call(depth0 != null ? depth0 : {},depth0,{"name":"renderTextParam","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
630},"13":function(container,depth0,helpers,partials,data) {
631 return "";
632},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
633 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
634
635 return "<td class='code required'><label for='"
636 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
637 + "'>"
638 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
639 + "</label></td>\n<td>\n"
640 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isBody : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(9, data, 0),"data":data})) != null ? stack1 : "")
641 + "</td>\n<td>\n <strong><span class=\"markdown\">"
642 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
643 + "</span></strong>\n</td>\n<td>"
644 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.paramType : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
645 + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
646},"useData":true});
647templates['parameter_content_type'] = template({"1":function(container,depth0,helpers,partials,data) {
648 var stack1;
649
650 return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.consumes : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
651},"2":function(container,depth0,helpers,partials,data) {
652 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
653
654 return " <option value=\""
655 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
656 + "\">"
657 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
658 + "</option>\n";
659},"4":function(container,depth0,helpers,partials,data) {
660 return " <option value=\"application/json\">application/json</option>\n";
661},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
662 var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
663
664 return "<label for=\""
665 + container.escapeExpression(((helper = (helper = helpers.parameterContentTypeId || (depth0 != null ? depth0.parameterContentTypeId : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"parameterContentTypeId","hash":{},"data":data}) : helper)))
666 + "\" data-sw-translate>Parameter content type:</label>\n<select name=\"parameterContentType\" id=\""
667 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.parameterContentTypeId : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
668 + "\">\n"
669 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.consumes : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "")
670 + "</select>\n";
671},"useData":true});
672templates['popup'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
673 var helper;
674
675 return "<div class=\"api-popup-dialog-wrapper\">\n <div class=\"api-popup-title\">"
676 + container.escapeExpression(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"title","hash":{},"data":data}) : helper)))
677 + "</div>\n <div class=\"api-popup-content\"></div>\n <p class=\"error-msg\"></p>\n <div class=\"api-popup-actions\">\n <button class=\"api-popup-cancel api-button gray\" type=\"button\">Cancel</button>\n </div>\n</div>\n<div class=\"api-popup-dialog-shadow\"></div>";
678},"useData":true});
679templates['resource'] = template({"1":function(container,depth0,helpers,partials,data) {
680 return " : ";
681},"3":function(container,depth0,helpers,partials,data) {
682 var stack1;
683
684 return " <li>\n <a href='"
685 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.url : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
686 + "' data-sw-translate>Raw</a>\n </li>\n";
687},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
688 var stack1, helper, options, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, buffer =
689 "<div class='heading'>\n <h2>\n <a href='#!/"
690 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
691 + "' class=\"toggleEndpointList\" data-id=\""
692 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
693 + "\">"
694 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
695 + "</a> ";
696 stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : alias2),(options={"name":"summary","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(alias1,options) : helper));
697 if (!helpers.summary) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
698 if (stack1 != null) { buffer += stack1; }
699 return buffer + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.summary : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
700 + "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/"
701 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
702 + "' id='endpointListTogger_"
703 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
704 + "' class=\"toggleEndpointList\" data-id=\""
705 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
706 + "\" data-sw-translate>Show/Hide</a>\n </li>\n <li>\n <a href='#' class=\"collapseResource\" data-id=\""
707 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
708 + "\" data-sw-translate>\n List Operations\n </a>\n </li>\n <li>\n <a href='#' class=\"expandResource\" data-id=\""
709 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
710 + "\" data-sw-translate>\n Expand Operations\n </a>\n </li>\n"
711 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.url : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
712 + " </ul>\n</div>\n<ul class='endpoints' id='"
713 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
714 + "_endpoint_list' style='display:none'>\n\n</ul>\n";
715},"useData":true});
716templates['response_content_type'] = template({"1":function(container,depth0,helpers,partials,data) {
717 var stack1;
718
719 return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.produces : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
720},"2":function(container,depth0,helpers,partials,data) {
721 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
722
723 return " <option value=\""
724 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
725 + "\">"
726 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
727 + "</option>\n";
728},"4":function(container,depth0,helpers,partials,data) {
729 return " <option value=\"application/json\">application/json</option>\n";
730},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
731 var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
732
733 return "<label data-sw-translate for=\""
734 + alias4(((helper = (helper = helpers.responseContentTypeId || (depth0 != null ? depth0.responseContentTypeId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"responseContentTypeId","hash":{},"data":data}) : helper)))
735 + "\">Response Content Type</label>\n<select name=\"responseContentType\" id=\""
736 + alias4(((helper = (helper = helpers.responseContentTypeId || (depth0 != null ? depth0.responseContentTypeId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"responseContentTypeId","hash":{},"data":data}) : helper)))
737 + "\">\n"
738 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.produces : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "")
739 + "</select>\n";
740},"useData":true});
741templates['signature'] = template({"1":function(container,depth0,helpers,partials,data) {
742 var stack1, alias1=depth0 != null ? depth0 : {};
743
744 return "\n<div>\n<ul class=\"signature-nav\">\n <li><a class=\"description-link\" href=\"#\" data-sw-translate>Model</a></li>\n <li><a class=\"snippet-link\" href=\"#\" data-sw-translate>Example Value</a></li>\n</ul>\n<div>\n\n<div class=\"signature-container\">\n <div class=\"description\">\n "
745 + container.escapeExpression((helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.signature : depth0),{"name":"sanitize","hash":{},"data":data}))
746 + "\n </div>\n\n <div class=\"snippet\">\n"
747 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.sampleJSON : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
748 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.sampleXML : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
749 + " </div>\n</div>\n";
750},"2":function(container,depth0,helpers,partials,data) {
751 var stack1, alias1=depth0 != null ? depth0 : {};
752
753 return " <div class=\"snippet_json\">\n <pre><code>"
754 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.sampleJSON : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
755 + "</code></pre>\n "
756 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isParam : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
757 + "\n </div>\n";
758},"3":function(container,depth0,helpers,partials,data) {
759 return "<small class=\"notice\" data-sw-translate></small>";
760},"5":function(container,depth0,helpers,partials,data) {
761 var stack1, alias1=depth0 != null ? depth0 : {};
762
763 return " <div class=\"snippet_xml\">\n <pre><code>"
764 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.sampleXML : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
765 + "</code></pre>\n "
766 + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isParam : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
767 + "\n </div>\n";
768},"7":function(container,depth0,helpers,partials,data) {
769 var stack1;
770
771 return " "
772 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.signature : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
773 + "\n";
774},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
775 var stack1;
776
777 return ((stack1 = (helpers.ifCond || (depth0 && depth0.ifCond) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.sampleJSON : depth0),"||",(depth0 != null ? depth0.sampleXML : depth0),{"name":"ifCond","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(7, data, 0),"data":data})) != null ? stack1 : "");
778},"useData":true});
779templates['status_code'] = template({"1":function(container,depth0,helpers,partials,data) {
780 var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
781
782 return " <tr>\n <td>"
783 + container.escapeExpression(((helper = (helper = helpers.key || (data && data.key)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"key","hash":{},"data":data}) : helper)))
784 + "</td>\n <td>"
785 + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
786 + "</td>\n <td>"
787 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.type : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
788 + "</td>\n </tr>\n";
789},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
790 var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
791
792 return "<td width='15%' class='code'>"
793 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.code : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
794 + "</td>\n<td class=\"markdown\">"
795 + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.message : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
796 + "</td>\n<td width='50%'><span class=\"model-signature\" /></td>\n<td class=\"headers\">\n <table>\n <tbody>\n"
797 + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.headers : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
798 + " </tbody>\n </table>\n</td>";
799},"useData":true});
800})();}
801 /* jshint ignore:end */
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -0700802'use strict';
803
804
805$(function() {
806
807 // Helper function for vertically aligning DOM elements
808 // http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/
809 $.fn.vAlign = function() {
810 return this.each(function(){
811 var ah = $(this).height();
812 var ph = $(this).parent().height();
813 var mh = (ph - ah) / 2;
814 $(this).css('margin-top', mh);
815 });
816 };
817
818 $.fn.stretchFormtasticInputWidthToParent = function() {
819 return this.each(function(){
820 var p_width = $(this).closest("form").innerWidth();
821 var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest('form').css('padding-right'), 10);
822 var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10);
823 $(this).css('width', p_width - p_padding - this_padding);
824 });
825 };
826
827 $('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent();
828
829 // Vertically center these paragraphs
830 // Parent may need a min-height for this to work..
831 $('ul.downplayed li div.content p').vAlign();
832
833 // When a sandbox form is submitted..
834 $("form.sandbox").submit(function(){
835
836 var error_free = true;
837
838 // Cycle through the forms required inputs
839 $(this).find("input.required").each(function() {
840
841 // Remove any existing error styles from the input
842 $(this).removeClass('error');
843
844 // Tack the error style on if the input is empty..
845 if ($(this).val() === '') {
846 $(this).addClass('error');
847 $(this).wiggle();
848 error_free = false;
849 }
850
851 });
852
853 return error_free;
854 });
855
856});
857
858function clippyCopiedCallback() {
859 $('#api_key_copied').fadeIn().delay(1000).fadeOut();
860
861 // var b = $("#clippy_tooltip_" + a);
862 // b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() {
863 // b.attr("title", "copy to clipboard")
864 // },
865 // 500))
866}
867
868// Logging function that accounts for browsers that don't have window.console
869function log(){
870 log.history = log.history || [];
871 log.history.push(arguments);
872 if(this.console){
873 console.log( Array.prototype.slice.call(arguments)[0] );
874 }
875}
876
877// Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
878if (Function.prototype.bind && console && typeof console.log === "object") {
879 [
880 "log","info","warn","error","assert","dir","clear","profile","profileEnd"
881 ].forEach(function (method) {
882 console[method] = this.bind(console[method], console);
883 }, Function.prototype.call);
884}
885
886window.Docs = {
887
888 shebang: function() {
889
890 // If shebang has an operation nickname in it..
891 // e.g. /docs/#!/words/get_search
892 var fragments = $.param.fragment().split('/');
893 fragments.shift(); // get rid of the bang
894
895 switch (fragments.length) {
896 case 1:
897 if (fragments[0].length > 0) { // prevent matching "#/"
898 // Expand all operations for the resource and scroll to it
899 var dom_id = 'resource_' + fragments[0];
900
901 Docs.expandEndpointListForResource(fragments[0]);
902 $("#"+dom_id).slideto({highlight: false});
903 }
904 break;
905 case 2:
906 // Refer to the endpoint DOM element, e.g. #words_get_search
907
908 // Expand Resource
909 Docs.expandEndpointListForResource(fragments[0]);
910 $("#"+dom_id).slideto({highlight: false});
911
Jian Li83d87a72016-04-20 15:38:24 -0700912 // Expand operation
913 var li_dom_id = fragments.join('_');
914 var li_content_dom_id = li_dom_id + "_content";
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -0700915
916
Jian Li83d87a72016-04-20 15:38:24 -0700917 Docs.expandOperation($('#'+li_content_dom_id));
918 $('#'+li_dom_id).slideto({highlight: false});
919 break;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -0700920 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -0700921 },
922
923 toggleEndpointListForResource: function(resource) {
924 var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
925 if (elem.is(':visible')) {
Jian Li83d87a72016-04-20 15:38:24 -0700926 $.bbq.pushState('#/', 2);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -0700927 Docs.collapseEndpointListForResource(resource);
928 } else {
Jian Li83d87a72016-04-20 15:38:24 -0700929 $.bbq.pushState('#/' + resource, 2);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -0700930 Docs.expandEndpointListForResource(resource);
931 }
932 },
933
934 // Expand resource
935 expandEndpointListForResource: function(resource) {
936 var resource = Docs.escapeResourceName(resource);
937 if (resource == '') {
938 $('.resource ul.endpoints').slideDown();
939 return;
940 }
941
942 $('li#resource_' + resource).addClass('active');
943
944 var elem = $('li#resource_' + resource + ' ul.endpoints');
945 elem.slideDown();
946 },
947
948 // Collapse resource and mark as explicitly closed
949 collapseEndpointListForResource: function(resource) {
950 var resource = Docs.escapeResourceName(resource);
951 if (resource == '') {
952 $('.resource ul.endpoints').slideUp();
953 return;
954 }
955
956 $('li#resource_' + resource).removeClass('active');
957
958 var elem = $('li#resource_' + resource + ' ul.endpoints');
959 elem.slideUp();
960 },
961
962 expandOperationsForResource: function(resource) {
963 // Make sure the resource container is open..
964 Docs.expandEndpointListForResource(resource);
965
966 if (resource == '') {
967 $('.resource ul.endpoints li.operation div.content').slideDown();
968 return;
969 }
970
971 $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
972 Docs.expandOperation($(this));
973 });
974 },
975
976 collapseOperationsForResource: function(resource) {
977 // Make sure the resource container is open..
978 Docs.expandEndpointListForResource(resource);
979
980 if (resource == '') {
981 $('.resource ul.endpoints li.operation div.content').slideUp();
982 return;
983 }
984
985 $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
986 Docs.collapseOperation($(this));
987 });
988 },
989
990 escapeResourceName: function(resource) {
991 return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
992 },
993
994 expandOperation: function(elem) {
995 elem.slideDown();
996 },
997
998 collapseOperation: function(elem) {
999 elem.slideUp();
1000 }
1001};
1002
Jian Li8afbbee2016-07-27 19:16:51 +09001003/*!
1004 * https://github.com/es-shims/es5-shim
1005 * @license es5-shim Copyright 2009-2015 by contributors, MIT License
1006 * see https://github.com/es-shims/es5-shim/blob/master/LICENSE
1007 */
1008
1009// vim: ts=4 sts=4 sw=4 expandtab
1010
1011// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
1012;
1013
1014// UMD (Universal Module Definition)
1015// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js
1016(function (root, factory) {
1017 'use strict';
1018
1019 /* global define, exports, module */
1020 if (typeof define === 'function' && define.amd) {
1021 // AMD. Register as an anonymous module.
1022 define(factory);
1023 } else if (typeof exports === 'object') {
1024 // Node. Does not work with strict CommonJS, but
1025 // only CommonJS-like enviroments that support module.exports,
1026 // like Node.
1027 module.exports = factory();
1028 } else {
1029 // Browser globals (root is window)
1030 root.returnExports = factory();
1031 }
1032}(this, function () {
1033 /**
1034 * Brings an environment as close to ECMAScript 5 compliance
1035 * as is possible with the facilities of erstwhile engines.
1036 *
1037 * Annotated ES5: http://es5.github.com/ (specific links below)
1038 * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
1039 * Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/
1040 */
1041
1042 // Shortcut to an often accessed properties, in order to avoid multiple
1043 // dereference that costs universally. This also holds a reference to known-good
1044 // functions.
1045 var $Array = Array;
1046 var ArrayPrototype = $Array.prototype;
1047 var $Object = Object;
1048 var ObjectPrototype = $Object.prototype;
1049 var $Function = Function;
1050 var FunctionPrototype = $Function.prototype;
1051 var $String = String;
1052 var StringPrototype = $String.prototype;
1053 var $Number = Number;
1054 var NumberPrototype = $Number.prototype;
1055 var array_slice = ArrayPrototype.slice;
1056 var array_splice = ArrayPrototype.splice;
1057 var array_push = ArrayPrototype.push;
1058 var array_unshift = ArrayPrototype.unshift;
1059 var array_concat = ArrayPrototype.concat;
1060 var array_join = ArrayPrototype.join;
1061 var call = FunctionPrototype.call;
1062 var apply = FunctionPrototype.apply;
1063 var max = Math.max;
1064 var min = Math.min;
1065
1066 // Having a toString local variable name breaks in Opera so use to_string.
1067 var to_string = ObjectPrototype.toString;
1068
1069 /* global Symbol */
1070 /* eslint-disable one-var-declaration-per-line, no-redeclare, max-statements-per-line */
1071 var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
1072 var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn(value) { try { var fnStr = fnToStr.call(value); var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); return constructorRegex.test(spaceStripped); } catch (e) { return false; /* not a function */ } }, tryFunctionObject = function tryFunctionObject(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]', isCallable = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; };
1073
1074 var isRegex; /* inlined from https://npmjs.com/is-regex */ var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec(value) { try { regexExec.call(value); return true; } catch (e) { return false; } }, regexClass = '[object RegExp]'; isRegex = function isRegex(value) { if (typeof value !== 'object') { return false; } return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass; };
1075 var isString; /* inlined from https://npmjs.com/is-string */ var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; };
1076 /* eslint-enable one-var-declaration-per-line, no-redeclare, max-statements-per-line */
1077
1078 /* inlined from http://npmjs.com/define-properties */
1079 var supportsDescriptors = $Object.defineProperty && (function () {
1080 try {
1081 var obj = {};
1082 $Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
1083 for (var _ in obj) { // jscs:ignore disallowUnusedVariables
1084 return false;
1085 }
1086 return obj.x === obj;
1087 } catch (e) { /* this is ES3 */
1088 return false;
1089 }
1090 }());
1091 var defineProperties = (function (has) {
1092 // Define configurable, writable, and non-enumerable props
1093 // if they don't exist.
1094 var defineProperty;
1095 if (supportsDescriptors) {
1096 defineProperty = function (object, name, method, forceAssign) {
1097 if (!forceAssign && (name in object)) {
1098 return;
1099 }
1100 $Object.defineProperty(object, name, {
1101 configurable: true,
1102 enumerable: false,
1103 writable: true,
1104 value: method
1105 });
1106 };
1107 } else {
1108 defineProperty = function (object, name, method, forceAssign) {
1109 if (!forceAssign && (name in object)) {
1110 return;
1111 }
1112 object[name] = method;
1113 };
1114 }
1115 return function defineProperties(object, map, forceAssign) {
1116 for (var name in map) {
1117 if (has.call(map, name)) {
1118 defineProperty(object, name, map[name], forceAssign);
1119 }
1120 }
1121 };
1122 }(ObjectPrototype.hasOwnProperty));
1123
1124 //
1125 // Util
1126 // ======
1127 //
1128
1129 /* replaceable with https://npmjs.com/package/es-abstract /helpers/isPrimitive */
1130 var isPrimitive = function isPrimitive(input) {
1131 var type = typeof input;
1132 return input === null || (type !== 'object' && type !== 'function');
1133 };
1134
1135 var isActualNaN = $Number.isNaN || function isActualNaN(x) {
1136 return x !== x;
1137 };
1138
1139 var ES = {
1140 // ES5 9.4
1141 // http://es5.github.com/#x9.4
1142 // http://jsperf.com/to-integer
1143 /* replaceable with https://npmjs.com/package/es-abstract ES5.ToInteger */
1144 ToInteger: function ToInteger(num) {
1145 var n = +num;
1146 if (isActualNaN(n)) {
1147 n = 0;
1148 } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
1149 n = (n > 0 || -1) * Math.floor(Math.abs(n));
1150 }
1151 return n;
1152 },
1153
1154 /* replaceable with https://npmjs.com/package/es-abstract ES5.ToPrimitive */
1155 ToPrimitive: function ToPrimitive(input) {
1156 var val, valueOf, toStr;
1157 if (isPrimitive(input)) {
1158 return input;
1159 }
1160 valueOf = input.valueOf;
1161 if (isCallable(valueOf)) {
1162 val = valueOf.call(input);
1163 if (isPrimitive(val)) {
1164 return val;
1165 }
1166 }
1167 toStr = input.toString;
1168 if (isCallable(toStr)) {
1169 val = toStr.call(input);
1170 if (isPrimitive(val)) {
1171 return val;
1172 }
1173 }
1174 throw new TypeError();
1175 },
1176
1177 // ES5 9.9
1178 // http://es5.github.com/#x9.9
1179 /* replaceable with https://npmjs.com/package/es-abstract ES5.ToObject */
1180 ToObject: function (o) {
1181 if (o == null) { // this matches both null and undefined
1182 throw new TypeError("can't convert " + o + ' to object');
1183 }
1184 return $Object(o);
1185 },
1186
1187 /* replaceable with https://npmjs.com/package/es-abstract ES5.ToUint32 */
1188 ToUint32: function ToUint32(x) {
1189 return x >>> 0;
1190 }
1191 };
1192
1193 //
1194 // Function
1195 // ========
1196 //
1197
1198 // ES-5 15.3.4.5
1199 // http://es5.github.com/#x15.3.4.5
1200
1201 var Empty = function Empty() {};
1202
1203 defineProperties(FunctionPrototype, {
1204 bind: function bind(that) { // .length is 1
1205 // 1. Let Target be the this value.
1206 var target = this;
1207 // 2. If IsCallable(Target) is false, throw a TypeError exception.
1208 if (!isCallable(target)) {
1209 throw new TypeError('Function.prototype.bind called on incompatible ' + target);
1210 }
1211 // 3. Let A be a new (possibly empty) internal list of all of the
1212 // argument values provided after thisArg (arg1, arg2 etc), in order.
1213 // XXX slicedArgs will stand in for "A" if used
1214 var args = array_slice.call(arguments, 1); // for normal call
1215 // 4. Let F be a new native ECMAScript object.
1216 // 11. Set the [[Prototype]] internal property of F to the standard
1217 // built-in Function prototype object as specified in 15.3.3.1.
1218 // 12. Set the [[Call]] internal property of F as described in
1219 // 15.3.4.5.1.
1220 // 13. Set the [[Construct]] internal property of F as described in
1221 // 15.3.4.5.2.
1222 // 14. Set the [[HasInstance]] internal property of F as described in
1223 // 15.3.4.5.3.
1224 var bound;
1225 var binder = function () {
1226
1227 if (this instanceof bound) {
1228 // 15.3.4.5.2 [[Construct]]
1229 // When the [[Construct]] internal method of a function object,
1230 // F that was created using the bind function is called with a
1231 // list of arguments ExtraArgs, the following steps are taken:
1232 // 1. Let target be the value of F's [[TargetFunction]]
1233 // internal property.
1234 // 2. If target has no [[Construct]] internal method, a
1235 // TypeError exception is thrown.
1236 // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
1237 // property.
1238 // 4. Let args be a new list containing the same values as the
1239 // list boundArgs in the same order followed by the same
1240 // values as the list ExtraArgs in the same order.
1241 // 5. Return the result of calling the [[Construct]] internal
1242 // method of target providing args as the arguments.
1243
1244 var result = apply.call(
1245 target,
1246 this,
1247 array_concat.call(args, array_slice.call(arguments))
1248 );
1249 if ($Object(result) === result) {
1250 return result;
1251 }
1252 return this;
1253
1254 } else {
1255 // 15.3.4.5.1 [[Call]]
1256 // When the [[Call]] internal method of a function object, F,
1257 // which was created using the bind function is called with a
1258 // this value and a list of arguments ExtraArgs, the following
1259 // steps are taken:
1260 // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
1261 // property.
1262 // 2. Let boundThis be the value of F's [[BoundThis]] internal
1263 // property.
1264 // 3. Let target be the value of F's [[TargetFunction]] internal
1265 // property.
1266 // 4. Let args be a new list containing the same values as the
1267 // list boundArgs in the same order followed by the same
1268 // values as the list ExtraArgs in the same order.
1269 // 5. Return the result of calling the [[Call]] internal method
1270 // of target providing boundThis as the this value and
1271 // providing args as the arguments.
1272
1273 // equiv: target.call(this, ...boundArgs, ...args)
1274 return apply.call(
1275 target,
1276 that,
1277 array_concat.call(args, array_slice.call(arguments))
1278 );
1279
1280 }
1281
1282 };
1283
1284 // 15. If the [[Class]] internal property of Target is "Function", then
1285 // a. Let L be the length property of Target minus the length of A.
1286 // b. Set the length own property of F to either 0 or L, whichever is
1287 // larger.
1288 // 16. Else set the length own property of F to 0.
1289
1290 var boundLength = max(0, target.length - args.length);
1291
1292 // 17. Set the attributes of the length own property of F to the values
1293 // specified in 15.3.5.1.
1294 var boundArgs = [];
1295 for (var i = 0; i < boundLength; i++) {
1296 array_push.call(boundArgs, '$' + i);
1297 }
1298
1299 // XXX Build a dynamic function with desired amount of arguments is the only
1300 // way to set the length property of a function.
1301 // In environments where Content Security Policies enabled (Chrome extensions,
1302 // for ex.) all use of eval or Function costructor throws an exception.
1303 // However in all of these environments Function.prototype.bind exists
1304 // and so this code will never be executed.
1305 bound = $Function('binder', 'return function (' + array_join.call(boundArgs, ',') + '){ return binder.apply(this, arguments); }')(binder);
1306
1307 if (target.prototype) {
1308 Empty.prototype = target.prototype;
1309 bound.prototype = new Empty();
1310 // Clean up dangling references.
1311 Empty.prototype = null;
1312 }
1313
1314 // TODO
1315 // 18. Set the [[Extensible]] internal property of F to true.
1316
1317 // TODO
1318 // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
1319 // 20. Call the [[DefineOwnProperty]] internal method of F with
1320 // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
1321 // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
1322 // false.
1323 // 21. Call the [[DefineOwnProperty]] internal method of F with
1324 // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
1325 // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
1326 // and false.
1327
1328 // TODO
1329 // NOTE Function objects created using Function.prototype.bind do not
1330 // have a prototype property or the [[Code]], [[FormalParameters]], and
1331 // [[Scope]] internal properties.
1332 // XXX can't delete prototype in pure-js.
1333
1334 // 22. Return F.
1335 return bound;
1336 }
1337 });
1338
1339 // _Please note: Shortcuts are defined after `Function.prototype.bind` as we
1340 // use it in defining shortcuts.
1341 var owns = call.bind(ObjectPrototype.hasOwnProperty);
1342 var toStr = call.bind(ObjectPrototype.toString);
1343 var arraySlice = call.bind(array_slice);
1344 var arraySliceApply = apply.bind(array_slice);
1345 var strSlice = call.bind(StringPrototype.slice);
1346 var strSplit = call.bind(StringPrototype.split);
1347 var strIndexOf = call.bind(StringPrototype.indexOf);
1348 var pushCall = call.bind(array_push);
1349 var isEnum = call.bind(ObjectPrototype.propertyIsEnumerable);
1350 var arraySort = call.bind(ArrayPrototype.sort);
1351
1352 //
1353 // Array
1354 // =====
1355 //
1356
1357 var isArray = $Array.isArray || function isArray(obj) {
1358 return toStr(obj) === '[object Array]';
1359 };
1360
1361 // ES5 15.4.4.12
1362 // http://es5.github.com/#x15.4.4.13
1363 // Return len+argCount.
1364 // [bugfix, ielt8]
1365 // IE < 8 bug: [].unshift(0) === undefined but should be "1"
1366 var hasUnshiftReturnValueBug = [].unshift(0) !== 1;
1367 defineProperties(ArrayPrototype, {
1368 unshift: function () {
1369 array_unshift.apply(this, arguments);
1370 return this.length;
1371 }
1372 }, hasUnshiftReturnValueBug);
1373
1374 // ES5 15.4.3.2
1375 // http://es5.github.com/#x15.4.3.2
1376 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
1377 defineProperties($Array, { isArray: isArray });
1378
1379 // The IsCallable() check in the Array functions
1380 // has been replaced with a strict check on the
1381 // internal class of the object to trap cases where
1382 // the provided function was actually a regular
1383 // expression literal, which in V8 and
1384 // JavaScriptCore is a typeof "function". Only in
1385 // V8 are regular expression literals permitted as
1386 // reduce parameters, so it is desirable in the
1387 // general case for the shim to match the more
1388 // strict and common behavior of rejecting regular
1389 // expressions.
1390
1391 // ES5 15.4.4.18
1392 // http://es5.github.com/#x15.4.4.18
1393 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
1394
1395 // Check failure of by-index access of string characters (IE < 9)
1396 // and failure of `0 in boxedString` (Rhino)
1397 var boxedString = $Object('a');
1398 var splitString = boxedString[0] !== 'a' || !(0 in boxedString);
1399
1400 var properlyBoxesContext = function properlyBoxed(method) {
1401 // Check node 0.6.21 bug where third parameter is not boxed
1402 var properlyBoxesNonStrict = true;
1403 var properlyBoxesStrict = true;
1404 var threwException = false;
1405 if (method) {
1406 try {
1407 method.call('foo', function (_, __, context) {
1408 if (typeof context !== 'object') {
1409 properlyBoxesNonStrict = false;
1410 }
1411 });
1412
1413 method.call([1], function () {
1414 'use strict';
1415
1416 properlyBoxesStrict = typeof this === 'string';
1417 }, 'x');
1418 } catch (e) {
1419 threwException = true;
1420 }
1421 }
1422 return !!method && !threwException && properlyBoxesNonStrict && properlyBoxesStrict;
1423 };
1424
1425 defineProperties(ArrayPrototype, {
1426 forEach: function forEach(callbackfn/*, thisArg*/) {
1427 var object = ES.ToObject(this);
1428 var self = splitString && isString(this) ? strSplit(this, '') : object;
1429 var i = -1;
1430 var length = ES.ToUint32(self.length);
1431 var T;
1432 if (arguments.length > 1) {
1433 T = arguments[1];
1434 }
1435
1436 // If no callback function or if callback is not a callable function
1437 if (!isCallable(callbackfn)) {
1438 throw new TypeError('Array.prototype.forEach callback must be a function');
1439 }
1440
1441 while (++i < length) {
1442 if (i in self) {
1443 // Invoke the callback function with call, passing arguments:
1444 // context, property value, property key, thisArg object
1445 if (typeof T === 'undefined') {
1446 callbackfn(self[i], i, object);
1447 } else {
1448 callbackfn.call(T, self[i], i, object);
1449 }
1450 }
1451 }
1452 }
1453 }, !properlyBoxesContext(ArrayPrototype.forEach));
1454
1455 // ES5 15.4.4.19
1456 // http://es5.github.com/#x15.4.4.19
1457 // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
1458 defineProperties(ArrayPrototype, {
1459 map: function map(callbackfn/*, thisArg*/) {
1460 var object = ES.ToObject(this);
1461 var self = splitString && isString(this) ? strSplit(this, '') : object;
1462 var length = ES.ToUint32(self.length);
1463 var result = $Array(length);
1464 var T;
1465 if (arguments.length > 1) {
1466 T = arguments[1];
1467 }
1468
1469 // If no callback function or if callback is not a callable function
1470 if (!isCallable(callbackfn)) {
1471 throw new TypeError('Array.prototype.map callback must be a function');
1472 }
1473
1474 for (var i = 0; i < length; i++) {
1475 if (i in self) {
1476 if (typeof T === 'undefined') {
1477 result[i] = callbackfn(self[i], i, object);
1478 } else {
1479 result[i] = callbackfn.call(T, self[i], i, object);
1480 }
1481 }
1482 }
1483 return result;
1484 }
1485 }, !properlyBoxesContext(ArrayPrototype.map));
1486
1487 // ES5 15.4.4.20
1488 // http://es5.github.com/#x15.4.4.20
1489 // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
1490 defineProperties(ArrayPrototype, {
1491 filter: function filter(callbackfn/*, thisArg*/) {
1492 var object = ES.ToObject(this);
1493 var self = splitString && isString(this) ? strSplit(this, '') : object;
1494 var length = ES.ToUint32(self.length);
1495 var result = [];
1496 var value;
1497 var T;
1498 if (arguments.length > 1) {
1499 T = arguments[1];
1500 }
1501
1502 // If no callback function or if callback is not a callable function
1503 if (!isCallable(callbackfn)) {
1504 throw new TypeError('Array.prototype.filter callback must be a function');
1505 }
1506
1507 for (var i = 0; i < length; i++) {
1508 if (i in self) {
1509 value = self[i];
1510 if (typeof T === 'undefined' ? callbackfn(value, i, object) : callbackfn.call(T, value, i, object)) {
1511 pushCall(result, value);
1512 }
1513 }
1514 }
1515 return result;
1516 }
1517 }, !properlyBoxesContext(ArrayPrototype.filter));
1518
1519 // ES5 15.4.4.16
1520 // http://es5.github.com/#x15.4.4.16
1521 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
1522 defineProperties(ArrayPrototype, {
1523 every: function every(callbackfn/*, thisArg*/) {
1524 var object = ES.ToObject(this);
1525 var self = splitString && isString(this) ? strSplit(this, '') : object;
1526 var length = ES.ToUint32(self.length);
1527 var T;
1528 if (arguments.length > 1) {
1529 T = arguments[1];
1530 }
1531
1532 // If no callback function or if callback is not a callable function
1533 if (!isCallable(callbackfn)) {
1534 throw new TypeError('Array.prototype.every callback must be a function');
1535 }
1536
1537 for (var i = 0; i < length; i++) {
1538 if (i in self && !(typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
1539 return false;
1540 }
1541 }
1542 return true;
1543 }
1544 }, !properlyBoxesContext(ArrayPrototype.every));
1545
1546 // ES5 15.4.4.17
1547 // http://es5.github.com/#x15.4.4.17
1548 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
1549 defineProperties(ArrayPrototype, {
1550 some: function some(callbackfn/*, thisArg */) {
1551 var object = ES.ToObject(this);
1552 var self = splitString && isString(this) ? strSplit(this, '') : object;
1553 var length = ES.ToUint32(self.length);
1554 var T;
1555 if (arguments.length > 1) {
1556 T = arguments[1];
1557 }
1558
1559 // If no callback function or if callback is not a callable function
1560 if (!isCallable(callbackfn)) {
1561 throw new TypeError('Array.prototype.some callback must be a function');
1562 }
1563
1564 for (var i = 0; i < length; i++) {
1565 if (i in self && (typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
1566 return true;
1567 }
1568 }
1569 return false;
1570 }
1571 }, !properlyBoxesContext(ArrayPrototype.some));
1572
1573 // ES5 15.4.4.21
1574 // http://es5.github.com/#x15.4.4.21
1575 // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
1576 var reduceCoercesToObject = false;
1577 if (ArrayPrototype.reduce) {
1578 reduceCoercesToObject = typeof ArrayPrototype.reduce.call('es5', function (_, __, ___, list) {
1579 return list;
1580 }) === 'object';
1581 }
1582 defineProperties(ArrayPrototype, {
1583 reduce: function reduce(callbackfn/*, initialValue*/) {
1584 var object = ES.ToObject(this);
1585 var self = splitString && isString(this) ? strSplit(this, '') : object;
1586 var length = ES.ToUint32(self.length);
1587
1588 // If no callback function or if callback is not a callable function
1589 if (!isCallable(callbackfn)) {
1590 throw new TypeError('Array.prototype.reduce callback must be a function');
1591 }
1592
1593 // no value to return if no initial value and an empty array
1594 if (length === 0 && arguments.length === 1) {
1595 throw new TypeError('reduce of empty array with no initial value');
1596 }
1597
1598 var i = 0;
1599 var result;
1600 if (arguments.length >= 2) {
1601 result = arguments[1];
1602 } else {
1603 do {
1604 if (i in self) {
1605 result = self[i++];
1606 break;
1607 }
1608
1609 // if array contains no values, no initial value to return
1610 if (++i >= length) {
1611 throw new TypeError('reduce of empty array with no initial value');
1612 }
1613 } while (true);
1614 }
1615
1616 for (; i < length; i++) {
1617 if (i in self) {
1618 result = callbackfn(result, self[i], i, object);
1619 }
1620 }
1621
1622 return result;
1623 }
1624 }, !reduceCoercesToObject);
1625
1626 // ES5 15.4.4.22
1627 // http://es5.github.com/#x15.4.4.22
1628 // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
1629 var reduceRightCoercesToObject = false;
1630 if (ArrayPrototype.reduceRight) {
1631 reduceRightCoercesToObject = typeof ArrayPrototype.reduceRight.call('es5', function (_, __, ___, list) {
1632 return list;
1633 }) === 'object';
1634 }
1635 defineProperties(ArrayPrototype, {
1636 reduceRight: function reduceRight(callbackfn/*, initial*/) {
1637 var object = ES.ToObject(this);
1638 var self = splitString && isString(this) ? strSplit(this, '') : object;
1639 var length = ES.ToUint32(self.length);
1640
1641 // If no callback function or if callback is not a callable function
1642 if (!isCallable(callbackfn)) {
1643 throw new TypeError('Array.prototype.reduceRight callback must be a function');
1644 }
1645
1646 // no value to return if no initial value, empty array
1647 if (length === 0 && arguments.length === 1) {
1648 throw new TypeError('reduceRight of empty array with no initial value');
1649 }
1650
1651 var result;
1652 var i = length - 1;
1653 if (arguments.length >= 2) {
1654 result = arguments[1];
1655 } else {
1656 do {
1657 if (i in self) {
1658 result = self[i--];
1659 break;
1660 }
1661
1662 // if array contains no values, no initial value to return
1663 if (--i < 0) {
1664 throw new TypeError('reduceRight of empty array with no initial value');
1665 }
1666 } while (true);
1667 }
1668
1669 if (i < 0) {
1670 return result;
1671 }
1672
1673 do {
1674 if (i in self) {
1675 result = callbackfn(result, self[i], i, object);
1676 }
1677 } while (i--);
1678
1679 return result;
1680 }
1681 }, !reduceRightCoercesToObject);
1682
1683 // ES5 15.4.4.14
1684 // http://es5.github.com/#x15.4.4.14
1685 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
1686 var hasFirefox2IndexOfBug = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
1687 defineProperties(ArrayPrototype, {
1688 indexOf: function indexOf(searchElement/*, fromIndex */) {
1689 var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this);
1690 var length = ES.ToUint32(self.length);
1691
1692 if (length === 0) {
1693 return -1;
1694 }
1695
1696 var i = 0;
1697 if (arguments.length > 1) {
1698 i = ES.ToInteger(arguments[1]);
1699 }
1700
1701 // handle negative indices
1702 i = i >= 0 ? i : max(0, length + i);
1703 for (; i < length; i++) {
1704 if (i in self && self[i] === searchElement) {
1705 return i;
1706 }
1707 }
1708 return -1;
1709 }
1710 }, hasFirefox2IndexOfBug);
1711
1712 // ES5 15.4.4.15
1713 // http://es5.github.com/#x15.4.4.15
1714 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
1715 var hasFirefox2LastIndexOfBug = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1;
1716 defineProperties(ArrayPrototype, {
1717 lastIndexOf: function lastIndexOf(searchElement/*, fromIndex */) {
1718 var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this);
1719 var length = ES.ToUint32(self.length);
1720
1721 if (length === 0) {
1722 return -1;
1723 }
1724 var i = length - 1;
1725 if (arguments.length > 1) {
1726 i = min(i, ES.ToInteger(arguments[1]));
1727 }
1728 // handle negative indices
1729 i = i >= 0 ? i : length - Math.abs(i);
1730 for (; i >= 0; i--) {
1731 if (i in self && searchElement === self[i]) {
1732 return i;
1733 }
1734 }
1735 return -1;
1736 }
1737 }, hasFirefox2LastIndexOfBug);
1738
1739 // ES5 15.4.4.12
1740 // http://es5.github.com/#x15.4.4.12
1741 var spliceNoopReturnsEmptyArray = (function () {
1742 var a = [1, 2];
1743 var result = a.splice();
1744 return a.length === 2 && isArray(result) && result.length === 0;
1745 }());
1746 defineProperties(ArrayPrototype, {
1747 // Safari 5.0 bug where .splice() returns undefined
1748 splice: function splice(start, deleteCount) {
1749 if (arguments.length === 0) {
1750 return [];
1751 } else {
1752 return array_splice.apply(this, arguments);
1753 }
1754 }
1755 }, !spliceNoopReturnsEmptyArray);
1756
1757 var spliceWorksWithEmptyObject = (function () {
1758 var obj = {};
1759 ArrayPrototype.splice.call(obj, 0, 0, 1);
1760 return obj.length === 1;
1761 }());
1762 defineProperties(ArrayPrototype, {
1763 splice: function splice(start, deleteCount) {
1764 if (arguments.length === 0) {
1765 return [];
1766 }
1767 var args = arguments;
1768 this.length = max(ES.ToInteger(this.length), 0);
1769 if (arguments.length > 0 && typeof deleteCount !== 'number') {
1770 args = arraySlice(arguments);
1771 if (args.length < 2) {
1772 pushCall(args, this.length - start);
1773 } else {
1774 args[1] = ES.ToInteger(deleteCount);
1775 }
1776 }
1777 return array_splice.apply(this, args);
1778 }
1779 }, !spliceWorksWithEmptyObject);
1780 var spliceWorksWithLargeSparseArrays = (function () {
1781 // Per https://github.com/es-shims/es5-shim/issues/295
1782 // Safari 7/8 breaks with sparse arrays of size 1e5 or greater
1783 var arr = new $Array(1e5);
1784 // note: the index MUST be 8 or larger or the test will false pass
1785 arr[8] = 'x';
1786 arr.splice(1, 1);
1787 // note: this test must be defined *after* the indexOf shim
1788 // per https://github.com/es-shims/es5-shim/issues/313
1789 return arr.indexOf('x') === 7;
1790 }());
1791 var spliceWorksWithSmallSparseArrays = (function () {
1792 // Per https://github.com/es-shims/es5-shim/issues/295
1793 // Opera 12.15 breaks on this, no idea why.
1794 var n = 256;
1795 var arr = [];
1796 arr[n] = 'a';
1797 arr.splice(n + 1, 0, 'b');
1798 return arr[n] === 'a';
1799 }());
1800 defineProperties(ArrayPrototype, {
1801 splice: function splice(start, deleteCount) {
1802 var O = ES.ToObject(this);
1803 var A = [];
1804 var len = ES.ToUint32(O.length);
1805 var relativeStart = ES.ToInteger(start);
1806 var actualStart = relativeStart < 0 ? max((len + relativeStart), 0) : min(relativeStart, len);
1807 var actualDeleteCount = min(max(ES.ToInteger(deleteCount), 0), len - actualStart);
1808
1809 var k = 0;
1810 var from;
1811 while (k < actualDeleteCount) {
1812 from = $String(actualStart + k);
1813 if (owns(O, from)) {
1814 A[k] = O[from];
1815 }
1816 k += 1;
1817 }
1818
1819 var items = arraySlice(arguments, 2);
1820 var itemCount = items.length;
1821 var to;
1822 if (itemCount < actualDeleteCount) {
1823 k = actualStart;
1824 var maxK = len - actualDeleteCount;
1825 while (k < maxK) {
1826 from = $String(k + actualDeleteCount);
1827 to = $String(k + itemCount);
1828 if (owns(O, from)) {
1829 O[to] = O[from];
1830 } else {
1831 delete O[to];
1832 }
1833 k += 1;
1834 }
1835 k = len;
1836 var minK = len - actualDeleteCount + itemCount;
1837 while (k > minK) {
1838 delete O[k - 1];
1839 k -= 1;
1840 }
1841 } else if (itemCount > actualDeleteCount) {
1842 k = len - actualDeleteCount;
1843 while (k > actualStart) {
1844 from = $String(k + actualDeleteCount - 1);
1845 to = $String(k + itemCount - 1);
1846 if (owns(O, from)) {
1847 O[to] = O[from];
1848 } else {
1849 delete O[to];
1850 }
1851 k -= 1;
1852 }
1853 }
1854 k = actualStart;
1855 for (var i = 0; i < items.length; ++i) {
1856 O[k] = items[i];
1857 k += 1;
1858 }
1859 O.length = len - actualDeleteCount + itemCount;
1860
1861 return A;
1862 }
1863 }, !spliceWorksWithLargeSparseArrays || !spliceWorksWithSmallSparseArrays);
1864
1865 var originalJoin = ArrayPrototype.join;
1866 var hasStringJoinBug;
1867 try {
1868 hasStringJoinBug = Array.prototype.join.call('123', ',') !== '1,2,3';
1869 } catch (e) {
1870 hasStringJoinBug = true;
1871 }
1872 if (hasStringJoinBug) {
1873 defineProperties(ArrayPrototype, {
1874 join: function join(separator) {
1875 var sep = typeof separator === 'undefined' ? ',' : separator;
1876 return originalJoin.call(isString(this) ? strSplit(this, '') : this, sep);
1877 }
1878 }, hasStringJoinBug);
1879 }
1880
1881 var hasJoinUndefinedBug = [1, 2].join(undefined) !== '1,2';
1882 if (hasJoinUndefinedBug) {
1883 defineProperties(ArrayPrototype, {
1884 join: function join(separator) {
1885 var sep = typeof separator === 'undefined' ? ',' : separator;
1886 return originalJoin.call(this, sep);
1887 }
1888 }, hasJoinUndefinedBug);
1889 }
1890
1891 var pushShim = function push(item) {
1892 var O = ES.ToObject(this);
1893 var n = ES.ToUint32(O.length);
1894 var i = 0;
1895 while (i < arguments.length) {
1896 O[n + i] = arguments[i];
1897 i += 1;
1898 }
1899 O.length = n + i;
1900 return n + i;
1901 };
1902
1903 var pushIsNotGeneric = (function () {
1904 var obj = {};
1905 var result = Array.prototype.push.call(obj, undefined);
1906 return result !== 1 || obj.length !== 1 || typeof obj[0] !== 'undefined' || !owns(obj, 0);
1907 }());
1908 defineProperties(ArrayPrototype, {
1909 push: function push(item) {
1910 if (isArray(this)) {
1911 return array_push.apply(this, arguments);
1912 }
1913 return pushShim.apply(this, arguments);
1914 }
1915 }, pushIsNotGeneric);
1916
1917 // This fixes a very weird bug in Opera 10.6 when pushing `undefined
1918 var pushUndefinedIsWeird = (function () {
1919 var arr = [];
1920 var result = arr.push(undefined);
1921 return result !== 1 || arr.length !== 1 || typeof arr[0] !== 'undefined' || !owns(arr, 0);
1922 }());
1923 defineProperties(ArrayPrototype, { push: pushShim }, pushUndefinedIsWeird);
1924
1925 // ES5 15.2.3.14
1926 // http://es5.github.io/#x15.4.4.10
1927 // Fix boxed string bug
1928 defineProperties(ArrayPrototype, {
1929 slice: function (start, end) {
1930 var arr = isString(this) ? strSplit(this, '') : this;
1931 return arraySliceApply(arr, arguments);
1932 }
1933 }, splitString);
1934
1935 var sortIgnoresNonFunctions = (function () {
1936 try {
1937 [1, 2].sort(null);
1938 [1, 2].sort({});
1939 return true;
1940 } catch (e) {}
1941 return false;
1942 }());
1943 var sortThrowsOnRegex = (function () {
1944 // this is a problem in Firefox 4, in which `typeof /a/ === 'function'`
1945 try {
1946 [1, 2].sort(/a/);
1947 return false;
1948 } catch (e) {}
1949 return true;
1950 }());
1951 var sortIgnoresUndefined = (function () {
1952 // applies in IE 8, for one.
1953 try {
1954 [1, 2].sort(undefined);
1955 return true;
1956 } catch (e) {}
1957 return false;
1958 }());
1959 defineProperties(ArrayPrototype, {
1960 sort: function sort(compareFn) {
1961 if (typeof compareFn === 'undefined') {
1962 return arraySort(this);
1963 }
1964 if (!isCallable(compareFn)) {
1965 throw new TypeError('Array.prototype.sort callback must be a function');
1966 }
1967 return arraySort(this, compareFn);
1968 }
1969 }, sortIgnoresNonFunctions || !sortIgnoresUndefined || !sortThrowsOnRegex);
1970
1971 //
1972 // Object
1973 // ======
1974 //
1975
1976 // ES5 15.2.3.14
1977 // http://es5.github.com/#x15.2.3.14
1978
1979 // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
1980 var hasDontEnumBug = !isEnum({ 'toString': null }, 'toString');
1981 var hasProtoEnumBug = isEnum(function () {}, 'prototype');
1982 var hasStringEnumBug = !owns('x', '0');
1983 var equalsConstructorPrototype = function (o) {
1984 var ctor = o.constructor;
1985 return ctor && ctor.prototype === o;
1986 };
1987 var blacklistedKeys = {
1988 $window: true,
1989 $console: true,
1990 $parent: true,
1991 $self: true,
1992 $frame: true,
1993 $frames: true,
1994 $frameElement: true,
1995 $webkitIndexedDB: true,
1996 $webkitStorageInfo: true,
1997 $external: true
1998 };
1999 var hasAutomationEqualityBug = (function () {
2000 /* globals window */
2001 if (typeof window === 'undefined') {
2002 return false;
2003 }
2004 for (var k in window) {
2005 try {
2006 if (!blacklistedKeys['$' + k] && owns(window, k) && window[k] !== null && typeof window[k] === 'object') {
2007 equalsConstructorPrototype(window[k]);
2008 }
2009 } catch (e) {
2010 return true;
2011 }
2012 }
2013 return false;
2014 }());
2015 var equalsConstructorPrototypeIfNotBuggy = function (object) {
2016 if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
2017 return equalsConstructorPrototype(object);
2018 }
2019 try {
2020 return equalsConstructorPrototype(object);
2021 } catch (e) {
2022 return false;
2023 }
2024 };
2025 var dontEnums = [
2026 'toString',
2027 'toLocaleString',
2028 'valueOf',
2029 'hasOwnProperty',
2030 'isPrototypeOf',
2031 'propertyIsEnumerable',
2032 'constructor'
2033 ];
2034 var dontEnumsLength = dontEnums.length;
2035
2036 // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js
2037 // can be replaced with require('is-arguments') if we ever use a build process instead
2038 var isStandardArguments = function isArguments(value) {
2039 return toStr(value) === '[object Arguments]';
2040 };
2041 var isLegacyArguments = function isArguments(value) {
2042 return value !== null &&
2043 typeof value === 'object' &&
2044 typeof value.length === 'number' &&
2045 value.length >= 0 &&
2046 !isArray(value) &&
2047 isCallable(value.callee);
2048 };
2049 var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments;
2050
2051 defineProperties($Object, {
2052 keys: function keys(object) {
2053 var isFn = isCallable(object);
2054 var isArgs = isArguments(object);
2055 var isObject = object !== null && typeof object === 'object';
2056 var isStr = isObject && isString(object);
2057
2058 if (!isObject && !isFn && !isArgs) {
2059 throw new TypeError('Object.keys called on a non-object');
2060 }
2061
2062 var theKeys = [];
2063 var skipProto = hasProtoEnumBug && isFn;
2064 if ((isStr && hasStringEnumBug) || isArgs) {
2065 for (var i = 0; i < object.length; ++i) {
2066 pushCall(theKeys, $String(i));
2067 }
2068 }
2069
2070 if (!isArgs) {
2071 for (var name in object) {
2072 if (!(skipProto && name === 'prototype') && owns(object, name)) {
2073 pushCall(theKeys, $String(name));
2074 }
2075 }
2076 }
2077
2078 if (hasDontEnumBug) {
2079 var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
2080 for (var j = 0; j < dontEnumsLength; j++) {
2081 var dontEnum = dontEnums[j];
2082 if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) {
2083 pushCall(theKeys, dontEnum);
2084 }
2085 }
2086 }
2087 return theKeys;
2088 }
2089 });
2090
2091 var keysWorksWithArguments = $Object.keys && (function () {
2092 // Safari 5.0 bug
2093 return $Object.keys(arguments).length === 2;
2094 }(1, 2));
2095 var keysHasArgumentsLengthBug = $Object.keys && (function () {
2096 var argKeys = $Object.keys(arguments);
2097 return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1;
2098 }(1));
2099 var originalKeys = $Object.keys;
2100 defineProperties($Object, {
2101 keys: function keys(object) {
2102 if (isArguments(object)) {
2103 return originalKeys(arraySlice(object));
2104 } else {
2105 return originalKeys(object);
2106 }
2107 }
2108 }, !keysWorksWithArguments || keysHasArgumentsLengthBug);
2109
2110 //
2111 // Date
2112 // ====
2113 //
2114
2115 var hasNegativeMonthYearBug = new Date(-3509827329600292).getUTCMonth() !== 0;
2116 var aNegativeTestDate = new Date(-1509842289600292);
2117 var aPositiveTestDate = new Date(1449662400000);
2118 var hasToUTCStringFormatBug = aNegativeTestDate.toUTCString() !== 'Mon, 01 Jan -45875 11:59:59 GMT';
2119 var hasToDateStringFormatBug;
2120 var hasToStringFormatBug;
2121 var timeZoneOffset = aNegativeTestDate.getTimezoneOffset();
2122 if (timeZoneOffset < -720) {
2123 hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Tue Jan 02 -45875';
2124 hasToStringFormatBug = !(/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString());
2125 } else {
2126 hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Mon Jan 01 -45875';
2127 hasToStringFormatBug = !(/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString());
2128 }
2129
2130 var originalGetFullYear = call.bind(Date.prototype.getFullYear);
2131 var originalGetMonth = call.bind(Date.prototype.getMonth);
2132 var originalGetDate = call.bind(Date.prototype.getDate);
2133 var originalGetUTCFullYear = call.bind(Date.prototype.getUTCFullYear);
2134 var originalGetUTCMonth = call.bind(Date.prototype.getUTCMonth);
2135 var originalGetUTCDate = call.bind(Date.prototype.getUTCDate);
2136 var originalGetUTCDay = call.bind(Date.prototype.getUTCDay);
2137 var originalGetUTCHours = call.bind(Date.prototype.getUTCHours);
2138 var originalGetUTCMinutes = call.bind(Date.prototype.getUTCMinutes);
2139 var originalGetUTCSeconds = call.bind(Date.prototype.getUTCSeconds);
2140 var originalGetUTCMilliseconds = call.bind(Date.prototype.getUTCMilliseconds);
2141 var dayName = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
2142 var monthName = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
2143 var daysInMonth = function daysInMonth(month, year) {
2144 return originalGetDate(new Date(year, month, 0));
2145 };
2146
2147 defineProperties(Date.prototype, {
2148 getFullYear: function getFullYear() {
2149 if (!this || !(this instanceof Date)) {
2150 throw new TypeError('this is not a Date object.');
2151 }
2152 var year = originalGetFullYear(this);
2153 if (year < 0 && originalGetMonth(this) > 11) {
2154 return year + 1;
2155 }
2156 return year;
2157 },
2158 getMonth: function getMonth() {
2159 if (!this || !(this instanceof Date)) {
2160 throw new TypeError('this is not a Date object.');
2161 }
2162 var year = originalGetFullYear(this);
2163 var month = originalGetMonth(this);
2164 if (year < 0 && month > 11) {
2165 return 0;
2166 }
2167 return month;
2168 },
2169 getDate: function getDate() {
2170 if (!this || !(this instanceof Date)) {
2171 throw new TypeError('this is not a Date object.');
2172 }
2173 var year = originalGetFullYear(this);
2174 var month = originalGetMonth(this);
2175 var date = originalGetDate(this);
2176 if (year < 0 && month > 11) {
2177 if (month === 12) {
2178 return date;
2179 }
2180 var days = daysInMonth(0, year + 1);
2181 return (days - date) + 1;
2182 }
2183 return date;
2184 },
2185 getUTCFullYear: function getUTCFullYear() {
2186 if (!this || !(this instanceof Date)) {
2187 throw new TypeError('this is not a Date object.');
2188 }
2189 var year = originalGetUTCFullYear(this);
2190 if (year < 0 && originalGetUTCMonth(this) > 11) {
2191 return year + 1;
2192 }
2193 return year;
2194 },
2195 getUTCMonth: function getUTCMonth() {
2196 if (!this || !(this instanceof Date)) {
2197 throw new TypeError('this is not a Date object.');
2198 }
2199 var year = originalGetUTCFullYear(this);
2200 var month = originalGetUTCMonth(this);
2201 if (year < 0 && month > 11) {
2202 return 0;
2203 }
2204 return month;
2205 },
2206 getUTCDate: function getUTCDate() {
2207 if (!this || !(this instanceof Date)) {
2208 throw new TypeError('this is not a Date object.');
2209 }
2210 var year = originalGetUTCFullYear(this);
2211 var month = originalGetUTCMonth(this);
2212 var date = originalGetUTCDate(this);
2213 if (year < 0 && month > 11) {
2214 if (month === 12) {
2215 return date;
2216 }
2217 var days = daysInMonth(0, year + 1);
2218 return (days - date) + 1;
2219 }
2220 return date;
2221 }
2222 }, hasNegativeMonthYearBug);
2223
2224 defineProperties(Date.prototype, {
2225 toUTCString: function toUTCString() {
2226 if (!this || !(this instanceof Date)) {
2227 throw new TypeError('this is not a Date object.');
2228 }
2229 var day = originalGetUTCDay(this);
2230 var date = originalGetUTCDate(this);
2231 var month = originalGetUTCMonth(this);
2232 var year = originalGetUTCFullYear(this);
2233 var hour = originalGetUTCHours(this);
2234 var minute = originalGetUTCMinutes(this);
2235 var second = originalGetUTCSeconds(this);
2236 return dayName[day] + ', ' +
2237 (date < 10 ? '0' + date : date) + ' ' +
2238 monthName[month] + ' ' +
2239 year + ' ' +
2240 (hour < 10 ? '0' + hour : hour) + ':' +
2241 (minute < 10 ? '0' + minute : minute) + ':' +
2242 (second < 10 ? '0' + second : second) + ' GMT';
2243 }
2244 }, hasNegativeMonthYearBug || hasToUTCStringFormatBug);
2245
2246 // Opera 12 has `,`
2247 defineProperties(Date.prototype, {
2248 toDateString: function toDateString() {
2249 if (!this || !(this instanceof Date)) {
2250 throw new TypeError('this is not a Date object.');
2251 }
2252 var day = this.getDay();
2253 var date = this.getDate();
2254 var month = this.getMonth();
2255 var year = this.getFullYear();
2256 return dayName[day] + ' ' +
2257 monthName[month] + ' ' +
2258 (date < 10 ? '0' + date : date) + ' ' +
2259 year;
2260 }
2261 }, hasNegativeMonthYearBug || hasToDateStringFormatBug);
2262
2263 // can't use defineProperties here because of toString enumeration issue in IE <= 8
2264 if (hasNegativeMonthYearBug || hasToStringFormatBug) {
2265 Date.prototype.toString = function toString() {
2266 if (!this || !(this instanceof Date)) {
2267 throw new TypeError('this is not a Date object.');
2268 }
2269 var day = this.getDay();
2270 var date = this.getDate();
2271 var month = this.getMonth();
2272 var year = this.getFullYear();
2273 var hour = this.getHours();
2274 var minute = this.getMinutes();
2275 var second = this.getSeconds();
2276 var timezoneOffset = this.getTimezoneOffset();
2277 var hoursOffset = Math.floor(Math.abs(timezoneOffset) / 60);
2278 var minutesOffset = Math.floor(Math.abs(timezoneOffset) % 60);
2279 return dayName[day] + ' ' +
2280 monthName[month] + ' ' +
2281 (date < 10 ? '0' + date : date) + ' ' +
2282 year + ' ' +
2283 (hour < 10 ? '0' + hour : hour) + ':' +
2284 (minute < 10 ? '0' + minute : minute) + ':' +
2285 (second < 10 ? '0' + second : second) + ' GMT' +
2286 (timezoneOffset > 0 ? '-' : '+') +
2287 (hoursOffset < 10 ? '0' + hoursOffset : hoursOffset) +
2288 (minutesOffset < 10 ? '0' + minutesOffset : minutesOffset);
2289 };
2290 if (supportsDescriptors) {
2291 $Object.defineProperty(Date.prototype, 'toString', {
2292 configurable: true,
2293 enumerable: false,
2294 writable: true
2295 });
2296 }
2297 }
2298
2299 // ES5 15.9.5.43
2300 // http://es5.github.com/#x15.9.5.43
2301 // This function returns a String value represent the instance in time
2302 // represented by this Date object. The format of the String is the Date Time
2303 // string format defined in 15.9.1.15. All fields are present in the String.
2304 // The time zone is always UTC, denoted by the suffix Z. If the time value of
2305 // this object is not a finite Number a RangeError exception is thrown.
2306 var negativeDate = -62198755200000;
2307 var negativeYearString = '-000001';
2308 var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1;
2309 var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z';
2310
2311 var getTime = call.bind(Date.prototype.getTime);
2312
2313 defineProperties(Date.prototype, {
2314 toISOString: function toISOString() {
2315 if (!isFinite(this) || !isFinite(getTime(this))) {
2316 // Adope Photoshop requires the second check.
2317 throw new RangeError('Date.prototype.toISOString called on non-finite value.');
2318 }
2319
2320 var year = originalGetUTCFullYear(this);
2321
2322 var month = originalGetUTCMonth(this);
2323 // see https://github.com/es-shims/es5-shim/issues/111
2324 year += Math.floor(month / 12);
2325 month = (month % 12 + 12) % 12;
2326
2327 // the date time string format is specified in 15.9.1.15.
2328 var result = [month + 1, originalGetUTCDate(this), originalGetUTCHours(this), originalGetUTCMinutes(this), originalGetUTCSeconds(this)];
2329 year = (
2330 (year < 0 ? '-' : (year > 9999 ? '+' : '')) +
2331 strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6)
2332 );
2333
2334 for (var i = 0; i < result.length; ++i) {
2335 // pad months, days, hours, minutes, and seconds to have two digits.
2336 result[i] = strSlice('00' + result[i], -2);
2337 }
2338 // pad milliseconds to have three digits.
2339 return (
2340 year + '-' + arraySlice(result, 0, 2).join('-') +
2341 'T' + arraySlice(result, 2).join(':') + '.' +
2342 strSlice('000' + originalGetUTCMilliseconds(this), -3) + 'Z'
2343 );
2344 }
2345 }, hasNegativeDateBug || hasSafari51DateBug);
2346
2347 // ES5 15.9.5.44
2348 // http://es5.github.com/#x15.9.5.44
2349 // This function provides a String representation of a Date object for use by
2350 // JSON.stringify (15.12.3).
2351 var dateToJSONIsSupported = (function () {
2352 try {
2353 return Date.prototype.toJSON &&
2354 new Date(NaN).toJSON() === null &&
2355 new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 &&
2356 Date.prototype.toJSON.call({ // generic
2357 toISOString: function () { return true; }
2358 });
2359 } catch (e) {
2360 return false;
2361 }
2362 }());
2363 if (!dateToJSONIsSupported) {
2364 Date.prototype.toJSON = function toJSON(key) {
2365 // When the toJSON method is called with argument key, the following
2366 // steps are taken:
2367
2368 // 1. Let O be the result of calling ToObject, giving it the this
2369 // value as its argument.
2370 // 2. Let tv be ES.ToPrimitive(O, hint Number).
2371 var O = $Object(this);
2372 var tv = ES.ToPrimitive(O);
2373 // 3. If tv is a Number and is not finite, return null.
2374 if (typeof tv === 'number' && !isFinite(tv)) {
2375 return null;
2376 }
2377 // 4. Let toISO be the result of calling the [[Get]] internal method of
2378 // O with argument "toISOString".
2379 var toISO = O.toISOString;
2380 // 5. If IsCallable(toISO) is false, throw a TypeError exception.
2381 if (!isCallable(toISO)) {
2382 throw new TypeError('toISOString property is not callable');
2383 }
2384 // 6. Return the result of calling the [[Call]] internal method of
2385 // toISO with O as the this value and an empty argument list.
2386 return toISO.call(O);
2387
2388 // NOTE 1 The argument is ignored.
2389
2390 // NOTE 2 The toJSON function is intentionally generic; it does not
2391 // require that its this value be a Date object. Therefore, it can be
2392 // transferred to other kinds of objects for use as a method. However,
2393 // it does require that any such object have a toISOString method. An
2394 // object is free to use the argument key to filter its
2395 // stringification.
2396 };
2397 }
2398
2399 // ES5 15.9.4.2
2400 // http://es5.github.com/#x15.9.4.2
2401 // based on work shared by Daniel Friesen (dantman)
2402 // http://gist.github.com/303249
2403 var supportsExtendedYears = Date.parse('+033658-09-27T01:46:40.000Z') === 1e15;
2404 var acceptsInvalidDates = !isNaN(Date.parse('2012-04-04T24:00:00.500Z')) || !isNaN(Date.parse('2012-11-31T23:59:59.000Z')) || !isNaN(Date.parse('2012-12-31T23:59:60.000Z'));
2405 var doesNotParseY2KNewYear = isNaN(Date.parse('2000-01-01T00:00:00.000Z'));
2406 if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) {
2407 // XXX global assignment won't work in embeddings that use
2408 // an alternate object for the context.
2409 /* global Date: true */
2410 /* eslint-disable no-undef */
2411 var maxSafeUnsigned32Bit = Math.pow(2, 31) - 1;
2412 var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime());
2413 /* eslint-disable no-implicit-globals */
2414 Date = (function (NativeDate) {
2415 /* eslint-enable no-implicit-globals */
2416 /* eslint-enable no-undef */
2417 // Date.length === 7
2418 var DateShim = function Date(Y, M, D, h, m, s, ms) {
2419 var length = arguments.length;
2420 var date;
2421 if (this instanceof NativeDate) {
2422 var seconds = s;
2423 var millis = ms;
2424 if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) {
2425 // work around a Safari 8/9 bug where it treats the seconds as signed
2426 var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
2427 var sToShift = Math.floor(msToShift / 1e3);
2428 seconds += sToShift;
2429 millis -= sToShift * 1e3;
2430 }
2431 date = length === 1 && $String(Y) === Y ? // isString(Y)
2432 // We explicitly pass it through parse:
2433 new NativeDate(DateShim.parse(Y)) :
2434 // We have to manually make calls depending on argument
2435 // length here
2436 length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis) :
2437 length >= 6 ? new NativeDate(Y, M, D, h, m, seconds) :
2438 length >= 5 ? new NativeDate(Y, M, D, h, m) :
2439 length >= 4 ? new NativeDate(Y, M, D, h) :
2440 length >= 3 ? new NativeDate(Y, M, D) :
2441 length >= 2 ? new NativeDate(Y, M) :
2442 length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y) :
2443 new NativeDate();
2444 } else {
2445 date = NativeDate.apply(this, arguments);
2446 }
2447 if (!isPrimitive(date)) {
2448 // Prevent mixups with unfixed Date object
2449 defineProperties(date, { constructor: DateShim }, true);
2450 }
2451 return date;
2452 };
2453
2454 // 15.9.1.15 Date Time String Format.
2455 var isoDateExpression = new RegExp('^' +
2456 '(\\d{4}|[+-]\\d{6})' + // four-digit year capture or sign +
2457 // 6-digit extended year
2458 '(?:-(\\d{2})' + // optional month capture
2459 '(?:-(\\d{2})' + // optional day capture
2460 '(?:' + // capture hours:minutes:seconds.milliseconds
2461 'T(\\d{2})' + // hours capture
2462 ':(\\d{2})' + // minutes capture
2463 '(?:' + // optional :seconds.milliseconds
2464 ':(\\d{2})' + // seconds capture
2465 '(?:(\\.\\d{1,}))?' + // milliseconds capture
2466 ')?' +
2467 '(' + // capture UTC offset component
2468 'Z|' + // UTC capture
2469 '(?:' + // offset specifier +/-hours:minutes
2470 '([-+])' + // sign capture
2471 '(\\d{2})' + // hours offset capture
2472 ':(\\d{2})' + // minutes offset capture
2473 ')' +
2474 ')?)?)?)?' +
2475 '$');
2476
2477 var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
2478
2479 var dayFromMonth = function dayFromMonth(year, month) {
2480 var t = month > 1 ? 1 : 0;
2481 return (
2482 months[month] +
2483 Math.floor((year - 1969 + t) / 4) -
2484 Math.floor((year - 1901 + t) / 100) +
2485 Math.floor((year - 1601 + t) / 400) +
2486 365 * (year - 1970)
2487 );
2488 };
2489
2490 var toUTC = function toUTC(t) {
2491 var s = 0;
2492 var ms = t;
2493 if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) {
2494 // work around a Safari 8/9 bug where it treats the seconds as signed
2495 var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
2496 var sToShift = Math.floor(msToShift / 1e3);
2497 s += sToShift;
2498 ms -= sToShift * 1e3;
2499 }
2500 return $Number(new NativeDate(1970, 0, 1, 0, 0, s, ms));
2501 };
2502
2503 // Copy any custom methods a 3rd party library may have added
2504 for (var key in NativeDate) {
2505 if (owns(NativeDate, key)) {
2506 DateShim[key] = NativeDate[key];
2507 }
2508 }
2509
2510 // Copy "native" methods explicitly; they may be non-enumerable
2511 defineProperties(DateShim, {
2512 now: NativeDate.now,
2513 UTC: NativeDate.UTC
2514 }, true);
2515 DateShim.prototype = NativeDate.prototype;
2516 defineProperties(DateShim.prototype, {
2517 constructor: DateShim
2518 }, true);
2519
2520 // Upgrade Date.parse to handle simplified ISO 8601 strings
2521 var parseShim = function parse(string) {
2522 var match = isoDateExpression.exec(string);
2523 if (match) {
2524 // parse months, days, hours, minutes, seconds, and milliseconds
2525 // provide default values if necessary
2526 // parse the UTC offset component
2527 var year = $Number(match[1]),
2528 month = $Number(match[2] || 1) - 1,
2529 day = $Number(match[3] || 1) - 1,
2530 hour = $Number(match[4] || 0),
2531 minute = $Number(match[5] || 0),
2532 second = $Number(match[6] || 0),
2533 millisecond = Math.floor($Number(match[7] || 0) * 1000),
2534 // When time zone is missed, local offset should be used
2535 // (ES 5.1 bug)
2536 // see https://bugs.ecmascript.org/show_bug.cgi?id=112
2537 isLocalTime = Boolean(match[4] && !match[8]),
2538 signOffset = match[9] === '-' ? 1 : -1,
2539 hourOffset = $Number(match[10] || 0),
2540 minuteOffset = $Number(match[11] || 0),
2541 result;
2542 var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0;
2543 if (
2544 hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) &&
2545 minute < 60 && second < 60 && millisecond < 1000 &&
2546 month > -1 && month < 12 && hourOffset < 24 &&
2547 minuteOffset < 60 && // detect invalid offsets
2548 day > -1 &&
2549 day < (dayFromMonth(year, month + 1) - dayFromMonth(year, month))
2550 ) {
2551 result = (
2552 (dayFromMonth(year, month) + day) * 24 +
2553 hour +
2554 hourOffset * signOffset
2555 ) * 60;
2556 result = (
2557 (result + minute + minuteOffset * signOffset) * 60 +
2558 second
2559 ) * 1000 + millisecond;
2560 if (isLocalTime) {
2561 result = toUTC(result);
2562 }
2563 if (-8.64e15 <= result && result <= 8.64e15) {
2564 return result;
2565 }
2566 }
2567 return NaN;
2568 }
2569 return NativeDate.parse.apply(this, arguments);
2570 };
2571 defineProperties(DateShim, { parse: parseShim });
2572
2573 return DateShim;
2574 }(Date));
2575 /* global Date: false */
2576 }
2577
2578 // ES5 15.9.4.4
2579 // http://es5.github.com/#x15.9.4.4
2580 if (!Date.now) {
2581 Date.now = function now() {
2582 return new Date().getTime();
2583 };
2584 }
2585
2586 //
2587 // Number
2588 // ======
2589 //
2590
2591 // ES5.1 15.7.4.5
2592 // http://es5.github.com/#x15.7.4.5
2593 var hasToFixedBugs = NumberPrototype.toFixed && (
2594 (0.00008).toFixed(3) !== '0.000' ||
2595 (0.9).toFixed(0) !== '1' ||
2596 (1.255).toFixed(2) !== '1.25' ||
2597 (1000000000000000128).toFixed(0) !== '1000000000000000128'
2598 );
2599
2600 var toFixedHelpers = {
2601 base: 1e7,
2602 size: 6,
2603 data: [0, 0, 0, 0, 0, 0],
2604 multiply: function multiply(n, c) {
2605 var i = -1;
2606 var c2 = c;
2607 while (++i < toFixedHelpers.size) {
2608 c2 += n * toFixedHelpers.data[i];
2609 toFixedHelpers.data[i] = c2 % toFixedHelpers.base;
2610 c2 = Math.floor(c2 / toFixedHelpers.base);
2611 }
2612 },
2613 divide: function divide(n) {
2614 var i = toFixedHelpers.size;
2615 var c = 0;
2616 while (--i >= 0) {
2617 c += toFixedHelpers.data[i];
2618 toFixedHelpers.data[i] = Math.floor(c / n);
2619 c = (c % n) * toFixedHelpers.base;
2620 }
2621 },
2622 numToString: function numToString() {
2623 var i = toFixedHelpers.size;
2624 var s = '';
2625 while (--i >= 0) {
2626 if (s !== '' || i === 0 || toFixedHelpers.data[i] !== 0) {
2627 var t = $String(toFixedHelpers.data[i]);
2628 if (s === '') {
2629 s = t;
2630 } else {
2631 s += strSlice('0000000', 0, 7 - t.length) + t;
2632 }
2633 }
2634 }
2635 return s;
2636 },
2637 pow: function pow(x, n, acc) {
2638 return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc)));
2639 },
2640 log: function log(x) {
2641 var n = 0;
2642 var x2 = x;
2643 while (x2 >= 4096) {
2644 n += 12;
2645 x2 /= 4096;
2646 }
2647 while (x2 >= 2) {
2648 n += 1;
2649 x2 /= 2;
2650 }
2651 return n;
2652 }
2653 };
2654
2655 var toFixedShim = function toFixed(fractionDigits) {
2656 var f, x, s, m, e, z, j, k;
2657
2658 // Test for NaN and round fractionDigits down
2659 f = $Number(fractionDigits);
2660 f = isActualNaN(f) ? 0 : Math.floor(f);
2661
2662 if (f < 0 || f > 20) {
2663 throw new RangeError('Number.toFixed called with invalid number of decimals');
2664 }
2665
2666 x = $Number(this);
2667
2668 if (isActualNaN(x)) {
2669 return 'NaN';
2670 }
2671
2672 // If it is too big or small, return the string value of the number
2673 if (x <= -1e21 || x >= 1e21) {
2674 return $String(x);
2675 }
2676
2677 s = '';
2678
2679 if (x < 0) {
2680 s = '-';
2681 x = -x;
2682 }
2683
2684 m = '0';
2685
2686 if (x > 1e-21) {
2687 // 1e-21 < x < 1e21
2688 // -70 < log2(x) < 70
2689 e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69;
2690 z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1));
2691 z *= 0x10000000000000; // Math.pow(2, 52);
2692 e = 52 - e;
2693
2694 // -18 < e < 122
2695 // x = z / 2 ^ e
2696 if (e > 0) {
2697 toFixedHelpers.multiply(0, z);
2698 j = f;
2699
2700 while (j >= 7) {
2701 toFixedHelpers.multiply(1e7, 0);
2702 j -= 7;
2703 }
2704
2705 toFixedHelpers.multiply(toFixedHelpers.pow(10, j, 1), 0);
2706 j = e - 1;
2707
2708 while (j >= 23) {
2709 toFixedHelpers.divide(1 << 23);
2710 j -= 23;
2711 }
2712
2713 toFixedHelpers.divide(1 << j);
2714 toFixedHelpers.multiply(1, 1);
2715 toFixedHelpers.divide(2);
2716 m = toFixedHelpers.numToString();
2717 } else {
2718 toFixedHelpers.multiply(0, z);
2719 toFixedHelpers.multiply(1 << (-e), 0);
2720 m = toFixedHelpers.numToString() + strSlice('0.00000000000000000000', 2, 2 + f);
2721 }
2722 }
2723
2724 if (f > 0) {
2725 k = m.length;
2726
2727 if (k <= f) {
2728 m = s + strSlice('0.0000000000000000000', 0, f - k + 2) + m;
2729 } else {
2730 m = s + strSlice(m, 0, k - f) + '.' + strSlice(m, k - f);
2731 }
2732 } else {
2733 m = s + m;
2734 }
2735
2736 return m;
2737 };
2738 defineProperties(NumberPrototype, { toFixed: toFixedShim }, hasToFixedBugs);
2739
2740 var hasToPrecisionUndefinedBug = (function () {
2741 try {
2742 return 1.0.toPrecision(undefined) === '1';
2743 } catch (e) {
2744 return true;
2745 }
2746 }());
2747 var originalToPrecision = NumberPrototype.toPrecision;
2748 defineProperties(NumberPrototype, {
2749 toPrecision: function toPrecision(precision) {
2750 return typeof precision === 'undefined' ? originalToPrecision.call(this) : originalToPrecision.call(this, precision);
2751 }
2752 }, hasToPrecisionUndefinedBug);
2753
2754 //
2755 // String
2756 // ======
2757 //
2758
2759 // ES5 15.5.4.14
2760 // http://es5.github.com/#x15.5.4.14
2761
2762 // [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
2763 // Many browsers do not split properly with regular expressions or they
2764 // do not perform the split correctly under obscure conditions.
2765 // See http://blog.stevenlevithan.com/archives/cross-browser-split
2766 // I've tested in many browsers and this seems to cover the deviant ones:
2767 // 'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
2768 // '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
2769 // 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not
2770 // [undefined, "t", undefined, "e", ...]
2771 // ''.split(/.?/) should be [], not [""]
2772 // '.'.split(/()()/) should be ["."], not ["", "", "."]
2773
2774 if (
2775 'ab'.split(/(?:ab)*/).length !== 2 ||
2776 '.'.split(/(.?)(.?)/).length !== 4 ||
2777 'tesst'.split(/(s)*/)[1] === 't' ||
2778 'test'.split(/(?:)/, -1).length !== 4 ||
2779 ''.split(/.?/).length ||
2780 '.'.split(/()()/).length > 1
2781 ) {
2782 (function () {
2783 var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group
2784 var maxSafe32BitInt = Math.pow(2, 32) - 1;
2785
2786 StringPrototype.split = function (separator, limit) {
2787 var string = String(this);
2788 if (typeof separator === 'undefined' && limit === 0) {
2789 return [];
2790 }
2791
2792 // If `separator` is not a regex, use native split
2793 if (!isRegex(separator)) {
2794 return strSplit(this, separator, limit);
2795 }
2796
2797 var output = [];
2798 var flags = (separator.ignoreCase ? 'i' : '') +
2799 (separator.multiline ? 'm' : '') +
2800 (separator.unicode ? 'u' : '') + // in ES6
2801 (separator.sticky ? 'y' : ''), // Firefox 3+ and ES6
2802 lastLastIndex = 0,
2803 // Make `global` and avoid `lastIndex` issues by working with a copy
2804 separator2, match, lastIndex, lastLength;
2805 var separatorCopy = new RegExp(separator.source, flags + 'g');
2806 if (!compliantExecNpcg) {
2807 // Doesn't need flags gy, but they don't hurt
2808 separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
2809 }
2810 /* Values for `limit`, per the spec:
2811 * If undefined: 4294967295 // maxSafe32BitInt
2812 * If 0, Infinity, or NaN: 0
2813 * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
2814 * If negative number: 4294967296 - Math.floor(Math.abs(limit))
2815 * If other: Type-convert, then use the above rules
2816 */
2817 var splitLimit = typeof limit === 'undefined' ? maxSafe32BitInt : ES.ToUint32(limit);
2818 match = separatorCopy.exec(string);
2819 while (match) {
2820 // `separatorCopy.lastIndex` is not reliable cross-browser
2821 lastIndex = match.index + match[0].length;
2822 if (lastIndex > lastLastIndex) {
2823 pushCall(output, strSlice(string, lastLastIndex, match.index));
2824 // Fix browsers whose `exec` methods don't consistently return `undefined` for
2825 // nonparticipating capturing groups
2826 if (!compliantExecNpcg && match.length > 1) {
2827 /* eslint-disable no-loop-func */
2828 match[0].replace(separator2, function () {
2829 for (var i = 1; i < arguments.length - 2; i++) {
2830 if (typeof arguments[i] === 'undefined') {
2831 match[i] = void 0;
2832 }
2833 }
2834 });
2835 /* eslint-enable no-loop-func */
2836 }
2837 if (match.length > 1 && match.index < string.length) {
2838 array_push.apply(output, arraySlice(match, 1));
2839 }
2840 lastLength = match[0].length;
2841 lastLastIndex = lastIndex;
2842 if (output.length >= splitLimit) {
2843 break;
2844 }
2845 }
2846 if (separatorCopy.lastIndex === match.index) {
2847 separatorCopy.lastIndex++; // Avoid an infinite loop
2848 }
2849 match = separatorCopy.exec(string);
2850 }
2851 if (lastLastIndex === string.length) {
2852 if (lastLength || !separatorCopy.test('')) {
2853 pushCall(output, '');
2854 }
2855 } else {
2856 pushCall(output, strSlice(string, lastLastIndex));
2857 }
2858 return output.length > splitLimit ? arraySlice(output, 0, splitLimit) : output;
2859 };
2860 }());
2861
2862 // [bugfix, chrome]
2863 // If separator is undefined, then the result array contains just one String,
2864 // which is the this value (converted to a String). If limit is not undefined,
2865 // then the output array is truncated so that it contains no more than limit
2866 // elements.
2867 // "0".split(undefined, 0) -> []
2868 } else if ('0'.split(void 0, 0).length) {
2869 StringPrototype.split = function split(separator, limit) {
2870 if (typeof separator === 'undefined' && limit === 0) {
2871 return [];
2872 }
2873 return strSplit(this, separator, limit);
2874 };
2875 }
2876
2877 var str_replace = StringPrototype.replace;
2878 var replaceReportsGroupsCorrectly = (function () {
2879 var groups = [];
2880 'x'.replace(/x(.)?/g, function (match, group) {
2881 pushCall(groups, group);
2882 });
2883 return groups.length === 1 && typeof groups[0] === 'undefined';
2884 }());
2885
2886 if (!replaceReportsGroupsCorrectly) {
2887 StringPrototype.replace = function replace(searchValue, replaceValue) {
2888 var isFn = isCallable(replaceValue);
2889 var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source);
2890 if (!isFn || !hasCapturingGroups) {
2891 return str_replace.call(this, searchValue, replaceValue);
2892 } else {
2893 var wrappedReplaceValue = function (match) {
2894 var length = arguments.length;
2895 var originalLastIndex = searchValue.lastIndex;
2896 searchValue.lastIndex = 0;
2897 var args = searchValue.exec(match) || [];
2898 searchValue.lastIndex = originalLastIndex;
2899 pushCall(args, arguments[length - 2], arguments[length - 1]);
2900 return replaceValue.apply(this, args);
2901 };
2902 return str_replace.call(this, searchValue, wrappedReplaceValue);
2903 }
2904 };
2905 }
2906
2907 // ECMA-262, 3rd B.2.3
2908 // Not an ECMAScript standard, although ECMAScript 3rd Edition has a
2909 // non-normative section suggesting uniform semantics and it should be
2910 // normalized across all browsers
2911 // [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
2912 var string_substr = StringPrototype.substr;
2913 var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b';
2914 defineProperties(StringPrototype, {
2915 substr: function substr(start, length) {
2916 var normalizedStart = start;
2917 if (start < 0) {
2918 normalizedStart = max(this.length + start, 0);
2919 }
2920 return string_substr.call(this, normalizedStart, length);
2921 }
2922 }, hasNegativeSubstrBug);
2923
2924 // ES5 15.5.4.20
2925 // whitespace from: http://es5.github.io/#x15.5.4.20
2926 var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
2927 '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028' +
2928 '\u2029\uFEFF';
2929 var zeroWidth = '\u200b';
2930 var wsRegexChars = '[' + ws + ']';
2931 var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*');
2932 var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$');
2933 var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWidth.trim());
2934 defineProperties(StringPrototype, {
2935 // http://blog.stevenlevithan.com/archives/faster-trim-javascript
2936 // http://perfectionkills.com/whitespace-deviations/
2937 trim: function trim() {
2938 if (typeof this === 'undefined' || this === null) {
2939 throw new TypeError("can't convert " + this + ' to object');
2940 }
2941 return $String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, '');
2942 }
2943 }, hasTrimWhitespaceBug);
2944 var trim = call.bind(String.prototype.trim);
2945
2946 var hasLastIndexBug = StringPrototype.lastIndexOf && 'abcあい'.lastIndexOf('あい', 2) !== -1;
2947 defineProperties(StringPrototype, {
2948 lastIndexOf: function lastIndexOf(searchString) {
2949 if (typeof this === 'undefined' || this === null) {
2950 throw new TypeError("can't convert " + this + ' to object');
2951 }
2952 var S = $String(this);
2953 var searchStr = $String(searchString);
2954 var numPos = arguments.length > 1 ? $Number(arguments[1]) : NaN;
2955 var pos = isActualNaN(numPos) ? Infinity : ES.ToInteger(numPos);
2956 var start = min(max(pos, 0), S.length);
2957 var searchLen = searchStr.length;
2958 var k = start + searchLen;
2959 while (k > 0) {
2960 k = max(0, k - searchLen);
2961 var index = strIndexOf(strSlice(S, k, start + searchLen), searchStr);
2962 if (index !== -1) {
2963 return k + index;
2964 }
2965 }
2966 return -1;
2967 }
2968 }, hasLastIndexBug);
2969
2970 var originalLastIndexOf = StringPrototype.lastIndexOf;
2971 defineProperties(StringPrototype, {
2972 lastIndexOf: function lastIndexOf(searchString) {
2973 return originalLastIndexOf.apply(this, arguments);
2974 }
2975 }, StringPrototype.lastIndexOf.length !== 1);
2976
2977 // ES-5 15.1.2.2
2978 /* eslint-disable radix */
2979 if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) {
2980 /* eslint-enable radix */
2981 /* global parseInt: true */
2982 parseInt = (function (origParseInt) {
2983 var hexRegex = /^[\-+]?0[xX]/;
2984 return function parseInt(str, radix) {
2985 var string = trim(String(str));
2986 var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
2987 return origParseInt(string, defaultedRadix);
2988 };
2989 }(parseInt));
2990 }
2991
2992 // https://es5.github.io/#x15.1.2.3
2993 if (1 / parseFloat('-0') !== -Infinity) {
2994 /* global parseFloat: true */
2995 parseFloat = (function (origParseFloat) {
2996 return function parseFloat(string) {
2997 var inputString = trim(String(string));
2998 var result = origParseFloat(inputString);
2999 return result === 0 && strSlice(inputString, 0, 1) === '-' ? -0 : result;
3000 };
3001 }(parseFloat));
3002 }
3003
3004 if (String(new RangeError('test')) !== 'RangeError: test') {
3005 var errorToStringShim = function toString() {
3006 if (typeof this === 'undefined' || this === null) {
3007 throw new TypeError("can't convert " + this + ' to object');
3008 }
3009 var name = this.name;
3010 if (typeof name === 'undefined') {
3011 name = 'Error';
3012 } else if (typeof name !== 'string') {
3013 name = $String(name);
3014 }
3015 var msg = this.message;
3016 if (typeof msg === 'undefined') {
3017 msg = '';
3018 } else if (typeof msg !== 'string') {
3019 msg = $String(msg);
3020 }
3021 if (!name) {
3022 return msg;
3023 }
3024 if (!msg) {
3025 return name;
3026 }
3027 return name + ': ' + msg;
3028 };
3029 // can't use defineProperties here because of toString enumeration issue in IE <= 8
3030 Error.prototype.toString = errorToStringShim;
3031 }
3032
3033 if (supportsDescriptors) {
3034 var ensureNonEnumerable = function (obj, prop) {
3035 if (isEnum(obj, prop)) {
3036 var desc = Object.getOwnPropertyDescriptor(obj, prop);
3037 if (desc.configurable) {
3038 desc.enumerable = false;
3039 Object.defineProperty(obj, prop, desc);
3040 }
3041 }
3042 };
3043 ensureNonEnumerable(Error.prototype, 'message');
3044 if (Error.prototype.message !== '') {
3045 Error.prototype.message = '';
3046 }
3047 ensureNonEnumerable(Error.prototype, 'name');
3048 }
3049
3050 if (String(/a/mig) !== '/a/gim') {
3051 var regexToString = function toString() {
3052 var str = '/' + this.source + '/';
3053 if (this.global) {
3054 str += 'g';
3055 }
3056 if (this.ignoreCase) {
3057 str += 'i';
3058 }
3059 if (this.multiline) {
3060 str += 'm';
3061 }
3062 return str;
3063 };
3064 // can't use defineProperties here because of toString enumeration issue in IE <= 8
3065 RegExp.prototype.toString = regexToString;
3066 }
3067}));
3068
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003069'use strict';
Jian Li8afbbee2016-07-27 19:16:51 +09003070/*jslint eqeq: true*/
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003071
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003072Handlebars.registerHelper('sanitize', function (text) {
3073 var result;
3074
3075 if (text === undefined) { return ''; }
3076
3077 result = sanitizeHtml(text, {
Jian Li1c94b9d2017-02-08 15:47:21 +09003078 allowedTags: [ 'div', 'span', 'b', 'i', 'em', 'strong', 'a', 'br', 'table', 'tbody', 'tr', 'th', 'td' ],
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003079 allowedAttributes: {
3080 'div': [ 'class' ],
3081 'span': [ 'class' ],
Jian Li1c94b9d2017-02-08 15:47:21 +09003082 'table': [ 'class' ],
3083 'td': [ 'class' ],
3084 'th': [ 'colspan' ],
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003085 'a': [ 'href' ]
3086 }
3087 });
3088
3089 return new Handlebars.SafeString(result);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003090});
3091
3092Handlebars.registerHelper('renderTextParam', function(param) {
3093 var result, type = 'text', idAtt = '';
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003094 var paramType = param.type || param.schema && param.schema.type || '';
Jian Li83d87a72016-04-20 15:38:24 -07003095 var isArray = paramType.toLowerCase() === 'array' || param.allowMultiple;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003096 var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003097 var name = Handlebars.Utils.escapeExpression(param.name);
3098 var valueId = Handlebars.Utils.escapeExpression(param.valueId);
3099 paramType = Handlebars.Utils.escapeExpression(paramType);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003100
Jian Li83d87a72016-04-20 15:38:24 -07003101 var dataVendorExtensions = Object.keys(param).filter(function(property) {
3102 // filter X-data- properties
3103 return property.match(/^X-data-/i) !== null;
3104 }).reduce(function(result, property) {
3105 // remove X- from property name, so it results in html attributes like data-foo='bar'
3106 return result += ' ' + property.substring(2, property.length) + '=\'' + param[property] + '\'';
3107 }, '');
3108
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003109 if(param.format && param.format === 'password') {
3110 type = 'password';
3111 }
3112
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003113 if(valueId) {
3114 idAtt = ' id=\'' + valueId + '\'';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003115 }
3116
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003117 if (defaultValue) {
3118 defaultValue = sanitizeHtml(defaultValue);
3119 } else {
3120 defaultValue = '';
Jian Li83d87a72016-04-20 15:38:24 -07003121 }
3122
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003123 if(isArray) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003124 result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + name + '\'' + idAtt + dataVendorExtensions;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003125 result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>';
3126 result += defaultValue + '</textarea>';
3127 } else {
3128 var parameterClass = 'parameter';
3129 if(param.required) {
3130 parameterClass += ' required';
3131 }
3132 result = '<input class=\'' + parameterClass + '\' minlength=\'' + (param.required ? 1 : 0) + '\'';
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003133 result += ' name=\'' + name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt + dataVendorExtensions;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003134 result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>';
3135 }
3136 return new Handlebars.SafeString(result);
3137});
3138
Jian Li8afbbee2016-07-27 19:16:51 +09003139Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
3140
3141 switch (operator) {
3142 case '==':
3143 return (v1 == v2) ? options.fn(this) : options.inverse(this);
3144 case '===':
3145 return (v1 === v2) ? options.fn(this) : options.inverse(this);
3146 case '<':
3147 return (v1 < v2) ? options.fn(this) : options.inverse(this);
3148 case '<=':
3149 return (v1 <= v2) ? options.fn(this) : options.inverse(this);
3150 case '>':
3151 return (v1 > v2) ? options.fn(this) : options.inverse(this);
3152 case '>=':
3153 return (v1 >= v2) ? options.fn(this) : options.inverse(this);
3154 case '&&':
3155 return (v1 && v2) ? options.fn(this) : options.inverse(this);
3156 case '||':
3157 return (v1 || v2) ? options.fn(this) : options.inverse(this);
3158 default:
3159 return options.inverse(this);
3160 }
3161});
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003162
3163Handlebars.registerHelper('escape', function (value) {
3164 var text = Handlebars.Utils.escapeExpression(value);
3165
3166 return new Handlebars.SafeString(text);
3167});
3168
3169(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.sanitizeHtml=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){var htmlparser=require("htmlparser2");var extend=require("xtend");var quoteRegexp=require("regexp-quote");function each(obj,cb){if(obj)Object.keys(obj).forEach(function(key){cb(obj[key],key)})}function has(obj,key){return{}.hasOwnProperty.call(obj,key)}module.exports=sanitizeHtml;function sanitizeHtml(html,options,_recursing){var result="";function Frame(tag,attribs){var that=this;this.tag=tag;this.attribs=attribs||{};this.tagPosition=result.length;this.text="";this.updateParentNodeText=function(){if(stack.length){var parentFrame=stack[stack.length-1];parentFrame.text+=that.text}}}if(!options){options=sanitizeHtml.defaults;options.parser=htmlParserDefaults}else{options=extend(sanitizeHtml.defaults,options);if(options.parser){options.parser=extend(htmlParserDefaults,options.parser)}else{options.parser=htmlParserDefaults}}var nonTextTagsArray=options.nonTextTags||["script","style","textarea"];var allowedAttributesMap;var allowedAttributesGlobMap;if(options.allowedAttributes){allowedAttributesMap={};allowedAttributesGlobMap={};each(options.allowedAttributes,function(attributes,tag){allowedAttributesMap[tag]=[];var globRegex=[];attributes.forEach(function(name){if(name.indexOf("*")>=0){globRegex.push(quoteRegexp(name).replace(/\\\*/g,".*"))}else{allowedAttributesMap[tag].push(name)}});allowedAttributesGlobMap[tag]=new RegExp("^("+globRegex.join("|")+")$")})}var allowedClassesMap={};each(options.allowedClasses,function(classes,tag){if(allowedAttributesMap){if(!has(allowedAttributesMap,tag)){allowedAttributesMap[tag]=[]}allowedAttributesMap[tag].push("class")}allowedClassesMap[tag]=classes});var transformTagsMap={};var transformTagsAll;each(options.transformTags,function(transform,tag){var transFun;if(typeof transform==="function"){transFun=transform}else if(typeof transform==="string"){transFun=sanitizeHtml.simpleTransform(transform)}if(tag==="*"){transformTagsAll=transFun}else{transformTagsMap[tag]=transFun}});var depth=0;var stack=[];var skipMap={};var transformMap={};var skipText=false;var skipTextDepth=0;var parser=new htmlparser.Parser({onopentag:function(name,attribs){if(skipText){skipTextDepth++;return}var frame=new Frame(name,attribs);stack.push(frame);var skip=false;var hasText=frame.text?true:false;var transformedTag;if(has(transformTagsMap,name)){transformedTag=transformTagsMap[name](name,attribs);frame.attribs=attribs=transformedTag.attribs;if(transformedTag.text!==undefined){frame.innerText=transformedTag.text}if(name!==transformedTag.tagName){frame.name=name=transformedTag.tagName;transformMap[depth]=transformedTag.tagName}}if(transformTagsAll){transformedTag=transformTagsAll(name,attribs);frame.attribs=attribs=transformedTag.attribs;if(name!==transformedTag.tagName){frame.name=name=transformedTag.tagName;transformMap[depth]=transformedTag.tagName}}if(options.allowedTags&&options.allowedTags.indexOf(name)===-1){skip=true;if(nonTextTagsArray.indexOf(name)!==-1){skipText=true;skipTextDepth=1}skipMap[depth]=true}depth++;if(skip){return}result+="<"+name;if(!allowedAttributesMap||has(allowedAttributesMap,name)||allowedAttributesMap["*"]){each(attribs,function(value,a){if(!allowedAttributesMap||has(allowedAttributesMap,name)&&allowedAttributesMap[name].indexOf(a)!==-1||allowedAttributesMap["*"]&&allowedAttributesMap["*"].indexOf(a)!==-1||has(allowedAttributesGlobMap,name)&&allowedAttributesGlobMap[name].test(a)||allowedAttributesGlobMap["*"]&&allowedAttributesGlobMap["*"].test(a)){if(a==="href"||a==="src"){if(naughtyHref(name,value)){delete frame.attribs[a];return}}if(a==="class"){value=filterClasses(value,allowedClassesMap[name]);if(!value.length){delete frame.attribs[a];return}}result+=" "+a;if(value.length){result+='="'+escapeHtml(value)+'"'}}else{delete frame.attribs[a]}})}if(options.selfClosing.indexOf(name)!==-1){result+=" />"}else{result+=">";if(frame.innerText&&!hasText&&!options.textFilter){result+=frame.innerText}}},ontext:function(text){if(skipText){return}var lastFrame=stack[stack.length-1];var tag;if(lastFrame){tag=lastFrame.tag;text=lastFrame.innerText!==undefined?lastFrame.innerText:text}if(tag==="script"||tag==="style"){result+=text}else{var escaped=escapeHtml(text);if(options.textFilter){result+=options.textFilter(escaped)}else{result+=escaped}}if(stack.length){var frame=stack[stack.length-1];frame.text+=text}},onclosetag:function(name){if(skipText){skipTextDepth--;if(!skipTextDepth){skipText=false}else{return}}var frame=stack.pop();if(!frame){return}skipText=false;depth--;if(skipMap[depth]){delete skipMap[depth];frame.updateParentNodeText();return}if(transformMap[depth]){name=transformMap[depth];delete transformMap[depth]}if(options.exclusiveFilter&&options.exclusiveFilter(frame)){result=result.substr(0,frame.tagPosition);return}frame.updateParentNodeText();if(options.selfClosing.indexOf(name)!==-1){return}result+="</"+name+">"}},options.parser);parser.write(html);parser.end();return result;function escapeHtml(s){if(typeof s!=="string"){s=s+""}return s.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/\>/g,"&gt;").replace(/\"/g,"&quot;")}function naughtyHref(name,href){href=href.replace(/[\x00-\x20]+/g,"");href=href.replace(/<\!\-\-.*?\-\-\>/g,"");var matches=href.match(/^([a-zA-Z]+)\:/);if(!matches){return false}var scheme=matches[1].toLowerCase();if(has(options.allowedSchemesByTag,name)){return options.allowedSchemesByTag[name].indexOf(scheme)===-1}return!options.allowedSchemes||options.allowedSchemes.indexOf(scheme)===-1}function filterClasses(classes,allowed){if(!allowed){return classes}classes=classes.split(/\s+/);return classes.filter(function(clss){return allowed.indexOf(clss)!==-1}).join(" ")}}var htmlParserDefaults={decodeEntities:true};sanitizeHtml.defaults={allowedTags:["h3","h4","h5","h6","blockquote","p","a","ul","ol","nl","li","b","i","strong","em","strike","code","hr","br","div","table","thead","caption","tbody","tr","th","td","pre"],allowedAttributes:{a:["href","name","target"],img:["src"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto"],allowedSchemesByTag:{}};sanitizeHtml.simpleTransform=function(newTagName,newAttribs,merge){merge=merge===undefined?true:merge;newAttribs=newAttribs||{};return function(tagName,attribs){var attrib;if(merge){for(attrib in newAttribs){attribs[attrib]=newAttribs[attrib]}}else{attribs=newAttribs}return{tagName:newTagName,attribs:attribs}}}},{htmlparser2:36,"regexp-quote":54,xtend:58}],2:[function(require,module,exports){"use strict";exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;function init(){var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i}revLookup["-".charCodeAt(0)]=62;revLookup["_".charCodeAt(0)]=63}init();function toByteArray(b64){var i,j,l,tmp,placeHolders,arr;var len=b64.length;if(len%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}placeHolders=b64[len-2]==="="?2:b64[len-1]==="="?1:0;arr=new Arr(len*3/4-placeHolders);l=placeHolders>0?len-4:len;var L=0;for(i=0,j=0;i<l;i+=4,j+=3){tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)];arr[L++]=tmp>>16&255;arr[L++]=tmp>>8&255;arr[L++]=tmp&255}if(placeHolders===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[L++]=tmp&255}else if(placeHolders===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[L++]=tmp>>8&255;arr[L++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;i<end;i+=3){tmp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output.push(tripletToBase64(tmp))}return output.join("")}function fromByteArray(uint8){var tmp;var len=uint8.length;var extraBytes=len%3;var output="";var parts=[];var maxChunkLength=16383;for(var i=0,len2=len-extraBytes;i<len2;i+=maxChunkLength){parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];output+=lookup[tmp>>2];output+=lookup[tmp<<4&63];output+="=="}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];output+=lookup[tmp>>10];output+=lookup[tmp>>4&63];output+=lookup[tmp<<2&63];output+="="}parts.push(output);return parts.join("")}},{}],3:[function(require,module,exports){},{}],4:[function(require,module,exports){(function(global){"use strict";var buffer=require("buffer");var Buffer=buffer.Buffer;var SlowBuffer=buffer.SlowBuffer;var MAX_LEN=buffer.kMaxLength||2147483647;exports.alloc=function alloc(size,fill,encoding){if(typeof Buffer.alloc==="function"){return Buffer.alloc(size,fill,encoding)}if(typeof encoding==="number"){throw new TypeError("encoding must not be number")}if(typeof size!=="number"){throw new TypeError("size must be a number")}if(size>MAX_LEN){throw new RangeError("size is too large")}var enc=encoding;var _fill=fill;if(_fill===undefined){enc=undefined;_fill=0}var buf=new Buffer(size);if(typeof _fill==="string"){var fillBuf=new Buffer(_fill,enc);var flen=fillBuf.length;var i=-1;while(++i<size){buf[i]=fillBuf[i%flen]}}else{buf.fill(_fill)}return buf};exports.allocUnsafe=function allocUnsafe(size){if(typeof Buffer.allocUnsafe==="function"){return Buffer.allocUnsafe(size)}if(typeof size!=="number"){throw new TypeError("size must be a number")}if(size>MAX_LEN){throw new RangeError("size is too large")}return new Buffer(size)};exports.from=function from(value,encodingOrOffset,length){if(typeof Buffer.from==="function"&&(!global.Uint8Array||Uint8Array.from!==Buffer.from)){return Buffer.from(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof value==="string"){return new Buffer(value,encodingOrOffset)}if(typeof ArrayBuffer!=="undefined"&&value instanceof ArrayBuffer){var offset=encodingOrOffset;if(arguments.length===1){return new Buffer(value)}if(typeof offset==="undefined"){offset=0}var len=length;if(typeof len==="undefined"){len=value.byteLength-offset}if(offset>=value.byteLength){throw new RangeError("'offset' is out of bounds")}if(len>value.byteLength-offset){throw new RangeError("'length' is out of bounds")}return new Buffer(value.slice(offset,offset+len))}if(Buffer.isBuffer(value)){var out=new Buffer(value.length);value.copy(out,0,0,value.length);return out}if(value){if(Array.isArray(value)||typeof ArrayBuffer!=="undefined"&&value.buffer instanceof ArrayBuffer||"length"in value){return new Buffer(value)}if(value.type==="Buffer"&&Array.isArray(value.data)){return new Buffer(value.data)}}throw new TypeError("First argument must be a string, Buffer, "+"ArrayBuffer, Array, or array-like object.")};exports.allocUnsafeSlow=function allocUnsafeSlow(size){if(typeof Buffer.allocUnsafeSlow==="function"){return Buffer.allocUnsafeSlow(size)}if(typeof size!=="number"){throw new TypeError("size must be a number")}if(size>=MAX_LEN){throw new RangeError("size is too large")}return new SlowBuffer(size)}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{buffer:5}],5:[function(require,module,exports){(function(global){"use strict";var base64=require("base64-js");var ieee754=require("ieee754");var isArray=require("isarray");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global.TYPED_ARRAY_SUPPORT!==undefined?global.TYPED_ARRAY_SUPPORT:typedArraySupport();exports.kMaxLength=kMaxLength();function typedArraySupport(){try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return arr.foo()===42&&typeof arr.subarray==="function"&&arr.subarray(1,1).byteLength===0}catch(e){return false}}function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()<length){throw new RangeError("Invalid typed array length")}if(Buffer.TYPED_ARRAY_SUPPORT){that=new Uint8Array(length);that.__proto__=Buffer.prototype}else{if(that===null){that=new Buffer(length)}that.length=length}return that}function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length)}if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return allocUnsafe(this,arg)}return from(this,arg,encodingOrOffset,length)}Buffer.poolSize=8192;Buffer._augment=function(arr){arr.__proto__=Buffer.prototype;return arr};function from(that,value,encodingOrOffset,length){if(typeof value==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&value instanceof ArrayBuffer){return fromArrayBuffer(that,value,encodingOrOffset,length)}if(typeof value==="string"){return fromString(that,value,encodingOrOffset)}return fromObject(that,value)}Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;if(typeof Symbol!=="undefined"&&Symbol.species&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true})}}function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be a number')}else if(size<0){throw new RangeError('"size" argument must not be negative')}}function alloc(that,size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(that,size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(that,size).fill(fill,encoding):createBuffer(that,size).fill(fill)}return createBuffer(that,size)}Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)};function allocUnsafe(that,size){assertSize(size);that=createBuffer(that,size<0?0:checked(size)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i<size;++i){that[i]=0}}return that}Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)};function fromString(that,string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError('"encoding" must be a valid string encoding')}var length=byteLength(string,encoding)|0;that=createBuffer(that,length);var actual=that.write(string,encoding);if(actual!==length){that=that.slice(0,actual)}return that}function fromArrayLike(that,array){var length=array.length<0?0:checked(array.length)|0;that=createBuffer(that,length);for(var i=0;i<length;i+=1){that[i]=array[i]&255}return that}function fromArrayBuffer(that,array,byteOffset,length){array.byteLength;if(byteOffset<0||array.byteLength<byteOffset){throw new RangeError("'offset' is out of bounds")}if(array.byteLength<byteOffset+(length||0)){throw new RangeError("'length' is out of bounds")}if(byteOffset===undefined&&length===undefined){array=new Uint8Array(array)}else if(length===undefined){array=new Uint8Array(array,byteOffset)}else{array=new Uint8Array(array,byteOffset,length)}if(Buffer.TYPED_ARRAY_SUPPORT){that=array;that.__proto__=Buffer.prototype}else{that=fromArrayLike(that,array)}return that}function fromObject(that,obj){if(Buffer.isBuffer(obj)){var len=checked(obj.length)|0;that=createBuffer(that,len);if(that.length===0){return that}obj.copy(that,0,0,len);return that}if(obj){if(typeof ArrayBuffer!=="undefined"&&obj.buffer instanceof ArrayBuffer||"length"in obj){if(typeof obj.length!=="number"||isnan(obj.length)){return createBuffer(that,0)}return fromArrayLike(that,obj)}if(obj.type==="Buffer"&&isArray(obj.data)){return fromArrayLike(that,obj.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(length){if(length>=kMaxLength()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return!!(b!=null&&b._isBuffer)};Buffer.compare=function compare(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError("Arguments must be Buffers")}if(a===b)return 0;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len;++i){if(a[i]!==b[i]){x=a[i];y=b[i];break}}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function isEncoding(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function concat(list,length){if(!isArray(list)){throw new TypeError('"list" argument must be an Array of Buffers')}if(list.length===0){return Buffer.alloc(0)}var i;if(length===undefined){length=0;for(i=0;i<list.length;++i){length+=list[i].length}}var buffer=Buffer.allocUnsafe(length);var pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers')}buf.copy(buffer,pos);pos+=buf.length}return buffer};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer)){return string.byteLength}if(typeof string!=="string"){string=""+string}var len=string.length;if(len===0)return 0;var loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case undefined:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var i=0;i<len;i+=2){swap(this,i,i+1)}return this};Buffer.prototype.swap32=function swap32(){var len=this.length;if(len%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var i=0;i<len;i+=4){swap(this,i,i+3);swap(this,i+1,i+2)}return this};Buffer.prototype.swap64=function swap64(){var len=this.length;if(len%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var i=0;i<len;i+=8){swap(this,i,i+7);swap(this,i+1,i+6);swap(this,i+2,i+5);swap(this,i+3,i+4)}return this};Buffer.prototype.toString=function toString(){var length=this.length|0;if(length===0)return"";if(arguments.length===0)return utf8Slice(this,0,length);return slowToString.apply(this,arguments)};Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");if(this===b)return true;return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function inspect(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return"<Buffer "+str+">"};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target)){throw new TypeError("Argument must be a Buffer")}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i<len;++i){if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i];y=targetCopy[i];break}}if(x<y)return-1;if(y<x)return 1;return 0};function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(buffer.length===0)return-1;if(typeof byteOffset==="string"){encoding=byteOffset;byteOffset=0}else if(byteOffset>2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(isNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++){if(read(arr,i)===read(val,foundIndex===-1?0:i-foundIndex)){if(foundIndex===-1)foundIndex=i;if(i-foundIndex+1===valLength)return foundIndex*indexSize}else{if(foundIndex!==-1)i-=i-foundIndex;foundIndex=-1}}}else{if(byteOffset+valLength>arrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;j<valLength;j++){if(read(arr,i+j)!==read(val,j)){found=false;break}}if(found)return i}}return-1}Buffer.prototype.includes=function includes(val,byteOffset,encoding){return this.indexOf(val,byteOffset,encoding)!==-1};Buffer.prototype.indexOf=function indexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,true)};Buffer.prototype.lastIndexOf=function lastIndexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,false)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new TypeError("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;i<length;++i){var parsed=parseInt(string.substr(i*2,2),16);if(isNaN(parsed))return i;buf[offset+i]=parsed}return i}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length)}function asciiWrite(buf,string,offset,length){return blitBuffer(asciiToBytes(string),buf,offset,length)}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length)}function ucs2Write(buf,string,offset,length){return blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length)}Buffer.prototype.write=function write(string,offset,length,encoding){if(offset===undefined){encoding="utf8";length=this.length;offset=0}else if(length===undefined&&typeof offset==="string"){encoding=offset;length=this.length;offset=0}else if(isFinite(offset)){offset=offset|0;if(isFinite(length)){length=length|0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";var loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i<end){var firstByte=buf[i];var codePoint=null;var bytesPerSequence=firstByte>239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}var res="";var i=0;while(i<len){res+=String.fromCharCode.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH))}return res}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i){ret+=String.fromCharCode(buf[i]&127)}return ret}function latin1Slice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i){ret+=String.fromCharCode(buf[i])}return ret}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;++i){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function slice(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;var newBuf;if(Buffer.TYPED_ARRAY_SUPPORT){newBuf=this.subarray(start,end);newBuf.__proto__=Buffer.prototype}else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,undefined);for(var i=0;i<sliceLen;++i){newBuf[i]=this[i+start]}}return newBuf};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256)){val+=this[offset+i]*mul}return val};Buffer.prototype.readUIntBE=function readUIntBE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert){checkOffset(offset,byteLength,this.length)}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256)){val+=this[offset+i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert)checkOffset(offset,byteLength,this.length);
3170var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||value<min)throw new RangeError('"value" argument is out of bounds');if(offset+ext>buf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;byteLength=byteLength|0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1;var i=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUIntBE=function writeUIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;byteLength=byteLength|0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value&255;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i<j;++i){buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value&255;this[offset+1]=value>>>8}else{objectWriteUInt16(this,value,offset,true)}return offset+2};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value&255}else{objectWriteUInt16(this,value,offset,false)}return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i<j;++i){buf[offset+i]=value>>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255}else{objectWriteUInt32(this,value,offset,true)}return offset+4};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255}else{objectWriteUInt32(this,value,offset,false)}return offset+4};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0;var mul=1;var sub=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256)){if(value<0&&sub===0&&this[offset+i-1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value&255;this[offset+1]=value>>>8}else{objectWriteUInt16(this,value,offset,true)}return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value&255}else{objectWriteUInt16(this,value,offset,false)}return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else{objectWriteUInt32(this,value,offset,true)}return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255}else{objectWriteUInt32(this,value,offset,false)}return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert){checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert){checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end<start)end=start;if(end===start)return 0;if(target.length===0||this.length===0)return 0;if(targetStart<0){throw new RangeError("targetStart out of bounds")}if(start<0||start>=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart<end-start){end=target.length-targetStart+start}var len=end-start;var i;if(this===target&&start<targetStart&&targetStart<end){for(i=len-1;i>=0;--i){target[i+targetStart]=this[i+start]}}else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(i=0;i<len;++i){target[i+targetStart]=this[i+start]}}else{Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart)}return len};Buffer.prototype.fill=function fill(val,start,end,encoding){if(typeof val==="string"){if(typeof start==="string"){encoding=start;start=0;end=this.length}else if(typeof end==="string"){encoding=end;end=this.length}if(val.length===1){var code=val.charCodeAt(0);if(code<256){val=code}}if(encoding!==undefined&&typeof encoding!=="string"){throw new TypeError("encoding must be a string")}if(typeof encoding==="string"&&!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}}else if(typeof val==="number"){val=val&255}if(start<0||this.length<start||this.length<end){throw new RangeError("Out of range index")}if(end<=start){return this}start=start>>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==="number"){for(i=start;i<end;++i){this[i]=val}}else{var bytes=Buffer.isBuffer(val)?val:utf8ToBytes(new Buffer(val,encoding).toString());var len=bytes.length;for(i=0;i<end-start;++i){this[i+start]=bytes[i%len]}}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(str){str=stringtrim(str).replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function stringtrim(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,"")}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(string,units){units=units||Infinity;var codePoint;var length=string.length;var leadSurrogate=null;var bytes=[];for(var i=0;i<length;++i){codePoint=string.charCodeAt(i);if(codePoint>55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;++i){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str,units){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;++i){if((units-=2)<0)break;c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i<length;++i){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isnan(val){return val!==val}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"base64-js":2,ieee754:37,isarray:40}],6:[function(require,module,exports){(function(Buffer){function isArray(arg){if(Array.isArray){return Array.isArray(arg)}return objectToString(arg)==="[object Array]"}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return objectToString(e)==="[object Error]"||e instanceof Error}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=Buffer.isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}).call(this,{isBuffer:require("../../is-buffer/index.js")})},{"../../is-buffer/index.js":39}],7:[function(require,module,exports){var ElementType=require("domelementtype");var entities=require("entities");var booleanAttributes={__proto__:null,allowfullscreen:true,async:true,autofocus:true,autoplay:true,checked:true,controls:true,default:true,defer:true,disabled:true,hidden:true,ismap:true,loop:true,multiple:true,muted:true,open:true,readonly:true,required:true,reversed:true,scoped:true,seamless:true,selected:true,typemustmatch:true};var unencodedElements={__proto__:null,style:true,script:true,xmp:true,iframe:true,noembed:true,noframes:true,plaintext:true,noscript:true};function formatAttrs(attributes,opts){if(!attributes)return;var output="",value;for(var key in attributes){value=attributes[key];if(output){output+=" "}if(!value&&booleanAttributes[key]){output+=key}else{output+=key+'="'+(opts.decodeEntities?entities.encodeXML(value):value)+'"'}}return output}var singleTag={__proto__:null,area:true,base:true,basefont:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,isindex:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true};var render=module.exports=function(dom,opts){if(!Array.isArray(dom)&&!dom.cheerio)dom=[dom];opts=opts||{};var output="";for(var i=0;i<dom.length;i++){var elem=dom[i];if(elem.type==="root")output+=render(elem.children,opts);else if(ElementType.isTag(elem))output+=renderTag(elem,opts);else if(elem.type===ElementType.Directive)output+=renderDirective(elem);else if(elem.type===ElementType.Comment)output+=renderComment(elem);else if(elem.type===ElementType.CDATA)output+=renderCdata(elem);else output+=renderText(elem,opts)}return output};function renderTag(elem,opts){if(elem.name==="svg")opts={decodeEntities:opts.decodeEntities,xmlMode:true};var tag="<"+elem.name,attribs=formatAttrs(elem.attribs,opts);if(attribs){tag+=" "+attribs}if(opts.xmlMode&&(!elem.children||elem.children.length===0)){tag+="/>"}else{tag+=">";if(elem.children){tag+=render(elem.children,opts)}if(!singleTag[elem.name]||opts.xmlMode){tag+="</"+elem.name+">"}}return tag}function renderDirective(elem){return"<"+elem.data+">"}function renderText(elem,opts){var data=elem.data||"";if(opts.decodeEntities&&!(elem.parent&&elem.parent.name in unencodedElements)){data=entities.encodeXML(data)}return data}function renderCdata(elem){return"<![CDATA["+elem.children[0].data+"]]>"}function renderComment(elem){return"<!--"+elem.data+"-->"}},{domelementtype:8,entities:20}],8:[function(require,module,exports){module.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",isTag:function(elem){return elem.type==="tag"||elem.type==="script"||elem.type==="style"}}},{}],9:[function(require,module,exports){module.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",Doctype:"doctype",isTag:function(elem){return elem.type==="tag"||elem.type==="script"||elem.type==="style"}}},{}],10:[function(require,module,exports){var ElementType=require("domelementtype");var re_whitespace=/\s+/g;var NodePrototype=require("./lib/node");var ElementPrototype=require("./lib/element");function DomHandler(callback,options,elementCB){if(typeof callback==="object"){elementCB=options;options=callback;callback=null}else if(typeof options==="function"){elementCB=options;options=defaultOpts}this._callback=callback;this._options=options||defaultOpts;this._elementCB=elementCB;this.dom=[];this._done=false;this._tagStack=[];this._parser=this._parser||null}var defaultOpts={normalizeWhitespace:false,withStartIndices:false};DomHandler.prototype.onparserinit=function(parser){this._parser=parser};DomHandler.prototype.onreset=function(){DomHandler.call(this,this._callback,this._options,this._elementCB)};DomHandler.prototype.onend=function(){if(this._done)return;this._done=true;this._parser=null;this._handleCallback(null)};DomHandler.prototype._handleCallback=DomHandler.prototype.onerror=function(error){if(typeof this._callback==="function"){this._callback(error,this.dom)}else{if(error)throw error}};DomHandler.prototype.onclosetag=function(){var elem=this._tagStack.pop();if(this._elementCB)this._elementCB(elem)};DomHandler.prototype._addDomElement=function(element){var parent=this._tagStack[this._tagStack.length-1];var siblings=parent?parent.children:this.dom;var previousSibling=siblings[siblings.length-1];element.next=null;if(this._options.withStartIndices){element.startIndex=this._parser.startIndex}if(this._options.withDomLvl1){element.__proto__=element.type==="tag"?ElementPrototype:NodePrototype}if(previousSibling){element.prev=previousSibling;previousSibling.next=element}else{element.prev=null}siblings.push(element);element.parent=parent||null};DomHandler.prototype.onopentag=function(name,attribs){var element={type:name==="script"?ElementType.Script:name==="style"?ElementType.Style:ElementType.Tag,name:name,attribs:attribs,children:[]};this._addDomElement(element);this._tagStack.push(element)};DomHandler.prototype.ontext=function(data){var normalize=this._options.normalizeWhitespace||this._options.ignoreWhitespace;var lastTag;if(!this._tagStack.length&&this.dom.length&&(lastTag=this.dom[this.dom.length-1]).type===ElementType.Text){if(normalize){lastTag.data=(lastTag.data+data).replace(re_whitespace," ")}else{lastTag.data+=data}}else{if(this._tagStack.length&&(lastTag=this._tagStack[this._tagStack.length-1])&&(lastTag=lastTag.children[lastTag.children.length-1])&&lastTag.type===ElementType.Text){if(normalize){lastTag.data=(lastTag.data+data).replace(re_whitespace," ")}else{lastTag.data+=data}}else{if(normalize){data=data.replace(re_whitespace," ")}this._addDomElement({data:data,type:ElementType.Text})}}};DomHandler.prototype.oncomment=function(data){var lastTag=this._tagStack[this._tagStack.length-1];if(lastTag&&lastTag.type===ElementType.Comment){lastTag.data+=data;return}var element={data:data,type:ElementType.Comment};this._addDomElement(element);this._tagStack.push(element)};DomHandler.prototype.oncdatastart=function(){var element={children:[{data:"",type:ElementType.Text}],type:ElementType.CDATA};this._addDomElement(element);this._tagStack.push(element)};DomHandler.prototype.oncommentend=DomHandler.prototype.oncdataend=function(){this._tagStack.pop()};DomHandler.prototype.onprocessinginstruction=function(name,data){this._addDomElement({name:name,data:data,type:ElementType.Directive})};module.exports=DomHandler},{"./lib/element":11,"./lib/node":12,domelementtype:9}],11:[function(require,module,exports){var NodePrototype=require("./node");var ElementPrototype=module.exports=Object.create(NodePrototype);var domLvl1={tagName:"name"};Object.keys(domLvl1).forEach(function(key){var shorthand=domLvl1[key];Object.defineProperty(ElementPrototype,key,{get:function(){return this[shorthand]||null},set:function(val){this[shorthand]=val;return val}})})},{"./node":12}],12:[function(require,module,exports){var NodePrototype=module.exports={get firstChild(){var children=this.children;return children&&children[0]||null},get lastChild(){var children=this.children;return children&&children[children.length-1]||null},get nodeType(){return nodeTypes[this.type]||nodeTypes.element}};var domLvl1={tagName:"name",childNodes:"children",parentNode:"parent",previousSibling:"prev",nextSibling:"next",nodeValue:"data"};var nodeTypes={element:1,text:3,cdata:4,comment:8};Object.keys(domLvl1).forEach(function(key){var shorthand=domLvl1[key];Object.defineProperty(NodePrototype,key,{get:function(){return this[shorthand]||null},set:function(val){this[shorthand]=val;return val}})})},{}],13:[function(require,module,exports){var DomUtils=module.exports;[require("./lib/stringify"),require("./lib/traversal"),require("./lib/manipulation"),require("./lib/querying"),require("./lib/legacy"),require("./lib/helpers")].forEach(function(ext){Object.keys(ext).forEach(function(key){DomUtils[key]=ext[key].bind(DomUtils)})})},{"./lib/helpers":14,"./lib/legacy":15,"./lib/manipulation":16,"./lib/querying":17,"./lib/stringify":18,"./lib/traversal":19}],14:[function(require,module,exports){exports.removeSubsets=function(nodes){var idx=nodes.length,node,ancestor,replace;while(--idx>-1){node=ancestor=nodes[idx];nodes[idx]=null;replace=true;while(ancestor){if(nodes.indexOf(ancestor)>-1){replace=false;nodes.splice(idx,1);break}ancestor=ancestor.parent}if(replace){nodes[idx]=node}}return nodes};var POSITION={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16};var comparePos=exports.compareDocumentPosition=function(nodeA,nodeB){var aParents=[];var bParents=[];var current,sharedParent,siblings,aSibling,bSibling,idx;if(nodeA===nodeB){return 0}current=nodeA;while(current){aParents.unshift(current);current=current.parent}current=nodeB;while(current){bParents.unshift(current);current=current.parent}idx=0;while(aParents[idx]===bParents[idx]){idx++}if(idx===0){return POSITION.DISCONNECTED}sharedParent=aParents[idx-1];siblings=sharedParent.children;aSibling=aParents[idx];bSibling=bParents[idx];if(siblings.indexOf(aSibling)>siblings.indexOf(bSibling)){if(sharedParent===nodeB){return POSITION.FOLLOWING|POSITION.CONTAINED_BY}return POSITION.FOLLOWING}else{if(sharedParent===nodeA){return POSITION.PRECEDING|POSITION.CONTAINS}return POSITION.PRECEDING}};exports.uniqueSort=function(nodes){var idx=nodes.length,node,position;nodes=nodes.slice();while(--idx>-1){node=nodes[idx];position=nodes.indexOf(node);if(position>-1&&position<idx){nodes.splice(idx,1)}}nodes.sort(function(a,b){var relative=comparePos(a,b);if(relative&POSITION.PRECEDING){return-1}else if(relative&POSITION.FOLLOWING){return 1}return 0});return nodes}},{}],15:[function(require,module,exports){var ElementType=require("domelementtype");var isTag=exports.isTag=ElementType.isTag;exports.testElement=function(options,element){for(var key in options){if(!options.hasOwnProperty(key));else if(key==="tag_name"){if(!isTag(element)||!options.tag_name(element.name)){return false}}else if(key==="tag_type"){if(!options.tag_type(element.type))return false}else if(key==="tag_contains"){if(isTag(element)||!options.tag_contains(element.data)){return false}}else if(!element.attribs||!options[key](element.attribs[key])){return false}}return true};var Checks={tag_name:function(name){if(typeof name==="function"){return function(elem){return isTag(elem)&&name(elem.name)}}else if(name==="*"){return isTag}else{return function(elem){return isTag(elem)&&elem.name===name}}},tag_type:function(type){if(typeof type==="function"){return function(elem){return type(elem.type)}}else{return function(elem){return elem.type===type}}},tag_contains:function(data){if(typeof data==="function"){return function(elem){return!isTag(elem)&&data(elem.data)}}else{return function(elem){return!isTag(elem)&&elem.data===data}}}};function getAttribCheck(attrib,value){if(typeof value==="function"){return function(elem){return elem.attribs&&value(elem.attribs[attrib])}}else{return function(elem){return elem.attribs&&elem.attribs[attrib]===value}}}function combineFuncs(a,b){return function(elem){return a(elem)||b(elem)}}exports.getElements=function(options,element,recurse,limit){var funcs=Object.keys(options).map(function(key){var value=options[key];return key in Checks?Checks[key](value):getAttribCheck(key,value)});return funcs.length===0?[]:this.filter(funcs.reduce(combineFuncs),element,recurse,limit)};exports.getElementById=function(id,element,recurse){if(!Array.isArray(element))element=[element];return this.findOne(getAttribCheck("id",id),element,recurse!==false)};exports.getElementsByTagName=function(name,element,recurse,limit){return this.filter(Checks.tag_name(name),element,recurse,limit)};exports.getElementsByTagType=function(type,element,recurse,limit){return this.filter(Checks.tag_type(type),element,recurse,limit)}},{domelementtype:9}],16:[function(require,module,exports){exports.removeElement=function(elem){if(elem.prev)elem.prev.next=elem.next;if(elem.next)elem.next.prev=elem.prev;if(elem.parent){var childs=elem.parent.children;childs.splice(childs.lastIndexOf(elem),1)}};exports.replaceElement=function(elem,replacement){var prev=replacement.prev=elem.prev;if(prev){prev.next=replacement}var next=replacement.next=elem.next;if(next){next.prev=replacement}var parent=replacement.parent=elem.parent;if(parent){var childs=parent.children;childs[childs.lastIndexOf(elem)]=replacement}};exports.appendChild=function(elem,child){child.parent=elem;if(elem.children.push(child)!==1){var sibling=elem.children[elem.children.length-2];sibling.next=child;child.prev=sibling;child.next=null}};exports.append=function(elem,next){var parent=elem.parent,currNext=elem.next;next.next=currNext;next.prev=elem;elem.next=next;next.parent=parent;if(currNext){currNext.prev=next;if(parent){var childs=parent.children;childs.splice(childs.lastIndexOf(currNext),0,next)}}else if(parent){parent.children.push(next)}};exports.prepend=function(elem,prev){var parent=elem.parent;if(parent){var childs=parent.children;childs.splice(childs.lastIndexOf(elem),0,prev)}if(elem.prev){elem.prev.next=prev}prev.parent=parent;prev.prev=elem.prev;prev.next=elem;elem.prev=prev}},{}],17:[function(require,module,exports){var isTag=require("domelementtype").isTag;module.exports={filter:filter,find:find,findOneChild:findOneChild,findOne:findOne,existsOne:existsOne,findAll:findAll};function filter(test,element,recurse,limit){if(!Array.isArray(element))element=[element];if(typeof limit!=="number"||!isFinite(limit)){limit=Infinity}return find(test,element,recurse!==false,limit)}function find(test,elems,recurse,limit){var result=[],childs;for(var i=0,j=elems.length;i<j;i++){if(test(elems[i])){result.push(elems[i]);if(--limit<=0)break}childs=elems[i].children;if(recurse&&childs&&childs.length>0){childs=find(test,childs,recurse,limit);result=result.concat(childs);limit-=childs.length;if(limit<=0)break}}return result}function findOneChild(test,elems){for(var i=0,l=elems.length;i<l;i++){if(test(elems[i]))return elems[i]}return null}function findOne(test,elems){var elem=null;for(var i=0,l=elems.length;i<l&&!elem;i++){if(!isTag(elems[i])){continue}else if(test(elems[i])){elem=elems[i]}else if(elems[i].children.length>0){elem=findOne(test,elems[i].children)}}return elem}function existsOne(test,elems){for(var i=0,l=elems.length;i<l;i++){if(isTag(elems[i])&&(test(elems[i])||elems[i].children.length>0&&existsOne(test,elems[i].children))){return true}}return false}function findAll(test,elems){var result=[];for(var i=0,j=elems.length;i<j;i++){if(!isTag(elems[i]))continue;if(test(elems[i]))result.push(elems[i]);if(elems[i].children.length>0){result=result.concat(findAll(test,elems[i].children))}}return result}},{domelementtype:9}],18:[function(require,module,exports){var ElementType=require("domelementtype"),getOuterHTML=require("dom-serializer"),isTag=ElementType.isTag;module.exports={getInnerHTML:getInnerHTML,getOuterHTML:getOuterHTML,getText:getText};function getInnerHTML(elem,opts){return elem.children?elem.children.map(function(elem){return getOuterHTML(elem,opts)}).join(""):""}function getText(elem){if(Array.isArray(elem))return elem.map(getText).join("");if(isTag(elem)||elem.type===ElementType.CDATA)return getText(elem.children);if(elem.type===ElementType.Text)return elem.data;return""}},{"dom-serializer":7,domelementtype:9}],19:[function(require,module,exports){var getChildren=exports.getChildren=function(elem){return elem.children};var getParent=exports.getParent=function(elem){return elem.parent};exports.getSiblings=function(elem){var parent=getParent(elem);return parent?getChildren(parent):[elem]};exports.getAttributeValue=function(elem,name){return elem.attribs&&elem.attribs[name]};exports.hasAttrib=function(elem,name){return!!elem.attribs&&hasOwnProperty.call(elem.attribs,name)};exports.getName=function(elem){return elem.name}},{}],20:[function(require,module,exports){var encode=require("./lib/encode.js"),decode=require("./lib/decode.js");exports.decode=function(data,level){return(!level||level<=0?decode.XML:decode.HTML)(data)};exports.decodeStrict=function(data,level){return(!level||level<=0?decode.XML:decode.HTMLStrict)(data)};exports.encode=function(data,level){return(!level||level<=0?encode.XML:encode.HTML)(data)};exports.encodeXML=encode.XML;exports.encodeHTML4=exports.encodeHTML5=exports.encodeHTML=encode.HTML;exports.decodeXML=exports.decodeXMLStrict=decode.XML;exports.decodeHTML4=exports.decodeHTML5=exports.decodeHTML=decode.HTML;exports.decodeHTML4Strict=exports.decodeHTML5Strict=exports.decodeHTMLStrict=decode.HTMLStrict;exports.escape=encode.escape},{"./lib/decode.js":21,"./lib/encode.js":23}],21:[function(require,module,exports){var entityMap=require("../maps/entities.json"),legacyMap=require("../maps/legacy.json"),xmlMap=require("../maps/xml.json"),decodeCodePoint=require("./decode_codepoint.js");var decodeXMLStrict=getStrictDecoder(xmlMap),decodeHTMLStrict=getStrictDecoder(entityMap);function getStrictDecoder(map){var keys=Object.keys(map).join("|"),replace=getReplacer(map);keys+="|#[xX][\\da-fA-F]+|#\\d+";var re=new RegExp("&(?:"+keys+");","g");return function(str){return String(str).replace(re,replace)}}var decodeHTML=function(){var legacy=Object.keys(legacyMap).sort(sorter);var keys=Object.keys(entityMap).sort(sorter);for(var i=0,j=0;i<keys.length;i++){if(legacy[j]===keys[i]){keys[i]+=";?";j++}else{keys[i]+=";"}}var re=new RegExp("&(?:"+keys.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),replace=getReplacer(entityMap);function replacer(str){if(str.substr(-1)!==";")str+=";";return replace(str)}return function(str){return String(str).replace(re,replacer)}}();function sorter(a,b){return a<b?1:-1}function getReplacer(map){return function replace(str){if(str.charAt(1)==="#"){if(str.charAt(2)==="X"||str.charAt(2)==="x"){return decodeCodePoint(parseInt(str.substr(3),16))}return decodeCodePoint(parseInt(str.substr(2),10))}return map[str.slice(1,-1)];
3171}}module.exports={XML:decodeXMLStrict,HTML:decodeHTML,HTMLStrict:decodeHTMLStrict}},{"../maps/entities.json":25,"../maps/legacy.json":26,"../maps/xml.json":27,"./decode_codepoint.js":22}],22:[function(require,module,exports){var decodeMap=require("../maps/decode.json");module.exports=decodeCodePoint;function decodeCodePoint(codePoint){if(codePoint>=55296&&codePoint<=57343||codePoint>1114111){return"�"}if(codePoint in decodeMap){codePoint=decodeMap[codePoint]}var output="";if(codePoint>65535){codePoint-=65536;output+=String.fromCharCode(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}output+=String.fromCharCode(codePoint);return output}},{"../maps/decode.json":24}],23:[function(require,module,exports){var inverseXML=getInverseObj(require("../maps/xml.json")),xmlReplacer=getInverseReplacer(inverseXML);exports.XML=getInverse(inverseXML,xmlReplacer);var inverseHTML=getInverseObj(require("../maps/entities.json")),htmlReplacer=getInverseReplacer(inverseHTML);exports.HTML=getInverse(inverseHTML,htmlReplacer);function getInverseObj(obj){return Object.keys(obj).sort().reduce(function(inverse,name){inverse[obj[name]]="&"+name+";";return inverse},{})}function getInverseReplacer(inverse){var single=[],multiple=[];Object.keys(inverse).forEach(function(k){if(k.length===1){single.push("\\"+k)}else{multiple.push(k)}});multiple.unshift("["+single.join("")+"]");return new RegExp(multiple.join("|"),"g")}var re_nonASCII=/[^\0-\x7F]/g,re_astralSymbols=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function singleCharReplacer(c){return"&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"}function astralReplacer(c){var high=c.charCodeAt(0);var low=c.charCodeAt(1);var codePoint=(high-55296)*1024+low-56320+65536;return"&#x"+codePoint.toString(16).toUpperCase()+";"}function getInverse(inverse,re){function func(name){return inverse[name]}return function(data){return data.replace(re,func).replace(re_astralSymbols,astralReplacer).replace(re_nonASCII,singleCharReplacer)}}var re_xmlChars=getInverseReplacer(inverseXML);function escapeXML(data){return data.replace(re_xmlChars,singleCharReplacer).replace(re_astralSymbols,astralReplacer).replace(re_nonASCII,singleCharReplacer)}exports.escape=escapeXML},{"../maps/entities.json":25,"../maps/xml.json":27}],24:[function(require,module,exports){module.exports={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}},{}],25:[function(require,module,exports){module.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},{}],26:[function(require,module,exports){module.exports={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"}},{}],27:[function(require,module,exports){module.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}},{}],28:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}else{var err=new Error('Uncaught, unspecified "error" event. ('+er+")");err.context=er;throw err}}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1);handler.apply(this,args)}}else if(isObject(handler)){args=Array.prototype.slice.call(arguments,1);listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1);
3172}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],29:[function(require,module,exports){module.exports=CollectingHandler;function CollectingHandler(cbs){this._cbs=cbs||{};this.events=[]}var EVENTS=require("./").EVENTS;Object.keys(EVENTS).forEach(function(name){if(EVENTS[name]===0){name="on"+name;CollectingHandler.prototype[name]=function(){this.events.push([name]);if(this._cbs[name])this._cbs[name]()}}else if(EVENTS[name]===1){name="on"+name;CollectingHandler.prototype[name]=function(a){this.events.push([name,a]);if(this._cbs[name])this._cbs[name](a)}}else if(EVENTS[name]===2){name="on"+name;CollectingHandler.prototype[name]=function(a,b){this.events.push([name,a,b]);if(this._cbs[name])this._cbs[name](a,b)}}else{throw Error("wrong number of arguments")}});CollectingHandler.prototype.onreset=function(){this.events=[];if(this._cbs.onreset)this._cbs.onreset()};CollectingHandler.prototype.restart=function(){if(this._cbs.onreset)this._cbs.onreset();for(var i=0,len=this.events.length;i<len;i++){if(this._cbs[this.events[i][0]]){var num=this.events[i].length;if(num===1){this._cbs[this.events[i][0]]()}else if(num===2){this._cbs[this.events[i][0]](this.events[i][1])}else{this._cbs[this.events[i][0]](this.events[i][1],this.events[i][2])}}}}},{"./":36}],30:[function(require,module,exports){var index=require("./index.js"),DomHandler=index.DomHandler,DomUtils=index.DomUtils;function FeedHandler(callback,options){this.init(callback,options)}require("inherits")(FeedHandler,DomHandler);FeedHandler.prototype.init=DomHandler;function getElements(what,where){return DomUtils.getElementsByTagName(what,where,true)}function getOneElement(what,where){return DomUtils.getElementsByTagName(what,where,true,1)[0]}function fetch(what,where,recurse){return DomUtils.getText(DomUtils.getElementsByTagName(what,where,recurse,1)).trim()}function addConditionally(obj,prop,what,where,recurse){var tmp=fetch(what,where,recurse);if(tmp)obj[prop]=tmp}var isValidFeed=function(value){return value==="rss"||value==="feed"||value==="rdf:RDF"};FeedHandler.prototype.onend=function(){var feed={},feedRoot=getOneElement(isValidFeed,this.dom),tmp,childs;if(feedRoot){if(feedRoot.name==="feed"){childs=feedRoot.children;feed.type="atom";addConditionally(feed,"id","id",childs);addConditionally(feed,"title","title",childs);if((tmp=getOneElement("link",childs))&&(tmp=tmp.attribs)&&(tmp=tmp.href))feed.link=tmp;addConditionally(feed,"description","subtitle",childs);if(tmp=fetch("updated",childs))feed.updated=new Date(tmp);addConditionally(feed,"author","email",childs,true);feed.items=getElements("entry",childs).map(function(item){var entry={},tmp;item=item.children;addConditionally(entry,"id","id",item);addConditionally(entry,"title","title",item);if((tmp=getOneElement("link",item))&&(tmp=tmp.attribs)&&(tmp=tmp.href))entry.link=tmp;if(tmp=fetch("summary",item)||fetch("content",item))entry.description=tmp;if(tmp=fetch("updated",item))entry.pubDate=new Date(tmp);return entry})}else{childs=getOneElement("channel",feedRoot.children).children;feed.type=feedRoot.name.substr(0,3);feed.id="";addConditionally(feed,"title","title",childs);addConditionally(feed,"link","link",childs);addConditionally(feed,"description","description",childs);if(tmp=fetch("lastBuildDate",childs))feed.updated=new Date(tmp);addConditionally(feed,"author","managingEditor",childs,true);feed.items=getElements("item",feedRoot.children).map(function(item){var entry={},tmp;item=item.children;addConditionally(entry,"id","guid",item);addConditionally(entry,"title","title",item);addConditionally(entry,"link","link",item);addConditionally(entry,"description","description",item);if(tmp=fetch("pubDate",item))entry.pubDate=new Date(tmp);return entry})}}this.dom=feed;DomHandler.prototype._handleCallback.call(this,feedRoot?null:Error("couldn't find root of feed"))};module.exports=FeedHandler},{"./index.js":36,inherits:38}],31:[function(require,module,exports){var Tokenizer=require("./Tokenizer.js");var formTags={input:true,option:true,optgroup:true,select:true,button:true,datalist:true,textarea:true};var openImpliesClose={tr:{tr:true,th:true,td:true},th:{th:true},td:{thead:true,th:true,td:true},body:{head:true,link:true,script:true},li:{li:true},p:{p:true},h1:{p:true},h2:{p:true},h3:{p:true},h4:{p:true},h5:{p:true},h6:{p:true},select:formTags,input:formTags,output:formTags,button:formTags,datalist:formTags,textarea:formTags,option:{option:true},optgroup:{optgroup:true}};var voidElements={__proto__:null,area:true,base:true,basefont:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,isindex:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true,path:true,circle:true,ellipse:true,line:true,rect:true,use:true,stop:true,polyline:true,polygon:true};var re_nameEnd=/\s|\//;function Parser(cbs,options){this._options=options||{};this._cbs=cbs||{};this._tagname="";this._attribname="";this._attribvalue="";this._attribs=null;this._stack=[];this.startIndex=0;this.endIndex=null;this._lowerCaseTagNames="lowerCaseTags"in this._options?!!this._options.lowerCaseTags:!this._options.xmlMode;this._lowerCaseAttributeNames="lowerCaseAttributeNames"in this._options?!!this._options.lowerCaseAttributeNames:!this._options.xmlMode;if(this._options.Tokenizer){Tokenizer=this._options.Tokenizer}this._tokenizer=new Tokenizer(this._options,this);if(this._cbs.onparserinit)this._cbs.onparserinit(this)}require("inherits")(Parser,require("events").EventEmitter);Parser.prototype._updatePosition=function(initialOffset){if(this.endIndex===null){if(this._tokenizer._sectionStart<=initialOffset){this.startIndex=0}else{this.startIndex=this._tokenizer._sectionStart-initialOffset}}else this.startIndex=this.endIndex+1;this.endIndex=this._tokenizer.getAbsoluteIndex()};Parser.prototype.ontext=function(data){this._updatePosition(1);this.endIndex--;if(this._cbs.ontext)this._cbs.ontext(data)};Parser.prototype.onopentagname=function(name){if(this._lowerCaseTagNames){name=name.toLowerCase()}this._tagname=name;if(!this._options.xmlMode&&name in openImpliesClose){for(var el;(el=this._stack[this._stack.length-1])in openImpliesClose[name];this.onclosetag(el));}if(this._options.xmlMode||!(name in voidElements)){this._stack.push(name)}if(this._cbs.onopentagname)this._cbs.onopentagname(name);if(this._cbs.onopentag)this._attribs={}};Parser.prototype.onopentagend=function(){this._updatePosition(1);if(this._attribs){if(this._cbs.onopentag)this._cbs.onopentag(this._tagname,this._attribs);this._attribs=null}if(!this._options.xmlMode&&this._cbs.onclosetag&&this._tagname in voidElements){this._cbs.onclosetag(this._tagname)}this._tagname=""};Parser.prototype.onclosetag=function(name){this._updatePosition(1);if(this._lowerCaseTagNames){name=name.toLowerCase()}if(this._stack.length&&(!(name in voidElements)||this._options.xmlMode)){var pos=this._stack.lastIndexOf(name);if(pos!==-1){if(this._cbs.onclosetag){pos=this._stack.length-pos;while(pos--)this._cbs.onclosetag(this._stack.pop())}else this._stack.length=pos}else if(name==="p"&&!this._options.xmlMode){this.onopentagname(name);this._closeCurrentTag()}}else if(!this._options.xmlMode&&(name==="br"||name==="p")){this.onopentagname(name);this._closeCurrentTag()}};Parser.prototype.onselfclosingtag=function(){if(this._options.xmlMode||this._options.recognizeSelfClosing){this._closeCurrentTag()}else{this.onopentagend()}};Parser.prototype._closeCurrentTag=function(){var name=this._tagname;this.onopentagend();if(this._stack[this._stack.length-1]===name){if(this._cbs.onclosetag){this._cbs.onclosetag(name)}this._stack.pop()}};Parser.prototype.onattribname=function(name){if(this._lowerCaseAttributeNames){name=name.toLowerCase()}this._attribname=name};Parser.prototype.onattribdata=function(value){this._attribvalue+=value};Parser.prototype.onattribend=function(){if(this._cbs.onattribute)this._cbs.onattribute(this._attribname,this._attribvalue);if(this._attribs&&!Object.prototype.hasOwnProperty.call(this._attribs,this._attribname)){this._attribs[this._attribname]=this._attribvalue}this._attribname="";this._attribvalue=""};Parser.prototype._getInstructionName=function(value){var idx=value.search(re_nameEnd),name=idx<0?value:value.substr(0,idx);if(this._lowerCaseTagNames){name=name.toLowerCase()}return name};Parser.prototype.ondeclaration=function(value){if(this._cbs.onprocessinginstruction){var name=this._getInstructionName(value);this._cbs.onprocessinginstruction("!"+name,"!"+value)}};Parser.prototype.onprocessinginstruction=function(value){if(this._cbs.onprocessinginstruction){var name=this._getInstructionName(value);this._cbs.onprocessinginstruction("?"+name,"?"+value)}};Parser.prototype.oncomment=function(value){this._updatePosition(4);if(this._cbs.oncomment)this._cbs.oncomment(value);if(this._cbs.oncommentend)this._cbs.oncommentend()};Parser.prototype.oncdata=function(value){this._updatePosition(1);if(this._options.xmlMode||this._options.recognizeCDATA){if(this._cbs.oncdatastart)this._cbs.oncdatastart();if(this._cbs.ontext)this._cbs.ontext(value);if(this._cbs.oncdataend)this._cbs.oncdataend()}else{this.oncomment("[CDATA["+value+"]]")}};Parser.prototype.onerror=function(err){if(this._cbs.onerror)this._cbs.onerror(err)};Parser.prototype.onend=function(){if(this._cbs.onclosetag){for(var i=this._stack.length;i>0;this._cbs.onclosetag(this._stack[--i]));}if(this._cbs.onend)this._cbs.onend()};Parser.prototype.reset=function(){if(this._cbs.onreset)this._cbs.onreset();this._tokenizer.reset();this._tagname="";this._attribname="";this._attribs=null;this._stack=[];if(this._cbs.onparserinit)this._cbs.onparserinit(this)};Parser.prototype.parseComplete=function(data){this.reset();this.end(data)};Parser.prototype.write=function(chunk){this._tokenizer.write(chunk)};Parser.prototype.end=function(chunk){this._tokenizer.end(chunk)};Parser.prototype.pause=function(){this._tokenizer.pause()};Parser.prototype.resume=function(){this._tokenizer.resume()};Parser.prototype.parseChunk=Parser.prototype.write;Parser.prototype.done=Parser.prototype.end;module.exports=Parser},{"./Tokenizer.js":34,events:28,inherits:38}],32:[function(require,module,exports){module.exports=ProxyHandler;function ProxyHandler(cbs){this._cbs=cbs||{}}var EVENTS=require("./").EVENTS;Object.keys(EVENTS).forEach(function(name){if(EVENTS[name]===0){name="on"+name;ProxyHandler.prototype[name]=function(){if(this._cbs[name])this._cbs[name]()}}else if(EVENTS[name]===1){name="on"+name;ProxyHandler.prototype[name]=function(a){if(this._cbs[name])this._cbs[name](a)}}else if(EVENTS[name]===2){name="on"+name;ProxyHandler.prototype[name]=function(a,b){if(this._cbs[name])this._cbs[name](a,b)}}else{throw Error("wrong number of arguments")}})},{"./":36}],33:[function(require,module,exports){module.exports=Stream;var Parser=require("./WritableStream.js");function Stream(options){Parser.call(this,new Cbs(this),options)}require("inherits")(Stream,Parser);Stream.prototype.readable=true;function Cbs(scope){this.scope=scope}var EVENTS=require("../").EVENTS;Object.keys(EVENTS).forEach(function(name){if(EVENTS[name]===0){Cbs.prototype["on"+name]=function(){this.scope.emit(name)}}else if(EVENTS[name]===1){Cbs.prototype["on"+name]=function(a){this.scope.emit(name,a)}}else if(EVENTS[name]===2){Cbs.prototype["on"+name]=function(a,b){this.scope.emit(name,a,b)}}else{throw Error("wrong number of arguments!")}})},{"../":36,"./WritableStream.js":35,inherits:38}],34:[function(require,module,exports){module.exports=Tokenizer;var decodeCodePoint=require("entities/lib/decode_codepoint.js"),entityMap=require("entities/maps/entities.json"),legacyMap=require("entities/maps/legacy.json"),xmlMap=require("entities/maps/xml.json"),i=0,TEXT=i++,BEFORE_TAG_NAME=i++,IN_TAG_NAME=i++,IN_SELF_CLOSING_TAG=i++,BEFORE_CLOSING_TAG_NAME=i++,IN_CLOSING_TAG_NAME=i++,AFTER_CLOSING_TAG_NAME=i++,BEFORE_ATTRIBUTE_NAME=i++,IN_ATTRIBUTE_NAME=i++,AFTER_ATTRIBUTE_NAME=i++,BEFORE_ATTRIBUTE_VALUE=i++,IN_ATTRIBUTE_VALUE_DQ=i++,IN_ATTRIBUTE_VALUE_SQ=i++,IN_ATTRIBUTE_VALUE_NQ=i++,BEFORE_DECLARATION=i++,IN_DECLARATION=i++,IN_PROCESSING_INSTRUCTION=i++,BEFORE_COMMENT=i++,IN_COMMENT=i++,AFTER_COMMENT_1=i++,AFTER_COMMENT_2=i++,BEFORE_CDATA_1=i++,BEFORE_CDATA_2=i++,BEFORE_CDATA_3=i++,BEFORE_CDATA_4=i++,BEFORE_CDATA_5=i++,BEFORE_CDATA_6=i++,IN_CDATA=i++,AFTER_CDATA_1=i++,AFTER_CDATA_2=i++,BEFORE_SPECIAL=i++,BEFORE_SPECIAL_END=i++,BEFORE_SCRIPT_1=i++,BEFORE_SCRIPT_2=i++,BEFORE_SCRIPT_3=i++,BEFORE_SCRIPT_4=i++,BEFORE_SCRIPT_5=i++,AFTER_SCRIPT_1=i++,AFTER_SCRIPT_2=i++,AFTER_SCRIPT_3=i++,AFTER_SCRIPT_4=i++,AFTER_SCRIPT_5=i++,BEFORE_STYLE_1=i++,BEFORE_STYLE_2=i++,BEFORE_STYLE_3=i++,BEFORE_STYLE_4=i++,AFTER_STYLE_1=i++,AFTER_STYLE_2=i++,AFTER_STYLE_3=i++,AFTER_STYLE_4=i++,BEFORE_ENTITY=i++,BEFORE_NUMERIC_ENTITY=i++,IN_NAMED_ENTITY=i++,IN_NUMERIC_ENTITY=i++,IN_HEX_ENTITY=i++,j=0,SPECIAL_NONE=j++,SPECIAL_SCRIPT=j++,SPECIAL_STYLE=j++;function whitespace(c){return c===" "||c==="\n"||c==="\t"||c==="\f"||c==="\r"}function characterState(char,SUCCESS){return function(c){if(c===char)this._state=SUCCESS}}function ifElseState(upper,SUCCESS,FAILURE){var lower=upper.toLowerCase();if(upper===lower){return function(c){if(c===lower){this._state=SUCCESS}else{this._state=FAILURE;this._index--}}}else{return function(c){if(c===lower||c===upper){this._state=SUCCESS}else{this._state=FAILURE;this._index--}}}}function consumeSpecialNameChar(upper,NEXT_STATE){var lower=upper.toLowerCase();return function(c){if(c===lower||c===upper){this._state=NEXT_STATE}else{this._state=IN_TAG_NAME;this._index--}}}function Tokenizer(options,cbs){this._state=TEXT;this._buffer="";this._sectionStart=0;this._index=0;this._bufferOffset=0;this._baseState=TEXT;this._special=SPECIAL_NONE;this._cbs=cbs;this._running=true;this._ended=false;this._xmlMode=!!(options&&options.xmlMode);this._decodeEntities=!!(options&&options.decodeEntities)}Tokenizer.prototype._stateText=function(c){if(c==="<"){if(this._index>this._sectionStart){this._cbs.ontext(this._getSection())}this._state=BEFORE_TAG_NAME;this._sectionStart=this._index}else if(this._decodeEntities&&this._special===SPECIAL_NONE&&c==="&"){if(this._index>this._sectionStart){this._cbs.ontext(this._getSection())}this._baseState=TEXT;this._state=BEFORE_ENTITY;this._sectionStart=this._index}};Tokenizer.prototype._stateBeforeTagName=function(c){if(c==="/"){this._state=BEFORE_CLOSING_TAG_NAME}else if(c==="<"){this._cbs.ontext(this._getSection());this._sectionStart=this._index}else if(c===">"||this._special!==SPECIAL_NONE||whitespace(c)){this._state=TEXT}else if(c==="!"){this._state=BEFORE_DECLARATION;this._sectionStart=this._index+1}else if(c==="?"){this._state=IN_PROCESSING_INSTRUCTION;this._sectionStart=this._index+1}else{this._state=!this._xmlMode&&(c==="s"||c==="S")?BEFORE_SPECIAL:IN_TAG_NAME;this._sectionStart=this._index}};Tokenizer.prototype._stateInTagName=function(c){if(c==="/"||c===">"||whitespace(c)){this._emitToken("onopentagname");this._state=BEFORE_ATTRIBUTE_NAME;this._index--}};Tokenizer.prototype._stateBeforeCloseingTagName=function(c){if(whitespace(c));else if(c===">"){this._state=TEXT}else if(this._special!==SPECIAL_NONE){if(c==="s"||c==="S"){this._state=BEFORE_SPECIAL_END}else{this._state=TEXT;this._index--}}else{this._state=IN_CLOSING_TAG_NAME;this._sectionStart=this._index}};Tokenizer.prototype._stateInCloseingTagName=function(c){if(c===">"||whitespace(c)){this._emitToken("onclosetag");this._state=AFTER_CLOSING_TAG_NAME;this._index--}};Tokenizer.prototype._stateAfterCloseingTagName=function(c){if(c===">"){this._state=TEXT;this._sectionStart=this._index+1}};Tokenizer.prototype._stateBeforeAttributeName=function(c){if(c===">"){this._cbs.onopentagend();this._state=TEXT;this._sectionStart=this._index+1}else if(c==="/"){this._state=IN_SELF_CLOSING_TAG}else if(!whitespace(c)){this._state=IN_ATTRIBUTE_NAME;this._sectionStart=this._index}};Tokenizer.prototype._stateInSelfClosingTag=function(c){if(c===">"){this._cbs.onselfclosingtag();this._state=TEXT;this._sectionStart=this._index+1}else if(!whitespace(c)){this._state=BEFORE_ATTRIBUTE_NAME;this._index--}};Tokenizer.prototype._stateInAttributeName=function(c){if(c==="="||c==="/"||c===">"||whitespace(c)){this._cbs.onattribname(this._getSection());this._sectionStart=-1;this._state=AFTER_ATTRIBUTE_NAME;this._index--}};Tokenizer.prototype._stateAfterAttributeName=function(c){if(c==="="){this._state=BEFORE_ATTRIBUTE_VALUE}else if(c==="/"||c===">"){this._cbs.onattribend();this._state=BEFORE_ATTRIBUTE_NAME;this._index--}else if(!whitespace(c)){this._cbs.onattribend();this._state=IN_ATTRIBUTE_NAME;this._sectionStart=this._index}};Tokenizer.prototype._stateBeforeAttributeValue=function(c){if(c==='"'){this._state=IN_ATTRIBUTE_VALUE_DQ;this._sectionStart=this._index+1}else if(c==="'"){this._state=IN_ATTRIBUTE_VALUE_SQ;this._sectionStart=this._index+1}else if(!whitespace(c)){this._state=IN_ATTRIBUTE_VALUE_NQ;this._sectionStart=this._index;this._index--}};Tokenizer.prototype._stateInAttributeValueDoubleQuotes=function(c){if(c==='"'){this._emitToken("onattribdata");this._cbs.onattribend();this._state=BEFORE_ATTRIBUTE_NAME}else if(this._decodeEntities&&c==="&"){this._emitToken("onattribdata");this._baseState=this._state;this._state=BEFORE_ENTITY;this._sectionStart=this._index}};Tokenizer.prototype._stateInAttributeValueSingleQuotes=function(c){if(c==="'"){this._emitToken("onattribdata");this._cbs.onattribend();this._state=BEFORE_ATTRIBUTE_NAME}else if(this._decodeEntities&&c==="&"){this._emitToken("onattribdata");this._baseState=this._state;this._state=BEFORE_ENTITY;this._sectionStart=this._index}};Tokenizer.prototype._stateInAttributeValueNoQuotes=function(c){if(whitespace(c)||c===">"){this._emitToken("onattribdata");this._cbs.onattribend();this._state=BEFORE_ATTRIBUTE_NAME;this._index--}else if(this._decodeEntities&&c==="&"){this._emitToken("onattribdata");this._baseState=this._state;this._state=BEFORE_ENTITY;this._sectionStart=this._index}};Tokenizer.prototype._stateBeforeDeclaration=function(c){this._state=c==="["?BEFORE_CDATA_1:c==="-"?BEFORE_COMMENT:IN_DECLARATION};Tokenizer.prototype._stateInDeclaration=function(c){if(c===">"){this._cbs.ondeclaration(this._getSection());this._state=TEXT;this._sectionStart=this._index+1}};Tokenizer.prototype._stateInProcessingInstruction=function(c){if(c===">"){this._cbs.onprocessinginstruction(this._getSection());this._state=TEXT;this._sectionStart=this._index+1}};Tokenizer.prototype._stateBeforeComment=function(c){if(c==="-"){this._state=IN_COMMENT;this._sectionStart=this._index+1}else{this._state=IN_DECLARATION}};Tokenizer.prototype._stateInComment=function(c){if(c==="-")this._state=AFTER_COMMENT_1};Tokenizer.prototype._stateAfterComment1=function(c){if(c==="-"){this._state=AFTER_COMMENT_2}else{this._state=IN_COMMENT}};Tokenizer.prototype._stateAfterComment2=function(c){if(c===">"){this._cbs.oncomment(this._buffer.substring(this._sectionStart,this._index-2));this._state=TEXT;this._sectionStart=this._index+1}else if(c!=="-"){this._state=IN_COMMENT}};Tokenizer.prototype._stateBeforeCdata1=ifElseState("C",BEFORE_CDATA_2,IN_DECLARATION);Tokenizer.prototype._stateBeforeCdata2=ifElseState("D",BEFORE_CDATA_3,IN_DECLARATION);Tokenizer.prototype._stateBeforeCdata3=ifElseState("A",BEFORE_CDATA_4,IN_DECLARATION);Tokenizer.prototype._stateBeforeCdata4=ifElseState("T",BEFORE_CDATA_5,IN_DECLARATION);Tokenizer.prototype._stateBeforeCdata5=ifElseState("A",BEFORE_CDATA_6,IN_DECLARATION);Tokenizer.prototype._stateBeforeCdata6=function(c){if(c==="["){this._state=IN_CDATA;this._sectionStart=this._index+1}else{this._state=IN_DECLARATION;this._index--}};Tokenizer.prototype._stateInCdata=function(c){if(c==="]")this._state=AFTER_CDATA_1};Tokenizer.prototype._stateAfterCdata1=characterState("]",AFTER_CDATA_2);Tokenizer.prototype._stateAfterCdata2=function(c){if(c===">"){this._cbs.oncdata(this._buffer.substring(this._sectionStart,this._index-2));this._state=TEXT;this._sectionStart=this._index+1}else if(c!=="]"){this._state=IN_CDATA}};Tokenizer.prototype._stateBeforeSpecial=function(c){if(c==="c"||c==="C"){this._state=BEFORE_SCRIPT_1}else if(c==="t"||c==="T"){this._state=BEFORE_STYLE_1}else{this._state=IN_TAG_NAME;this._index--}};Tokenizer.prototype._stateBeforeSpecialEnd=function(c){if(this._special===SPECIAL_SCRIPT&&(c==="c"||c==="C")){this._state=AFTER_SCRIPT_1}else if(this._special===SPECIAL_STYLE&&(c==="t"||c==="T")){this._state=AFTER_STYLE_1}else this._state=TEXT};Tokenizer.prototype._stateBeforeScript1=consumeSpecialNameChar("R",BEFORE_SCRIPT_2);Tokenizer.prototype._stateBeforeScript2=consumeSpecialNameChar("I",BEFORE_SCRIPT_3);Tokenizer.prototype._stateBeforeScript3=consumeSpecialNameChar("P",BEFORE_SCRIPT_4);Tokenizer.prototype._stateBeforeScript4=consumeSpecialNameChar("T",BEFORE_SCRIPT_5);Tokenizer.prototype._stateBeforeScript5=function(c){if(c==="/"||c===">"||whitespace(c)){this._special=SPECIAL_SCRIPT}this._state=IN_TAG_NAME;this._index--};Tokenizer.prototype._stateAfterScript1=ifElseState("R",AFTER_SCRIPT_2,TEXT);Tokenizer.prototype._stateAfterScript2=ifElseState("I",AFTER_SCRIPT_3,TEXT);Tokenizer.prototype._stateAfterScript3=ifElseState("P",AFTER_SCRIPT_4,TEXT);Tokenizer.prototype._stateAfterScript4=ifElseState("T",AFTER_SCRIPT_5,TEXT);Tokenizer.prototype._stateAfterScript5=function(c){if(c===">"||whitespace(c)){this._special=SPECIAL_NONE;this._state=IN_CLOSING_TAG_NAME;this._sectionStart=this._index-6;this._index--}else this._state=TEXT};Tokenizer.prototype._stateBeforeStyle1=consumeSpecialNameChar("Y",BEFORE_STYLE_2);Tokenizer.prototype._stateBeforeStyle2=consumeSpecialNameChar("L",BEFORE_STYLE_3);Tokenizer.prototype._stateBeforeStyle3=consumeSpecialNameChar("E",BEFORE_STYLE_4);Tokenizer.prototype._stateBeforeStyle4=function(c){if(c==="/"||c===">"||whitespace(c)){this._special=SPECIAL_STYLE}this._state=IN_TAG_NAME;this._index--};Tokenizer.prototype._stateAfterStyle1=ifElseState("Y",AFTER_STYLE_2,TEXT);Tokenizer.prototype._stateAfterStyle2=ifElseState("L",AFTER_STYLE_3,TEXT);Tokenizer.prototype._stateAfterStyle3=ifElseState("E",AFTER_STYLE_4,TEXT);Tokenizer.prototype._stateAfterStyle4=function(c){if(c===">"||whitespace(c)){this._special=SPECIAL_NONE;this._state=IN_CLOSING_TAG_NAME;this._sectionStart=this._index-5;this._index--}else this._state=TEXT};Tokenizer.prototype._stateBeforeEntity=ifElseState("#",BEFORE_NUMERIC_ENTITY,IN_NAMED_ENTITY);Tokenizer.prototype._stateBeforeNumericEntity=ifElseState("X",IN_HEX_ENTITY,IN_NUMERIC_ENTITY);Tokenizer.prototype._parseNamedEntityStrict=function(){if(this._sectionStart+1<this._index){var entity=this._buffer.substring(this._sectionStart+1,this._index),map=this._xmlMode?xmlMap:entityMap;if(map.hasOwnProperty(entity)){this._emitPartial(map[entity]);this._sectionStart=this._index+1}}};Tokenizer.prototype._parseLegacyEntity=function(){var start=this._sectionStart+1,limit=this._index-start;if(limit>6)limit=6;while(limit>=2){var entity=this._buffer.substr(start,limit);if(legacyMap.hasOwnProperty(entity)){this._emitPartial(legacyMap[entity]);this._sectionStart+=limit+1;return}else{limit--}}};Tokenizer.prototype._stateInNamedEntity=function(c){if(c===";"){this._parseNamedEntityStrict();if(this._sectionStart+1<this._index&&!this._xmlMode){this._parseLegacyEntity()}this._state=this._baseState}else if((c<"a"||c>"z")&&(c<"A"||c>"Z")&&(c<"0"||c>"9")){if(this._xmlMode);else if(this._sectionStart+1===this._index);else if(this._baseState!==TEXT){if(c!=="="){this._parseNamedEntityStrict()}}else{this._parseLegacyEntity()}this._state=this._baseState;this._index--}};Tokenizer.prototype._decodeNumericEntity=function(offset,base){var sectionStart=this._sectionStart+offset;if(sectionStart!==this._index){var entity=this._buffer.substring(sectionStart,this._index);var parsed=parseInt(entity,base);this._emitPartial(decodeCodePoint(parsed));this._sectionStart=this._index}else{this._sectionStart--}this._state=this._baseState};Tokenizer.prototype._stateInNumericEntity=function(c){if(c===";"){this._decodeNumericEntity(2,10);this._sectionStart++}else if(c<"0"||c>"9"){if(!this._xmlMode){this._decodeNumericEntity(2,10)}else{this._state=this._baseState}this._index--}};Tokenizer.prototype._stateInHexEntity=function(c){if(c===";"){this._decodeNumericEntity(3,16);this._sectionStart++}else if((c<"a"||c>"f")&&(c<"A"||c>"F")&&(c<"0"||c>"9")){if(!this._xmlMode){this._decodeNumericEntity(3,16)}else{this._state=this._baseState}this._index--}};Tokenizer.prototype._cleanup=function(){if(this._sectionStart<0){this._buffer="";this._index=0;this._bufferOffset+=this._index}else if(this._running){if(this._state===TEXT){if(this._sectionStart!==this._index){this._cbs.ontext(this._buffer.substr(this._sectionStart))}this._buffer="";this._bufferOffset+=this._index;this._index=0}else if(this._sectionStart===this._index){this._buffer="";this._bufferOffset+=this._index;this._index=0}else{this._buffer=this._buffer.substr(this._sectionStart);this._index-=this._sectionStart;this._bufferOffset+=this._sectionStart}this._sectionStart=0}};Tokenizer.prototype.write=function(chunk){if(this._ended)this._cbs.onerror(Error(".write() after done!"));this._buffer+=chunk;this._parse()};Tokenizer.prototype._parse=function(){while(this._index<this._buffer.length&&this._running){var c=this._buffer.charAt(this._index);if(this._state===TEXT){this._stateText(c)}else if(this._state===BEFORE_TAG_NAME){this._stateBeforeTagName(c)}else if(this._state===IN_TAG_NAME){this._stateInTagName(c)}else if(this._state===BEFORE_CLOSING_TAG_NAME){this._stateBeforeCloseingTagName(c)}else if(this._state===IN_CLOSING_TAG_NAME){this._stateInCloseingTagName(c)}else if(this._state===AFTER_CLOSING_TAG_NAME){this._stateAfterCloseingTagName(c)}else if(this._state===IN_SELF_CLOSING_TAG){this._stateInSelfClosingTag(c)}else if(this._state===BEFORE_ATTRIBUTE_NAME){this._stateBeforeAttributeName(c)}else if(this._state===IN_ATTRIBUTE_NAME){this._stateInAttributeName(c)}else if(this._state===AFTER_ATTRIBUTE_NAME){this._stateAfterAttributeName(c)}else if(this._state===BEFORE_ATTRIBUTE_VALUE){this._stateBeforeAttributeValue(c)}else if(this._state===IN_ATTRIBUTE_VALUE_DQ){this._stateInAttributeValueDoubleQuotes(c)}else if(this._state===IN_ATTRIBUTE_VALUE_SQ){this._stateInAttributeValueSingleQuotes(c)}else if(this._state===IN_ATTRIBUTE_VALUE_NQ){this._stateInAttributeValueNoQuotes(c)}else if(this._state===BEFORE_DECLARATION){this._stateBeforeDeclaration(c)}else if(this._state===IN_DECLARATION){this._stateInDeclaration(c)}else if(this._state===IN_PROCESSING_INSTRUCTION){this._stateInProcessingInstruction(c)}else if(this._state===BEFORE_COMMENT){this._stateBeforeComment(c)}else if(this._state===IN_COMMENT){this._stateInComment(c)}else if(this._state===AFTER_COMMENT_1){this._stateAfterComment1(c)}else if(this._state===AFTER_COMMENT_2){this._stateAfterComment2(c)}else if(this._state===BEFORE_CDATA_1){this._stateBeforeCdata1(c)}else if(this._state===BEFORE_CDATA_2){this._stateBeforeCdata2(c)}else if(this._state===BEFORE_CDATA_3){this._stateBeforeCdata3(c)}else if(this._state===BEFORE_CDATA_4){this._stateBeforeCdata4(c)}else if(this._state===BEFORE_CDATA_5){this._stateBeforeCdata5(c)}else if(this._state===BEFORE_CDATA_6){this._stateBeforeCdata6(c)}else if(this._state===IN_CDATA){this._stateInCdata(c)}else if(this._state===AFTER_CDATA_1){this._stateAfterCdata1(c)}else if(this._state===AFTER_CDATA_2){this._stateAfterCdata2(c)}else if(this._state===BEFORE_SPECIAL){this._stateBeforeSpecial(c)}else if(this._state===BEFORE_SPECIAL_END){this._stateBeforeSpecialEnd(c)}else if(this._state===BEFORE_SCRIPT_1){this._stateBeforeScript1(c)}else if(this._state===BEFORE_SCRIPT_2){this._stateBeforeScript2(c)}else if(this._state===BEFORE_SCRIPT_3){this._stateBeforeScript3(c)}else if(this._state===BEFORE_SCRIPT_4){this._stateBeforeScript4(c)}else if(this._state===BEFORE_SCRIPT_5){this._stateBeforeScript5(c)}else if(this._state===AFTER_SCRIPT_1){this._stateAfterScript1(c)}else if(this._state===AFTER_SCRIPT_2){this._stateAfterScript2(c)}else if(this._state===AFTER_SCRIPT_3){this._stateAfterScript3(c)}else if(this._state===AFTER_SCRIPT_4){this._stateAfterScript4(c)}else if(this._state===AFTER_SCRIPT_5){this._stateAfterScript5(c)}else if(this._state===BEFORE_STYLE_1){this._stateBeforeStyle1(c)}else if(this._state===BEFORE_STYLE_2){this._stateBeforeStyle2(c)}else if(this._state===BEFORE_STYLE_3){this._stateBeforeStyle3(c)}else if(this._state===BEFORE_STYLE_4){this._stateBeforeStyle4(c)}else if(this._state===AFTER_STYLE_1){this._stateAfterStyle1(c)}else if(this._state===AFTER_STYLE_2){this._stateAfterStyle2(c)}else if(this._state===AFTER_STYLE_3){this._stateAfterStyle3(c)}else if(this._state===AFTER_STYLE_4){this._stateAfterStyle4(c)}else if(this._state===BEFORE_ENTITY){this._stateBeforeEntity(c)}else if(this._state===BEFORE_NUMERIC_ENTITY){this._stateBeforeNumericEntity(c)}else if(this._state===IN_NAMED_ENTITY){this._stateInNamedEntity(c)}else if(this._state===IN_NUMERIC_ENTITY){this._stateInNumericEntity(c)}else if(this._state===IN_HEX_ENTITY){this._stateInHexEntity(c)}else{this._cbs.onerror(Error("unknown _state"),this._state)}this._index++}this._cleanup()};Tokenizer.prototype.pause=function(){this._running=false};Tokenizer.prototype.resume=function(){this._running=true;if(this._index<this._buffer.length){this._parse()}if(this._ended){this._finish()}};Tokenizer.prototype.end=function(chunk){if(this._ended)this._cbs.onerror(Error(".end() after done!"));if(chunk)this.write(chunk);this._ended=true;if(this._running)this._finish()};Tokenizer.prototype._finish=function(){if(this._sectionStart<this._index){this._handleTrailingData()}this._cbs.onend()};Tokenizer.prototype._handleTrailingData=function(){var data=this._buffer.substr(this._sectionStart);if(this._state===IN_CDATA||this._state===AFTER_CDATA_1||this._state===AFTER_CDATA_2){this._cbs.oncdata(data)}else if(this._state===IN_COMMENT||this._state===AFTER_COMMENT_1||this._state===AFTER_COMMENT_2){this._cbs.oncomment(data)}else if(this._state===IN_NAMED_ENTITY&&!this._xmlMode){this._parseLegacyEntity();if(this._sectionStart<this._index){this._state=this._baseState;this._handleTrailingData()}}else if(this._state===IN_NUMERIC_ENTITY&&!this._xmlMode){this._decodeNumericEntity(2,10);if(this._sectionStart<this._index){this._state=this._baseState;this._handleTrailingData()}}else if(this._state===IN_HEX_ENTITY&&!this._xmlMode){this._decodeNumericEntity(3,16);if(this._sectionStart<this._index){this._state=this._baseState;this._handleTrailingData()}}else if(this._state!==IN_TAG_NAME&&this._state!==BEFORE_ATTRIBUTE_NAME&&this._state!==BEFORE_ATTRIBUTE_VALUE&&this._state!==AFTER_ATTRIBUTE_NAME&&this._state!==IN_ATTRIBUTE_NAME&&this._state!==IN_ATTRIBUTE_VALUE_SQ&&this._state!==IN_ATTRIBUTE_VALUE_DQ&&this._state!==IN_ATTRIBUTE_VALUE_NQ&&this._state!==IN_CLOSING_TAG_NAME){
3173this._cbs.ontext(data)}};Tokenizer.prototype.reset=function(){Tokenizer.call(this,{xmlMode:this._xmlMode,decodeEntities:this._decodeEntities},this._cbs)};Tokenizer.prototype.getAbsoluteIndex=function(){return this._bufferOffset+this._index};Tokenizer.prototype._getSection=function(){return this._buffer.substring(this._sectionStart,this._index)};Tokenizer.prototype._emitToken=function(name){this._cbs[name](this._getSection());this._sectionStart=-1};Tokenizer.prototype._emitPartial=function(value){if(this._baseState!==TEXT){this._cbs.onattribdata(value)}else{this._cbs.ontext(value)}}},{"entities/lib/decode_codepoint.js":22,"entities/maps/entities.json":25,"entities/maps/legacy.json":26,"entities/maps/xml.json":27}],35:[function(require,module,exports){module.exports=Stream;var Parser=require("./Parser.js"),WritableStream=require("stream").Writable||require("readable-stream").Writable,StringDecoder=require("string_decoder").StringDecoder,Buffer=require("buffer").Buffer;function Stream(cbs,options){var parser=this._parser=new Parser(cbs,options);var decoder=this._decoder=new StringDecoder;WritableStream.call(this,{decodeStrings:false});this.once("finish",function(){parser.end(decoder.end())})}require("inherits")(Stream,WritableStream);WritableStream.prototype._write=function(chunk,encoding,cb){if(chunk instanceof Buffer)chunk=this._decoder.write(chunk);this._parser.write(chunk);cb()}},{"./Parser.js":31,buffer:5,inherits:38,"readable-stream":3,stream:55,string_decoder:56}],36:[function(require,module,exports){var Parser=require("./Parser.js"),DomHandler=require("domhandler");function defineProp(name,value){delete module.exports[name];module.exports[name]=value;return value}module.exports={Parser:Parser,Tokenizer:require("./Tokenizer.js"),ElementType:require("domelementtype"),DomHandler:DomHandler,get FeedHandler(){return defineProp("FeedHandler",require("./FeedHandler.js"))},get Stream(){return defineProp("Stream",require("./Stream.js"))},get WritableStream(){return defineProp("WritableStream",require("./WritableStream.js"))},get ProxyHandler(){return defineProp("ProxyHandler",require("./ProxyHandler.js"))},get DomUtils(){return defineProp("DomUtils",require("domutils"))},get CollectingHandler(){return defineProp("CollectingHandler",require("./CollectingHandler.js"))},DefaultHandler:DomHandler,get RssHandler(){return defineProp("RssHandler",this.FeedHandler)},parseDOM:function(data,options){var handler=new DomHandler(options);new Parser(handler,options).end(data);return handler.dom},parseFeed:function(feed,options){var handler=new module.exports.FeedHandler(options);new Parser(handler,options).end(feed);return handler.dom},createDomStream:function(cb,options,elementCb){var handler=new DomHandler(cb,options,elementCb);return new Parser(handler,options)},EVENTS:{attribute:2,cdatastart:0,cdataend:0,text:1,processinginstruction:2,comment:1,commentend:0,closetag:1,opentag:2,opentagname:1,error:1,end:0}}},{"./CollectingHandler.js":29,"./FeedHandler.js":30,"./Parser.js":31,"./ProxyHandler.js":32,"./Stream.js":33,"./Tokenizer.js":34,"./WritableStream.js":35,domelementtype:9,domhandler:10,domutils:13}],37:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],38:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],39:[function(require,module,exports){module.exports=function(obj){return obj!=null&&(isBuffer(obj)||isSlowBuffer(obj)||!!obj._isBuffer)};function isBuffer(obj){return!!obj.constructor&&typeof obj.constructor.isBuffer==="function"&&obj.constructor.isBuffer(obj)}function isSlowBuffer(obj){return typeof obj.readFloatLE==="function"&&typeof obj.slice==="function"&&isBuffer(obj.slice(0,0))}},{}],40:[function(require,module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return toString.call(arr)=="[object Array]"}},{}],41:[function(require,module,exports){(function(process){"use strict";if(!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){module.exports=nextTick}else{module.exports=process.nextTick}function nextTick(fn,arg1,arg2,arg3){if(typeof fn!=="function"){throw new TypeError('"callback" argument must be a function')}var len=arguments.length;var args,i;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function afterTickOne(){fn.call(null,arg1)});case 3:return process.nextTick(function afterTickTwo(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function afterTickThree(){fn.call(null,arg1,arg2,arg3)});default:args=new Array(len-1);i=0;while(i<args.length){args[i++]=arguments[i]}return process.nextTick(function afterTick(){fn.apply(null,args)})}}}).call(this,require("_process"))},{_process:42}],42:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],43:[function(require,module,exports){module.exports=require("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":44}],44:[function(require,module,exports){"use strict";var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){keys.push(key)}return keys};module.exports=Duplex;var processNextTick=require("process-nextick-args");var util=require("core-util-is");util.inherits=require("inherits");var Readable=require("./_stream_readable");var Writable=require("./_stream_writable");util.inherits(Duplex,Readable);var keys=objectKeys(Writable.prototype);for(var v=0;v<keys.length;v++){var method=keys[v];if(!Duplex.prototype[method])Duplex.prototype[method]=Writable.prototype[method]}function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options);Writable.call(this,options);if(options&&options.readable===false)this.readable=false;if(options&&options.writable===false)this.writable=false;this.allowHalfOpen=true;if(options&&options.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}function onend(){if(this.allowHalfOpen||this._writableState.ended)return;processNextTick(onEndNT,this)}function onEndNT(self){self.end()}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}},{"./_stream_readable":46,"./_stream_writable":48,"core-util-is":6,inherits:38,"process-nextick-args":41}],45:[function(require,module,exports){"use strict";module.exports=PassThrough;var Transform=require("./_stream_transform");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},{"./_stream_transform":47,"core-util-is":6,inherits:38}],46:[function(require,module,exports){(function(process){"use strict";module.exports=Readable;var processNextTick=require("process-nextick-args");var isArray=require("isarray");Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter;var EElistenerCount=function(emitter,type){return emitter.listeners(type).length};var Stream;(function(){try{Stream=require("st"+"ream")}catch(_){}finally{if(!Stream)Stream=require("events").EventEmitter}})();var Buffer=require("buffer").Buffer;var bufferShim=require("buffer-shims");var util=require("core-util-is");util.inherits=require("inherits");var debugUtil=require("util");var debug=void 0;if(debugUtil&&debugUtil.debuglog){debug=debugUtil.debuglog("stream")}else{debug=function(){}}var BufferList=require("./internal/streams/BufferList");var StringDecoder;util.inherits(Readable,Stream);function prependListener(emitter,event,fn){if(typeof emitter.prependListener==="function"){return emitter.prependListener(event,fn)}else{if(!emitter._events||!emitter._events[event])emitter.on(event,fn);else if(isArray(emitter._events[event]))emitter._events[event].unshift(fn);else emitter._events[event]=[fn,emitter._events[event]]}}var Duplex;function ReadableState(options,stream){Duplex=Duplex||require("./_stream_duplex");options=options||{};this.objectMode=!!options.objectMode;if(stream instanceof Duplex)this.objectMode=this.objectMode||!!options.readableObjectMode;var hwm=options.highWaterMark;var defaultHwm=this.objectMode?16:16*1024;this.highWaterMark=hwm||hwm===0?hwm:defaultHwm;this.highWaterMark=~~this.highWaterMark;this.buffer=new BufferList;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.defaultEncoding=options.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(options.encoding){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this.decoder=new StringDecoder(options.encoding);this.encoding=options.encoding}}var Duplex;function Readable(options){Duplex=Duplex||require("./_stream_duplex");if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this);this.readable=true;if(options&&typeof options.read==="function")this._read=options.read;Stream.call(this)}Readable.prototype.push=function(chunk,encoding){var state=this._readableState;if(!state.objectMode&&typeof chunk==="string"){encoding=encoding||state.defaultEncoding;if(encoding!==state.encoding){chunk=bufferShim.from(chunk,encoding);encoding=""}}return readableAddChunk(this,state,chunk,encoding,false)};Readable.prototype.unshift=function(chunk){var state=this._readableState;return readableAddChunk(this,state,chunk,"",true)};Readable.prototype.isPaused=function(){return this._readableState.flowing===false};function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er){stream.emit("error",er)}else if(chunk===null){state.reading=false;onEofChunk(stream,state)}else if(state.objectMode||chunk&&chunk.length>0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;if(state.decoder&&!addToFront&&!encoding){chunk=state.decoder.write(chunk);skipAdd=!state.objectMode&&chunk.length===0}if(!addToFront)state.reading=false;if(!skipAdd){if(state.flowing&&state.length===0&&!state.sync){stream.emit("data",chunk);stream.read(0)}else{state.length+=state.objectMode?1:chunk.length;if(addToFront)state.buffer.unshift(chunk);else state.buffer.push(chunk);if(state.needReadable)emitReadable(stream)}}maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.setEncoding=function(enc){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this._readableState.decoder=new StringDecoder(enc);this._readableState.encoding=enc;return this};var MAX_HWM=8388608;function computeNewHighWaterMark(n){if(n>=MAX_HWM){n=MAX_HWM}else{n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++}return n}function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){if(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length}if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;if(!state.ended){state.needReadable=true;return 0}return state.length}Readable.prototype.read=function(n){debug("read",n);n=parseInt(n,10);var state=this._readableState;var nOrig=n;if(n!==0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){debug("read: emitReadable",state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);else emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){if(state.length===0)endReadable(this);return null}var doRead=state.needReadable;debug("need readable",doRead);if(state.length===0||state.length-n<state.highWaterMark){doRead=true;debug("length less than watermark",doRead)}if(state.ended||state.reading){doRead=false;debug("reading or ended",doRead)}else if(doRead){debug("do read");state.reading=true;state.sync=true;if(state.length===0)state.needReadable=true;this._read(state.highWaterMark);state.sync=false;if(!state.reading)n=howMuchToRead(nOrig,state)}var ret;if(n>0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}else{state.length-=n}if(state.length===0){if(!state.ended)state.needReadable=true;if(nOrig!==n&&state.ended)endReadable(this)}if(ret!==null)this.emit("data",ret);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&typeof chunk!=="string"&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug("emitReadable",state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream)}}function emitReadable_(stream){debug("emit readable");stream.emit("readable");flow(stream)}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark){debug("maybeReadMore read 0");stream.read(0);if(len===state.length)break;else len=state.length}state.readingMore=false}Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this;var state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1;debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==false)&&dest!==process.stdout&&dest!==process.stderr;var endFn=doEnd?onend:cleanup;if(state.endEmitted)processNextTick(endFn);else src.once("end",endFn);dest.on("unpipe",onunpipe);function onunpipe(readable){debug("onunpipe");if(readable===src){cleanup()}}function onend(){debug("onend");dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=false;function cleanup(){debug("cleanup");dest.removeListener("close",onclose);dest.removeListener("finish",onfinish);dest.removeListener("drain",ondrain);dest.removeListener("error",onerror);dest.removeListener("unpipe",onunpipe);src.removeListener("end",onend);src.removeListener("end",cleanup);src.removeListener("data",ondata);cleanedUp=true;if(state.awaitDrain&&(!dest._writableState||dest._writableState.needDrain))ondrain()}var increasedAwaitDrain=false;src.on("data",ondata);function ondata(chunk){debug("ondata");increasedAwaitDrain=false;var ret=dest.write(chunk);if(false===ret&&!increasedAwaitDrain){if((state.pipesCount===1&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp){debug("false write response, pause",src._readableState.awaitDrain);src._readableState.awaitDrain++;increasedAwaitDrain=true}src.pause()}}function onerror(er){debug("onerror",er);unpipe();dest.removeListener("error",onerror);if(EElistenerCount(dest,"error")===0)dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish");dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe");src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){debug("pipe resume");src.resume()}return dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain);if(state.awaitDrain)state.awaitDrain--;if(state.awaitDrain===0&&EElistenerCount(src,"data")){state.flowing=true;flow(src)}}}Readable.prototype.unpipe=function(dest){var state=this._readableState;if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;state.flowing=false;if(dest)dest.emit("unpipe",this);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;state.flowing=false;for(var _i=0;_i<len;_i++){dests[_i].emit("unpipe",this)}return this}var i=indexOf(state.pipes,dest);if(i===-1)return this;state.pipes.splice(i,1);state.pipesCount-=1;if(state.pipesCount===1)state.pipes=state.pipes[0];dest.emit("unpipe",this);return this};Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if(ev==="data"){if(this._readableState.flowing!==false)this.resume()}else if(ev==="readable"){var state=this._readableState;if(!state.endEmitted&&!state.readableListening){state.readableListening=state.needReadable=true;state.emittedReadable=false;if(!state.reading){processNextTick(nReadingNextTick,this)}else if(state.length){emitReadable(this,state)}}}return res};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(self){debug("readable nexttick read 0");self.read(0)}Readable.prototype.resume=function(){var state=this._readableState;if(!state.flowing){debug("resume");state.flowing=true;resume(this,state)}return this};function resume(stream,state){if(!state.resumeScheduled){state.resumeScheduled=true;processNextTick(resume_,stream,state)}}function resume_(stream,state){if(!state.reading){debug("resume read 0");stream.read(0)}state.resumeScheduled=false;state.awaitDrain=0;stream.emit("resume");flow(stream);if(state.flowing&&!state.reading)stream.read(0)}Readable.prototype.pause=function(){debug("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){debug("pause");this._readableState.flowing=false;this.emit("pause")}return this};function flow(stream){var state=stream._readableState;debug("flow",state.flowing);while(state.flowing&&stream.read()!==null){}}Readable.prototype.wrap=function(stream){var state=this._readableState;var paused=false;var self=this;stream.on("end",function(){debug("wrapped end");if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length)self.push(chunk)}self.push(null)});stream.on("data",function(chunk){debug("wrapped data");if(state.decoder)chunk=state.decoder.write(chunk);if(state.objectMode&&(chunk===null||chunk===undefined))return;else if(!state.objectMode&&(!chunk||!chunk.length))return;var ret=self.push(chunk);if(!ret){paused=true;stream.pause()}});for(var i in stream){if(this[i]===undefined&&typeof stream[i]==="function"){this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i)}}var events=["error","close","destroy","pause","resume"];forEach(events,function(ev){stream.on(ev,self.emit.bind(self,ev))});self._read=function(n){debug("wrapped _read",n);if(paused){paused=false;stream.resume()}};return self};Readable._fromList=fromList;function fromList(n,state){if(state.length===0)return null;var ret;if(state.objectMode)ret=state.buffer.shift();else if(!n||n>=state.length){if(state.decoder)ret=state.buffer.join("");else if(state.buffer.length===1)ret=state.buffer.head.data;else ret=state.buffer.concat(state.length);state.buffer.clear()}else{ret=fromListPartial(n,state.buffer,state.decoder)}return ret}function fromListPartial(n,list,hasStrings){var ret;if(n<list.head.data.length){ret=list.head.data.slice(0,n);list.head.data=list.head.data.slice(n)}else if(n===list.head.data.length){ret=list.shift()}else{ret=hasStrings?copyFromBufferString(n,list):copyFromBuffer(n,list)}return ret}function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null}else{list.head=p;p.data=str.slice(nb)}break}++c}list.length-=c;return ret}function copyFromBuffer(n,list){var ret=bufferShim.allocUnsafe(n);var p=list.head;var c=1;p.data.copy(ret);n-=p.data.length;while(p=p.next){var buf=p.data;var nb=n>buf.length?buf.length:n;buf.copy(ret,ret.length-n,0,nb);n-=nb;if(n===0){if(nb===buf.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null}else{list.head=p;p.data=buf.slice(nb)}break}++c}list.length-=c;return ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!state.endEmitted){state.ended=true;processNextTick(endReadableNT,state,stream)}}function endReadableNT(state,stream){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i}return-1}}).call(this,require("_process"))},{"./_stream_duplex":44,"./internal/streams/BufferList":49,_process:42,buffer:5,"buffer-shims":4,"core-util-is":6,events:28,inherits:38,isarray:40,"process-nextick-args":41,"string_decoder/":56,util:3}],47:[function(require,module,exports){"use strict";module.exports=Transform;var Duplex=require("./_stream_duplex");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(Transform,Duplex);function TransformState(stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null;this.writeencoding=null}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=false;var cb=ts.writecb;if(!cb)return stream.emit("error",new Error("no writecb in Transform class"));ts.writechunk=null;ts.writecb=null;if(data!==null&&data!==undefined)stream.push(data);cb(er);var rs=stream._readableState;rs.reading=false;if(rs.needReadable||rs.length<rs.highWaterMark){stream._read(rs.highWaterMark)}}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options);this._transformState=new TransformState(this);var stream=this;this._readableState.needReadable=true;this._readableState.sync=false;if(options){if(typeof options.transform==="function")this._transform=options.transform;if(typeof options.flush==="function")this._flush=options.flush}this.once("prefinish",function(){if(typeof this._flush==="function")this._flush(function(er){done(stream,er)});else done(stream)})}Transform.prototype.push=function(chunk,encoding){this._transformState.needTransform=false;return Duplex.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("Not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;ts.writecb=cb;ts.writechunk=chunk;ts.writeencoding=encoding;if(!ts.transforming){var rs=this._readableState;if(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;if(ts.writechunk!==null&&ts.writecb&&!ts.transforming){ts.transforming=true;this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)}else{ts.needTransform=true}};function done(stream,er){if(er)return stream.emit("error",er);var ws=stream._writableState;var ts=stream._transformState;if(ws.length)throw new Error("Calling transform done when ws.length != 0");if(ts.transforming)throw new Error("Calling transform done when still transforming");return stream.push(null)}},{"./_stream_duplex":44,"core-util-is":6,inherits:38}],48:[function(require,module,exports){(function(process){"use strict";module.exports=Writable;var processNextTick=require("process-nextick-args");var asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var internalUtil={deprecate:require("util-deprecate")};var Stream;(function(){try{Stream=require("st"+"ream")}catch(_){}finally{if(!Stream)Stream=require("events").EventEmitter}})();var Buffer=require("buffer").Buffer;var bufferShim=require("buffer-shims");util.inherits(Writable,Stream);function nop(){}function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb;this.next=null}var Duplex;function WritableState(options,stream){Duplex=Duplex||require("./_stream_duplex");options=options||{};this.objectMode=!!options.objectMode;if(stream instanceof Duplex)this.objectMode=this.objectMode||!!options.writableObjectMode;var hwm=options.highWaterMark;var defaultHwm=this.objectMode?16:16*1024;this.highWaterMark=hwm||hwm===0?hwm:defaultHwm;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function writableStateGetBuffer(){var current=this.bufferedRequest;var out=[];while(current){out.push(current);current=current.next}return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.")})}catch(_){}})();var Duplex;function Writable(options){Duplex=Duplex||require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;if(options){if(typeof options.write==="function")this._write=options.write;if(typeof options.writev==="function")this._writev=options.writev}Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er);processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError("May not write null values to stream")}else if(!Buffer.isBuffer(chunk)&&typeof chunk!=="string"&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}if(er){stream.emit("error",er);processNextTick(cb,er);valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=nop;if(state.ended)writeAfterEnd(this,cb);else if(validChunk(this,state,chunk,cb)){
3174state.pendingcb++;ret=writeOrBuffer(this,state,chunk,encoding,cb)}return ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){if(typeof encoding==="string")encoding=encoding.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);this._writableState.defaultEncoding=encoding;return this};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=bufferShim.from(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(!ret)state.needDrain=true;if(state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest=new WriteReq(chunk,encoding,cb);if(last){last.next=state.lastBufferedRequest}else{state.bufferedRequest=state.lastBufferedRequest}state.bufferedRequestCount+=1}else{doWrite(stream,state,false,len,chunk,encoding,cb)}return ret}function doWrite(stream,state,writev,len,chunk,encoding,cb){state.writelen=len;state.writecb=cb;state.writing=true;state.sync=true;if(writev)stream._writev(chunk,state.onwrite);else stream._write(chunk,encoding,state.onwrite);state.sync=false}function onwriteError(stream,state,sync,er,cb){--state.pendingcb;if(sync)processNextTick(cb,er);else cb(er);stream._writableState.errorEmitted=true;stream.emit("error",er)}function onwriteStateUpdate(state){state.writing=false;state.writecb=null;state.length-=state.writelen;state.writelen=0}function onwrite(stream,er){var state=stream._writableState;var sync=state.sync;var cb=state.writecb;onwriteStateUpdate(state);if(er)onwriteError(stream,state,sync,er,cb);else{var finished=needFinish(state);if(!finished&&!state.corked&&!state.bufferProcessing&&state.bufferedRequest){clearBuffer(stream,state)}if(sync){asyncWrite(afterWrite,stream,state,finished,cb)}else{afterWrite(stream,state,finished,cb)}}}function afterWrite(stream,state,finished,cb){if(!finished)onwriteDrain(stream,state);state.pendingcb--;cb();finishMaybe(stream,state)}function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit("drain")}}function clearBuffer(stream,state){state.bufferProcessing=true;var entry=state.bufferedRequest;if(stream._writev&&entry&&entry.next){var l=state.bufferedRequestCount;var buffer=new Array(l);var holder=state.corkedRequestsFree;holder.entry=entry;var count=0;while(entry){buffer[count]=entry;entry=entry.next;count+=1}doWrite(stream,state,true,state.length,buffer,"",holder.finish);state.pendingcb++;state.lastBufferedRequest=null;if(holder.next){state.corkedRequestsFree=holder.next;holder.next=null}else{state.corkedRequestsFree=new CorkedRequest(state)}}else{while(entry){var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,false,len,chunk,encoding,cb);entry=entry.next;if(state.writing){break}}if(entry===null)state.lastBufferedRequest=null}state.bufferedRequestCount=0;state.bufferedRequest=entry;state.bufferProcessing=false}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;if(typeof chunk==="function"){cb=chunk;chunk=null;encoding=null}else if(typeof encoding==="function"){cb=encoding;encoding=null}if(chunk!==null&&chunk!==undefined)this.write(chunk,encoding);if(state.corked){state.corked=1;this.uncork()}if(!state.ending&&!state.finished)endWritable(this,state,cb)};function needFinish(state){return state.ending&&state.length===0&&state.bufferedRequest===null&&!state.finished&&!state.writing}function prefinish(stream,state){if(!state.prefinished){state.prefinished=true;stream.emit("prefinish")}}function finishMaybe(stream,state){var need=needFinish(state);if(need){if(state.pendingcb===0){prefinish(stream,state);state.finished=true;stream.emit("finish")}else{prefinish(stream,state)}}return need}function endWritable(stream,state,cb){state.ending=true;finishMaybe(stream,state);if(cb){if(state.finished)processNextTick(cb);else stream.once("finish",cb)}state.ended=true;stream.writable=false}function CorkedRequest(state){var _this=this;this.next=null;this.entry=null;this.finish=function(err){var entry=_this.entry;_this.entry=null;while(entry){var cb=entry.callback;state.pendingcb--;cb(err);entry=entry.next}if(state.corkedRequestsFree){state.corkedRequestsFree.next=_this}else{state.corkedRequestsFree=_this}}}}).call(this,require("_process"))},{"./_stream_duplex":44,_process:42,buffer:5,"buffer-shims":4,"core-util-is":6,events:28,inherits:38,"process-nextick-args":41,"util-deprecate":57}],49:[function(require,module,exports){"use strict";var Buffer=require("buffer").Buffer;var bufferShim=require("buffer-shims");module.exports=BufferList;function BufferList(){this.head=null;this.tail=null;this.length=0}BufferList.prototype.push=function(v){var entry={data:v,next:null};if(this.length>0)this.tail.next=entry;else this.head=entry;this.tail=entry;++this.length};BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};if(this.length===0)this.tail=entry;this.head=entry;++this.length};BufferList.prototype.shift=function(){if(this.length===0)return;var ret=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return ret};BufferList.prototype.clear=function(){this.head=this.tail=null;this.length=0};BufferList.prototype.join=function(s){if(this.length===0)return"";var p=this.head;var ret=""+p.data;while(p=p.next){ret+=s+p.data}return ret};BufferList.prototype.concat=function(n){if(this.length===0)return bufferShim.alloc(0);if(this.length===1)return this.head.data;var ret=bufferShim.allocUnsafe(n>>>0);var p=this.head;var i=0;while(p){p.data.copy(ret,i);i+=p.data.length;p=p.next}return ret}},{buffer:5,"buffer-shims":4}],50:[function(require,module,exports){module.exports=require("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":45}],51:[function(require,module,exports){(function(process){var Stream=function(){try{return require("st"+"ream")}catch(_){}}();exports=module.exports=require("./lib/_stream_readable.js");exports.Stream=Stream||exports;exports.Readable=exports;exports.Writable=require("./lib/_stream_writable.js");exports.Duplex=require("./lib/_stream_duplex.js");exports.Transform=require("./lib/_stream_transform.js");exports.PassThrough=require("./lib/_stream_passthrough.js");if(!process.browser&&process.env.READABLE_STREAM==="disable"&&Stream){module.exports=Stream}}).call(this,require("_process"))},{"./lib/_stream_duplex.js":44,"./lib/_stream_passthrough.js":45,"./lib/_stream_readable.js":46,"./lib/_stream_transform.js":47,"./lib/_stream_writable.js":48,_process:42}],52:[function(require,module,exports){module.exports=require("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":47}],53:[function(require,module,exports){module.exports=require("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":48}],54:[function(require,module,exports){module.exports=function(string){return string.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")}},{}],55:[function(require,module,exports){module.exports=Stream;var EE=require("events").EventEmitter;var inherits=require("inherits");inherits(Stream,EE);Stream.Readable=require("readable-stream/readable.js");Stream.Writable=require("readable-stream/writable.js");Stream.Duplex=require("readable-stream/duplex.js");Stream.Transform=require("readable-stream/transform.js");Stream.PassThrough=require("readable-stream/passthrough.js");Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){if(dest.writable){if(false===dest.write(chunk)&&source.pause){source.pause()}}}source.on("data",ondata);function ondrain(){if(source.readable&&source.resume){source.resume()}}dest.on("drain",ondrain);if(!dest._isStdio&&(!options||options.end!==false)){source.on("end",onend);source.on("close",onclose)}var didOnEnd=false;function onend(){if(didOnEnd)return;didOnEnd=true;dest.end()}function onclose(){if(didOnEnd)return;didOnEnd=true;if(typeof dest.destroy==="function")dest.destroy()}function onerror(er){cleanup();if(EE.listenerCount(this,"error")===0){throw er}}source.on("error",onerror);dest.on("error",onerror);function cleanup(){source.removeListener("data",ondata);dest.removeListener("drain",ondrain);source.removeListener("end",onend);source.removeListener("close",onclose);source.removeListener("error",onerror);dest.removeListener("error",onerror);source.removeListener("end",cleanup);source.removeListener("close",cleanup);dest.removeListener("close",cleanup)}source.on("end",cleanup);source.on("close",cleanup);dest.on("close",cleanup);dest.emit("pipe",source);return dest}},{events:28,inherits:38,"readable-stream/duplex.js":43,"readable-stream/passthrough.js":50,"readable-stream/readable.js":51,"readable-stream/transform.js":52,"readable-stream/writable.js":53}],56:[function(require,module,exports){var Buffer=require("buffer").Buffer;var isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding)){throw new Error("Unknown encoding: "+encoding)}}var StringDecoder=exports.StringDecoder=function(encoding){this.encoding=(encoding||"utf8").toLowerCase().replace(/[-_]/,"");assertEncoding(encoding);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return}this.charBuffer=new Buffer(6);this.charReceived=0;this.charLength=0};StringDecoder.prototype.write=function(buffer){var charStr="";while(this.charLength){var available=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived<this.charLength){return""}buffer=buffer.slice(available,buffer.length);charStr=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var charCode=charStr.charCodeAt(charStr.length-1);if(charCode>=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(buffer.length===0){return charStr}break}this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0}},{buffer:5}],57:[function(require,module,exports){(function(global){module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){try{if(!global.localStorage)return false}catch(_){return false}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],58:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target}},{}]},{},[1])(1)});
3175
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003176/**
3177 * swagger-client - swagger-client is a javascript client for use with swaggering APIs.
Jian Li1c94b9d2017-02-08 15:47:21 +09003178 * @version v2.1.29
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003179 * @link http://swagger.io
Jian Li83d87a72016-04-20 15:38:24 -07003180 * @license Apache-2.0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003181 */
3182(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.SwaggerClient = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
3183'use strict';
3184
3185var auth = require('./lib/auth');
3186var helpers = require('./lib/helpers');
3187var SwaggerClient = require('./lib/client');
3188var deprecationWrapper = function (url, options) {
3189 helpers.log('This is deprecated, use "new SwaggerClient" instead.');
3190
3191 return new SwaggerClient(url, options);
3192};
3193
3194/* Here for IE8 Support */
3195if (!Array.prototype.indexOf) {
3196 Array.prototype.indexOf = function(obj, start) {
3197 for (var i = (start || 0), j = this.length; i < j; i++) {
3198 if (this[i] === obj) { return i; }
3199 }
3200 return -1;
3201 };
3202}
3203
3204/* Here for IE8 Support */
3205if (!String.prototype.trim) {
3206 String.prototype.trim = function () {
3207 return this.replace(/^\s+|\s+$/g, '');
3208 };
3209}
3210
3211/* Here for node 10.x support */
3212if (!String.prototype.endsWith) {
3213 String.prototype.endsWith = function(suffix) {
3214 return this.indexOf(suffix, this.length - suffix.length) !== -1;
3215 };
3216}
3217
3218module.exports = SwaggerClient;
3219
3220SwaggerClient.ApiKeyAuthorization = auth.ApiKeyAuthorization;
3221SwaggerClient.PasswordAuthorization = auth.PasswordAuthorization;
3222SwaggerClient.CookieAuthorization = auth.CookieAuthorization;
3223SwaggerClient.SwaggerApi = deprecationWrapper;
3224SwaggerClient.SwaggerClient = deprecationWrapper;
Jian Li83d87a72016-04-20 15:38:24 -07003225SwaggerClient.SchemaMarkup = require('./lib/schema-markup');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003226
Jian Li83d87a72016-04-20 15:38:24 -07003227},{"./lib/auth":2,"./lib/client":3,"./lib/helpers":4,"./lib/schema-markup":7}],2:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003228'use strict';
3229
Jian Li83d87a72016-04-20 15:38:24 -07003230var helpers = require('./helpers');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003231var btoa = require('btoa'); // jshint ignore:line
Jian Li83d87a72016-04-20 15:38:24 -07003232var CookieJar = require('cookiejar').CookieJar;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003233var _ = {
3234 each: require('lodash-compat/collection/each'),
3235 includes: require('lodash-compat/collection/includes'),
3236 isObject: require('lodash-compat/lang/isObject'),
3237 isArray: require('lodash-compat/lang/isArray')
3238};
3239
3240/**
Jian Li1c94b9d2017-02-08 15:47:21 +09003241 * SwaggerAuthorizations applies the correct authorization to an operation being executed
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003242 */
3243var SwaggerAuthorizations = module.exports.SwaggerAuthorizations = function (authz) {
3244 this.authz = authz || {};
3245};
3246
3247/**
3248 * Add auths to the hash
3249 * Will overwrite any existing
3250 *
3251 */
3252SwaggerAuthorizations.prototype.add = function (name, auth) {
Jian Li83d87a72016-04-20 15:38:24 -07003253 if(_.isObject(name)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003254 for (var key in name) {
3255 this.authz[key] = name[key];
3256 }
3257 } else if(typeof name === 'string' ){
3258 this.authz[name] = auth;
3259 }
3260
3261 return auth;
3262};
3263
3264SwaggerAuthorizations.prototype.remove = function (name) {
3265 return delete this.authz[name];
3266};
3267
3268SwaggerAuthorizations.prototype.apply = function (obj, securities) {
Jian Li83d87a72016-04-20 15:38:24 -07003269 var status = true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003270 var applyAll = !securities;
3271 var flattenedSecurities = [];
3272
Jian Li8afbbee2016-07-27 19:16:51 +09003273 // favor the object-level authorizations over global
3274 var authz = obj.clientAuthorizations || this.authz;
3275
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003276 // Securities could be [ {} ]
3277 _.each(securities, function (obj, key) {
3278
3279 // Make sure we account for securities being [ str ]
3280 if(typeof key === 'string') {
3281 flattenedSecurities.push(key);
3282 }
3283
3284 // Flatten keys in to our array
3285 _.each(obj, function (val, key) {
3286 flattenedSecurities.push(key);
3287 });
3288 });
3289
Jian Li8afbbee2016-07-27 19:16:51 +09003290 _.each(authz, function (auth, authName) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003291 if(applyAll || _.includes(flattenedSecurities, authName)) {
Jian Li83d87a72016-04-20 15:38:24 -07003292 var newStatus = auth.apply(obj);
3293 status = status && !!newStatus; // logical ORs regarding status
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003294 }
3295 });
3296
3297 return status;
3298};
3299
3300/**
3301 * ApiKeyAuthorization allows a query param or header to be injected
3302 */
3303var ApiKeyAuthorization = module.exports.ApiKeyAuthorization = function (name, value, type) {
3304 this.name = name;
3305 this.value = value;
3306 this.type = type;
3307};
3308
3309ApiKeyAuthorization.prototype.apply = function (obj) {
3310 if (this.type === 'query') {
Jian Li83d87a72016-04-20 15:38:24 -07003311 // see if already applied. If so, don't do it again
3312
3313 var qp;
3314 if (obj.url.indexOf('?') > 0) {
3315 qp = obj.url.substring(obj.url.indexOf('?') + 1);
3316 var parts = qp.split('&');
3317 if(parts && parts.length > 0) {
3318 for(var i = 0; i < parts.length; i++) {
3319 var kv = parts[i].split('=');
3320 if(kv && kv.length > 0) {
3321 if (kv[0] === this.name) {
3322 // skip it
3323 return false;
3324 }
3325 }
3326 }
3327 }
3328 }
3329
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003330 if (obj.url.indexOf('?') > 0) {
3331 obj.url = obj.url + '&' + this.name + '=' + this.value;
3332 } else {
3333 obj.url = obj.url + '?' + this.name + '=' + this.value;
3334 }
3335
3336 return true;
3337 } else if (this.type === 'header') {
Jian Li83d87a72016-04-20 15:38:24 -07003338 if(typeof obj.headers[this.name] === 'undefined') {
3339 obj.headers[this.name] = this.value;
3340 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003341
3342 return true;
3343 }
3344};
3345
3346var CookieAuthorization = module.exports.CookieAuthorization = function (cookie) {
3347 this.cookie = cookie;
3348};
3349
3350CookieAuthorization.prototype.apply = function (obj) {
3351 obj.cookieJar = obj.cookieJar || new CookieJar();
3352 obj.cookieJar.setCookie(this.cookie);
3353
3354 return true;
3355};
3356
3357/**
3358 * Password Authorization is a basic auth implementation
3359 */
Jian Li83d87a72016-04-20 15:38:24 -07003360var PasswordAuthorization = module.exports.PasswordAuthorization = function (username, password) {
3361 if (arguments.length === 3) {
3362 helpers.log('PasswordAuthorization: the \'name\' argument has been removed, pass only username and password');
3363 username = arguments[1];
3364 password = arguments[2];
3365 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003366 this.username = username;
3367 this.password = password;
3368};
3369
3370PasswordAuthorization.prototype.apply = function (obj) {
Jian Li83d87a72016-04-20 15:38:24 -07003371 if(typeof obj.headers.Authorization === 'undefined') {
3372 obj.headers.Authorization = 'Basic ' + btoa(this.username + ':' + this.password);
3373 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003374
3375 return true;
3376};
3377
Jian Li8afbbee2016-07-27 19:16:51 +09003378},{"./helpers":4,"btoa":13,"cookiejar":18,"lodash-compat/collection/each":52,"lodash-compat/collection/includes":55,"lodash-compat/lang/isArray":140,"lodash-compat/lang/isObject":144}],3:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003379'use strict';
3380
3381var _ = {
3382 bind: require('lodash-compat/function/bind'),
3383 cloneDeep: require('lodash-compat/lang/cloneDeep'),
3384 find: require('lodash-compat/collection/find'),
3385 forEach: require('lodash-compat/collection/forEach'),
3386 indexOf: require('lodash-compat/array/indexOf'),
3387 isArray: require('lodash-compat/lang/isArray'),
Jian Li83d87a72016-04-20 15:38:24 -07003388 isObject: require('lodash-compat/lang/isObject'),
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003389 isFunction: require('lodash-compat/lang/isFunction'),
3390 isPlainObject: require('lodash-compat/lang/isPlainObject'),
3391 isUndefined: require('lodash-compat/lang/isUndefined')
3392};
3393var auth = require('./auth');
3394var helpers = require('./helpers');
3395var Model = require('./types/model');
3396var Operation = require('./types/operation');
3397var OperationGroup = require('./types/operationGroup');
3398var Resolver = require('./resolver');
3399var SwaggerHttp = require('./http');
3400var SwaggerSpecConverter = require('./spec-converter');
Jian Li83d87a72016-04-20 15:38:24 -07003401var Q = require('q');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003402
3403// We have to keep track of the function/property names to avoid collisions for tag names which are used to allow the
3404// following usage: 'client.{tagName}'
3405var reservedClientTags = [
3406 'apis',
3407 'authorizationScheme',
3408 'authorizations',
3409 'basePath',
3410 'build',
3411 'buildFrom1_1Spec',
3412 'buildFrom1_2Spec',
3413 'buildFromSpec',
3414 'clientAuthorizations',
3415 'convertInfo',
3416 'debug',
3417 'defaultErrorCallback',
3418 'defaultSuccessCallback',
Jian Li83d87a72016-04-20 15:38:24 -07003419 'enableCookies',
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003420 'fail',
3421 'failure',
3422 'finish',
3423 'help',
Jian Li8afbbee2016-07-27 19:16:51 +09003424 'host',
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003425 'idFromOp',
3426 'info',
3427 'initialize',
3428 'isBuilt',
3429 'isValid',
3430 'modelPropertyMacro',
3431 'models',
3432 'modelsArray',
3433 'options',
3434 'parameterMacro',
3435 'parseUri',
3436 'progress',
3437 'resourceCount',
3438 'sampleModels',
3439 'selfReflect',
3440 'setConsolidatedModels',
3441 'spec',
3442 'supportedSubmitMethods',
3443 'swaggerRequestHeaders',
3444 'tagFromLabel',
Jian Li83d87a72016-04-20 15:38:24 -07003445 'title',
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003446 'url',
Jian Li8afbbee2016-07-27 19:16:51 +09003447 'useJQuery',
3448 'jqueryAjaxCache'
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003449];
3450// We have to keep track of the function/property names to avoid collisions for tag names which are used to allow the
3451// following usage: 'client.apis.{tagName}'
3452var reservedApiTags = [
3453 'apis',
3454 'asCurl',
3455 'description',
3456 'externalDocs',
3457 'help',
3458 'label',
3459 'name',
3460 'operation',
3461 'operations',
3462 'operationsArray',
3463 'path',
3464 'tag'
3465];
3466var supportedOperationMethods = ['delete', 'get', 'head', 'options', 'patch', 'post', 'put'];
3467var SwaggerClient = module.exports = function (url, options) {
3468 this.authorizations = null;
3469 this.authorizationScheme = null;
3470 this.basePath = null;
3471 this.debug = false;
Jian Li83d87a72016-04-20 15:38:24 -07003472 this.enableCookies = false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003473 this.info = null;
3474 this.isBuilt = false;
3475 this.isValid = false;
3476 this.modelsArray = [];
3477 this.resourceCount = 0;
3478 this.url = null;
3479 this.useJQuery = false;
Jian Li8afbbee2016-07-27 19:16:51 +09003480 this.jqueryAjaxCache = false;
Jian Li83d87a72016-04-20 15:38:24 -07003481 this.swaggerObject = {};
Jian Li8afbbee2016-07-27 19:16:51 +09003482 this.deferredClient = undefined;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003483
3484 this.clientAuthorizations = new auth.SwaggerAuthorizations();
3485
3486 if (typeof url !== 'undefined') {
3487 return this.initialize(url, options);
3488 } else {
3489 return this;
3490 }
3491};
3492
3493SwaggerClient.prototype.initialize = function (url, options) {
3494 this.models = {};
3495 this.sampleModels = {};
3496
3497 if (typeof url === 'string') {
3498 this.url = url;
Jian Li83d87a72016-04-20 15:38:24 -07003499 } else if (_.isObject(url)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003500 options = url;
3501 this.url = options.url;
3502 }
3503
Jian Li8afbbee2016-07-27 19:16:51 +09003504 if(this.url && this.url.indexOf('http:') === -1 && this.url.indexOf('https:') === -1) {
3505 // no protocol, so we can only use window if it exists
3506 if(typeof(window) !== 'undefined' && window && window.location) {
3507 this.url = window.location.origin + this.url;
3508 }
3509 }
3510
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003511 options = options || {};
3512 this.clientAuthorizations.add(options.authorizations);
3513 this.swaggerRequestHeaders = options.swaggerRequestHeaders || 'application/json;charset=utf-8,*/*';
3514 this.defaultSuccessCallback = options.defaultSuccessCallback || null;
3515 this.defaultErrorCallback = options.defaultErrorCallback || null;
3516 this.modelPropertyMacro = options.modelPropertyMacro || null;
Jian Li1c94b9d2017-02-08 15:47:21 +09003517 this.connectionAgent = options.connectionAgent || null;
Jian Li83d87a72016-04-20 15:38:24 -07003518 this.parameterMacro = options.parameterMacro || null;
3519 this.usePromise = options.usePromise || null;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003520
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003521 // operation request timeout default
3522 this.timeout = options.timeout || null;
3523 // default to request timeout when not specified
3524 this.fetchSpecTimeout = typeof options.fetchSpecTimeout !== 'undefined' ?
3525 options.fetchSpecTimeout : options.timeout || null;
Jian Li8afbbee2016-07-27 19:16:51 +09003526
3527 if(this.usePromise) {
3528 this.deferredClient = Q.defer();
3529 }
3530
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003531 if (typeof options.success === 'function') {
3532 this.success = options.success;
3533 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003534 if (options.useJQuery) {
3535 this.useJQuery = options.useJQuery;
3536 }
3537
Jian Li8afbbee2016-07-27 19:16:51 +09003538 if (options.jqueryAjaxCache) {
3539 this.jqueryAjaxCache = options.jqueryAjaxCache;
3540 }
3541
Jian Li83d87a72016-04-20 15:38:24 -07003542 if (options.enableCookies) {
3543 this.enableCookies = options.enableCookies;
3544 }
3545
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003546 this.options = options || {};
3547
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003548 // maybe don't need this?
3549 this.options.timeout = this.timeout;
3550 this.options.fetchSpecTimeout = this.fetchSpecTimeout;
3551
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003552 this.supportedSubmitMethods = options.supportedSubmitMethods || [];
Jian Li83d87a72016-04-20 15:38:24 -07003553 this.failure = options.failure || function (err) { throw err; };
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003554 this.progress = options.progress || function () {};
3555 this.spec = _.cloneDeep(options.spec); // Clone so we do not alter the provided document
3556
Jian Li83d87a72016-04-20 15:38:24 -07003557 if (options.scheme) {
3558 this.scheme = options.scheme;
3559 }
3560
3561 if (this.usePromise || typeof options.success === 'function') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003562 this.ready = true;
Jian Li83d87a72016-04-20 15:38:24 -07003563 return this.build();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003564 }
3565};
3566
3567SwaggerClient.prototype.build = function (mock) {
3568 if (this.isBuilt) {
3569 return this;
3570 }
3571
3572 var self = this;
3573
Jian Li8afbbee2016-07-27 19:16:51 +09003574 if (this.spec) {
3575 this.progress('fetching resource list; Please wait.');
3576 } else {
3577 this.progress('fetching resource list: ' + this.url + '; Please wait.');
3578 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003579
3580 var obj = {
3581 useJQuery: this.useJQuery,
Jian Li8afbbee2016-07-27 19:16:51 +09003582 jqueryAjaxCache: this.jqueryAjaxCache,
Jian Li1c94b9d2017-02-08 15:47:21 +09003583 connectionAgent: this.connectionAgent,
3584 enableCookies: this.enableCookies,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003585 url: this.url,
3586 method: 'get',
3587 headers: {
3588 accept: this.swaggerRequestHeaders
3589 },
3590 on: {
3591 error: function (response) {
3592 if (self.url.substring(0, 4) !== 'http') {
3593 return self.fail('Please specify the protocol for ' + self.url);
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003594 } else if (response.errObj && (response.errObj.code === 'ECONNABORTED' || response.errObj.message.indexOf('timeout') !== -1)) {
3595 return self.fail('Request timed out after ' + self.fetchSpecTimeout + 'ms');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003596 } else if (response.status === 0) {
3597 return self.fail('Can\'t read from server. It may not have the appropriate access-control-origin settings.');
3598 } else if (response.status === 404) {
3599 return self.fail('Can\'t read swagger JSON from ' + self.url);
3600 } else {
3601 return self.fail(response.status + ' : ' + response.statusText + ' ' + self.url);
3602 }
3603 },
3604 response: function (resp) {
3605
3606 var responseObj = resp.obj;
3607 if(!responseObj) {
3608 return self.fail('failed to parse JSON/YAML response');
3609 }
3610
3611 self.swaggerVersion = responseObj.swaggerVersion;
Jian Li83d87a72016-04-20 15:38:24 -07003612 self.swaggerObject = responseObj;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003613
3614 if (responseObj.swagger && parseInt(responseObj.swagger) === 2) {
3615 self.swaggerVersion = responseObj.swagger;
3616
3617 new Resolver().resolve(responseObj, self.url, self.buildFromSpec, self);
3618
3619 self.isValid = true;
3620 } else {
3621 var converter = new SwaggerSpecConverter();
Jian Li83d87a72016-04-20 15:38:24 -07003622 self.oldSwaggerObject = self.swaggerObject;
3623
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003624 converter.setDocumentationLocation(self.url);
Jian Li83d87a72016-04-20 15:38:24 -07003625 converter.convert(responseObj, self.clientAuthorizations, self.options, function(spec) {
3626 self.swaggerObject = spec;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003627 new Resolver().resolve(spec, self.url, self.buildFromSpec, self);
3628 self.isValid = true;
3629 });
3630 }
3631 }
3632 }
3633 };
3634
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003635 // only set timeout when specified
3636 if (this.fetchSpecTimeout) {
3637 obj.timeout = this.fetchSpecTimeout;
3638 }
3639
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003640 if (this.spec) {
Jian Li83d87a72016-04-20 15:38:24 -07003641 self.swaggerObject = this.spec;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003642 setTimeout(function () {
Jian Li8afbbee2016-07-27 19:16:51 +09003643 new Resolver().resolve(self.spec, self.url, self.buildFromSpec, self);
Jian Li83d87a72016-04-20 15:38:24 -07003644 }, 10);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003645 } else {
3646 this.clientAuthorizations.apply(obj);
3647
3648 if (mock) {
3649 return obj;
3650 }
3651
3652 new SwaggerHttp().execute(obj, this.options);
3653 }
3654
Jian Li83d87a72016-04-20 15:38:24 -07003655 return (this.usePromise) ? this.deferredClient.promise : this;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003656};
3657
3658SwaggerClient.prototype.buildFromSpec = function (response) {
3659 if (this.isBuilt) {
3660 return this;
3661 }
3662
3663 this.apis = {};
3664 this.apisArray = [];
3665 this.basePath = response.basePath || '';
3666 this.consumes = response.consumes;
3667 this.host = response.host || '';
3668 this.info = response.info || {};
3669 this.produces = response.produces;
3670 this.schemes = response.schemes || [];
Jian Li1c94b9d2017-02-08 15:47:21 +09003671 this.securityDefinitions = _.cloneDeep(response.securityDefinitions);
Jian Li8afbbee2016-07-27 19:16:51 +09003672 this.security = response.security;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003673 this.title = response.title || '';
3674
Jian Li1c94b9d2017-02-08 15:47:21 +09003675 var key, definedTags = {}, k, location, self = this, i;
3676
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003677 if (response.externalDocs) {
3678 this.externalDocs = response.externalDocs;
3679 }
3680
3681 // legacy support
Jian Li1c94b9d2017-02-08 15:47:21 +09003682 this.authSchemes = this.securityDefinitions;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003683
Jian Li1c94b9d2017-02-08 15:47:21 +09003684 if(this.securityDefinitions) {
3685 for(key in this.securityDefinitions) {
3686 var securityDefinition = this.securityDefinitions[key];
3687 securityDefinition.vendorExtensions = {};
3688 for(var ext in securityDefinition) {
3689 helpers.extractExtensions(ext, securityDefinition);
3690 if (ext === 'scopes') {
3691 var scopes = securityDefinition[ext];
3692 if(typeof scopes === 'object') {
3693 scopes.vendorExtensions = {};
3694 for (var s in scopes) {
3695 helpers.extractExtensions(s, scopes);
3696 if(s.indexOf('x-') === 0) {
3697 delete scopes[s];
3698 }
3699 }
3700 }
3701 }
3702 }
3703 }
3704 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003705
3706 if (Array.isArray(response.tags)) {
3707 definedTags = {};
3708
3709 for (k = 0; k < response.tags.length; k++) {
Jian Li1c94b9d2017-02-08 15:47:21 +09003710 var t = _.cloneDeep(response.tags[k]);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003711 definedTags[t.name] = t;
Jian Li1c94b9d2017-02-08 15:47:21 +09003712 for(i in t) {
3713 if(i === 'externalDocs' && typeof t[i] === 'object') {
3714 for(var j in t[i]) {
3715 helpers.extractExtensions(j, t[i]);
3716 }
3717 }
3718 helpers.extractExtensions(i, t);
3719 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003720 }
3721 }
3722
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003723
3724 if (typeof this.url === 'string') {
3725 location = this.parseUri(this.url);
Jian Li83d87a72016-04-20 15:38:24 -07003726 if (typeof this.scheme === 'undefined' && typeof this.schemes === 'undefined' || this.schemes.length === 0) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003727 if(typeof window !== 'undefined') {
3728 // use the window scheme
3729 this.scheme = window.location.protocol.replace(':','');
3730 }
3731 else {
3732 this.scheme = location.scheme || 'http';
3733 }
Jian Li1c94b9d2017-02-08 15:47:21 +09003734 } else if (typeof window !== 'undefined' && window.location.protocol.indexOf('chrome-extension') === 0) {
3735 // if it is chrome swagger ui extension scheme then let swagger doc url scheme decide the protocol
3736 this.scheme = location.scheme;
3737 } else if (typeof this.scheme === 'undefined') {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003738 if(typeof window !== 'undefined') {
3739 var scheme = window.location.protocol.replace(':','');
Jian Li1c94b9d2017-02-08 15:47:21 +09003740 if(scheme === 'https' && this.schemes.indexOf(scheme) === -1) {
3741 // can't call http from https served page in a browser!
3742 helpers.log('Cannot call a http server from https inside a browser!');
3743 this.scheme = 'http';
3744 }
3745 else if(this.schemes.indexOf(scheme) !== -1) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003746 this.scheme = scheme;
3747 }
3748 else {
Jian Li1c94b9d2017-02-08 15:47:21 +09003749 if(this.schemes.indexOf('https') !== -1) {
3750 this.scheme = 'https';
3751 }
3752 else {
3753 this.scheme = 'http';
3754 }
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003755 }
3756 }
3757 else {
3758 this.scheme = this.schemes[0] || location.scheme;
3759 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003760 }
3761
3762 if (typeof this.host === 'undefined' || this.host === '') {
3763 this.host = location.host;
3764
3765 if (location.port) {
3766 this.host = this.host + ':' + location.port;
3767 }
3768 }
3769 }
3770 else {
3771 if (typeof this.schemes === 'undefined' || this.schemes.length === 0) {
3772 this.scheme = 'http';
3773 }
Jian Li83d87a72016-04-20 15:38:24 -07003774 else if (typeof this.scheme === 'undefined') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003775 this.scheme = this.schemes[0];
3776 }
3777 }
3778
3779 this.definitions = response.definitions;
3780
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003781 for (key in this.definitions) {
3782 var model = new Model(key, this.definitions[key], this.models, this.modelPropertyMacro);
3783
3784 if (model) {
3785 this.models[key] = model;
3786 }
3787 }
3788
3789 // get paths, create functions for each operationId
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003790
3791 // Bind help to 'client.apis'
3792 self.apis.help = _.bind(self.help, self);
3793
3794 _.forEach(response.paths, function (pathObj, path) {
3795 // Only process a path if it's an object
3796 if (!_.isPlainObject(pathObj)) {
3797 return;
3798 }
3799
3800 _.forEach(supportedOperationMethods, function (method) {
3801 var operation = pathObj[method];
3802
3803 if (_.isUndefined(operation)) {
3804 // Operation does not exist
3805 return;
3806 } else if (!_.isPlainObject(operation)) {
3807 // Operation exists but it is not an Operation Object. Since this is invalid, log it.
3808 helpers.log('The \'' + method + '\' operation for \'' + path + '\' path is not an Operation Object');
3809
3810 return;
3811 }
3812
3813 var tags = operation.tags;
3814
3815 if (_.isUndefined(tags) || !_.isArray(tags) || tags.length === 0) {
3816 tags = operation.tags = [ 'default' ];
3817 }
3818
3819 var operationId = self.idFromOp(path, method, operation);
Jian Li83d87a72016-04-20 15:38:24 -07003820
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003821 var operationObject = new Operation(self,
3822 operation.scheme,
3823 operationId,
3824 method,
3825 path,
3826 operation,
3827 self.definitions,
3828 self.models,
3829 self.clientAuthorizations);
3830
Jian Li1c94b9d2017-02-08 15:47:21 +09003831 operationObject.connectionAgent = self.connectionAgent;
3832 operationObject.vendorExtensions = {};
3833 for(i in operation) {
3834 helpers.extractExtensions(i, operationObject, operation[i]);
3835 }
3836 operationObject.externalDocs = operation.externalDocs;
3837 if(operationObject.externalDocs) {
3838 operationObject.externalDocs = _.cloneDeep(operationObject.externalDocs);
3839 operationObject.externalDocs.vendorExtensions = {};
3840 for(i in operationObject.externalDocs) {
3841 helpers.extractExtensions(i, operationObject.externalDocs);
3842 }
3843 }
3844
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003845 // bind self operation's execute command to the api
3846 _.forEach(tags, function (tag) {
3847 var clientProperty = _.indexOf(reservedClientTags, tag) > -1 ? '_' + tag : tag;
3848 var apiProperty = _.indexOf(reservedApiTags, tag) > -1 ? '_' + tag : tag;
3849 var operationGroup = self[clientProperty];
3850
3851 if (clientProperty !== tag) {
3852 helpers.log('The \'' + tag + '\' tag conflicts with a SwaggerClient function/property name. Use \'client.' +
3853 clientProperty + '\' or \'client.apis.' + tag + '\' instead of \'client.' + tag + '\'.');
3854 }
3855
3856 if (apiProperty !== tag) {
3857 helpers.log('The \'' + tag + '\' tag conflicts with a SwaggerClient operation function/property name. Use ' +
3858 '\'client.apis.' + apiProperty + '\' instead of \'client.apis.' + tag + '\'.');
3859 }
3860
3861 if (_.indexOf(reservedApiTags, operationId) > -1) {
3862 helpers.log('The \'' + operationId + '\' operationId conflicts with a SwaggerClient operation ' +
3863 'function/property name. Use \'client.apis.' + apiProperty + '._' + operationId +
3864 '\' instead of \'client.apis.' + apiProperty + '.' + operationId + '\'.');
3865
3866 operationId = '_' + operationId;
3867 operationObject.nickname = operationId; // So 'client.apis.[tag].operationId.help() works properly
3868 }
3869
3870 if (_.isUndefined(operationGroup)) {
3871 operationGroup = self[clientProperty] = self.apis[apiProperty] = {};
3872
3873 operationGroup.operations = {};
3874 operationGroup.label = apiProperty;
3875 operationGroup.apis = {};
3876
3877 var tagDef = definedTags[tag];
3878
3879 if (!_.isUndefined(tagDef)) {
3880 operationGroup.description = tagDef.description;
3881 operationGroup.externalDocs = tagDef.externalDocs;
Jian Li1c94b9d2017-02-08 15:47:21 +09003882 operationGroup.vendorExtensions = tagDef.vendorExtensions;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003883 }
3884
3885 self[clientProperty].help = _.bind(self.help, operationGroup);
3886 self.apisArray.push(new OperationGroup(tag, operationGroup.description, operationGroup.externalDocs, operationObject));
3887 }
3888
Jian Li83d87a72016-04-20 15:38:24 -07003889 operationId = self.makeUniqueOperationId(operationId, self.apis[apiProperty]);
3890
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003891 // Bind tag help
3892 if (!_.isFunction(operationGroup.help)) {
3893 operationGroup.help = _.bind(self.help, operationGroup);
3894 }
3895
3896 // bind to the apis object
3897 self.apis[apiProperty][operationId] = operationGroup[operationId] = _.bind(operationObject.execute,
3898 operationObject);
3899 self.apis[apiProperty][operationId].help = operationGroup[operationId].help = _.bind(operationObject.help,
3900 operationObject);
3901 self.apis[apiProperty][operationId].asCurl = operationGroup[operationId].asCurl = _.bind(operationObject.asCurl,
3902 operationObject);
3903
3904 operationGroup.apis[operationId] = operationGroup.operations[operationId] = operationObject;
3905
3906 // legacy UI feature
3907 var api = _.find(self.apisArray, function (api) {
3908 return api.tag === tag;
3909 });
3910
3911 if (api) {
3912 api.operationsArray.push(operationObject);
3913 }
3914 });
3915 });
3916 });
3917
Jian Li8afbbee2016-07-27 19:16:51 +09003918 // sort the apisArray according to the tags
3919 var sortedApis = [];
3920 _.forEach(Object.keys(definedTags), function (tag) {
Jian Li8afbbee2016-07-27 19:16:51 +09003921 var pos;
3922 for(pos in self.apisArray) {
3923 var _api = self.apisArray[pos];
3924 if(_api && tag === _api.name) {
3925 sortedApis.push(_api);
3926 self.apisArray[pos] = null;
3927 }
3928 }
3929 });
3930 // add anything left
3931 _.forEach(self.apisArray, function (api) {
3932 if(api) {
3933 sortedApis.push(api);
3934 }
3935 });
3936 self.apisArray = sortedApis;
3937
3938 _.forEach(response.definitions, function (definitionObj, definition) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09003939 definitionObj.id = definition.toLowerCase();
3940 definitionObj.name = definition;
Jian Li8afbbee2016-07-27 19:16:51 +09003941 self.modelsArray.push(definitionObj);
3942 });
3943
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003944 this.isBuilt = true;
3945
Jian Li83d87a72016-04-20 15:38:24 -07003946 if (this.usePromise) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003947 this.isValid = true;
3948 this.isBuilt = true;
Jian Li83d87a72016-04-20 15:38:24 -07003949 this.deferredClient.resolve(this);
3950
3951 return this.deferredClient.promise;
3952 }
3953
3954 if (this.success) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003955 this.success();
3956 }
3957
3958 return this;
3959};
3960
Jian Li83d87a72016-04-20 15:38:24 -07003961SwaggerClient.prototype.makeUniqueOperationId = function(operationId, api) {
3962 var count = 0;
3963 var name = operationId;
3964
3965 // make unique across this operation group
3966 while(true) {
3967 var matched = false;
3968 _.forEach(api.operations, function (operation) {
3969 if(operation.nickname === name) {
3970 matched = true;
3971 }
3972 });
3973 if(!matched) {
3974 return name;
3975 }
3976 name = operationId + '_' + count;
3977 count ++;
3978 }
3979
3980 return operationId;
3981};
3982
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003983SwaggerClient.prototype.parseUri = function (uri) {
3984 var urlParseRE = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/;
3985 var parts = urlParseRE.exec(uri);
3986
3987 return {
Jian Li83d87a72016-04-20 15:38:24 -07003988 scheme: parts[4] ? parts[4].replace(':','') : undefined,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07003989 host: parts[11],
3990 port: parts[12],
3991 path: parts[15]
3992 };
3993};
3994
3995SwaggerClient.prototype.help = function (dontPrint) {
3996 var output = '';
3997
3998 if (this instanceof SwaggerClient) {
3999 _.forEach(this.apis, function (api, name) {
4000 if (_.isPlainObject(api)) {
4001 output += 'operations for the \'' + name + '\' tag\n';
4002
4003 _.forEach(api.operations, function (operation, name) {
4004 output += ' * ' + name + ': ' + operation.summary + '\n';
4005 });
4006 }
4007 });
4008 } else if (this instanceof OperationGroup || _.isPlainObject(this)) {
4009 output += 'operations for the \'' + this.label + '\' tag\n';
4010
4011 _.forEach(this.apis, function (operation, name) {
4012 output += ' * ' + name + ': ' + operation.summary + '\n';
4013 });
4014 }
4015
4016 if (dontPrint) {
4017 return output;
4018 } else {
4019 helpers.log(output);
4020
4021 return output;
4022 }
4023};
4024
4025SwaggerClient.prototype.tagFromLabel = function (label) {
4026 return label;
4027};
4028
4029SwaggerClient.prototype.idFromOp = function (path, httpMethod, op) {
4030 if(!op || !op.operationId) {
4031 op = op || {};
4032 op.operationId = httpMethod + '_' + path;
4033 }
4034 var opId = op.operationId.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g, '_') || (path.substring(1) + '_' + httpMethod);
4035
4036 opId = opId.replace(/((_){2,})/g, '_');
4037 opId = opId.replace(/^(_)*/g, '');
4038 opId = opId.replace(/([_])*$/g, '');
Jian Li83d87a72016-04-20 15:38:24 -07004039
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004040 return opId;
4041};
4042
Jian Li83d87a72016-04-20 15:38:24 -07004043SwaggerClient.prototype.setHost = function (host) {
4044 this.host = host;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004045
Jian Li83d87a72016-04-20 15:38:24 -07004046 if(this.apis) {
4047 _.forEach(this.apis, function(api) {
4048 if(api.operations) {
4049 _.forEach(api.operations, function(operation) {
4050 operation.host = host;
4051 });
4052 }
4053 });
4054 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004055};
4056
Jian Li83d87a72016-04-20 15:38:24 -07004057SwaggerClient.prototype.setBasePath = function (basePath) {
4058 this.basePath = basePath;
4059
4060 if(this.apis) {
4061 _.forEach(this.apis, function(api) {
4062 if(api.operations) {
4063 _.forEach(api.operations, function(operation) {
4064 operation.basePath = basePath;
4065 });
4066 }
4067 });
4068 }
4069};
4070
Jian Li8afbbee2016-07-27 19:16:51 +09004071SwaggerClient.prototype.setSchemes = function (schemes) {
4072 this.schemes = schemes;
4073
4074 if(schemes && schemes.length > 0) {
4075 if(this.apis) {
4076 _.forEach(this.apis, function (api) {
4077 if (api.operations) {
4078 _.forEach(api.operations, function (operation) {
4079 operation.scheme = schemes[0];
4080 });
4081 }
4082 });
4083 }
4084 }
4085};
4086
Jian Li83d87a72016-04-20 15:38:24 -07004087SwaggerClient.prototype.fail = function (message) {
4088 if (this.usePromise) {
4089 this.deferredClient.reject(message);
4090 return this.deferredClient.promise;
4091 } else {
4092 if (this.failure) {
4093 this.failure(message);
4094 }
4095 else {
4096 this.failure(message);
4097 }
4098 }
4099};
4100
Jian Li8afbbee2016-07-27 19:16:51 +09004101},{"./auth":2,"./helpers":4,"./http":5,"./resolver":6,"./spec-converter":8,"./types/model":9,"./types/operation":10,"./types/operationGroup":11,"lodash-compat/array/indexOf":49,"lodash-compat/collection/find":53,"lodash-compat/collection/forEach":54,"lodash-compat/function/bind":58,"lodash-compat/lang/cloneDeep":138,"lodash-compat/lang/isArray":140,"lodash-compat/lang/isFunction":142,"lodash-compat/lang/isObject":144,"lodash-compat/lang/isPlainObject":145,"lodash-compat/lang/isUndefined":148,"q":157}],4:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004102(function (process){
4103'use strict';
4104
4105var _ = {
Jian Li83d87a72016-04-20 15:38:24 -07004106 isPlainObject: require('lodash-compat/lang/isPlainObject'),
4107 indexOf: require('lodash-compat/array/indexOf')
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004108};
4109
4110module.exports.__bind = function (fn, me) {
4111 return function(){
4112 return fn.apply(me, arguments);
4113 };
4114};
4115
4116var log = module.exports.log = function() {
4117 // Only log if available and we're not testing
4118 if (console && process.env.NODE_ENV !== 'test') {
4119 console.log(Array.prototype.slice.call(arguments)[0]);
4120 }
4121};
4122
4123module.exports.fail = function (message) {
4124 log(message);
4125};
4126
Jian Li1c94b9d2017-02-08 15:47:21 +09004127module.exports.optionHtml = function (label, value) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004128 return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
4129};
4130
4131var resolveSchema = module.exports.resolveSchema = function (schema) {
4132 if (_.isPlainObject(schema.schema)) {
4133 schema = resolveSchema(schema.schema);
4134 }
4135
4136 return schema;
4137};
4138
Jian Li1c94b9d2017-02-08 15:47:21 +09004139module.exports.simpleRef = function (name) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004140 if (typeof name === 'undefined') {
4141 return null;
4142 }
4143
4144 if (name.indexOf('#/definitions/') === 0) {
4145 return name.substring('#/definitions/'.length);
4146 } else {
4147 return name;
4148 }
4149};
4150
Jian Li1c94b9d2017-02-08 15:47:21 +09004151/**
4152 * helper to remove extensions and add them to an object
4153 *
4154 * @param keyname
4155 * @param obj
4156 */
4157module.exports.extractExtensions = function (keyname, obj, value) {
4158 if(!keyname || !obj) {
4159 return;
4160 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004161
Jian Li1c94b9d2017-02-08 15:47:21 +09004162 if (typeof keyname === 'string' && keyname.indexOf('x-') === 0) {
4163 obj.vendorExtensions = obj.vendorExtensions || {};
4164 if(value) {
4165 obj.vendorExtensions[keyname] = value;
4166 }
4167 else {
4168 obj.vendorExtensions[keyname] = obj[keyname];
4169 }
4170 }
4171};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004172}).call(this,require('_process'))
Jian Li1c94b9d2017-02-08 15:47:21 +09004173
Jian Li8afbbee2016-07-27 19:16:51 +09004174},{"_process":12,"lodash-compat/array/indexOf":49,"lodash-compat/lang/isPlainObject":145}],5:[function(require,module,exports){
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004175(function (Buffer){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004176'use strict';
4177
4178var helpers = require('./helpers');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004179var request = require('superagent');
4180var jsyaml = require('js-yaml');
Jian Li83d87a72016-04-20 15:38:24 -07004181var _ = {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004182 isObject: require('lodash-compat/lang/isObject'),
4183 keys: require('lodash-compat/object/keys')
Jian Li83d87a72016-04-20 15:38:24 -07004184};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004185
4186/*
4187 * JQueryHttpClient is a light-weight, node or browser HTTP client
4188 */
Jian Li8afbbee2016-07-27 19:16:51 +09004189var JQueryHttpClient = function () {
4190 this.type = 'JQueryHttpClient';
4191};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004192
4193/*
4194 * SuperagentHttpClient is a light-weight, node or browser HTTP client
4195 */
Jian Li8afbbee2016-07-27 19:16:51 +09004196var SuperagentHttpClient = function () {
4197 this.type = 'SuperagentHttpClient';
4198};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004199
4200/**
4201 * SwaggerHttp is a wrapper for executing requests
4202 */
4203var SwaggerHttp = module.exports = function () {};
4204
4205SwaggerHttp.prototype.execute = function (obj, opts) {
4206 var client;
4207
4208 if(opts && opts.client) {
4209 client = opts.client;
4210 }
4211 else {
4212 client = new SuperagentHttpClient(opts);
4213 }
Jian Li83d87a72016-04-20 15:38:24 -07004214 client.opts = opts || {};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004215
Jian Li1c94b9d2017-02-08 15:47:21 +09004216 if (opts && opts.requestAgent) {
4217 request = opts.requestAgent;
4218 }
4219
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004220 // legacy support
Jian Li83d87a72016-04-20 15:38:24 -07004221 var hasJQuery = false;
4222 if(typeof window !== 'undefined') {
4223 if(typeof window.jQuery !== 'undefined') {
4224 hasJQuery = true;
4225 }
4226 }
Jian Li8afbbee2016-07-27 19:16:51 +09004227 // OPTIONS support
4228 if(obj.method.toLowerCase() === 'options' && client.type === 'SuperagentHttpClient') {
4229 log('forcing jQuery as OPTIONS are not supported by SuperAgent');
4230 obj.useJQuery = true;
4231 }
Jian Li83d87a72016-04-20 15:38:24 -07004232 if(this.isInternetExplorer() && (obj.useJQuery === false || !hasJQuery )) {
4233 throw new Error('Unsupported configuration! JQuery is required but not available');
4234 }
4235 if ((obj && obj.useJQuery === true) || this.isInternetExplorer() && hasJQuery) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004236 client = new JQueryHttpClient(opts);
4237 }
4238
4239 var success = obj.on.response;
Jian Li8afbbee2016-07-27 19:16:51 +09004240 var error = obj.on.error;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004241
Jian Li83d87a72016-04-20 15:38:24 -07004242 var requestInterceptor = function(data) {
4243 if(opts && opts.requestInterceptor) {
4244 data = opts.requestInterceptor.apply(data);
4245 }
4246 return data;
4247 };
4248
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004249 var responseInterceptor = function(data) {
4250 if(opts && opts.responseInterceptor) {
Jian Li1c94b9d2017-02-08 15:47:21 +09004251 data = opts.responseInterceptor.apply(data, [obj]);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004252 }
Jian Li83d87a72016-04-20 15:38:24 -07004253 return success(data);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004254 };
4255
Jian Li8afbbee2016-07-27 19:16:51 +09004256 var errorInterceptor = function(data) {
4257 if(opts && opts.responseInterceptor) {
Jian Li1c94b9d2017-02-08 15:47:21 +09004258 data = opts.responseInterceptor.apply(data, [obj]);
Jian Li8afbbee2016-07-27 19:16:51 +09004259 }
4260 error(data);
4261 };
4262
4263 obj.on.error = function(data) {
4264 errorInterceptor(data);
4265 };
4266
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004267 obj.on.response = function(data) {
Jian Li1c94b9d2017-02-08 15:47:21 +09004268 if(data && data.status >= 400) {
4269 errorInterceptor(data);
4270 }
4271 else {
4272 responseInterceptor(data);
4273 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004274 };
4275
Jian Li83d87a72016-04-20 15:38:24 -07004276 if (_.isObject(obj) && _.isObject(obj.body)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004277 // special processing for file uploads via jquery
4278 if (obj.body.type && obj.body.type === 'formData'){
Jian Li8afbbee2016-07-27 19:16:51 +09004279 if(opts.useJQuery) {
4280 obj.contentType = false;
4281 obj.processData = false;
4282 delete obj.headers['Content-Type'];
4283 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004284 }
4285 }
Jian Li83d87a72016-04-20 15:38:24 -07004286
Jian Li8afbbee2016-07-27 19:16:51 +09004287 obj = requestInterceptor(obj) || obj;
4288 if (obj.beforeSend) {
4289 obj.beforeSend(function(_obj) {
4290 client.execute(_obj || obj);
4291 });
4292 } else {
4293 client.execute(obj);
4294 }
Jian Li83d87a72016-04-20 15:38:24 -07004295
4296 return (obj.deferred) ? obj.deferred.promise : obj;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004297};
4298
4299SwaggerHttp.prototype.isInternetExplorer = function () {
4300 var detectedIE = false;
4301
4302 if (typeof navigator !== 'undefined' && navigator.userAgent) {
4303 var nav = navigator.userAgent.toLowerCase();
4304
4305 if (nav.indexOf('msie') !== -1) {
4306 var version = parseInt(nav.split('msie')[1]);
4307
4308 if (version <= 8) {
4309 detectedIE = true;
4310 }
4311 }
4312 }
4313
4314 return detectedIE;
4315};
4316
4317JQueryHttpClient.prototype.execute = function (obj) {
Jian Li8afbbee2016-07-27 19:16:51 +09004318 var jq = this.jQuery || (typeof window !== 'undefined' && window.jQuery);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004319 var cb = obj.on;
4320 var request = obj;
4321
Jian Li8afbbee2016-07-27 19:16:51 +09004322 if(typeof jq === 'undefined' || jq === false) {
4323 throw new Error('Unsupported configuration! JQuery is required but not available');
4324 }
4325
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004326 obj.type = obj.method;
Jian Li8afbbee2016-07-27 19:16:51 +09004327 obj.cache = obj.jqueryAjaxCache;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004328 obj.data = obj.body;
Jian Li8afbbee2016-07-27 19:16:51 +09004329 delete obj.jqueryAjaxCache;
4330 delete obj.useJQuery;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004331 delete obj.body;
4332
4333 obj.complete = function (response) {
4334 var headers = {};
4335 var headerArray = response.getAllResponseHeaders().split('\n');
4336
4337 for (var i = 0; i < headerArray.length; i++) {
4338 var toSplit = headerArray[i].trim();
4339
4340 if (toSplit.length === 0) {
4341 continue;
4342 }
4343
4344 var separator = toSplit.indexOf(':');
4345
4346 if (separator === -1) {
4347 // Name but no value in the header
4348 headers[toSplit] = null;
4349
4350 continue;
4351 }
4352
4353 var name = toSplit.substring(0, separator).trim();
4354 var value = toSplit.substring(separator + 1).trim();
4355
4356 headers[name] = value;
4357 }
4358
4359 var out = {
4360 url: request.url,
4361 method: request.method,
4362 status: response.status,
4363 statusText: response.statusText,
4364 data: response.responseText,
4365 headers: headers
4366 };
4367
4368 try {
4369 var possibleObj = response.responseJSON || jsyaml.safeLoad(response.responseText);
4370 out.obj = (typeof possibleObj === 'string') ? {} : possibleObj;
4371 } catch (ex) {
4372 // do not set out.obj
4373 helpers.log('unable to parse JSON/YAML content');
4374 }
4375
4376 // I can throw, or parse null?
4377 out.obj = out.obj || null;
4378
4379 if (response.status >= 200 && response.status < 300) {
4380 cb.response(out);
4381 } else if (response.status === 0 || (response.status >= 400 && response.status < 599)) {
4382 cb.error(out);
4383 } else {
4384 return cb.response(out);
4385 }
4386 };
4387
Jian Li83d87a72016-04-20 15:38:24 -07004388 jq.support.cors = true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004389
Jian Li83d87a72016-04-20 15:38:24 -07004390 return jq.ajax(obj);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004391};
4392
4393SuperagentHttpClient.prototype.execute = function (obj) {
4394 var method = obj.method.toLowerCase();
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004395 var timeout = obj.timeout;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004396
4397 if (method === 'delete') {
4398 method = 'del';
4399 }
4400 var headers = obj.headers || {};
Jian Li1c94b9d2017-02-08 15:47:21 +09004401
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004402 var r = request[method](obj.url);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004403
Jian Li1c94b9d2017-02-08 15:47:21 +09004404 if (obj.connectionAgent) {
4405 r.agent(obj.connectionAgent);
4406 }
4407
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004408 if (timeout) {
4409 r.timeout(timeout);
4410 }
4411
Jian Li83d87a72016-04-20 15:38:24 -07004412 if (obj.enableCookies) {
4413 r.withCredentials();
4414 }
4415
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004416 var accept = obj.headers.Accept;
4417
4418 if(this.binaryRequest(accept)) {
4419 r.on('request', function () {
4420 if(this.xhr) {
4421 this.xhr.responseType = 'blob';
4422 }
4423 });
4424 }
4425
Jian Li8afbbee2016-07-27 19:16:51 +09004426 if(obj.body) {
4427 if(_.isObject(obj.body)) {
4428 var contentType = obj.headers['Content-Type'] || '';
4429 if (contentType.indexOf('multipart/form-data') === 0) {
4430 delete headers['Content-Type'];
4431 if({}.toString.apply(obj.body) === '[object FormData]') {
Jian Li1c94b9d2017-02-08 15:47:21 +09004432 r.send(obj.body);
Jian Li8afbbee2016-07-27 19:16:51 +09004433 }
4434 else {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004435 var keyname, value, v;
4436 for (keyname in obj.body) {
4437 value = obj.body[keyname];
4438 if(Array.isArray(value)) {
4439 for(v in value) {
4440 r.field(keyname, v);
4441 }
4442 }
4443 else {
4444 r.field(keyname, value);
4445 }
Jian Li8afbbee2016-07-27 19:16:51 +09004446 }
4447 }
4448 }
4449 else if (_.isObject(obj.body)) {
Jian Li1c94b9d2017-02-08 15:47:21 +09004450 // non multipart/form-data
Jian Li8afbbee2016-07-27 19:16:51 +09004451 obj.body = JSON.stringify(obj.body);
4452 r.send(obj.body);
4453 }
4454 }
4455 else {
4456 r.send(obj.body);
4457 }
4458 }
4459
4460 var name;
4461 for (name in headers) {
4462 r.set(name, headers[name]);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004463 }
4464
4465 if(typeof r.buffer === 'function') {
4466 r.buffer(); // force superagent to populate res.text with the raw response data
4467 }
4468
4469 r.end(function (err, res) {
4470 res = res || {
4471 status: 0,
4472 headers: {error: 'no response from server'}
4473 };
4474 var response = {
4475 url: obj.url,
4476 method: obj.method,
4477 headers: res.headers
4478 };
4479 var cb;
4480
4481 if (!err && res.error) {
4482 err = res.error;
4483 }
4484
4485 if (err && obj.on && obj.on.error) {
Jian Li83d87a72016-04-20 15:38:24 -07004486 response.errObj = err;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004487 response.status = res ? res.status : 500;
4488 response.statusText = res ? res.text : err.message;
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004489 if (res.headers && res.headers['content-type']) {
4490 if (res.headers['content-type'].indexOf('application/json') >= 0) {
Jian Li83d87a72016-04-20 15:38:24 -07004491 try {
4492 response.obj = JSON.parse(response.statusText);
4493 }
4494 catch (e) {
4495 response.obj = null;
4496 }
4497 }
4498 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004499 cb = obj.on.error;
4500 } else if (res && obj.on && obj.on.response) {
4501 var possibleObj;
4502
4503 // Already parsed by by superagent?
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004504 if (res.body && _.keys(res.body).length > 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004505 possibleObj = res.body;
4506 } else {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004507 try {
4508 possibleObj = jsyaml.safeLoad(res.text);
4509 // can parse into a string... which we don't need running around in the system
4510 possibleObj = (typeof possibleObj === 'string') ? null : possibleObj;
4511 } catch (e) {
4512 helpers.log('cannot parse JSON/YAML content');
4513 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004514 }
4515
4516 // null means we can't parse into object
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004517 if(typeof Buffer === 'function' && Buffer.isBuffer(possibleObj)) {
4518 response.data = possibleObj;
4519 }
4520 else {
4521 response.obj = (typeof possibleObj === 'object') ? possibleObj : null;
4522 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004523
4524 response.status = res.status;
4525 response.statusText = res.text;
4526 cb = obj.on.response;
4527 }
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004528 if (res.xhr && res.xhr.response) {
4529 response.data = res.xhr.response;
4530 }
4531 else if(!response.data) {
4532 response.data = response.statusText;
4533 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004534
4535 if (cb) {
4536 cb(response);
4537 }
4538 });
4539};
4540
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004541SuperagentHttpClient.prototype. binaryRequest = function (accept) {
4542 if(!accept) {
4543 return false;
4544 }
Jian Li1c94b9d2017-02-08 15:47:21 +09004545 return (/^image/i).test(accept)
4546 || (/^application\/pdf/).test(accept)
4547 || (/^application\/octet-stream/).test(accept);
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004548};
4549
4550}).call(this,require("buffer").Buffer)
Jian Li1c94b9d2017-02-08 15:47:21 +09004551
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004552},{"./helpers":4,"buffer":14,"js-yaml":19,"lodash-compat/lang/isObject":144,"lodash-compat/object/keys":149,"superagent":158}],6:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004553'use strict';
4554
4555var SwaggerHttp = require('./http');
Jian Li83d87a72016-04-20 15:38:24 -07004556var _ = {
4557 isObject: require('lodash-compat/lang/isObject'),
4558 cloneDeep: require('lodash-compat/lang/cloneDeep'),
Jian Li8afbbee2016-07-27 19:16:51 +09004559 isArray: require('lodash-compat/lang/isArray'),
4560 isString: require('lodash-compat/lang/isString')
Jian Li83d87a72016-04-20 15:38:24 -07004561};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004562
Jian Li83d87a72016-04-20 15:38:24 -07004563
4564/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004565 * Resolves a spec's remote references
4566 */
Jian Li8afbbee2016-07-27 19:16:51 +09004567var Resolver = module.exports = function () {
4568 this.failedUrls = [];
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004569 this.resolverCache = {};
4570 this.pendingUrls = {};
Jian Li8afbbee2016-07-27 19:16:51 +09004571};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004572
Jian Li83d87a72016-04-20 15:38:24 -07004573Resolver.prototype.processAllOf = function(root, name, definition, resolutionTable, unresolvedRefs, spec) {
4574 var i, location, property;
4575
4576 definition['x-resolved-from'] = [ '#/definitions/' + name ];
4577 var allOf = definition.allOf;
4578 // the refs go first
4579 allOf.sort(function(a, b) {
4580 if(a.$ref && b.$ref) { return 0; }
4581 else if(a.$ref) { return -1; }
4582 else { return 1; }
4583 });
4584 for (i = 0; i < allOf.length; i++) {
4585 property = allOf[i];
4586 location = '/definitions/' + name + '/allOf';
4587 this.resolveInline(root, spec, property, resolutionTable, unresolvedRefs, location);
4588 }
4589};
4590
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004591Resolver.prototype.resolve = function (spec, arg1, arg2, arg3) {
Jian Li83d87a72016-04-20 15:38:24 -07004592 this.spec = spec;
4593 var root = arg1, callback = arg2, scope = arg3, opts = {}, location, i;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004594 if(typeof arg1 === 'function') {
4595 root = null;
4596 callback = arg1;
4597 scope = arg2;
4598 }
Jian Li1c94b9d2017-02-08 15:47:21 +09004599 var _root = root, modelName;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004600 this.scope = (scope || this);
4601 this.iteration = this.iteration || 0;
4602
Jian Li83d87a72016-04-20 15:38:24 -07004603 if(this.scope.options && this.scope.options.requestInterceptor){
4604 opts.requestInterceptor = this.scope.options.requestInterceptor;
4605 }
4606
4607 if(this.scope.options && this.scope.options.responseInterceptor){
4608 opts.responseInterceptor = this.scope.options.responseInterceptor;
4609 }
4610
Jian Li1c94b9d2017-02-08 15:47:21 +09004611 var name, path, property, propertyName, parameter, done, counter;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004612 var processedCalls = 0, resolvedRefs = {}, unresolvedRefs = {};
4613 var resolutionTable = []; // store objects for dereferencing
4614
Jian Li83d87a72016-04-20 15:38:24 -07004615 spec.definitions = spec.definitions || {};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004616 // definitions
4617 for (name in spec.definitions) {
4618 var definition = spec.definitions[name];
Jian Li1c94b9d2017-02-08 15:47:21 +09004619 if(definition.$ref) {
Jian Li8afbbee2016-07-27 19:16:51 +09004620 this.resolveInline(root, spec, definition, resolutionTable, unresolvedRefs, definition);
4621 }
4622 else {
4623 for (propertyName in definition.properties) {
4624 property = definition.properties[propertyName];
4625 if (_.isArray(property.allOf)) {
4626 this.processAllOf(root, name, property, resolutionTable, unresolvedRefs, spec);
4627 }
4628 else {
4629 this.resolveTo(root, property, resolutionTable, '/definitions');
4630 }
4631 }
4632
4633 if (definition.allOf) {
4634 this.processAllOf(root, name, definition, resolutionTable, unresolvedRefs, spec);
4635 }
4636 }
4637 }
4638
4639 // shared parameters
4640 spec.parameters = spec.parameters || {};
4641 for(name in spec.parameters) {
Jian Li1c94b9d2017-02-08 15:47:21 +09004642 parameter = spec.parameters[name];
Jian Li8afbbee2016-07-27 19:16:51 +09004643 if (parameter.in === 'body' && parameter.schema) {
4644 if(_.isArray(parameter.schema.allOf)) {
4645 // move to a definition
Jian Li1c94b9d2017-02-08 15:47:21 +09004646 modelName = 'inline_model';
4647 var _name = modelName;
4648 done = false; counter = 0;
Jian Li8afbbee2016-07-27 19:16:51 +09004649 while(!done) {
Jian Li1c94b9d2017-02-08 15:47:21 +09004650 if(typeof spec.definitions[_name] === 'undefined') {
Jian Li8afbbee2016-07-27 19:16:51 +09004651 done = true;
4652 break;
4653 }
Jian Li1c94b9d2017-02-08 15:47:21 +09004654 _name = modelName + '_' + counter;
Jian Li8afbbee2016-07-27 19:16:51 +09004655 counter ++;
4656 }
Jian Li1c94b9d2017-02-08 15:47:21 +09004657 spec.definitions[_name] = { allOf: parameter.schema.allOf };
Jian Li8afbbee2016-07-27 19:16:51 +09004658 delete parameter.schema.allOf;
Jian Li1c94b9d2017-02-08 15:47:21 +09004659 parameter.schema.$ref = '#/definitions/' + _name;
4660 this.processAllOf(root, _name, spec.definitions[_name], resolutionTable, unresolvedRefs, spec);
Jian Li83d87a72016-04-20 15:38:24 -07004661 }
4662 else {
Jian Li8afbbee2016-07-27 19:16:51 +09004663 this.resolveTo(root, parameter.schema, resolutionTable, location);
Jian Li83d87a72016-04-20 15:38:24 -07004664 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004665 }
4666
Jian Li8afbbee2016-07-27 19:16:51 +09004667 if (parameter.$ref) {
4668 // parameter reference
4669 this.resolveInline(root, spec, parameter, resolutionTable, unresolvedRefs, parameter.$ref);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004670 }
4671 }
4672
4673 // operations
4674 for (name in spec.paths) {
4675 var method, operation, responseCode;
4676 path = spec.paths[name];
4677
Jian Li1c94b9d2017-02-08 15:47:21 +09004678 if(typeof path === 'object') {
4679 for (method in path) {
4680 // operation reference
4681 if (method === '$ref') {
4682 // location = path[method];
4683 location = '/paths' + name;
4684 this.resolveInline(root, spec, path, resolutionTable, unresolvedRefs, location);
Jian Li83d87a72016-04-20 15:38:24 -07004685 }
Jian Li1c94b9d2017-02-08 15:47:21 +09004686 else {
4687 operation = path[method];
4688 var sharedParameters = path.parameters || [];
4689 var parameters = operation.parameters || [];
Jian Li83d87a72016-04-20 15:38:24 -07004690
Jian Li1c94b9d2017-02-08 15:47:21 +09004691 sharedParameters.forEach(function(parameter) {
4692 parameters.unshift(parameter);
4693 });
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004694
Jian Li1c94b9d2017-02-08 15:47:21 +09004695 if (method !== 'parameters' && _.isObject(operation)) {
4696 operation.parameters = operation.parameters || parameters;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004697 }
4698
Jian Li1c94b9d2017-02-08 15:47:21 +09004699 for (i in parameters) {
4700 parameter = parameters[i];
4701 location = '/paths' + name + '/' + method + '/parameters';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004702
Jian Li1c94b9d2017-02-08 15:47:21 +09004703 if (parameter.in === 'body' && parameter.schema) {
4704 if (_.isArray(parameter.schema.allOf)) {
Jian Li8afbbee2016-07-27 19:16:51 +09004705 // move to a definition
Jian Li1c94b9d2017-02-08 15:47:21 +09004706 modelName = 'inline_model';
4707 name = modelName;
4708 done = false;
4709 counter = 0;
4710 while (!done) {
4711 if (typeof spec.definitions[name] === 'undefined') {
Jian Li8afbbee2016-07-27 19:16:51 +09004712 done = true;
4713 break;
4714 }
4715 name = modelName + '_' + counter;
Jian Li1c94b9d2017-02-08 15:47:21 +09004716 counter++;
Jian Li8afbbee2016-07-27 19:16:51 +09004717 }
Jian Li1c94b9d2017-02-08 15:47:21 +09004718 spec.definitions[name] = {allOf: parameter.schema.allOf};
4719 delete parameter.schema.allOf;
4720 parameter.schema.$ref = '#/definitions/' + name;
Jian Li8afbbee2016-07-27 19:16:51 +09004721 this.processAllOf(root, name, spec.definitions[name], resolutionTable, unresolvedRefs, spec);
4722 }
Jian Li8afbbee2016-07-27 19:16:51 +09004723 else {
Jian Li1c94b9d2017-02-08 15:47:21 +09004724 this.resolveTo(root, parameter.schema, resolutionTable, location);
4725 }
4726 }
4727
4728 if (parameter.$ref) {
4729 // parameter reference
4730 this.resolveInline(root, spec, parameter, resolutionTable, unresolvedRefs, parameter.$ref);
4731 }
4732 }
4733
4734 for (responseCode in operation.responses) {
4735 var response = operation.responses[responseCode];
4736 location = '/paths' + name + '/' + method + '/responses/' + responseCode;
4737
4738 if (_.isObject(response)) {
4739 if (response.$ref) {
4740 // response reference
4741 this.resolveInline(root, spec, response, resolutionTable, unresolvedRefs, location);
4742 }
4743 if (response.schema) {
4744 var responseObj = response;
4745 if (_.isArray(responseObj.schema.allOf)) {
4746 // move to a definition
4747 modelName = 'inline_model';
4748 name = modelName;
4749 done = false;
4750 counter = 0;
4751 while (!done) {
4752 if (typeof spec.definitions[name] === 'undefined') {
4753 done = true;
4754 break;
4755 }
4756 name = modelName + '_' + counter;
4757 counter++;
4758 }
4759 spec.definitions[name] = {allOf: responseObj.schema.allOf};
4760 delete responseObj.schema.allOf;
4761 delete responseObj.schema.type;
4762 responseObj.schema.$ref = '#/definitions/' + name;
4763 this.processAllOf(root, name, spec.definitions[name], resolutionTable, unresolvedRefs, spec);
4764 }
4765 else if ('array' === responseObj.schema.type) {
4766 if (responseObj.schema.items && responseObj.schema.items.$ref) {
4767 // response reference
4768 this.resolveInline(root, spec, responseObj.schema.items, resolutionTable, unresolvedRefs, location);
4769 }
4770 }
4771 else {
4772 this.resolveTo(root, response.schema, resolutionTable, location);
4773 }
Jian Li8afbbee2016-07-27 19:16:51 +09004774 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004775 }
4776 }
4777 }
4778 }
Jian Li1c94b9d2017-02-08 15:47:21 +09004779 // clear them out to avoid multiple resolutions
4780 path.parameters = [];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004781 }
4782 }
4783
4784 var expectedCalls = 0, toResolve = [];
4785 // if the root is same as obj[i].root we can resolve locally
4786 var all = resolutionTable;
4787
Jian Li83d87a72016-04-20 15:38:24 -07004788 var parts;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004789 for(i = 0; i < all.length; i++) {
4790 var a = all[i];
4791 if(root === a.root) {
4792 if(a.resolveAs === 'ref') {
4793 // resolve any path walking
4794 var joined = ((a.root || '') + '/' + a.key).split('/');
4795 var normalized = [];
4796 var url = '';
4797 var k;
4798
4799 if(a.key.indexOf('../') >= 0) {
4800 for(var j = 0; j < joined.length; j++) {
4801 if(joined[j] === '..') {
4802 normalized = normalized.slice(0, normalized.length-1);
4803 }
4804 else {
4805 normalized.push(joined[j]);
4806 }
4807 }
4808 for(k = 0; k < normalized.length; k ++) {
4809 if(k > 0) {
4810 url += '/';
4811 }
4812 url += normalized[k];
4813 }
4814 // we now have to remote resolve this because the path has changed
4815 a.root = url;
4816 toResolve.push(a);
4817 }
4818 else {
Jian Li83d87a72016-04-20 15:38:24 -07004819 parts = a.key.split('#');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004820 if(parts.length === 2) {
Jian Li8afbbee2016-07-27 19:16:51 +09004821 if(parts[0].indexOf('http:') === 0 || parts[0].indexOf('https:') === 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004822 a.root = parts[0];
4823 }
4824 location = parts[1].split('/');
4825 var r;
4826 var s = spec;
4827 for(k = 0; k < location.length; k++) {
4828 var part = location[k];
4829 if(part !== '') {
4830 s = s[part];
4831 if(typeof s !== 'undefined') {
4832 r = s;
4833 }
4834 else {
4835 r = null;
4836 break;
4837 }
4838 }
4839 }
4840 if(r === null) {
4841 // must resolve this too
4842 toResolve.push(a);
4843 }
4844 }
4845 }
4846 }
4847 else {
4848 if (a.resolveAs === 'inline') {
Jian Li83d87a72016-04-20 15:38:24 -07004849 if(a.key && a.key.indexOf('#') === -1 && a.key.charAt(0) !== '/') {
4850 // handle relative schema
4851 parts = a.root.split('/');
4852 location = '';
4853 for(i = 0; i < parts.length - 1; i++) {
4854 location += parts[i] + '/';
4855 }
4856 location += a.key;
4857 a.root = location;
4858 a.location = '';
4859 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004860 toResolve.push(a);
4861 }
4862 }
4863 }
4864 else {
4865 toResolve.push(a);
4866 }
4867 }
4868 expectedCalls = toResolve.length;
4869
4870 // resolve anything that is local
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004871
4872 var lock = {};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004873 for(var ii = 0; ii < toResolve.length; ii++) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004874 (function(item, spec, self, lock, ii) {
Jian Li8afbbee2016-07-27 19:16:51 +09004875 if(!item.root || item.root === root) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004876 // local resolve
4877 self.resolveItem(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, item);
4878 processedCalls += 1;
4879
4880 if(processedCalls === expectedCalls) {
Jian Li83d87a72016-04-20 15:38:24 -07004881 self.finish(spec, root, resolutionTable, resolvedRefs, unresolvedRefs, callback, true);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004882 }
4883 }
Jian Li8afbbee2016-07-27 19:16:51 +09004884 else if(self.failedUrls.indexOf(item.root) === -1) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004885 var obj = {
4886 useJQuery: false, // TODO
4887 url: item.root,
4888 method: 'get',
4889 headers: {
4890 accept: self.scope.swaggerRequestHeaders || 'application/json'
4891 },
4892 on: {
Jian Li83d87a72016-04-20 15:38:24 -07004893 error: function (error) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004894 processedCalls += 1;
Jian Li8afbbee2016-07-27 19:16:51 +09004895 console.log('failed url: ' + obj.url);
4896 self.failedUrls.push(obj.url);
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004897 if (lock) {
4898 delete lock[item.root];
4899 }
Jian Li83d87a72016-04-20 15:38:24 -07004900 unresolvedRefs[item.key] = {
4901 root: item.root,
4902 location: item.location
4903 };
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004904
4905 if (processedCalls === expectedCalls) {
4906 self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
4907 }
4908 }, // jshint ignore:line
4909 response: function (response) {
4910 var swagger = response.obj;
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004911 if (lock) {
4912 delete lock[item.root];
4913 }
4914 if (self.resolverCache) {
4915 self.resolverCache[item.root] = swagger;
4916 }
Jian Li83d87a72016-04-20 15:38:24 -07004917 self.resolveItem(swagger, item.root, resolutionTable, resolvedRefs, unresolvedRefs, item);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004918 processedCalls += 1;
4919
4920 if (processedCalls === expectedCalls) {
4921 self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
4922 }
4923 }
4924 } // jshint ignore:line
4925 };
4926
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004927 // apply timeout only when specified
4928 if (scope && scope.fetchSpecTimeout) {
4929 obj.timeout = scope.fetchSpecTimeout;
4930 }
4931
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004932 if (scope && scope.clientAuthorizations) {
4933 scope.clientAuthorizations.apply(obj);
4934 }
Jian Li83d87a72016-04-20 15:38:24 -07004935
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004936 (function waitForUnlock() {
4937 setTimeout(function() {
4938 if (lock[obj.url]) {
4939 waitForUnlock();
4940 }
4941 else {
4942 var cached = self.resolverCache[obj.url];
4943 if (_.isObject(cached)) {
Jian Li1c94b9d2017-02-08 15:47:21 +09004944 obj.on.response({obj: cached});
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004945 }
4946 else {
4947 lock[obj.url] = true;
4948 new SwaggerHttp().execute(obj, opts);
4949 }
4950 }
4951 }, 0);
4952 })();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004953 }
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004954
Jian Li8afbbee2016-07-27 19:16:51 +09004955 else {
4956 processedCalls += 1;
4957 unresolvedRefs[item.key] = {
4958 root: item.root,
4959 location: item.location
4960 };
4961 if (processedCalls === expectedCalls) {
4962 self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
4963 }
4964 }
Jian Li7f6d0e9e2016-09-27 02:04:49 +09004965 }(toResolve[ii], spec, this, lock, ii));
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004966 }
4967
4968 if (Object.keys(toResolve).length === 0) {
4969 this.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
4970 }
4971};
4972
4973Resolver.prototype.resolveItem = function(spec, root, resolutionTable, resolvedRefs, unresolvedRefs, item) {
4974 var path = item.location;
4975 var location = spec, parts = path.split('/');
Jian Li83d87a72016-04-20 15:38:24 -07004976 if(path !== '') {
4977 for (var j = 0; j < parts.length; j++) {
4978 var segment = parts[j];
4979 if (segment.indexOf('~1') !== -1) {
4980 segment = parts[j].replace(/~0/g, '~').replace(/~1/g, '/');
4981 if (segment.charAt(0) !== '/') {
4982 segment = '/' + segment;
4983 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004984 }
Jian Li83d87a72016-04-20 15:38:24 -07004985 if (typeof location === 'undefined' || location === null) {
4986 break;
4987 }
4988 if (segment === '' && j === (parts.length - 1) && parts.length > 1) {
4989 location = null;
4990 break;
4991 }
4992 if (segment.length > 0) {
4993 location = location[segment];
4994 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07004995 }
4996 }
4997 var resolved = item.key;
4998 parts = item.key.split('/');
4999 var resolvedName = parts[parts.length-1];
5000
5001 if(resolvedName.indexOf('#') >= 0) {
5002 resolvedName = resolvedName.split('#')[1];
5003 }
5004
5005 if (location !== null && typeof location !== 'undefined') {
5006 resolvedRefs[resolved] = {
5007 name: resolvedName,
5008 obj: location,
5009 key: item.key,
5010 root: item.root
5011 };
5012 } else {
5013 unresolvedRefs[resolved] = {
5014 root: item.root,
5015 location: item.location
5016 };
5017 }
5018};
5019
Jian Li83d87a72016-04-20 15:38:24 -07005020Resolver.prototype.finish = function (spec, root, resolutionTable, resolvedRefs, unresolvedRefs, callback, localResolve) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005021 // walk resolution table and replace with resolved refs
Jian Li1c94b9d2017-02-08 15:47:21 +09005022 var ref, abs;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005023 for (ref in resolutionTable) {
5024 var item = resolutionTable[ref];
5025
5026 var key = item.key;
5027 var resolvedTo = resolvedRefs[key];
5028 if (resolvedTo) {
5029 spec.definitions = spec.definitions || {};
5030 if (item.resolveAs === 'ref') {
Jian Li83d87a72016-04-20 15:38:24 -07005031 if (localResolve !== true) {
5032 // don't retain root for local definitions
5033 for (key in resolvedTo.obj) {
Jian Li1c94b9d2017-02-08 15:47:21 +09005034 abs = this.retainRoot(key, resolvedTo.obj[key], item.root);
Jian Li8afbbee2016-07-27 19:16:51 +09005035 resolvedTo.obj[key] = abs;
Jian Li83d87a72016-04-20 15:38:24 -07005036 }
5037 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005038 spec.definitions[resolvedTo.name] = resolvedTo.obj;
5039 item.obj.$ref = '#/definitions/' + resolvedTo.name;
5040 } else if (item.resolveAs === 'inline') {
5041 var targetObj = item.obj;
5042 targetObj['x-resolved-from'] = [ item.key ];
5043 delete targetObj.$ref;
5044
5045 for (key in resolvedTo.obj) {
Jian Li1c94b9d2017-02-08 15:47:21 +09005046 abs = resolvedTo.obj[key];
Jian Li7f6d0e9e2016-09-27 02:04:49 +09005047
Jian Li83d87a72016-04-20 15:38:24 -07005048 if (localResolve !== true) {
5049 // don't retain root for local definitions
Jian Li8afbbee2016-07-27 19:16:51 +09005050 abs = this.retainRoot(key, resolvedTo.obj[key], item.root);
Jian Li83d87a72016-04-20 15:38:24 -07005051 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005052 targetObj[key] = abs;
5053 }
5054 }
5055 }
5056 }
5057 var existingUnresolved = this.countUnresolvedRefs(spec);
5058
Jian Li83d87a72016-04-20 15:38:24 -07005059 if(existingUnresolved === 0 || this.iteration > 5) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005060 this.resolveAllOf(spec.definitions);
Jian Li7f6d0e9e2016-09-27 02:04:49 +09005061 this.resolverCache = null;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005062 callback.call(this.scope, spec, unresolvedRefs);
5063 }
5064 else {
5065 this.iteration += 1;
5066 this.resolve(spec, root, callback, this.scope);
5067 }
5068};
5069
5070Resolver.prototype.countUnresolvedRefs = function(spec) {
5071 var i;
5072 var refs = this.getRefs(spec);
5073 var keys = [];
5074 var unresolvedKeys = [];
5075 for(i in refs) {
5076 if(i.indexOf('#') === 0) {
5077 keys.push(i.substring(1));
5078 }
5079 else {
5080 unresolvedKeys.push(i);
5081 }
5082 }
5083
5084 // verify possible keys
Jian Li83d87a72016-04-20 15:38:24 -07005085 for (i = 0; i < keys.length; i++) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005086 var part = keys[i];
5087 var parts = part.split('/');
5088 var obj = spec;
5089
Jian Li83d87a72016-04-20 15:38:24 -07005090 for (var k = 0; k < parts.length; k++) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005091 var key = parts[k];
5092 if(key !== '') {
5093 obj = obj[key];
5094 if(typeof obj === 'undefined') {
5095 unresolvedKeys.push(part);
5096 break;
5097 }
5098 }
5099 }
5100 }
5101 return unresolvedKeys.length;
5102};
5103
5104Resolver.prototype.getRefs = function(spec, obj) {
5105 obj = obj || spec;
5106 var output = {};
5107 for(var key in obj) {
Jian Li83d87a72016-04-20 15:38:24 -07005108 if (!obj.hasOwnProperty(key)) {
5109 continue;
5110 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005111 var item = obj[key];
5112 if(key === '$ref' && typeof item === 'string') {
5113 output[item] = null;
5114 }
Jian Li83d87a72016-04-20 15:38:24 -07005115 else if(_.isObject(item)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005116 var o = this.getRefs(item);
5117 for(var k in o) {
5118 output[k] = null;
5119 }
5120 }
5121 }
5122 return output;
5123};
5124
Jian Li7f6d0e9e2016-09-27 02:04:49 +09005125function splitUrl(url) {
5126 var result = {};
5127 var proto = /[a-z]+:\/\//i.exec(url);
5128 if (proto) {
5129 result.proto = proto[0].slice(0, -3);
5130 url = url.slice(result.proto.length + 1);
5131 }
5132 if (url.slice(0, 2) === '//') {
5133 result.domain = url.slice(2).split('/')[0];
5134 url = url.slice(2 + result.domain.length);
5135 }
5136 var p = url.split('#');
5137 if (p[0].length) {
5138 result.path = p[0];
5139 }
5140 if (p.length > 1) {
5141 result.fragment = p.slice(1).join('#');
5142 }
5143 return result;
5144}
5145
5146function unsplitUrl(url) {
5147 var result = url.path;
5148 if (result === undefined) {
5149 result = '';
5150 }
5151 if (url.fragment !== undefined) {
5152 result += '#' + url.fragment;
5153 }
5154 if (url.domain !== undefined) {
5155 if (result.slice(0, 1) === '/') {
5156 result = result.slice(1);
5157 }
5158 result = '//' + url.domain + '/' + result;
5159 if (url.proto !== undefined) {
5160 result = url.proto + ':' + result;
5161 }
5162 }
5163 return result;
5164}
5165
5166function joinUrl(base, rel) {
5167 var relsp = splitUrl(rel);
5168 if (relsp.domain !== undefined) {
5169 return rel;
5170 }
5171 var result = splitUrl(base);
5172 if (relsp.path === undefined) {
5173 // change only fragment part
5174 result.fragment = relsp.fragment;
5175 } else if (relsp.path.slice(0, 1) === '/') {
5176 // relative to domain
5177 result.path = relsp.path;
5178 result.fragment = relsp.fragment;
5179 } else {
5180 // relative to path
5181 var path = result.path === undefined ? [] : result.path.split('/');
5182 var relpath = relsp.path.split('/');
5183 if (path.length) {
5184 path.pop();
5185 }
5186 while (relpath[0] === '..' || relpath[0] === '.') {
5187 if (relpath[0] === '..') {
5188 path.pop();
5189 }
5190 relpath.shift();
5191 }
5192 result.path = path.concat(relpath).join('/');
5193 result.fragment = relsp.fragment;
5194 }
5195 return unsplitUrl(result);
5196}
5197
Jian Li8afbbee2016-07-27 19:16:51 +09005198Resolver.prototype.retainRoot = function(origKey, obj, root) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005199 // walk object and look for relative $refs
Jian Li8afbbee2016-07-27 19:16:51 +09005200 if(_.isObject(obj)) {
5201 for(var key in obj) {
5202 var item = obj[key];
5203 if (key === '$ref' && typeof item === 'string') {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09005204 obj[key] = joinUrl(root, item);
Jian Li8afbbee2016-07-27 19:16:51 +09005205 }
5206 else if (_.isObject(item)) {
5207 this.retainRoot(key, item, root);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005208 }
5209 }
Jian Li8afbbee2016-07-27 19:16:51 +09005210 }
5211 else if(_.isString(obj) && origKey === '$ref') {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09005212 obj = joinUrl(root, obj);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005213 }
5214 return obj;
5215};
5216
5217/**
5218 * immediately in-lines local refs, queues remote refs
5219 * for inline resolution
5220 */
5221Resolver.prototype.resolveInline = function (root, spec, property, resolutionTable, unresolvedRefs, location) {
5222 var key = property.$ref, ref = property.$ref, i, p, p2, rs;
5223 var rootTrimmed = false;
Jian Li8afbbee2016-07-27 19:16:51 +09005224
Jian Li1c94b9d2017-02-08 15:47:21 +09005225 root = root || ''; // Guard against .split. @fehguy, you'll need to check if this logic fits
Jian Li8afbbee2016-07-27 19:16:51 +09005226 // More imporantly is how do we gracefully handle relative urls, when provided just a 'spec', not a 'url' ?
5227
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005228 if (ref) {
5229 if(ref.indexOf('../') === 0) {
5230 // reset root
5231 p = ref.split('../');
5232 p2 = root.split('/');
5233 ref = '';
5234 for(i = 0; i < p.length; i++) {
5235 if(p[i] === '') {
5236 p2 = p2.slice(0, p2.length-1);
5237 }
5238 else {
5239 ref += p[i];
5240 }
5241 }
5242 root = '';
5243 for(i = 0; i < p2.length - 1; i++) {
5244 if(i > 0) { root += '/'; }
5245 root += p2[i];
5246 }
5247 rootTrimmed = true;
5248 }
5249 if(ref.indexOf('#') >= 0) {
5250 if(ref.indexOf('/') === 0) {
5251 rs = ref.split('#');
5252 p = root.split('//');
5253 p2 = p[1].split('/');
5254 root = p[0] + '//' + p2[0] + rs[0];
5255 location = rs[1];
5256 }
5257 else {
5258 rs = ref.split('#');
5259 if(rs[0] !== '') {
5260 p2 = root.split('/');
5261 p2 = p2.slice(0, p2.length - 1);
5262 if(!rootTrimmed) {
5263 root = '';
5264 for (var k = 0; k < p2.length; k++) {
5265 if(k > 0) { root += '/'; }
5266 root += p2[k];
5267 }
5268 }
5269 root += '/' + ref.split('#')[0];
5270 }
5271 location = rs[1];
5272 }
5273 }
Jian Li8afbbee2016-07-27 19:16:51 +09005274 if (ref.indexOf('http:') === 0 || ref.indexOf('https:') === 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005275 if(ref.indexOf('#') >= 0) {
5276 root = ref.split('#')[0];
5277 location = ref.split('#')[1];
5278 }
5279 else {
5280 root = ref;
5281 location = '';
5282 }
5283 resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
5284 } else if (ref.indexOf('#') === 0) {
5285 location = ref.split('#')[1];
5286 resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
Jian Li8afbbee2016-07-27 19:16:51 +09005287 } else if (ref.indexOf('/') === 0 && ref.indexOf('#') === -1) {
5288 location = ref;
5289 var matches = root.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
5290 if(matches) {
5291 root = matches[0] + ref.substring(1);
5292 location = '';
5293 }
5294 resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005295 }
5296 else {
5297 resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
5298 }
Jian Li83d87a72016-04-20 15:38:24 -07005299 }
5300 else if (property.type === 'array') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005301 this.resolveTo(root, property.items, resolutionTable, location);
5302 }
5303};
5304
5305Resolver.prototype.resolveTo = function (root, property, resolutionTable, location) {
Jian Li83d87a72016-04-20 15:38:24 -07005306 var sp, i;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005307 var ref = property.$ref;
Jian Li83d87a72016-04-20 15:38:24 -07005308 var lroot = root;
Jian Li8afbbee2016-07-27 19:16:51 +09005309 if ((typeof ref !== 'undefined') && (ref !== null)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005310 if(ref.indexOf('#') >= 0) {
Jian Li83d87a72016-04-20 15:38:24 -07005311 var parts = ref.split('#');
5312
5313 // #/definitions/foo
5314 // foo.json#/bar
5315 if(parts[0] && ref.indexOf('/') === 0) {
5316
5317 }
Jian Li8afbbee2016-07-27 19:16:51 +09005318 else if(parts[0] && (parts[0].indexOf('http:') === 0 || parts[0].indexOf('https:') === 0)) {
Jian Li83d87a72016-04-20 15:38:24 -07005319 lroot = parts[0];
5320 ref = parts[1];
5321 }
5322 else if(parts[0] && parts[0].length > 0) {
5323 // relative file
5324 sp = root.split('/');
5325 lroot = '';
5326 for(i = 0; i < sp.length - 1; i++) {
5327 lroot += sp[i] + '/';
5328 }
5329 lroot += parts[0];
5330 }
5331 else {
5332
5333 }
5334
5335 location = parts[1];
5336 }
Jian Li8afbbee2016-07-27 19:16:51 +09005337 else if (ref.indexOf('http:') === 0 || ref.indexOf('https:') === 0) {
Jian Li83d87a72016-04-20 15:38:24 -07005338 lroot = ref;
5339 location = '';
5340 }
5341 else {
5342 // relative file
5343 sp = root.split('/');
5344 lroot = '';
5345 for(i = 0; i < sp.length - 1; i++) {
5346 lroot += sp[i] + '/';
5347 }
5348 lroot += ref;
5349 location = '';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005350 }
5351 resolutionTable.push({
Jian Li83d87a72016-04-20 15:38:24 -07005352 obj: property, resolveAs: 'ref', root: lroot, key: ref, location: location
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005353 });
5354 } else if (property.type === 'array') {
5355 var items = property.items;
5356 this.resolveTo(root, items, resolutionTable, location);
Jian Li83d87a72016-04-20 15:38:24 -07005357 } else {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09005358 if(property && (property.properties || property.additionalProperties)) {
Jian Li83d87a72016-04-20 15:38:24 -07005359 var name = this.uniqueName('inline_model');
Jian Li8afbbee2016-07-27 19:16:51 +09005360 if (property.title) {
5361 name = this.uniqueName(property.title);
5362 }
5363 delete property.title;
Jian Li83d87a72016-04-20 15:38:24 -07005364 this.spec.definitions[name] = _.cloneDeep(property);
Jian Li1c94b9d2017-02-08 15:47:21 +09005365 property.$ref = '#/definitions/' + name;
Jian Li83d87a72016-04-20 15:38:24 -07005366 delete property.type;
5367 delete property.properties;
5368 }
5369 }
5370};
5371
5372Resolver.prototype.uniqueName = function(base) {
5373 var name = base;
5374 var count = 0;
5375 while(true) {
5376 if(!_.isObject(this.spec.definitions[name])) {
5377 return name;
5378 }
5379 name = base + '_' + count;
5380 count++;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005381 }
5382};
5383
5384Resolver.prototype.resolveAllOf = function(spec, obj, depth) {
5385 depth = depth || 0;
5386 obj = obj || spec;
5387 var name;
5388 for(var key in obj) {
Jian Li83d87a72016-04-20 15:38:24 -07005389 if (!obj.hasOwnProperty(key)) {
5390 continue;
5391 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005392 var item = obj[key];
Jian Li83d87a72016-04-20 15:38:24 -07005393 if(item === null) {
5394 throw new TypeError('Swagger 2.0 does not support null types (' + obj + '). See https://github.com/swagger-api/swagger-spec/issues/229.');
5395 }
5396 if(typeof item === 'object') {
5397 this.resolveAllOf(spec, item, depth + 1);
5398 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005399 if(item && typeof item.allOf !== 'undefined') {
5400 var allOf = item.allOf;
Jian Li83d87a72016-04-20 15:38:24 -07005401 if(_.isArray(allOf)) {
5402 var output = _.cloneDeep(item);
5403 delete output.allOf;
5404
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005405 output['x-composed'] = true;
Jian Li83d87a72016-04-20 15:38:24 -07005406 if (typeof item['x-resolved-from'] !== 'undefined') {
5407 output['x-resolved-from'] = item['x-resolved-from'];
5408 }
5409
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005410 for(var i = 0; i < allOf.length; i++) {
5411 var component = allOf[i];
5412 var source = 'self';
5413 if(typeof component['x-resolved-from'] !== 'undefined') {
5414 source = component['x-resolved-from'][0];
5415 }
5416
5417 for(var part in component) {
5418 if(!output.hasOwnProperty(part)) {
Jian Li83d87a72016-04-20 15:38:24 -07005419 output[part] = _.cloneDeep(component[part]);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005420 if(part === 'properties') {
5421 for(name in output[part]) {
5422 output[part][name]['x-resolved-from'] = source;
5423 }
5424 }
5425 }
5426 else {
5427 if(part === 'properties') {
5428 var properties = component[part];
5429 for(name in properties) {
Jian Li83d87a72016-04-20 15:38:24 -07005430 output.properties[name] = _.cloneDeep(properties[name]);
5431 var resolvedFrom = properties[name]['x-resolved-from'];
5432 if (typeof resolvedFrom === 'undefined' || resolvedFrom === 'self') {
5433 resolvedFrom = source;
5434 }
5435 output.properties[name]['x-resolved-from'] = resolvedFrom;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005436 }
5437 }
5438 else if(part === 'required') {
5439 // merge & dedup the required array
5440 var a = output.required.concat(component[part]);
5441 for(var k = 0; k < a.length; ++k) {
5442 for(var j = k + 1; j < a.length; ++j) {
5443 if(a[k] === a[j]) { a.splice(j--, 1); }
5444 }
5445 }
5446 output.required = a;
5447 }
5448 else if(part === 'x-resolved-from') {
5449 output['x-resolved-from'].push(source);
5450 }
5451 else {
5452 // TODO: need to merge this property
5453 // console.log('what to do with ' + part)
5454 }
5455 }
5456 }
5457 }
5458 obj[key] = output;
5459 }
5460 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005461 }
5462};
5463
Jian Li8afbbee2016-07-27 19:16:51 +09005464},{"./http":5,"lodash-compat/lang/cloneDeep":138,"lodash-compat/lang/isArray":140,"lodash-compat/lang/isObject":144,"lodash-compat/lang/isString":146}],7:[function(require,module,exports){
Jian Li83d87a72016-04-20 15:38:24 -07005465'use strict';
5466
5467var Helpers = require('./helpers');
5468
5469var _ = {
5470 isPlainObject: require('lodash-compat/lang/isPlainObject'),
5471 isUndefined: require('lodash-compat/lang/isUndefined'),
5472 isArray: require('lodash-compat/lang/isArray'),
5473 isObject: require('lodash-compat/lang/isObject'),
5474 isEmpty: require('lodash-compat/lang/isEmpty'),
5475 map: require('lodash-compat/collection/map'),
5476 indexOf: require('lodash-compat/array/indexOf'),
5477 cloneDeep: require('lodash-compat/lang/cloneDeep'),
5478 keys: require('lodash-compat/object/keys'),
5479 forEach: require('lodash-compat/collection/forEach')
5480};
5481
Jian Li1c94b9d2017-02-08 15:47:21 +09005482var optionHtml = module.exports.optionHtml = function (label, value) {
Jian Li83d87a72016-04-20 15:38:24 -07005483 return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
Jian Li1c94b9d2017-02-08 15:47:21 +09005484};
Jian Li83d87a72016-04-20 15:38:24 -07005485
Jian Li1c94b9d2017-02-08 15:47:21 +09005486module.exports.typeFromJsonSchema = function (type, format) {
Jian Li83d87a72016-04-20 15:38:24 -07005487 var str;
5488
5489 if (type === 'integer' && format === 'int32') {
5490 str = 'integer';
5491 } else if (type === 'integer' && format === 'int64') {
5492 str = 'long';
5493 } else if (type === 'integer' && typeof format === 'undefined') {
5494 str = 'long';
5495 } else if (type === 'string' && format === 'date-time') {
5496 str = 'date-time';
5497 } else if (type === 'string' && format === 'date') {
5498 str = 'date';
5499 } else if (type === 'number' && format === 'float') {
5500 str = 'float';
5501 } else if (type === 'number' && format === 'double') {
5502 str = 'double';
5503 } else if (type === 'number' && typeof format === 'undefined') {
5504 str = 'double';
5505 } else if (type === 'boolean') {
5506 str = 'boolean';
5507 } else if (type === 'string') {
5508 str = 'string';
5509 }
5510
5511 return str;
Jian Li1c94b9d2017-02-08 15:47:21 +09005512};
Jian Li83d87a72016-04-20 15:38:24 -07005513
Jian Li1c94b9d2017-02-08 15:47:21 +09005514var getStringSignature = module.exports.getStringSignature = function (obj, baseComponent) {
Jian Li83d87a72016-04-20 15:38:24 -07005515 var str = '';
5516
5517 if (typeof obj.$ref !== 'undefined') {
5518 str += Helpers.simpleRef(obj.$ref);
5519 } else if (typeof obj.type === 'undefined') {
5520 str += 'object';
5521 } else if (obj.type === 'array') {
5522 if (baseComponent) {
5523 str += getStringSignature((obj.items || obj.$ref || {}));
5524 } else {
5525 str += 'Array[';
5526 str += getStringSignature((obj.items || obj.$ref || {}));
5527 str += ']';
5528 }
5529 } else if (obj.type === 'integer' && obj.format === 'int32') {
5530 str += 'integer';
5531 } else if (obj.type === 'integer' && obj.format === 'int64') {
5532 str += 'long';
5533 } else if (obj.type === 'integer' && typeof obj.format === 'undefined') {
5534 str += 'long';
5535 } else if (obj.type === 'string' && obj.format === 'date-time') {
5536 str += 'date-time';
5537 } else if (obj.type === 'string' && obj.format === 'date') {
5538 str += 'date';
5539 } else if (obj.type === 'string' && typeof obj.format === 'undefined') {
5540 str += 'string';
5541 } else if (obj.type === 'number' && obj.format === 'float') {
5542 str += 'float';
5543 } else if (obj.type === 'number' && obj.format === 'double') {
5544 str += 'double';
5545 } else if (obj.type === 'number' && typeof obj.format === 'undefined') {
5546 str += 'double';
5547 } else if (obj.type === 'boolean') {
5548 str += 'boolean';
5549 } else if (obj.$ref) {
5550 str += Helpers.simpleRef(obj.$ref);
5551 } else {
5552 str += obj.type;
5553 }
5554
5555 return str;
Jian Li1c94b9d2017-02-08 15:47:21 +09005556};
Jian Li83d87a72016-04-20 15:38:24 -07005557
Jian Li1c94b9d2017-02-08 15:47:21 +09005558var schemaToJSON = module.exports.schemaToJSON = function (schema, models, modelsToIgnore, modelPropertyMacro) {
Jian Li83d87a72016-04-20 15:38:24 -07005559 // Resolve the schema (Handle nested schemas)
5560 schema = Helpers.resolveSchema(schema);
5561
5562 if(typeof modelPropertyMacro !== 'function') {
5563 modelPropertyMacro = function(prop){
5564 return (prop || {}).default;
5565 };
5566 }
5567
5568 modelsToIgnore= modelsToIgnore || {};
5569
5570 var type = schema.type || 'object';
5571 var format = schema.format;
5572 var model;
5573 var output;
5574
5575 if (!_.isUndefined(schema.example)) {
5576 output = schema.example;
5577 } else if (_.isUndefined(schema.items) && _.isArray(schema.enum)) {
5578 output = schema.enum[0];
5579 }
5580
5581 if (_.isUndefined(output)) {
5582 if (schema.$ref) {
5583 model = models[Helpers.simpleRef(schema.$ref)];
5584
5585 if (!_.isUndefined(model)) {
5586 if (_.isUndefined(modelsToIgnore[model.name])) {
5587 modelsToIgnore[model.name] = model;
5588 output = schemaToJSON(model.definition, models, modelsToIgnore, modelPropertyMacro);
5589 delete modelsToIgnore[model.name];
5590 } else {
5591 if (model.type === 'array') {
5592 output = [];
5593 } else {
5594 output = {};
5595 }
5596 }
5597 }
5598 } else if (!_.isUndefined(schema.default)) {
5599 output = schema.default;
5600 } else if (type === 'string') {
5601 if (format === 'date-time') {
5602 output = new Date().toISOString();
5603 } else if (format === 'date') {
5604 output = new Date().toISOString().split('T')[0];
5605 } else {
5606 output = 'string';
5607 }
5608 } else if (type === 'integer') {
5609 output = 0;
5610 } else if (type === 'number') {
5611 output = 0.0;
5612 } else if (type === 'boolean') {
5613 output = true;
5614 } else if (type === 'object') {
5615 output = {};
5616
5617 _.forEach(schema.properties, function (property, name) {
5618 var cProperty = _.cloneDeep(property);
5619
5620 // Allow macro to set the default value
5621 cProperty.default = modelPropertyMacro(property);
5622
5623 output[name] = schemaToJSON(cProperty, models, modelsToIgnore, modelPropertyMacro);
5624 });
5625 } else if (type === 'array') {
5626 output = [];
5627
5628 if (_.isArray(schema.items)) {
5629 _.forEach(schema.items, function (item) {
5630 output.push(schemaToJSON(item, models, modelsToIgnore, modelPropertyMacro));
5631 });
5632 } else if (_.isPlainObject(schema.items)) {
5633 output.push(schemaToJSON(schema.items, models, modelsToIgnore, modelPropertyMacro));
5634 } else if (_.isUndefined(schema.items)) {
5635 output.push({});
5636 } else {
5637 Helpers.log('Array type\'s \'items\' property is not an array or an object, cannot process');
5638 }
5639 }
5640 }
5641
5642 return output;
Jian Li1c94b9d2017-02-08 15:47:21 +09005643};
Jian Li83d87a72016-04-20 15:38:24 -07005644
Jian Li1c94b9d2017-02-08 15:47:21 +09005645module.exports.schemaToHTML =function (name, schema, models, modelPropertyMacro) {
Jian Li83d87a72016-04-20 15:38:24 -07005646 var strongOpen = '<span class="strong">';
5647 var strongClose = '</span>';
5648
5649 // Allow for ignoring the 'name' argument.... shifting the rest
5650 if(_.isObject(arguments[0])) {
5651 name = void 0;
5652 schema = arguments[0];
5653 models = arguments[1];
5654 modelPropertyMacro = arguments[2];
5655 }
5656
5657 models = models || {};
5658
5659 // Resolve the schema (Handle nested schemas)
5660 schema = Helpers.resolveSchema(schema);
5661
5662 // Return for empty object
5663 if(_.isEmpty(schema)) {
5664 return strongOpen + 'Empty' + strongClose;
5665 }
5666
5667 // Dereference $ref from 'models'
5668 if(typeof schema.$ref === 'string') {
5669 name = Helpers.simpleRef(schema.$ref);
5670 schema = models[name];
5671 if(typeof schema === 'undefined')
5672 {
5673 return strongOpen + name + ' is not defined!' + strongClose;
5674 }
5675 }
5676
5677 if(typeof name !== 'string') {
5678 name = schema.title || 'Inline Model';
5679 }
5680
5681 // If we are a Model object... adjust accordingly
5682 if(schema.definition) {
5683 schema = schema.definition;
5684 }
5685
5686 if(typeof modelPropertyMacro !== 'function') {
5687 modelPropertyMacro = function(prop){
5688 return (prop || {}).default;
5689 };
5690 }
5691
5692 var references = {};
5693 var seenModels = [];
5694 var inlineModels = 0;
5695
5696
5697
5698 // Generate current HTML
5699 var html = processModel(schema, name);
5700
5701 // Generate references HTML
5702 while (_.keys(references).length > 0) {
5703 /* jshint ignore:start */
5704 _.forEach(references, function (schema, name) {
5705 var seenModel = _.indexOf(seenModels, name) > -1;
5706
5707 delete references[name];
5708
5709 if (!seenModel) {
5710 seenModels.push(name);
5711
5712 html += '<br />' + processModel(schema, name);
5713 }
5714 });
5715 /* jshint ignore:end */
5716 }
5717
5718 return html;
5719
5720 /////////////////////////////////
5721
5722 function addReference(schema, name, skipRef) {
5723 var modelName = name;
5724 var model;
5725
5726 if (schema.$ref) {
5727 modelName = schema.title || Helpers.simpleRef(schema.$ref);
Jian Li8afbbee2016-07-27 19:16:51 +09005728 model = models[modelName];
Jian Li83d87a72016-04-20 15:38:24 -07005729 } else if (_.isUndefined(name)) {
5730 modelName = schema.title || 'Inline Model ' + (++inlineModels);
5731 model = {definition: schema};
5732 }
5733
5734 if (skipRef !== true) {
5735 references[modelName] = _.isUndefined(model) ? {} : model.definition;
5736 }
5737
5738 return modelName;
5739 }
5740
5741 function primitiveToHTML(schema) {
5742 var html = '<span class="propType">';
5743 var type = schema.type || 'object';
5744
5745 if (schema.$ref) {
5746 html += addReference(schema, Helpers.simpleRef(schema.$ref));
5747 } else if (type === 'object') {
5748 if (!_.isUndefined(schema.properties)) {
5749 html += addReference(schema);
5750 } else {
5751 html += 'object';
5752 }
5753 } else if (type === 'array') {
5754 html += 'Array[';
5755
5756 if (_.isArray(schema.items)) {
5757 html += _.map(schema.items, addReference).join(',');
5758 } else if (_.isPlainObject(schema.items)) {
5759 if (_.isUndefined(schema.items.$ref)) {
5760 if (!_.isUndefined(schema.items.type) && _.indexOf(['array', 'object'], schema.items.type) === -1) {
5761 html += schema.items.type;
5762 } else {
5763 html += addReference(schema.items);
5764 }
5765 } else {
5766 html += addReference(schema.items, Helpers.simpleRef(schema.items.$ref));
5767 }
5768 } else {
5769 Helpers.log('Array type\'s \'items\' schema is not an array or an object, cannot process');
5770 html += 'object';
5771 }
5772
5773 html += ']';
5774 } else {
5775 html += schema.type;
5776 }
5777
5778 html += '</span>';
5779
5780 return html;
5781 }
5782
5783 function primitiveToOptionsHTML(schema, html) {
5784 var options = '';
5785 var type = schema.type || 'object';
5786 var isArray = type === 'array';
5787
5788 if (isArray) {
5789 if (_.isPlainObject(schema.items) && !_.isUndefined(schema.items.type)) {
5790 type = schema.items.type;
5791 } else {
5792 type = 'object';
5793 }
5794 }
5795
5796 if (!_.isUndefined(schema.default)) {
5797 options += optionHtml('Default', schema.default);
5798 }
5799
5800 switch (type) {
5801 case 'string':
5802 if (schema.minLength) {
5803 options += optionHtml('Min. Length', schema.minLength);
5804 }
5805
5806 if (schema.maxLength) {
5807 options += optionHtml('Max. Length', schema.maxLength);
5808 }
5809
5810 if (schema.pattern) {
5811 options += optionHtml('Reg. Exp.', schema.pattern);
5812 }
5813 break;
5814 case 'integer':
5815 case 'number':
5816 if (schema.minimum) {
5817 options += optionHtml('Min. Value', schema.minimum);
5818 }
5819
5820 if (schema.exclusiveMinimum) {
5821 options += optionHtml('Exclusive Min.', 'true');
5822 }
5823
5824 if (schema.maximum) {
5825 options += optionHtml('Max. Value', schema.maximum);
5826 }
5827
5828 if (schema.exclusiveMaximum) {
5829 options += optionHtml('Exclusive Max.', 'true');
5830 }
5831
5832 if (schema.multipleOf) {
5833 options += optionHtml('Multiple Of', schema.multipleOf);
5834 }
5835
5836 break;
5837 }
5838
5839 if (isArray) {
5840 if (schema.minItems) {
5841 options += optionHtml('Min. Items', schema.minItems);
5842 }
5843
5844 if (schema.maxItems) {
5845 options += optionHtml('Max. Items', schema.maxItems);
5846 }
5847
5848 if (schema.uniqueItems) {
5849 options += optionHtml('Unique Items', 'true');
5850 }
5851
5852 if (schema.collectionFormat) {
5853 options += optionHtml('Coll. Format', schema.collectionFormat);
5854 }
5855 }
5856
5857 if (_.isUndefined(schema.items)) {
5858 if (_.isArray(schema.enum)) {
5859 var enumString;
5860
5861 if (type === 'number' || type === 'integer') {
5862 enumString = schema.enum.join(', ');
5863 } else {
5864 enumString = '"' + schema.enum.join('", "') + '"';
5865 }
5866
5867 options += optionHtml('Enum', enumString);
5868 }
5869 }
5870
5871 if (options.length > 0) {
5872 html = '<span class="propWrap">' + html + '<table class="optionsWrapper"><tr><th colspan="2">' + type + '</th></tr>' + options + '</table></span>';
5873 }
5874
5875 return html;
5876 }
5877
5878 function processModel(schema, name) {
5879 var type = schema.type || 'object';
5880 var isArray = schema.type === 'array';
5881 var html = strongOpen + name + ' ' + (isArray ? '[' : '{') + strongClose;
5882
5883 if (name) {
5884 seenModels.push(name);
5885 }
5886
5887 if (isArray) {
5888 if (_.isArray(schema.items)) {
5889 html += '<div>' + _.map(schema.items, function (item) {
5890 var type = item.type || 'object';
5891
5892 if (_.isUndefined(item.$ref)) {
5893 if (_.indexOf(['array', 'object'], type) > -1) {
5894 if (type === 'object' && _.isUndefined(item.properties)) {
5895 return 'object';
5896 } else {
5897 return addReference(item);
5898 }
5899 } else {
5900 return primitiveToOptionsHTML(item, type);
5901 }
5902 } else {
5903 return addReference(item, Helpers.simpleRef(item.$ref));
5904 }
5905 }).join(',</div><div>');
5906 } else if (_.isPlainObject(schema.items)) {
5907 if (_.isUndefined(schema.items.$ref)) {
5908 if (_.indexOf(['array', 'object'], schema.items.type || 'object') > -1) {
5909 if ((_.isUndefined(schema.items.type) || schema.items.type === 'object') && _.isUndefined(schema.items.properties)) {
5910 html += '<div>object</div>';
5911 } else {
5912 html += '<div>' + addReference(schema.items) + '</div>';
5913 }
5914 } else {
5915 html += '<div>' + primitiveToOptionsHTML(schema.items, schema.items.type) + '</div>';
5916 }
5917 } else {
5918 html += '<div>' + addReference(schema.items, Helpers.simpleRef(schema.items.$ref)) + '</div>';
5919 }
5920 } else {
5921 Helpers.log('Array type\'s \'items\' property is not an array or an object, cannot process');
5922 html += '<div>object</div>';
5923 }
5924 } else {
5925 if (schema.$ref) {
5926 html += '<div>' + addReference(schema, name) + '</div>';
5927 } else if (type === 'object') {
5928 if (_.isPlainObject(schema.properties)) {
5929 var contents = _.map(schema.properties, function (property, name) {
5930 var propertyIsRequired = (_.indexOf(schema.required, name) >= 0);
5931 var cProperty = _.cloneDeep(property);
5932
5933 var requiredClass = propertyIsRequired ? 'required' : '';
Jian Li8afbbee2016-07-27 19:16:51 +09005934 var html = '<span class="propName ' + requiredClass + '">' + name + '</span> (';
Jian Li83d87a72016-04-20 15:38:24 -07005935 var model;
5936 var propDescription;
5937
5938 // Allow macro to set the default value
5939 cProperty.default = modelPropertyMacro(cProperty);
5940
5941 // Resolve the schema (Handle nested schemas)
5942 cProperty = Helpers.resolveSchema(cProperty);
5943
5944 propDescription = property.description || cProperty.description;
5945
5946 // We need to handle property references to primitives (Issue 339)
5947 if (!_.isUndefined(cProperty.$ref)) {
5948 model = models[Helpers.simpleRef(cProperty.$ref)];
5949
5950 if (!_.isUndefined(model) && _.indexOf([undefined, 'array', 'object'], model.definition.type) === -1) {
5951 // Use referenced schema
5952 cProperty = Helpers.resolveSchema(model.definition);
5953 }
5954 }
5955
5956 html += primitiveToHTML(cProperty);
5957
5958 if(!propertyIsRequired) {
5959 html += ', <span class="propOptKey">optional</span>';
5960 }
5961
5962 if(property.readOnly) {
5963 html += ', <span class="propReadOnly">read only</span>';
5964 }
5965
5966 html += ')';
5967
5968 if (!_.isUndefined(propDescription)) {
5969 html += ': ' + '<span class="propDesc">' + propDescription + '</span>';
5970 }
5971
5972 if (cProperty.enum) {
5973 html += ' = <span class="propVals">[\'' + cProperty.enum.join('\', \'') + '\']</span>';
5974 }
5975
Jian Li8afbbee2016-07-27 19:16:51 +09005976 return '<div' + (property.readOnly ? ' class="readOnly"' : '') + '>' + primitiveToOptionsHTML(cProperty, html);
Jian Li83d87a72016-04-20 15:38:24 -07005977 }).join(',</div>');
Jian Li83d87a72016-04-20 15:38:24 -07005978
Jian Li8afbbee2016-07-27 19:16:51 +09005979 if (contents) {
5980 html += contents + '</div>';
5981 }
Jian Li83d87a72016-04-20 15:38:24 -07005982 }
5983 } else {
5984 html += '<div>' + primitiveToOptionsHTML(schema, type) + '</div>';
5985 }
5986 }
5987
5988 return html + strongOpen + (isArray ? ']' : '}') + strongClose;
5989 }
Jian Li1c94b9d2017-02-08 15:47:21 +09005990};
Jian Li8afbbee2016-07-27 19:16:51 +09005991},{"./helpers":4,"lodash-compat/array/indexOf":49,"lodash-compat/collection/forEach":54,"lodash-compat/collection/map":56,"lodash-compat/lang/cloneDeep":138,"lodash-compat/lang/isArray":140,"lodash-compat/lang/isEmpty":141,"lodash-compat/lang/isObject":144,"lodash-compat/lang/isPlainObject":145,"lodash-compat/lang/isUndefined":148,"lodash-compat/object/keys":149}],8:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005992'use strict';
5993
5994var SwaggerHttp = require('./http');
Jian Li83d87a72016-04-20 15:38:24 -07005995var _ = {
5996 isObject: require('lodash-compat/lang/isObject')
5997};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07005998
5999var SwaggerSpecConverter = module.exports = function () {
6000 this.errors = [];
6001 this.warnings = [];
6002 this.modelMap = {};
6003};
6004
6005SwaggerSpecConverter.prototype.setDocumentationLocation = function (location) {
6006 this.docLocation = location;
6007};
6008
6009/**
6010 * converts a resource listing OR api declaration
6011 **/
Jian Li83d87a72016-04-20 15:38:24 -07006012SwaggerSpecConverter.prototype.convert = function (obj, clientAuthorizations, opts, callback) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006013 // not a valid spec
6014 if(!obj || !Array.isArray(obj.apis)) {
6015 return this.finish(callback, null);
6016 }
6017 this.clientAuthorizations = clientAuthorizations;
6018
6019 // create a new swagger object to return
6020 var swagger = { swagger: '2.0' };
6021
6022 swagger.originalVersion = obj.swaggerVersion;
6023
6024 // add the info
6025 this.apiInfo(obj, swagger);
6026
6027 // add security definitions
6028 this.securityDefinitions(obj, swagger);
6029
6030 // take basePath into account
6031 if (obj.basePath) {
6032 this.setDocumentationLocation(obj.basePath);
6033 }
6034
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006035 // see if this is a single-file swagger definition
6036 var isSingleFileSwagger = false;
6037 var i;
6038 for(i = 0; i < obj.apis.length; i++) {
6039 var api = obj.apis[i];
6040 if(Array.isArray(api.operations)) {
6041 isSingleFileSwagger = true;
6042 }
6043 }
6044 if(isSingleFileSwagger) {
6045 this.declaration(obj, swagger);
6046 this.finish(callback, swagger);
6047 }
6048 else {
Jian Li83d87a72016-04-20 15:38:24 -07006049 this.resourceListing(obj, swagger, opts, callback);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006050 }
6051};
6052
6053SwaggerSpecConverter.prototype.declaration = function(obj, swagger) {
6054 var name, i, p, pos;
6055 if(!obj.apis) {
6056 return;
6057 }
6058
6059 if (obj.basePath.indexOf('http://') === 0) {
6060 p = obj.basePath.substring('http://'.length);
6061 pos = p.indexOf('/');
6062 if (pos > 0) {
6063 swagger.host = p.substring(0, pos);
6064 swagger.basePath = p.substring(pos);
6065 }
6066 else {
6067 swagger.host = p;
6068 swagger.basePath = '/';
6069 }
6070 } else if (obj.basePath.indexOf('https://') === 0) {
6071 p = obj.basePath.substring('https://'.length);
6072 pos = p.indexOf('/');
6073 if (pos > 0) {
6074 swagger.host = p.substring(0, pos);
6075 swagger.basePath = p.substring(pos);
6076 }
6077 else {
6078 swagger.host = p;
6079 swagger.basePath = '/';
6080 }
6081 } else {
6082 swagger.basePath = obj.basePath;
6083 }
6084
6085 var resourceLevelAuth;
6086 if(obj.authorizations) {
6087 resourceLevelAuth = obj.authorizations;
6088 }
6089 if(obj.consumes) {
6090 swagger.consumes = obj.consumes;
6091 }
6092 if(obj.produces) {
6093 swagger.produces = obj.produces;
6094 }
6095
6096 // build a mapping of id to name for 1.0 model resolutions
Jian Li83d87a72016-04-20 15:38:24 -07006097 if(_.isObject(obj)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006098 for(name in obj.models) {
6099 var existingModel = obj.models[name];
6100 var key = (existingModel.id || name);
6101 this.modelMap[key] = name;
6102 }
6103 }
6104
6105 for(i = 0; i < obj.apis.length; i++) {
6106 var api = obj.apis[i];
6107 var path = api.path;
6108 var operations = api.operations;
6109 this.operations(path, obj.resourcePath, operations, resourceLevelAuth, swagger);
6110 }
6111
6112 var models = obj.models || {};
6113 this.models(models, swagger);
6114};
6115
6116SwaggerSpecConverter.prototype.models = function(obj, swagger) {
Jian Li83d87a72016-04-20 15:38:24 -07006117 if(!_.isObject(obj)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006118 return;
6119 }
6120 var name;
6121
6122 swagger.definitions = swagger.definitions || {};
6123 for(name in obj) {
6124 var existingModel = obj[name];
Jian Li8afbbee2016-07-27 19:16:51 +09006125 var _required = [];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006126 var schema = { properties: {}};
6127 var propertyName;
6128 for(propertyName in existingModel.properties) {
6129 var existingProperty = existingModel.properties[propertyName];
6130 var property = {};
6131 this.dataType(existingProperty, property);
6132 if(existingProperty.description) {
6133 property.description = existingProperty.description;
6134 }
6135 if(existingProperty['enum']) {
6136 property['enum'] = existingProperty['enum'];
6137 }
6138 if(typeof existingProperty.required === 'boolean' && existingProperty.required === true) {
Jian Li8afbbee2016-07-27 19:16:51 +09006139 _required.push(propertyName);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006140 }
6141 if(typeof existingProperty.required === 'string' && existingProperty.required === 'true') {
Jian Li8afbbee2016-07-27 19:16:51 +09006142 _required.push(propertyName);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006143 }
6144 schema.properties[propertyName] = property;
6145 }
Jian Li8afbbee2016-07-27 19:16:51 +09006146 if(_required.length > 0) {
6147 schema.required = _required;
6148 } else {
6149 schema.required = existingModel.required;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006150 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006151 swagger.definitions[name] = schema;
6152 }
6153};
6154
6155SwaggerSpecConverter.prototype.extractTag = function(resourcePath) {
6156 var pathString = resourcePath || 'default';
6157 if(pathString.indexOf('http:') === 0 || pathString.indexOf('https:') === 0) {
6158 pathString = pathString.split(['/']);
6159 pathString = pathString[pathString.length -1].substring();
6160 }
6161 if(pathString.endsWith('.json')) {
6162 pathString = pathString.substring(0, pathString.length - '.json'.length);
6163 }
6164 return pathString.replace('/','');
6165};
6166
6167SwaggerSpecConverter.prototype.operations = function(path, resourcePath, obj, resourceLevelAuth, swagger) {
6168 if(!Array.isArray(obj)) {
6169 return;
6170 }
6171 var i;
6172
6173 if(!swagger.paths) {
6174 swagger.paths = {};
6175 }
6176
6177 var pathObj = swagger.paths[path] || {};
6178 var tag = this.extractTag(resourcePath);
6179 swagger.tags = swagger.tags || [];
6180 var matched = false;
6181 for(i = 0; i < swagger.tags.length; i++) {
6182 var tagObject = swagger.tags[i];
6183 if(tagObject.name === tag) {
6184 matched = true;
6185 }
6186 }
6187 if(!matched) {
6188 swagger.tags.push({name: tag});
6189 }
6190
6191 for(i = 0; i < obj.length; i++) {
6192 var existingOperation = obj[i];
6193 var method = (existingOperation.method || existingOperation.httpMethod).toLowerCase();
6194 var operation = {tags: [tag]};
6195 var existingAuthorizations = existingOperation.authorizations;
6196
6197 if(existingAuthorizations && Object.keys(existingAuthorizations).length === 0) {
6198 existingAuthorizations = resourceLevelAuth;
6199 }
6200
6201 if(typeof existingAuthorizations !== 'undefined') {
6202 var scopesObject;
6203 for(var key in existingAuthorizations) {
6204 operation.security = operation.security || [];
6205 var scopes = existingAuthorizations[key];
6206 if(scopes) {
6207 var securityScopes = [];
6208 for(var j in scopes) {
6209 securityScopes.push(scopes[j].scope);
6210 }
6211 scopesObject = {};
6212 scopesObject[key] = securityScopes;
6213 operation.security.push(scopesObject);
6214 }
6215 else {
6216 scopesObject = {};
6217 scopesObject[key] = [];
6218 operation.security.push(scopesObject);
6219 }
6220 }
6221 }
6222
6223 if(existingOperation.consumes) {
6224 operation.consumes = existingOperation.consumes;
6225 }
6226 else if(swagger.consumes) {
6227 operation.consumes = swagger.consumes;
6228 }
6229 if(existingOperation.produces) {
6230 operation.produces = existingOperation.produces;
6231 }
6232 else if(swagger.produces) {
6233 operation.produces = swagger.produces;
6234 }
6235 if(existingOperation.summary) {
6236 operation.summary = existingOperation.summary;
6237 }
6238 if(existingOperation.notes) {
6239 operation.description = existingOperation.notes;
6240 }
6241 if(existingOperation.nickname) {
6242 operation.operationId = existingOperation.nickname;
6243 }
6244 if(existingOperation.deprecated) {
6245 operation.deprecated = existingOperation.deprecated;
6246 }
6247
6248 this.authorizations(existingAuthorizations, swagger);
6249 this.parameters(operation, existingOperation.parameters, swagger);
6250 this.responseMessages(operation, existingOperation, swagger);
6251
6252 pathObj[method] = operation;
6253 }
6254
6255 swagger.paths[path] = pathObj;
6256};
6257
6258SwaggerSpecConverter.prototype.responseMessages = function(operation, existingOperation) {
Jian Li83d87a72016-04-20 15:38:24 -07006259 if(!_.isObject(existingOperation)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006260 return;
6261 }
6262 // build default response from the operation (1.x)
6263 var defaultResponse = {};
6264 this.dataType(existingOperation, defaultResponse);
6265 // TODO: look into the real problem of rendering responses in swagger-ui
6266 // ....should reponseType have an implicit schema?
6267 if(!defaultResponse.schema && defaultResponse.type) {
6268 defaultResponse = {schema: defaultResponse};
6269 }
6270
6271 operation.responses = operation.responses || {};
6272
6273 // grab from responseMessages (1.2)
6274 var has200 = false;
6275 if(Array.isArray(existingOperation.responseMessages)) {
6276 var i;
6277 var existingResponses = existingOperation.responseMessages;
6278 for(i = 0; i < existingResponses.length; i++) {
6279 var existingResponse = existingResponses[i];
6280 var response = { description: existingResponse.message };
6281 if(existingResponse.code === 200) {
6282 has200 = true;
6283 }
6284 // Convert responseModel -> schema{$ref: responseModel}
6285 if(existingResponse.responseModel) {
Jian Li83d87a72016-04-20 15:38:24 -07006286 response.schema = {'$ref': '#/definitions/' + existingResponse.responseModel};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006287 }
6288 operation.responses['' + existingResponse.code] = response;
6289 }
6290 }
6291
6292 if(has200) {
6293 operation.responses['default'] = defaultResponse;
6294 }
6295 else {
6296 operation.responses['200'] = defaultResponse;
6297 }
6298};
6299
6300SwaggerSpecConverter.prototype.authorizations = function(obj) {
6301 // TODO
Jian Li83d87a72016-04-20 15:38:24 -07006302 if(!_.isObject(obj)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006303 return;
6304 }
6305};
6306
6307SwaggerSpecConverter.prototype.parameters = function(operation, obj) {
6308 if(!Array.isArray(obj)) {
6309 return;
6310 }
6311 var i;
6312 for(i = 0; i < obj.length; i++) {
6313 var existingParameter = obj[i];
6314 var parameter = {};
6315 parameter.name = existingParameter.name;
6316 parameter.description = existingParameter.description;
6317 parameter.required = existingParameter.required;
6318 parameter.in = existingParameter.paramType;
6319
6320 // per #168
6321 if(parameter.in === 'body') {
6322 parameter.name = 'body';
6323 }
6324 if(parameter.in === 'form') {
6325 parameter.in = 'formData';
6326 }
6327
6328 if(existingParameter.enum) {
6329 parameter.enum = existingParameter.enum;
6330 }
6331
6332 if(existingParameter.allowMultiple === true || existingParameter.allowMultiple === 'true') {
6333 var innerType = {};
6334 this.dataType(existingParameter, innerType);
6335 parameter.type = 'array';
6336 parameter.items = innerType;
6337
6338 if(existingParameter.allowableValues) {
6339 var av = existingParameter.allowableValues;
6340 if(av.valueType === 'LIST') {
6341 parameter['enum'] = av.values;
6342 }
6343 }
6344 }
6345 else {
6346 this.dataType(existingParameter, parameter);
6347 }
Jian Li83d87a72016-04-20 15:38:24 -07006348 if(typeof existingParameter.defaultValue !== 'undefined') {
6349 parameter.default = existingParameter.defaultValue;
6350 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006351
6352 operation.parameters = operation.parameters || [];
6353 operation.parameters.push(parameter);
6354 }
6355};
6356
6357SwaggerSpecConverter.prototype.dataType = function(source, target) {
Jian Li83d87a72016-04-20 15:38:24 -07006358 if(!_.isObject(source)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006359 return;
6360 }
6361
6362 if(source.minimum) {
6363 target.minimum = source.minimum;
6364 }
6365 if(source.maximum) {
6366 target.maximum = source.maximum;
6367 }
Jian Li83d87a72016-04-20 15:38:24 -07006368 if (source.format) {
6369 target.format = source.format;
6370 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006371
6372 // default can be 'false'
6373 if(typeof source.defaultValue !== 'undefined') {
6374 target.default = source.defaultValue;
6375 }
6376
6377 var jsonSchemaType = this.toJsonSchema(source);
6378 if(jsonSchemaType) {
6379 target = target || {};
6380 if(jsonSchemaType.type) {
6381 target.type = jsonSchemaType.type;
6382 }
6383 if(jsonSchemaType.format) {
6384 target.format = jsonSchemaType.format;
6385 }
6386 if(jsonSchemaType.$ref) {
6387 target.schema = {$ref: jsonSchemaType.$ref};
6388 }
6389 if(jsonSchemaType.items) {
6390 target.items = jsonSchemaType.items;
6391 }
6392 }
6393};
6394
6395SwaggerSpecConverter.prototype.toJsonSchema = function(source) {
6396 if(!source) {
6397 return 'object';
6398 }
6399 var detectedType = (source.type || source.dataType || source.responseClass || '');
6400 var lcType = detectedType.toLowerCase();
6401 var format = (source.format || '').toLowerCase();
6402
6403 if(lcType.indexOf('list[') === 0) {
6404 var innerType = detectedType.substring(5, detectedType.length - 1);
6405 var jsonType = this.toJsonSchema({type: innerType});
6406 return {type: 'array', items: jsonType};
Jian Li83d87a72016-04-20 15:38:24 -07006407 } else if(lcType === 'int' || (lcType === 'integer' && format === 'int32')) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006408 {return {type: 'integer', format: 'int32'};}
Jian Li83d87a72016-04-20 15:38:24 -07006409 } else if(lcType === 'long' || (lcType === 'integer' && format === 'int64')) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006410 {return {type: 'integer', format: 'int64'};}
Jian Li83d87a72016-04-20 15:38:24 -07006411 } else if(lcType === 'integer') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006412 {return {type: 'integer', format: 'int64'};}
Jian Li83d87a72016-04-20 15:38:24 -07006413 } else if(lcType === 'float' || (lcType === 'number' && format === 'float')) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006414 {return {type: 'number', format: 'float'};}
Jian Li83d87a72016-04-20 15:38:24 -07006415 } else if(lcType === 'double' || (lcType === 'number' && format === 'double')) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006416 {return {type: 'number', format: 'double'};}
Jian Li83d87a72016-04-20 15:38:24 -07006417 } else if((lcType === 'string' && format === 'date-time') || (lcType === 'date')) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006418 {return {type: 'string', format: 'date-time'};}
Jian Li83d87a72016-04-20 15:38:24 -07006419 } else if(lcType === 'string') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006420 {return {type: 'string'};}
Jian Li83d87a72016-04-20 15:38:24 -07006421 } else if(lcType === 'file') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006422 {return {type: 'file'};}
Jian Li83d87a72016-04-20 15:38:24 -07006423 } else if(lcType === 'boolean') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006424 {return {type: 'boolean'};}
Jian Li83d87a72016-04-20 15:38:24 -07006425 } else if(lcType === 'boolean') {
6426 {return {type: 'boolean'};}
6427 } else if(lcType === 'array' || lcType === 'list') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006428 if(source.items) {
6429 var it = this.toJsonSchema(source.items);
6430 return {type: 'array', items: it};
6431 }
6432 else {
6433 return {type: 'array', items: {type: 'object'}};
6434 }
Jian Li83d87a72016-04-20 15:38:24 -07006435 } else if(source.$ref) {
6436 return {$ref: this.modelMap[source.$ref] ? '#/definitions/' + this.modelMap[source.$ref] : source.$ref};
6437 } else if(lcType === 'void' || lcType === '') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006438 {return {};}
Jian Li83d87a72016-04-20 15:38:24 -07006439 } else if (this.modelMap[source.type]) {
6440 // If this a model using `type` instead of `$ref`, that's fine.
6441 return {$ref: '#/definitions/' + this.modelMap[source.type]};
6442 } else {
6443 // Unknown model type or 'object', pass it along.
6444 return {type: source.type};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006445 }
6446};
6447
Jian Li83d87a72016-04-20 15:38:24 -07006448SwaggerSpecConverter.prototype.resourceListing = function(obj, swagger, opts, callback) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006449 var i;
6450 var processedCount = 0; // jshint ignore:line
6451 var self = this; // jshint ignore:line
6452 var expectedCount = obj.apis.length;
6453 var _swagger = swagger; // jshint ignore:line
Jian Li83d87a72016-04-20 15:38:24 -07006454 var _opts = {};
6455
6456 if(opts && opts.requestInterceptor){
6457 _opts.requestInterceptor = opts.requestInterceptor;
6458 }
6459
6460 if(opts && opts.responseInterceptor){
6461 _opts.responseInterceptor = opts.responseInterceptor;
6462 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006463
Jian Li8afbbee2016-07-27 19:16:51 +09006464 var swaggerRequestHeaders = 'application/json';
6465
6466 if(opts && opts.swaggerRequestHeaders) {
6467 swaggerRequestHeaders = opts.swaggerRequestHeaders;
6468 }
6469
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006470 if(expectedCount === 0) {
6471 this.finish(callback, swagger);
6472 }
6473
6474 for(i = 0; i < expectedCount; i++) {
6475 var api = obj.apis[i];
6476 var path = api.path;
6477 var absolutePath = this.getAbsolutePath(obj.swaggerVersion, this.docLocation, path);
6478
6479 if(api.description) {
6480 swagger.tags = swagger.tags || [];
6481 swagger.tags.push({
6482 name : this.extractTag(api.path),
6483 description : api.description || ''
6484 });
6485 }
6486 var http = {
6487 url: absolutePath,
Jian Li8afbbee2016-07-27 19:16:51 +09006488 headers: { accept: swaggerRequestHeaders },
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006489 on: {},
Jian Li7f6d0e9e2016-09-27 02:04:49 +09006490 method: 'get',
6491 timeout: opts.timeout
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006492 };
6493 /* jshint ignore:start */
6494 http.on.response = function(data) {
6495 processedCount += 1;
6496 var obj = data.obj;
6497 if(obj) {
6498 self.declaration(obj, _swagger);
6499 }
6500 if(processedCount === expectedCount) {
6501 self.finish(callback, _swagger);
6502 }
6503 };
6504 http.on.error = function(data) {
6505 console.error(data);
6506 processedCount += 1;
6507 if(processedCount === expectedCount) {
6508 self.finish(callback, _swagger);
6509 }
6510 };
6511 /* jshint ignore:end */
6512
6513 if(this.clientAuthorizations && typeof this.clientAuthorizations.apply === 'function') {
6514 this.clientAuthorizations.apply(http);
6515 }
6516
Jian Li83d87a72016-04-20 15:38:24 -07006517 new SwaggerHttp().execute(http, _opts);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006518 }
6519};
6520
6521SwaggerSpecConverter.prototype.getAbsolutePath = function(version, docLocation, path) {
6522 if(version === '1.0') {
6523 if(docLocation.endsWith('.json')) {
6524 // get root path
6525 var pos = docLocation.lastIndexOf('/');
6526 if(pos > 0) {
6527 docLocation = docLocation.substring(0, pos);
6528 }
6529 }
6530 }
6531
6532 var location = docLocation;
Jian Li8afbbee2016-07-27 19:16:51 +09006533 if(path.indexOf('http:') === 0 || path.indexOf('https:') === 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006534 location = path;
6535 }
6536 else {
6537 if(docLocation.endsWith('/')) {
6538 location = docLocation.substring(0, docLocation.length - 1);
6539 }
6540 location += path;
6541 }
6542 location = location.replace('{format}', 'json');
6543 return location;
6544};
6545
6546SwaggerSpecConverter.prototype.securityDefinitions = function(obj, swagger) {
6547 if(obj.authorizations) {
6548 var name;
6549 for(name in obj.authorizations) {
6550 var isValid = false;
Jian Li1c94b9d2017-02-08 15:47:21 +09006551 var securityDefinition = {
6552 vendorExtensions: {}
6553 };
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006554 var definition = obj.authorizations[name];
6555 if(definition.type === 'apiKey') {
6556 securityDefinition.type = 'apiKey';
6557 securityDefinition.in = definition.passAs;
6558 securityDefinition.name = definition.keyname || name;
6559 isValid = true;
6560 }
Jian Li83d87a72016-04-20 15:38:24 -07006561 else if(definition.type === 'basicAuth') {
6562 securityDefinition.type = 'basicAuth';
6563 isValid = true;
6564 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006565 else if(definition.type === 'oauth2') {
6566 var existingScopes = definition.scopes || [];
6567 var scopes = {};
6568 var i;
6569 for(i in existingScopes) {
6570 var scope = existingScopes[i];
6571 scopes[scope.scope] = scope.description;
6572 }
6573 securityDefinition.type = 'oauth2';
6574 if(i > 0) {
6575 securityDefinition.scopes = scopes;
6576 }
6577 if(definition.grantTypes) {
6578 if(definition.grantTypes.implicit) {
6579 var implicit = definition.grantTypes.implicit;
6580 securityDefinition.flow = 'implicit';
6581 securityDefinition.authorizationUrl = implicit.loginEndpoint;
6582 isValid = true;
6583 }
6584 /* jshint ignore:start */
6585 if(definition.grantTypes['authorization_code']) {
6586 if(!securityDefinition.flow) {
6587 // cannot set if flow is already defined
6588 var authCode = definition.grantTypes['authorization_code'];
6589 securityDefinition.flow = 'accessCode';
6590 securityDefinition.authorizationUrl = authCode.tokenRequestEndpoint.url;
6591 securityDefinition.tokenUrl = authCode.tokenEndpoint.url;
6592 isValid = true;
6593 }
6594 }
6595 /* jshint ignore:end */
6596 }
6597 }
6598 if(isValid) {
6599 swagger.securityDefinitions = swagger.securityDefinitions || {};
6600 swagger.securityDefinitions[name] = securityDefinition;
6601 }
6602 }
6603 }
6604};
6605
6606SwaggerSpecConverter.prototype.apiInfo = function(obj, swagger) {
6607 // info section
6608 if(obj.info) {
6609 var info = obj.info;
6610 swagger.info = {};
6611
6612 if(info.contact) {
6613 swagger.info.contact = {};
6614 swagger.info.contact.email = info.contact;
6615 }
6616 if(info.description) {
6617 swagger.info.description = info.description;
6618 }
6619 if(info.title) {
6620 swagger.info.title = info.title;
6621 }
6622 if(info.termsOfServiceUrl) {
6623 swagger.info.termsOfService = info.termsOfServiceUrl;
6624 }
6625 if(info.license || info.licenseUrl) {
6626 swagger.license = {};
6627 if(info.license) {
6628 swagger.license.name = info.license;
6629 }
6630 if(info.licenseUrl) {
6631 swagger.license.url = info.licenseUrl;
6632 }
6633 }
6634 }
6635 else {
6636 this.warnings.push('missing info section');
6637 }
6638};
6639
6640SwaggerSpecConverter.prototype.finish = function (callback, obj) {
6641 callback(obj);
6642};
6643
Jian Li8afbbee2016-07-27 19:16:51 +09006644},{"./http":5,"lodash-compat/lang/isObject":144}],9:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006645'use strict';
6646
Jian Li8afbbee2016-07-27 19:16:51 +09006647var log = require('../helpers').log;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006648var _ = {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006649 isPlainObject: require('lodash-compat/lang/isPlainObject'),
6650 isString: require('lodash-compat/lang/isString'),
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006651};
Jian Li83d87a72016-04-20 15:38:24 -07006652
6653var SchemaMarkup = require('../schema-markup.js');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006654var jsyaml = require('js-yaml');
6655
6656var Model = module.exports = function (name, definition, models, modelPropertyMacro) {
6657 this.definition = definition || {};
6658 this.isArray = definition.type === 'array';
6659 this.models = models || {};
Jian Li8afbbee2016-07-27 19:16:51 +09006660 this.name = name || definition.title || 'Inline Model';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006661 this.modelPropertyMacro = modelPropertyMacro || function (property) {
6662 return property.default;
6663 };
6664
6665 return this;
6666};
6667
Jian Li8afbbee2016-07-27 19:16:51 +09006668// Note! This function will be removed in 2.2.x!
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006669Model.prototype.createJSONSample = Model.prototype.getSampleValue = function (modelsToIgnore) {
6670 modelsToIgnore = modelsToIgnore || {};
6671
6672 modelsToIgnore[this.name] = this;
6673
6674 // Response support
6675 if (this.examples && _.isPlainObject(this.examples) && this.examples['application/json']) {
6676 this.definition.example = this.examples['application/json'];
6677
6678 if (_.isString(this.definition.example)) {
6679 this.definition.example = jsyaml.safeLoad(this.definition.example);
6680 }
6681 } else if (!this.definition.example) {
6682 this.definition.example = this.examples;
6683 }
6684
Jian Li83d87a72016-04-20 15:38:24 -07006685 return SchemaMarkup.schemaToJSON(this.definition, this.models, modelsToIgnore, this.modelPropertyMacro);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006686};
6687
6688Model.prototype.getMockSignature = function () {
Jian Li83d87a72016-04-20 15:38:24 -07006689 return SchemaMarkup.schemaToHTML(this.name, this.definition, this.models, this.modelPropertyMacro);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006690};
6691
Jian Li8afbbee2016-07-27 19:16:51 +09006692},{"../helpers":4,"../schema-markup.js":7,"js-yaml":19,"lodash-compat/lang/isPlainObject":145,"lodash-compat/lang/isString":146}],10:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006693'use strict';
6694
6695var _ = {
6696 cloneDeep: require('lodash-compat/lang/cloneDeep'),
6697 isUndefined: require('lodash-compat/lang/isUndefined'),
Jian Li83d87a72016-04-20 15:38:24 -07006698 isEmpty: require('lodash-compat/lang/isEmpty'),
6699 isObject: require('lodash-compat/lang/isObject')
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006700};
6701var helpers = require('../helpers');
6702var Model = require('./model');
6703var SwaggerHttp = require('../http');
Jian Li83d87a72016-04-20 15:38:24 -07006704var Q = require('q');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006705
6706var Operation = module.exports = function (parent, scheme, operationId, httpMethod, path, args, definitions, models, clientAuthorizations) {
6707 var errors = [];
6708
6709 parent = parent || {};
6710 args = args || {};
6711
6712 if(parent && parent.options) {
6713 this.client = parent.options.client || null;
Jian Li83d87a72016-04-20 15:38:24 -07006714 this.requestInterceptor = parent.options.requestInterceptor || null;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006715 this.responseInterceptor = parent.options.responseInterceptor || null;
Jian Li1c94b9d2017-02-08 15:47:21 +09006716 this.requestAgent = parent.options.requestAgent;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006717 }
6718 this.authorizations = args.security;
6719 this.basePath = parent.basePath || '/';
6720 this.clientAuthorizations = clientAuthorizations;
6721 this.consumes = args.consumes || parent.consumes || ['application/json'];
6722 this.produces = args.produces || parent.produces || ['application/json'];
6723 this.deprecated = args.deprecated;
6724 this.description = args.description;
Jian Li7f6d0e9e2016-09-27 02:04:49 +09006725 this.host = parent.host;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006726 this.method = (httpMethod || errors.push('Operation ' + operationId + ' is missing method.'));
6727 this.models = models || {};
6728 this.nickname = (operationId || errors.push('Operations must have a nickname.'));
6729 this.operation = args;
6730 this.operations = {};
6731 this.parameters = args !== null ? (args.parameters || []) : {};
6732 this.parent = parent;
6733 this.path = (path || errors.push('Operation ' + this.nickname + ' is missing path.'));
6734 this.responses = (args.responses || {});
6735 this.scheme = scheme || parent.scheme || 'http';
Jian Li83d87a72016-04-20 15:38:24 -07006736 this.schemes = args.schemes || parent.schemes;
Jian Li8afbbee2016-07-27 19:16:51 +09006737 this.security = args.security || parent.security;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006738 this.summary = args.summary || '';
Jian Li7f6d0e9e2016-09-27 02:04:49 +09006739 this.timeout = parent.timeout;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006740 this.type = null;
6741 this.useJQuery = parent.useJQuery;
Jian Li8afbbee2016-07-27 19:16:51 +09006742 this.jqueryAjaxCache = parent.jqueryAjaxCache;
Jian Li83d87a72016-04-20 15:38:24 -07006743 this.enableCookies = parent.enableCookies;
Jian Li7f6d0e9e2016-09-27 02:04:49 +09006744
Jian Li1c94b9d2017-02-08 15:47:21 +09006745 var key;
6746
Jian Li7f6d0e9e2016-09-27 02:04:49 +09006747 if(!this.host) {
6748 if(typeof window !== 'undefined') {
6749 this.host = window.location.host;
6750 }
6751 else {
6752 this.host = 'localhost';
6753 }
6754 }
Jian Li83d87a72016-04-20 15:38:24 -07006755 this.parameterMacro = parent.parameterMacro || function (operation, parameter) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006756 return parameter.default;
6757 };
6758
6759 this.inlineModels = [];
6760
Jian Li8afbbee2016-07-27 19:16:51 +09006761 if(this.basePath !== '/' && this.basePath.slice(-1) === '/') {
6762 this.basePath = this.basePath.slice(0, -1);
6763 }
6764
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006765 if (typeof this.deprecated === 'string') {
6766 switch(this.deprecated.toLowerCase()) {
6767 case 'true': case 'yes': case '1': {
6768 this.deprecated = true;
6769 break;
6770 }
6771
6772 case 'false': case 'no': case '0': case null: {
6773 this.deprecated = false;
6774 break;
6775 }
6776
6777 default: this.deprecated = Boolean(this.deprecated);
6778 }
6779 }
6780
6781 var i, model;
6782
6783 if (definitions) {
6784 // add to global models
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006785 for (key in definitions) {
6786 model = new Model(key, definitions[key], this.models, parent.modelPropertyMacro);
6787
6788 if (model) {
6789 this.models[key] = model;
6790 }
6791 }
6792 }
Jian Li83d87a72016-04-20 15:38:24 -07006793 else {
6794 definitions = {};
6795 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006796
6797 for (i = 0; i < this.parameters.length; i++) {
Jian Li1c94b9d2017-02-08 15:47:21 +09006798 var d, param = this.parameters[i];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006799
6800 // Allow macro to set the default value
Jian Li83d87a72016-04-20 15:38:24 -07006801 param.default = this.parameterMacro(this, param);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006802
6803 if (param.type === 'array') {
6804 param.isList = true;
6805 param.allowMultiple = true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006806 }
6807
6808 var innerType = this.getType(param);
6809
6810 if (innerType && innerType.toString().toLowerCase() === 'boolean') {
6811 param.allowableValues = {};
6812 param.isList = true;
6813 param['enum'] = [true, false]; // use actual primitives
6814 }
6815
Jian Li1c94b9d2017-02-08 15:47:21 +09006816 for(key in param) {
6817 helpers.extractExtensions(key, param);
6818 }
Jian Li83d87a72016-04-20 15:38:24 -07006819 if(typeof param['x-example'] !== 'undefined') {
Jian Li1c94b9d2017-02-08 15:47:21 +09006820 d = param['x-example'];
Jian Li83d87a72016-04-20 15:38:24 -07006821 param.default = d;
6822 }
6823 if(param['x-examples']) {
Jian Li1c94b9d2017-02-08 15:47:21 +09006824 d = param['x-examples'].default;
Jian Li83d87a72016-04-20 15:38:24 -07006825 if(typeof d !== 'undefined') {
6826 param.default = d;
6827 }
6828 }
6829
Jian Li8afbbee2016-07-27 19:16:51 +09006830 var enumValues = param['enum'] || (param.items && param.items['enum']);
6831
6832 if (typeof enumValues !== 'undefined') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006833 var id;
6834
6835 param.allowableValues = {};
6836 param.allowableValues.values = [];
6837 param.allowableValues.descriptiveValues = [];
6838
Jian Li8afbbee2016-07-27 19:16:51 +09006839 for (id = 0; id < enumValues.length; id++) {
6840 var value = enumValues[id];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006841 var isDefault = (value === param.default || value+'' === param.default);
6842
6843 param.allowableValues.values.push(value);
6844 // Always have string for descriptive values....
6845 param.allowableValues.descriptiveValues.push({value : value+'', isDefault: isDefault});
6846 }
6847 }
6848
6849 if (param.type === 'array') {
6850 innerType = [innerType];
6851
6852 if (typeof param.allowableValues === 'undefined') {
6853 // can't show as a list if no values to select from
6854 delete param.isList;
6855 delete param.allowMultiple;
6856 }
6857 }
6858
Jian Li8afbbee2016-07-27 19:16:51 +09006859 param.modelSignature = {type: innerType, definitions: this.models};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006860 param.signature = this.getModelSignature(innerType, this.models).toString();
6861 param.sampleJSON = this.getModelSampleJSON(innerType, this.models);
6862 param.responseClassSignature = param.signature;
6863 }
6864
Jian Li1c94b9d2017-02-08 15:47:21 +09006865 var keyname, defaultResponseCode, response, responses = this.responses;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006866
6867 if (responses['200']) {
6868 response = responses['200'];
6869 defaultResponseCode = '200';
6870 } else if (responses['201']) {
6871 response = responses['201'];
6872 defaultResponseCode = '201';
6873 } else if (responses['202']) {
6874 response = responses['202'];
6875 defaultResponseCode = '202';
6876 } else if (responses['203']) {
6877 response = responses['203'];
6878 defaultResponseCode = '203';
6879 } else if (responses['204']) {
6880 response = responses['204'];
6881 defaultResponseCode = '204';
6882 } else if (responses['205']) {
6883 response = responses['205'];
6884 defaultResponseCode = '205';
6885 } else if (responses['206']) {
6886 response = responses['206'];
6887 defaultResponseCode = '206';
6888 } else if (responses['default']) {
6889 response = responses['default'];
6890 defaultResponseCode = 'default';
6891 }
6892
Jian Li1c94b9d2017-02-08 15:47:21 +09006893 for(keyname in responses) {
6894 helpers.extractExtensions(keyname, responses);
6895 if(typeof keyname === 'string' && keyname.indexOf('x-') === -1) {
6896 var responseObject = responses[keyname];
6897 if(typeof responseObject === 'object' && typeof responseObject.headers === 'object') {
6898 var headers = responseObject.headers;
6899 for(var headerName in headers) {
6900 var header = headers[headerName];
6901 if(typeof header === 'object') {
6902 for(var headerKey in header) {
6903 helpers.extractExtensions(headerKey, header);
6904 }
6905 }
6906 }
6907 }
6908 }
6909 }
6910
6911 if (response) {
6912 for(keyname in response) {
6913 helpers.extractExtensions(keyname, response);
6914 }
6915 }
6916
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006917 if (response && response.schema) {
6918 var resolvedModel = this.resolveModel(response.schema, definitions);
6919 var successResponse;
6920
6921 delete responses[defaultResponseCode];
6922
6923 if (resolvedModel) {
6924 this.successResponse = {};
6925 successResponse = this.successResponse[defaultResponseCode] = resolvedModel;
6926 } else if (!response.schema.type || response.schema.type === 'object' || response.schema.type === 'array') {
6927 // Inline model
6928 this.successResponse = {};
6929 successResponse = this.successResponse[defaultResponseCode] = new Model(undefined, response.schema || {}, this.models, parent.modelPropertyMacro);
6930 } else {
6931 // Primitive
6932 this.successResponse = {};
6933 successResponse = this.successResponse[defaultResponseCode] = response.schema;
6934 }
6935
6936 if (successResponse) {
Jian Li1c94b9d2017-02-08 15:47:21 +09006937 successResponse.vendorExtensions = response.vendorExtensions;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07006938 // Attach response properties
6939 if (response.description) {
6940 successResponse.description = response.description;
6941 }
6942
6943 if (response.examples) {
6944 successResponse.examples = response.examples;
6945 }
6946
6947 if (response.headers) {
6948 successResponse.headers = response.headers;
6949 }
6950 }
6951
6952 this.type = response;
6953 }
6954
6955 if (errors.length > 0) {
6956 if (this.resource && this.resource.api && this.resource.api.fail) {
6957 this.resource.api.fail(errors);
6958 }
6959 }
6960
6961 return this;
6962};
6963
6964Operation.prototype.isDefaultArrayItemValue = function(value, param) {
6965 if (param.default && Array.isArray(param.default)) {
6966 return param.default.indexOf(value) !== -1;
6967 }
6968 return value === param.default;
6969};
6970
6971Operation.prototype.getType = function (param) {
6972 var type = param.type;
6973 var format = param.format;
6974 var isArray = false;
6975 var str;
6976
6977 if (type === 'integer' && format === 'int32') {
6978 str = 'integer';
6979 } else if (type === 'integer' && format === 'int64') {
6980 str = 'long';
6981 } else if (type === 'integer') {
6982 str = 'integer';
6983 } else if (type === 'string') {
6984 if (format === 'date-time') {
6985 str = 'date-time';
6986 } else if (format === 'date') {
6987 str = 'date';
6988 } else {
6989 str = 'string';
6990 }
6991 } else if (type === 'number' && format === 'float') {
6992 str = 'float';
6993 } else if (type === 'number' && format === 'double') {
6994 str = 'double';
6995 } else if (type === 'number') {
6996 str = 'double';
6997 } else if (type === 'boolean') {
6998 str = 'boolean';
6999 } else if (type === 'array') {
7000 isArray = true;
7001
7002 if (param.items) {
7003 str = this.getType(param.items);
7004 }
Jian Li83d87a72016-04-20 15:38:24 -07007005 } else if (type === 'file') {
7006 str = 'file';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007007 }
7008
7009 if (param.$ref) {
7010 str = helpers.simpleRef(param.$ref);
7011 }
7012
7013 var schema = param.schema;
7014
7015 if (schema) {
7016 var ref = schema.$ref;
7017
7018 if (ref) {
7019 ref = helpers.simpleRef(ref);
7020
7021 if (isArray) {
7022 return [ ref ];
7023 } else {
7024 return ref;
7025 }
7026 } else {
7027 // If inline schema, we add it our interal hash -> which gives us it's ID (int)
7028 if(schema.type === 'object') {
7029 return this.addInlineModel(schema);
7030 }
7031 return this.getType(schema);
7032 }
7033 }
7034 if (isArray) {
7035 return [ str ];
7036 } else {
7037 return str;
7038 }
7039};
7040
7041/**
7042 * adds an inline schema (model) to a hash, where we can ref it later
7043 * @param {object} schema a schema
7044 * @return {number} the ID of the schema being added, or null
7045 **/
7046Operation.prototype.addInlineModel = function (schema) {
7047 var len = this.inlineModels.length;
7048 var model = this.resolveModel(schema, {});
7049 if(model) {
7050 this.inlineModels.push(model);
7051 return 'Inline Model '+len; // return string ref of the inline model (used with #getInlineModel)
7052 }
7053 return null; // report errors?
7054};
7055
7056/**
7057 * gets the internal ref to an inline model
7058 * @param {string} inline_str a string reference to an inline model
7059 * @return {Model} the model being referenced. Or null
7060 **/
7061Operation.prototype.getInlineModel = function(inlineStr) {
7062 if(/^Inline Model \d+$/.test(inlineStr)) {
7063 var id = parseInt(inlineStr.substr('Inline Model'.length).trim(),10); //
7064 var model = this.inlineModels[id];
7065 return model;
7066 }
7067 // I'm returning null here, should I rather throw an error?
7068 return null;
7069};
7070
7071Operation.prototype.resolveModel = function (schema, definitions) {
7072 if (typeof schema.$ref !== 'undefined') {
7073 var ref = schema.$ref;
7074
7075 if (ref.indexOf('#/definitions/') === 0) {
7076 ref = ref.substring('#/definitions/'.length);
7077 }
7078
7079 if (definitions[ref]) {
7080 return new Model(ref, definitions[ref], this.models, this.parent.modelPropertyMacro);
7081 }
7082 // schema must at least be an object to get resolved to an inline Model
7083 } else if (schema && typeof schema === 'object' &&
7084 (schema.type === 'object' || _.isUndefined(schema.type))) {
7085 return new Model(undefined, schema, this.models, this.parent.modelPropertyMacro);
7086 }
7087
7088 return null;
7089};
7090
7091Operation.prototype.help = function (dontPrint) {
7092 var out = this.nickname + ': ' + this.summary + '\n';
7093
7094 for (var i = 0; i < this.parameters.length; i++) {
7095 var param = this.parameters[i];
7096 var typeInfo = param.signature;
7097
7098 out += '\n * ' + param.name + ' (' + typeInfo + '): ' + param.description;
7099 }
7100
7101 if (typeof dontPrint === 'undefined') {
7102 helpers.log(out);
7103 }
7104
7105 return out;
7106};
7107
7108Operation.prototype.getModelSignature = function (type, definitions) {
7109 var isPrimitive, listType;
7110
7111 if (type instanceof Array) {
7112 listType = true;
7113 type = type[0];
7114 }
7115
7116 // Convert undefined to string of 'undefined'
7117 if (typeof type === 'undefined') {
7118 type = 'undefined';
7119 isPrimitive = true;
7120
7121 } else if (definitions[type]){
7122 // a model def exists?
7123 type = definitions[type]; /* Model */
7124 isPrimitive = false;
7125
7126 } else if (this.getInlineModel(type)) {
7127 type = this.getInlineModel(type); /* Model */
7128 isPrimitive = false;
7129
7130 } else {
7131 // We default to primitive
7132 isPrimitive = true;
7133 }
7134
7135 if (isPrimitive) {
7136 if (listType) {
7137 return 'Array[' + type + ']';
7138 } else {
7139 return type.toString();
7140 }
7141 } else {
7142 if (listType) {
7143 return 'Array[' + type.getMockSignature() + ']';
7144 } else {
7145 return type.getMockSignature();
7146 }
7147 }
7148};
7149
7150Operation.prototype.supportHeaderParams = function () {
7151 return true;
7152};
7153
7154Operation.prototype.supportedSubmitMethods = function () {
7155 return this.parent.supportedSubmitMethods;
7156};
7157
7158Operation.prototype.getHeaderParams = function (args) {
7159 var headers = this.setContentTypes(args, {});
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007160 var headerParamsByLowerCase = {};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007161
7162 for (var i = 0; i < this.parameters.length; i++) {
7163 var param = this.parameters[i];
7164
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007165 if (param.in === 'header') {
7166 headerParamsByLowerCase[param.name.toLowerCase()] = param;
7167 }
7168 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007169
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007170 for (var arg in args) {
7171 var headerParam = headerParamsByLowerCase[arg.toLowerCase()];
7172 if (typeof headerParam !== 'undefined') {
7173 var value = args[arg];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007174
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007175 if (Array.isArray(value)) {
7176 value = value.toString();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007177 }
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007178
7179 headers[headerParam.name] = value;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007180 }
7181 }
7182
7183 return headers;
7184};
7185
Jian Li1c94b9d2017-02-08 15:47:21 +09007186Operation.prototype.urlify = function (args, maskPasswords) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007187 var formParams = {};
Jian Li8afbbee2016-07-27 19:16:51 +09007188 var requestUrl = this.path.replace(/#.*/, ''); // remove URL fragment
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007189 var querystring = ''; // grab params from the args, build the querystring along the way
7190
7191 for (var i = 0; i < this.parameters.length; i++) {
7192 var param = this.parameters[i];
7193
7194 if (typeof args[param.name] !== 'undefined') {
Jian Li1c94b9d2017-02-08 15:47:21 +09007195 var isPassword;
7196 if(param.type === 'string' && param.format === 'password' && maskPasswords) {
7197 isPassword = true;
7198 }
7199
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007200 if (param.in === 'path') {
7201 var reg = new RegExp('\{' + param.name + '\}', 'gi');
7202 var value = args[param.name];
7203
7204 if (Array.isArray(value)) {
Jian Li1c94b9d2017-02-08 15:47:21 +09007205 value = this.encodePathCollection(param.collectionFormat, param.name, value, isPassword);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007206 } else {
Jian Li1c94b9d2017-02-08 15:47:21 +09007207 value = this.encodePathParam(value, isPassword);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007208 }
7209
7210 requestUrl = requestUrl.replace(reg, value);
7211 } else if (param.in === 'query' && typeof args[param.name] !== 'undefined') {
Jian Li8afbbee2016-07-27 19:16:51 +09007212 if (querystring === '' && requestUrl.indexOf('?') < 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007213 querystring += '?';
7214 } else {
7215 querystring += '&';
7216 }
7217
7218 if (typeof param.collectionFormat !== 'undefined') {
7219 var qp = args[param.name];
7220
7221 if (Array.isArray(qp)) {
Jian Li1c94b9d2017-02-08 15:47:21 +09007222 querystring += this.encodeQueryCollection(param.collectionFormat, param.name, qp, isPassword);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007223 } else {
Jian Li1c94b9d2017-02-08 15:47:21 +09007224 querystring += this.encodeQueryKey(param.name) + '=' + this.encodeQueryParam(args[param.name], isPassword);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007225 }
7226 } else {
Jian Li1c94b9d2017-02-08 15:47:21 +09007227 querystring += this.encodeQueryKey(param.name) + '=' + this.encodeQueryParam(args[param.name], isPassword);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007228 }
7229 } else if (param.in === 'formData') {
7230 formParams[param.name] = args[param.name];
7231 }
7232 }
7233 }
7234 var url = this.scheme + '://' + this.host;
7235
7236 if (this.basePath !== '/') {
7237 url += this.basePath;
7238 }
7239 return url + requestUrl + querystring;
7240};
7241
7242Operation.prototype.getMissingParams = function (args) {
7243 var missingParams = []; // check required params, track the ones that are missing
7244 var i;
7245
7246 for (i = 0; i < this.parameters.length; i++) {
7247 var param = this.parameters[i];
7248
7249 if (param.required === true) {
7250 if (typeof args[param.name] === 'undefined') {
7251 missingParams = param.name;
7252 }
7253 }
7254 }
7255
7256 return missingParams;
7257};
7258
7259Operation.prototype.getBody = function (headers, args, opts) {
Jian Li1c94b9d2017-02-08 15:47:21 +09007260 var formParams = {}, hasFormParams, param, body, key, value, hasBody = false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007261
Jian Li83d87a72016-04-20 15:38:24 -07007262 // look at each param and put form params in an object
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007263 for (var i = 0; i < this.parameters.length; i++) {
Jian Li1c94b9d2017-02-08 15:47:21 +09007264 param = this.parameters[i];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007265 if (typeof args[param.name] !== 'undefined') {
Jian Li1c94b9d2017-02-08 15:47:21 +09007266 var isPassword;
7267 if(param.type === 'string' && param.format === 'password') {
7268 isPassword = 'password';
7269 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007270 if (param.in === 'body') {
7271 body = args[param.name];
7272 } else if (param.in === 'formData') {
Jian Li8afbbee2016-07-27 19:16:51 +09007273 formParams[param.name] = {
7274 param: param,
Jian Li1c94b9d2017-02-08 15:47:21 +09007275 value: args[param.name],
7276 password: isPassword
Jian Li8afbbee2016-07-27 19:16:51 +09007277 };
Jian Li83d87a72016-04-20 15:38:24 -07007278 hasFormParams = true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007279 }
7280 }
7281 else {
7282 if(param.in === 'body') {
7283 hasBody = true;
7284 }
7285 }
7286 }
7287
7288 // if body is null and hasBody is true, AND a JSON body is requested, send empty {}
7289 if(hasBody && typeof body === 'undefined') {
7290 var contentType = headers['Content-Type'];
7291 if(contentType && contentType.indexOf('application/json') === 0) {
7292 body = '{}';
7293 }
7294 }
7295
Jian Li83d87a72016-04-20 15:38:24 -07007296 var isMultiPart = false;
7297 if(headers['Content-Type'] && headers['Content-Type'].indexOf('multipart/form-data') >= 0) {
7298 isMultiPart = true;
7299 }
7300
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007301 // handle form params
Jian Li83d87a72016-04-20 15:38:24 -07007302 if (hasFormParams && !isMultiPart) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007303 var encoded = '';
7304
7305 for (key in formParams) {
Jian Li1c94b9d2017-02-08 15:47:21 +09007306 param = formParams[key].param;
Jian Li8afbbee2016-07-27 19:16:51 +09007307 value = formParams[key].value;
Jian Li1c94b9d2017-02-08 15:47:21 +09007308 var password;
7309
7310 if(opts && opts.maskPasswords) {
7311 password = formParams[key].password;
7312 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007313
7314 if (typeof value !== 'undefined') {
Jian Li8afbbee2016-07-27 19:16:51 +09007315 if (Array.isArray(value)) {
7316 if (encoded !== '') {
7317 encoded += '&';
7318 }
Jian Li1c94b9d2017-02-08 15:47:21 +09007319 encoded += this.encodeQueryCollection(param.collectionFormat, key, value, password);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007320 }
Jian Li8afbbee2016-07-27 19:16:51 +09007321 else {
7322 if (encoded !== '') {
7323 encoded += '&';
7324 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007325
Jian Li1c94b9d2017-02-08 15:47:21 +09007326 encoded += encodeURIComponent(key) + '=' + mask(encodeURIComponent(value), password);
Jian Li8afbbee2016-07-27 19:16:51 +09007327 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007328 }
7329 }
7330
7331 body = encoded;
Jian Li83d87a72016-04-20 15:38:24 -07007332 } else if (isMultiPart) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007333 var bodyParam;
Jian Li8afbbee2016-07-27 19:16:51 +09007334 if (typeof FormData === 'function') {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007335 bodyParam = new FormData();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007336
7337 bodyParam.type = 'formData';
7338
7339 for (key in formParams) {
Jian Li1c94b9d2017-02-08 15:47:21 +09007340 param = formParams[key].param;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007341 value = args[key];
7342
7343 if (typeof value !== 'undefined') {
Jian Li8afbbee2016-07-27 19:16:51 +09007344 if({}.toString.apply(value) === '[object File]') {
7345 bodyParam.append(key, value);
7346 }
7347 else if (value.type === 'file' && value.value) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007348 bodyParam.append(key, value.value);
7349 } else {
Jian Li8afbbee2016-07-27 19:16:51 +09007350 if (Array.isArray(value)) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007351 if(param.collectionFormat === 'multi') {
7352 bodyParam.delete(key);
7353 for(var v in value) {
7354 bodyParam.append(key, value[v]);
7355 }
7356 }
7357 else {
7358 bodyParam.append(key, this.encodeQueryCollection(param.collectionFormat, key, value).split('=').slice(1).join('='));
7359 }
Jian Li8afbbee2016-07-27 19:16:51 +09007360 }
7361 else {
7362 bodyParam.append(key, value);
7363 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007364 }
7365 }
7366 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007367 body = bodyParam;
7368 }
Jian Li8afbbee2016-07-27 19:16:51 +09007369 else {
7370 bodyParam = {};
7371 for (key in formParams) {
7372 value = args[key];
7373 if (Array.isArray(value)) {
7374 var delimeter;
7375 var format = param.collectionFormat || 'multi';
7376 if(format === 'ssv') {
7377 delimeter = ' ';
7378 }
7379 else if(format === 'pipes') {
7380 delimeter = '|';
7381 }
7382 else if(format === 'tsv') {
7383 delimeter = '\t';
7384 }
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007385 else if(format === 'multi') {
7386 bodyParam[key] = value;
7387 break;
7388 }
Jian Li8afbbee2016-07-27 19:16:51 +09007389 else {
7390 delimeter = ',';
7391 }
7392 var data;
7393 value.forEach(function(v) {
7394 if(data) {
7395 data += delimeter;
7396 }
7397 else {
7398 data = '';
7399 }
7400 data += v;
7401 });
7402 bodyParam[key] = data;
7403 }
7404 else {
7405 bodyParam[key] = value;
7406 }
7407 }
7408 body = bodyParam;
7409 }
7410 headers['Content-Type'] = 'multipart/form-data';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007411 }
7412
7413 return body;
7414};
7415
7416/**
7417 * gets sample response for a single operation
7418 **/
7419Operation.prototype.getModelSampleJSON = function (type, models) {
7420 var listType, sampleJson, innerType;
7421 models = models || {};
7422
7423 listType = (type instanceof Array);
7424 innerType = listType ? type[0] : type;
7425
7426 if(models[innerType]) {
7427 sampleJson = models[innerType].createJSONSample();
7428 } else if (this.getInlineModel(innerType)){
7429 sampleJson = this.getInlineModel(innerType).createJSONSample(); // may return null, if type isn't correct
7430 }
7431
7432
7433 if (sampleJson) {
7434 sampleJson = listType ? [sampleJson] : sampleJson;
7435
7436 if (typeof sampleJson === 'string') {
7437 return sampleJson;
Jian Li83d87a72016-04-20 15:38:24 -07007438 } else if (_.isObject(sampleJson)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007439 var t = sampleJson;
7440
7441 if (sampleJson instanceof Array && sampleJson.length > 0) {
7442 t = sampleJson[0];
7443 }
7444
Jian Li83d87a72016-04-20 15:38:24 -07007445 if (t.nodeName && typeof t === 'Node') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007446 var xmlString = new XMLSerializer().serializeToString(t);
7447
7448 return this.formatXml(xmlString);
7449 } else {
7450 return JSON.stringify(sampleJson, null, 2);
7451 }
7452 } else {
7453 return sampleJson;
7454 }
7455 }
7456};
7457
7458/**
7459 * legacy binding
7460 **/
7461Operation.prototype.do = function (args, opts, callback, error, parent) {
7462 return this.execute(args, opts, callback, error, parent);
7463};
7464
7465/**
7466 * executes an operation
7467 **/
7468Operation.prototype.execute = function (arg1, arg2, arg3, arg4, parent) {
7469 var args = arg1 || {};
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007470 var opts = {}, success, error, deferred, timeout;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007471
Jian Li83d87a72016-04-20 15:38:24 -07007472 if (_.isObject(arg2)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007473 opts = arg2;
7474 success = arg3;
7475 error = arg4;
7476 }
7477
Jian Li1c94b9d2017-02-08 15:47:21 +09007478 timeout = typeof opts.timeout !== 'undefined' ? opts.timeout : this.timeout;
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007479
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007480 if(this.client) {
7481 opts.client = this.client;
7482 }
Jian Li83d87a72016-04-20 15:38:24 -07007483
Jian Li1c94b9d2017-02-08 15:47:21 +09007484 if(this.requestAgent) {
7485 opts.requestAgent = this.requestAgent;
7486 }
7487
Jian Li83d87a72016-04-20 15:38:24 -07007488 // add the request interceptor from parent, if none sent from client
7489 if(!opts.requestInterceptor && this.requestInterceptor ) {
7490 opts.requestInterceptor = this.requestInterceptor ;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007491 }
7492
Jian Li83d87a72016-04-20 15:38:24 -07007493 if(!opts.responseInterceptor && this.responseInterceptor) {
7494 opts.responseInterceptor = this.responseInterceptor;
7495 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007496
7497 if (typeof arg2 === 'function') {
7498 success = arg2;
7499 error = arg3;
7500 }
7501
Jian Li83d87a72016-04-20 15:38:24 -07007502 if (this.parent.usePromise) {
7503 deferred = Q.defer();
7504 } else {
7505 success = (success || this.parent.defaultSuccessCallback || helpers.log);
7506 error = (error || this.parent.defaultErrorCallback || helpers.log);
7507 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007508
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007509 if (typeof opts.useJQuery === 'undefined') {
7510 opts.useJQuery = this.useJQuery;
7511 }
Jian Li83d87a72016-04-20 15:38:24 -07007512
Jian Li8afbbee2016-07-27 19:16:51 +09007513 if (typeof opts.jqueryAjaxCache === 'undefined') {
7514 opts.jqueryAjaxCache = this.jqueryAjaxCache;
7515 }
7516
Jian Li83d87a72016-04-20 15:38:24 -07007517 if (typeof opts.enableCookies === 'undefined') {
7518 opts.enableCookies = this.enableCookies;
7519 }
7520
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007521 var missingParams = this.getMissingParams(args);
7522
7523 if (missingParams.length > 0) {
7524 var message = 'missing required params: ' + missingParams;
7525
7526 helpers.fail(message);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007527
Jian Li83d87a72016-04-20 15:38:24 -07007528 if (this.parent.usePromise) {
7529 deferred.reject(message);
7530 return deferred.promise;
7531 } else {
7532 error(message, parent);
7533 return {};
7534 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007535 }
7536
7537 var allHeaders = this.getHeaderParams(args);
7538 var contentTypeHeaders = this.setContentTypes(args, opts);
7539 var headers = {}, attrname;
7540
7541 for (attrname in allHeaders) { headers[attrname] = allHeaders[attrname]; }
7542 for (attrname in contentTypeHeaders) { headers[attrname] = contentTypeHeaders[attrname]; }
7543
7544 var body = this.getBody(contentTypeHeaders, args, opts);
Jian Li1c94b9d2017-02-08 15:47:21 +09007545 var url = this.urlify(args, opts.maskPasswords);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007546
7547 if(url.indexOf('.{format}') > 0) {
7548 if(headers) {
7549 var format = headers.Accept || headers.accept;
7550 if(format && format.indexOf('json') > 0) {
7551 url = url.replace('.{format}', '.json');
7552 }
7553 else if(format && format.indexOf('xml') > 0) {
7554 url = url.replace('.{format}', '.xml');
7555 }
7556 }
7557 }
7558
7559 var obj = {
7560 url: url,
7561 method: this.method.toUpperCase(),
7562 body: body,
Jian Li83d87a72016-04-20 15:38:24 -07007563 enableCookies: opts.enableCookies,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007564 useJQuery: opts.useJQuery,
Jian Li8afbbee2016-07-27 19:16:51 +09007565 jqueryAjaxCache: opts.jqueryAjaxCache,
Jian Li83d87a72016-04-20 15:38:24 -07007566 deferred: deferred,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007567 headers: headers,
Jian Li8afbbee2016-07-27 19:16:51 +09007568 clientAuthorizations: opts.clientAuthorizations,
Jian Li1c94b9d2017-02-08 15:47:21 +09007569 operation: this,
7570 connectionAgent: this.connectionAgent,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007571 on: {
7572 response: function (response) {
Jian Li83d87a72016-04-20 15:38:24 -07007573 if (deferred) {
7574 deferred.resolve(response);
7575 return deferred.promise;
7576 } else {
7577 return success(response, parent);
7578 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007579 },
7580 error: function (response) {
Jian Li83d87a72016-04-20 15:38:24 -07007581 if (deferred) {
7582 deferred.reject(response);
7583 return deferred.promise;
7584 } else {
7585 return error(response, parent);
7586 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007587 }
7588 }
7589 };
7590
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007591 if (timeout) {
7592 obj.timeout = timeout;
7593 }
7594
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007595 this.clientAuthorizations.apply(obj, this.operation.security);
7596 if (opts.mock === true) {
7597 return obj;
7598 } else {
Jian Li83d87a72016-04-20 15:38:24 -07007599 return new SwaggerHttp().execute(obj, opts);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007600 }
7601};
7602
7603function itemByPriority(col, itemPriority) {
7604
7605 // No priorities? return first...
7606 if(_.isEmpty(itemPriority)) {
7607 return col[0];
7608 }
7609
7610 for (var i = 0, len = itemPriority.length; i < len; i++) {
7611 if(col.indexOf(itemPriority[i]) > -1) {
7612 return itemPriority[i];
7613 }
7614 }
7615
7616 // Otherwise return first
7617 return col[0];
7618}
7619
7620Operation.prototype.setContentTypes = function (args, opts) {
7621 // default type
7622 var allDefinedParams = this.parameters;
7623 var body;
7624 var consumes = args.parameterContentType || itemByPriority(this.consumes, ['application/json', 'application/yaml']);
7625 var accepts = opts.responseContentType || itemByPriority(this.produces, ['application/json', 'application/yaml']);
7626 var definedFileParams = [];
7627 var definedFormParams = [];
7628 var headers = {};
7629 var i;
7630
7631 // get params from the operation and set them in definedFileParams, definedFormParams, headers
7632 for (i = 0; i < allDefinedParams.length; i++) {
7633 var param = allDefinedParams[i];
7634
7635 if (param.in === 'formData') {
7636 if (param.type === 'file') {
7637 definedFileParams.push(param);
7638 } else {
7639 definedFormParams.push(param);
7640 }
7641 } else if (param.in === 'header' && opts) {
7642 var key = param.name;
7643 var headerValue = opts[param.name];
7644
7645 if (typeof opts[param.name] !== 'undefined') {
7646 headers[key] = headerValue;
7647 }
7648 } else if (param.in === 'body' && typeof args[param.name] !== 'undefined') {
7649 body = args[param.name];
7650 }
7651 }
7652
7653 // if there's a body, need to set the consumes header via requestContentType
Jian Li8afbbee2016-07-27 19:16:51 +09007654 var hasBody = body || definedFileParams.length || definedFormParams.length;
Jian Li83d87a72016-04-20 15:38:24 -07007655 if (this.method === 'post' || this.method === 'put' || this.method === 'patch' ||
Jian Li8afbbee2016-07-27 19:16:51 +09007656 ((this.method === 'delete' || this.method === 'get') && hasBody)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007657 if (opts.requestContentType) {
7658 consumes = opts.requestContentType;
7659 }
7660 // if any form params, content type must be set
7661 if (definedFormParams.length > 0) {
Jian Li8afbbee2016-07-27 19:16:51 +09007662 consumes = undefined;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007663 if (opts.requestContentType) { // override if set
7664 consumes = opts.requestContentType;
7665 } else if (definedFileParams.length > 0) { // if a file, must be multipart/form-data
7666 consumes = 'multipart/form-data';
Jian Li8afbbee2016-07-27 19:16:51 +09007667 } else {
7668 if (this.consumes && this.consumes.length > 0) {
7669 // use the consumes setting
7670 for(var c in this.consumes) {
7671 var chk = this.consumes[c];
7672 if(chk.indexOf('application/x-www-form-urlencoded') === 0 || chk.indexOf('multipart/form-data') === 0) {
7673 consumes = chk;
7674 }
7675 }
7676 }
7677 }
7678 if(typeof consumes === 'undefined') {
7679 // default to x-www-from-urlencoded
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007680 consumes = 'application/x-www-form-urlencoded';
7681 }
7682 }
7683 }
7684 else {
7685 consumes = null;
7686 }
7687
7688 if (consumes && this.consumes) {
7689 if (this.consumes.indexOf(consumes) === -1) {
7690 helpers.log('server doesn\'t consume ' + consumes + ', try ' + JSON.stringify(this.consumes));
7691 }
7692 }
7693
7694 if (!this.matchesAccept(accepts)) {
7695 helpers.log('server can\'t produce ' + accepts);
7696 }
7697
7698 if ((consumes && body !== '') || (consumes === 'application/x-www-form-urlencoded')) {
7699 headers['Content-Type'] = consumes;
7700 }
Jian Li8afbbee2016-07-27 19:16:51 +09007701 else if(this.consumes && this.consumes.length > 0 && this.consumes[0] === 'application/x-www-form-urlencoded') {
7702 headers['Content-Type'] = this.consumes[0];
7703 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007704
7705 if (accepts) {
7706 headers.Accept = accepts;
7707 }
7708
7709 return headers;
7710};
7711
7712/**
7713 * Returns true if the request accepts header matches anything in this.produces.
Jian Li83d87a72016-04-20 15:38:24 -07007714 * If this.produces contains * / *, ignore the accept header.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007715 * @param {string=} accepts The client request accept header.
7716 * @return {boolean}
7717 */
7718Operation.prototype.matchesAccept = function(accepts) {
7719 // no accepts or produces, no problem!
7720 if (!accepts || !this.produces) {
7721 return true;
7722 }
7723 return this.produces.indexOf(accepts) !== -1 || this.produces.indexOf('*/*') !== -1;
7724};
7725
Jian Li83d87a72016-04-20 15:38:24 -07007726Operation.prototype.asCurl = function (args1, args2) {
Jian Li1c94b9d2017-02-08 15:47:21 +09007727 var opts = {mock: true, maskPasswords: true};
Jian Li83d87a72016-04-20 15:38:24 -07007728 if (typeof args2 === 'object') {
7729 for (var argKey in args2) {
7730 opts[argKey] = args2[argKey];
7731 }
7732 }
7733 var obj = this.execute(args1, opts);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007734
Jian Li83d87a72016-04-20 15:38:24 -07007735 this.clientAuthorizations.apply(obj, this.operation.security);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007736
7737 var results = [];
7738
7739 results.push('-X ' + this.method.toUpperCase());
7740
Jian Li83d87a72016-04-20 15:38:24 -07007741 if (typeof obj.headers !== 'undefined') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007742 var key;
7743
7744 for (key in obj.headers) {
Jian Li83d87a72016-04-20 15:38:24 -07007745 var value = obj.headers[key];
7746 if(typeof value === 'string'){
7747 value = value.replace(/\'/g, '\\u0027');
7748 }
7749 results.push('--header \'' + key + ': ' + value + '\'');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007750 }
7751 }
Jian Li8afbbee2016-07-27 19:16:51 +09007752 var isFormData = false;
7753 var isMultipart = false;
7754
7755 var type = obj.headers['Content-Type'];
7756 if(type && type.indexOf('application/x-www-form-urlencoded') === 0) {
7757 isFormData = true;
7758 }
7759 else if (type && type.indexOf('multipart/form-data') === 0) {
7760 isFormData = true;
7761 isMultipart = true;
7762 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007763
7764 if (obj.body) {
7765 var body;
Jian Li83d87a72016-04-20 15:38:24 -07007766 if (_.isObject(obj.body)) {
Jian Li8afbbee2016-07-27 19:16:51 +09007767 if(isMultipart) {
7768 isMultipart = true;
7769 // add the form data
7770 for(var i = 0; i < this.parameters.length; i++) {
7771 var parameter = this.parameters[i];
7772 if(parameter.in === 'formData') {
7773 if (!body) {
7774 body = '';
7775 }
7776
7777 var paramValue;
7778 if(typeof FormData === 'function' && obj.body instanceof FormData) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007779 paramValue = obj.body.getAll(parameter.name);
Jian Li8afbbee2016-07-27 19:16:51 +09007780 }
7781 else {
7782 paramValue = obj.body[parameter.name];
7783 }
7784 if (paramValue) {
7785 if (parameter.type === 'file') {
7786 if(paramValue.name) {
7787 body += '-F ' + parameter.name + '=@"' + paramValue.name + '" ';
7788 }
7789 }
7790 else {
Jian Li8afbbee2016-07-27 19:16:51 +09007791 if (Array.isArray(paramValue)) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007792 if(parameter.collectionFormat === 'multi') {
7793 for(var v in paramValue) {
Jian Li1c94b9d2017-02-08 15:47:21 +09007794 body += '-F ' + this.encodeQueryKey(parameter.name) + '=' + mask(paramValue[v], parameter.format) + ' ';
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007795 }
7796 }
7797 else {
Jian Li1c94b9d2017-02-08 15:47:21 +09007798 body += '-F ' + this.encodeQueryCollection(parameter.collectionFormat, parameter.name, mask(paramValue, parameter.format)) + ' ';
Jian Li7f6d0e9e2016-09-27 02:04:49 +09007799 }
Jian Li8afbbee2016-07-27 19:16:51 +09007800 } else {
Jian Li1c94b9d2017-02-08 15:47:21 +09007801 body += '-F ' + this.encodeQueryKey(parameter.name) + '=' + mask(paramValue, parameter.format) + ' ';
Jian Li8afbbee2016-07-27 19:16:51 +09007802 }
Jian Li8afbbee2016-07-27 19:16:51 +09007803 }
7804 }
7805 }
Jian Li8afbbee2016-07-27 19:16:51 +09007806 }
7807 }
7808 if(!body) {
7809 body = JSON.stringify(obj.body);
7810 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007811 } else {
7812 body = obj.body;
7813 }
Jian Li8afbbee2016-07-27 19:16:51 +09007814 // escape @ => %40, ' => %27
7815 body = body.replace(/\'/g, '%27').replace(/\n/g, ' \\ \n ');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007816
Jian Li8afbbee2016-07-27 19:16:51 +09007817 if(!isFormData) {
7818 // escape & => %26
7819 body = body.replace(/&/g, '%26');
7820 }
7821 if(isMultipart) {
7822 results.push(body);
7823 }
7824 else {
7825 results.push('-d \'' + body.replace(/@/g, '%40') + '\'');
7826 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007827 }
7828
Jian Li83d87a72016-04-20 15:38:24 -07007829 return 'curl ' + (results.join(' ')) + ' \'' + obj.url + '\'';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007830};
7831
Jian Li1c94b9d2017-02-08 15:47:21 +09007832Operation.prototype.encodePathCollection = function (type, name, value, maskPasswords) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007833 var encoded = '';
7834 var i;
7835 var separator = '';
7836
7837 if (type === 'ssv') {
7838 separator = '%20';
7839 } else if (type === 'tsv') {
Jian Li8afbbee2016-07-27 19:16:51 +09007840 separator = '%09';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007841 } else if (type === 'pipes') {
7842 separator = '|';
7843 } else {
7844 separator = ',';
7845 }
7846
7847 for (i = 0; i < value.length; i++) {
7848 if (i === 0) {
Jian Li1c94b9d2017-02-08 15:47:21 +09007849 encoded = this.encodeQueryParam(value[i], maskPasswords);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007850 } else {
Jian Li1c94b9d2017-02-08 15:47:21 +09007851 encoded += separator + this.encodeQueryParam(value[i], maskPasswords);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007852 }
7853 }
7854
7855 return encoded;
7856};
7857
Jian Li1c94b9d2017-02-08 15:47:21 +09007858Operation.prototype.encodeQueryCollection = function (type, name, value, maskPasswords) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007859 var encoded = '';
7860 var i;
7861
Jian Li8afbbee2016-07-27 19:16:51 +09007862 type = type || 'default';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007863 if (type === 'default' || type === 'multi') {
7864 for (i = 0; i < value.length; i++) {
7865 if (i > 0) {encoded += '&';}
7866
Jian Li1c94b9d2017-02-08 15:47:21 +09007867 encoded += this.encodeQueryKey(name) + '=' + mask(this.encodeQueryParam(value[i]), maskPasswords);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007868 }
7869 } else {
7870 var separator = '';
7871
7872 if (type === 'csv') {
7873 separator = ',';
7874 } else if (type === 'ssv') {
7875 separator = '%20';
7876 } else if (type === 'tsv') {
Jian Li8afbbee2016-07-27 19:16:51 +09007877 separator = '%09';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007878 } else if (type === 'pipes') {
7879 separator = '|';
7880 } else if (type === 'brackets') {
7881 for (i = 0; i < value.length; i++) {
7882 if (i !== 0) {
7883 encoded += '&';
7884 }
Jian Li1c94b9d2017-02-08 15:47:21 +09007885 encoded += this.encodeQueryKey(name) + '[]=' + mask(this.encodeQueryParam(value[i]), maskPasswords);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007886 }
7887 }
7888
7889 if (separator !== '') {
7890 for (i = 0; i < value.length; i++) {
7891 if (i === 0) {
Jian Li8afbbee2016-07-27 19:16:51 +09007892 encoded = this.encodeQueryKey(name) + '=' + this.encodeQueryParam(value[i]);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007893 } else {
7894 encoded += separator + this.encodeQueryParam(value[i]);
7895 }
7896 }
7897 }
7898 }
7899
7900 return encoded;
7901};
7902
Jian Li8afbbee2016-07-27 19:16:51 +09007903Operation.prototype.encodeQueryKey = function (arg) {
7904 return encodeURIComponent(arg)
7905 .replace('%5B','[').replace('%5D', ']').replace('%24', '$');
7906};
7907
Jian Li1c94b9d2017-02-08 15:47:21 +09007908Operation.prototype.encodeQueryParam = function (arg, maskPasswords) {
7909 if(maskPasswords) {
7910 return "******";
7911 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007912 return encodeURIComponent(arg);
7913};
7914
7915/**
7916 * TODO revisit, might not want to leave '/'
7917 **/
Jian Li1c94b9d2017-02-08 15:47:21 +09007918Operation.prototype.encodePathParam = function (pathParam, maskPasswords) {
7919 return encodeURIComponent(pathParam, maskPasswords);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007920};
7921
Jian Li1c94b9d2017-02-08 15:47:21 +09007922var mask = function(value, format) {
7923 if(typeof format === 'string' && format === 'password') {
7924 return '******';
7925 }
7926 return value;
7927}
Jian Li8afbbee2016-07-27 19:16:51 +09007928},{"../helpers":4,"../http":5,"./model":9,"lodash-compat/lang/cloneDeep":138,"lodash-compat/lang/isEmpty":141,"lodash-compat/lang/isObject":144,"lodash-compat/lang/isUndefined":148,"q":157}],11:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007929'use strict';
7930
7931var OperationGroup = module.exports = function (tag, description, externalDocs, operation) {
7932 this.description = description;
7933 this.externalDocs = externalDocs;
7934 this.name = tag;
7935 this.operation = operation;
7936 this.operationsArray = [];
7937 this.path = tag;
7938 this.tag = tag;
7939};
7940
7941OperationGroup.prototype.sort = function () {
7942
7943};
7944
7945
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07007946},{}],12:[function(require,module,exports){
Jian Li83d87a72016-04-20 15:38:24 -07007947// shim for using process in browser
7948
7949var process = module.exports = {};
7950var queue = [];
7951var draining = false;
7952
7953function drainQueue() {
7954 if (draining) {
7955 return;
7956 }
7957 draining = true;
7958 var currentQueue;
7959 var len = queue.length;
7960 while(len) {
7961 currentQueue = queue;
7962 queue = [];
7963 var i = -1;
7964 while (++i < len) {
7965 currentQueue[i]();
7966 }
7967 len = queue.length;
7968 }
7969 draining = false;
7970}
7971process.nextTick = function (fun) {
7972 queue.push(fun);
7973 if (!draining) {
7974 setTimeout(drainQueue, 0);
7975 }
7976};
7977
7978process.title = 'browser';
7979process.browser = true;
7980process.env = {};
7981process.argv = [];
7982process.version = ''; // empty string to avoid regexp issues
7983process.versions = {};
7984
7985function noop() {}
7986
7987process.on = noop;
7988process.addListener = noop;
7989process.once = noop;
7990process.off = noop;
7991process.removeListener = noop;
7992process.removeAllListeners = noop;
7993process.emit = noop;
7994
7995process.binding = function (name) {
7996 throw new Error('process.binding is not supported');
7997};
7998
7999// TODO(shtylman)
8000process.cwd = function () { return '/' };
8001process.chdir = function (dir) {
8002 throw new Error('process.chdir is not supported');
8003};
8004process.umask = function() { return 0; };
8005
Jian Li8afbbee2016-07-27 19:16:51 +09008006},{}],13:[function(require,module,exports){
Jian Li83d87a72016-04-20 15:38:24 -07008007(function (Buffer){
8008(function () {
8009 "use strict";
8010
8011 function btoa(str) {
8012 var buffer
8013 ;
8014
8015 if (str instanceof Buffer) {
8016 buffer = str;
8017 } else {
8018 buffer = new Buffer(str.toString(), 'binary');
8019 }
8020
8021 return buffer.toString('base64');
8022 }
8023
8024 module.exports = btoa;
8025}());
8026
8027}).call(this,require("buffer").Buffer)
Jian Li1c94b9d2017-02-08 15:47:21 +09008028
Jian Li8afbbee2016-07-27 19:16:51 +09008029},{"buffer":14}],14:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008030/*!
8031 * The buffer module from node.js, for the browser.
8032 *
8033 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
8034 * @license MIT
8035 */
8036
8037var base64 = require('base64-js')
8038var ieee754 = require('ieee754')
8039var isArray = require('is-array')
8040
8041exports.Buffer = Buffer
8042exports.SlowBuffer = SlowBuffer
8043exports.INSPECT_MAX_BYTES = 50
8044Buffer.poolSize = 8192 // not used by this implementation
8045
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008046var rootParent = {}
8047
8048/**
8049 * If `Buffer.TYPED_ARRAY_SUPPORT`:
8050 * === true Use Uint8Array implementation (fastest)
8051 * === false Use Object implementation (most compatible, even IE6)
8052 *
8053 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
8054 * Opera 11.6+, iOS 4.2+.
8055 *
Jian Li83d87a72016-04-20 15:38:24 -07008056 * Due to various browser bugs, sometimes the Object implementation will be used even
8057 * when the browser supports typed arrays.
8058 *
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008059 * Note:
8060 *
Jian Li83d87a72016-04-20 15:38:24 -07008061 * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
8062 * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008063 *
Jian Li83d87a72016-04-20 15:38:24 -07008064 * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property
8065 * on objects.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008066 *
Jian Li83d87a72016-04-20 15:38:24 -07008067 * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008068 *
Jian Li83d87a72016-04-20 15:38:24 -07008069 * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
8070 * incorrect length in some situations.
8071
8072 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
8073 * get the Object implementation, which is slower but behaves correctly.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008074 */
8075Buffer.TYPED_ARRAY_SUPPORT = (function () {
Jian Li83d87a72016-04-20 15:38:24 -07008076 function Bar () {}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008077 try {
Jian Li83d87a72016-04-20 15:38:24 -07008078 var arr = new Uint8Array(1)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008079 arr.foo = function () { return 42 }
Jian Li83d87a72016-04-20 15:38:24 -07008080 arr.constructor = Bar
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008081 return arr.foo() === 42 && // typed array instances can be augmented
Jian Li83d87a72016-04-20 15:38:24 -07008082 arr.constructor === Bar && // constructor can be set
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008083 typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
Jian Li83d87a72016-04-20 15:38:24 -07008084 arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008085 } catch (e) {
8086 return false
8087 }
8088})()
8089
Jian Li83d87a72016-04-20 15:38:24 -07008090function kMaxLength () {
8091 return Buffer.TYPED_ARRAY_SUPPORT
8092 ? 0x7fffffff
8093 : 0x3fffffff
8094}
8095
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008096/**
8097 * Class: Buffer
8098 * =============
8099 *
8100 * The Buffer constructor returns instances of `Uint8Array` that are augmented
8101 * with function properties for all the node `Buffer` API functions. We use
8102 * `Uint8Array` so that square bracket notation works as expected -- it returns
8103 * a single octet.
8104 *
8105 * By augmenting the instances, we can avoid modifying the `Uint8Array`
8106 * prototype.
8107 */
Jian Li83d87a72016-04-20 15:38:24 -07008108function Buffer (arg) {
8109 if (!(this instanceof Buffer)) {
8110 // Avoid going through an ArgumentsAdaptorTrampoline in the common case.
8111 if (arguments.length > 1) return new Buffer(arg, arguments[1])
8112 return new Buffer(arg)
8113 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008114
Jian Li83d87a72016-04-20 15:38:24 -07008115 this.length = 0
8116 this.parent = undefined
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008117
Jian Li83d87a72016-04-20 15:38:24 -07008118 // Common case.
8119 if (typeof arg === 'number') {
8120 return fromNumber(this, arg)
8121 }
8122
8123 // Slightly less common case.
8124 if (typeof arg === 'string') {
8125 return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')
8126 }
8127
8128 // Unusual.
8129 return fromObject(this, arg)
8130}
8131
8132function fromNumber (that, length) {
8133 that = allocate(that, length < 0 ? 0 : checked(length) | 0)
8134 if (!Buffer.TYPED_ARRAY_SUPPORT) {
8135 for (var i = 0; i < length; i++) {
8136 that[i] = 0
8137 }
8138 }
8139 return that
8140}
8141
8142function fromString (that, string, encoding) {
8143 if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8'
8144
8145 // Assumption: byteLength() return value is always < kMaxLength.
8146 var length = byteLength(string, encoding) | 0
8147 that = allocate(that, length)
8148
8149 that.write(string, encoding)
8150 return that
8151}
8152
8153function fromObject (that, object) {
8154 if (Buffer.isBuffer(object)) return fromBuffer(that, object)
8155
8156 if (isArray(object)) return fromArray(that, object)
8157
8158 if (object == null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008159 throw new TypeError('must start with number, buffer, array or string')
8160 }
8161
Jian Li83d87a72016-04-20 15:38:24 -07008162 if (typeof ArrayBuffer !== 'undefined') {
8163 if (object.buffer instanceof ArrayBuffer) {
8164 return fromTypedArray(that, object)
8165 }
8166 if (object instanceof ArrayBuffer) {
8167 return fromArrayBuffer(that, object)
8168 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008169 }
8170
Jian Li83d87a72016-04-20 15:38:24 -07008171 if (object.length) return fromArrayLike(that, object)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008172
Jian Li83d87a72016-04-20 15:38:24 -07008173 return fromJsonObject(that, object)
8174}
8175
8176function fromBuffer (that, buffer) {
8177 var length = checked(buffer.length) | 0
8178 that = allocate(that, length)
8179 buffer.copy(that, 0, 0, length)
8180 return that
8181}
8182
8183function fromArray (that, array) {
8184 var length = checked(array.length) | 0
8185 that = allocate(that, length)
8186 for (var i = 0; i < length; i += 1) {
8187 that[i] = array[i] & 255
8188 }
8189 return that
8190}
8191
8192// Duplicate of fromArray() to keep fromArray() monomorphic.
8193function fromTypedArray (that, array) {
8194 var length = checked(array.length) | 0
8195 that = allocate(that, length)
8196 // Truncating the elements is probably not what people expect from typed
8197 // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior
8198 // of the old Buffer constructor.
8199 for (var i = 0; i < length; i += 1) {
8200 that[i] = array[i] & 255
8201 }
8202 return that
8203}
8204
8205function fromArrayBuffer (that, array) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008206 if (Buffer.TYPED_ARRAY_SUPPORT) {
Jian Li83d87a72016-04-20 15:38:24 -07008207 // Return an augmented `Uint8Array` instance, for best performance
8208 array.byteLength
8209 that = Buffer._augment(new Uint8Array(array))
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008210 } else {
Jian Li83d87a72016-04-20 15:38:24 -07008211 // Fallback: Return an object instance of the Buffer class
8212 that = fromTypedArray(that, new Uint8Array(array))
8213 }
8214 return that
8215}
8216
8217function fromArrayLike (that, array) {
8218 var length = checked(array.length) | 0
8219 that = allocate(that, length)
8220 for (var i = 0; i < length; i += 1) {
8221 that[i] = array[i] & 255
8222 }
8223 return that
8224}
8225
8226// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object.
8227// Returns a zero-length buffer for inputs that don't conform to the spec.
8228function fromJsonObject (that, object) {
8229 var array
8230 var length = 0
8231
8232 if (object.type === 'Buffer' && isArray(object.data)) {
8233 array = object.data
8234 length = checked(array.length) | 0
8235 }
8236 that = allocate(that, length)
8237
8238 for (var i = 0; i < length; i += 1) {
8239 that[i] = array[i] & 255
8240 }
8241 return that
8242}
8243
8244function allocate (that, length) {
8245 if (Buffer.TYPED_ARRAY_SUPPORT) {
8246 // Return an augmented `Uint8Array` instance, for best performance
8247 that = Buffer._augment(new Uint8Array(length))
8248 } else {
8249 // Fallback: Return an object instance of the Buffer class
8250 that.length = length
8251 that._isBuffer = true
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008252 }
8253
Jian Li83d87a72016-04-20 15:38:24 -07008254 var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1
8255 if (fromPool) that.parent = rootParent
8256
8257 return that
8258}
8259
8260function checked (length) {
8261 // Note: cannot use `length < kMaxLength` here because that fails when
8262 // length is NaN (which is otherwise coerced to zero.)
8263 if (length >= kMaxLength()) {
8264 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
8265 'size: 0x' + kMaxLength().toString(16) + ' bytes')
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008266 }
Jian Li83d87a72016-04-20 15:38:24 -07008267 return length | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008268}
8269
8270function SlowBuffer (subject, encoding) {
8271 if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding)
8272
8273 var buf = new Buffer(subject, encoding)
8274 delete buf.parent
8275 return buf
8276}
8277
8278Buffer.isBuffer = function isBuffer (b) {
8279 return !!(b != null && b._isBuffer)
8280}
8281
8282Buffer.compare = function compare (a, b) {
8283 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
8284 throw new TypeError('Arguments must be Buffers')
8285 }
8286
8287 if (a === b) return 0
8288
8289 var x = a.length
8290 var y = b.length
Jian Li83d87a72016-04-20 15:38:24 -07008291
8292 var i = 0
8293 var len = Math.min(x, y)
8294 while (i < len) {
8295 if (a[i] !== b[i]) break
8296
8297 ++i
8298 }
8299
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008300 if (i !== len) {
8301 x = a[i]
8302 y = b[i]
8303 }
Jian Li83d87a72016-04-20 15:38:24 -07008304
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008305 if (x < y) return -1
8306 if (y < x) return 1
8307 return 0
8308}
8309
8310Buffer.isEncoding = function isEncoding (encoding) {
8311 switch (String(encoding).toLowerCase()) {
8312 case 'hex':
8313 case 'utf8':
8314 case 'utf-8':
8315 case 'ascii':
8316 case 'binary':
8317 case 'base64':
8318 case 'raw':
8319 case 'ucs2':
8320 case 'ucs-2':
8321 case 'utf16le':
8322 case 'utf-16le':
8323 return true
8324 default:
8325 return false
8326 }
8327}
8328
Jian Li83d87a72016-04-20 15:38:24 -07008329Buffer.concat = function concat (list, length) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008330 if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.')
8331
8332 if (list.length === 0) {
8333 return new Buffer(0)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008334 }
8335
8336 var i
Jian Li83d87a72016-04-20 15:38:24 -07008337 if (length === undefined) {
8338 length = 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008339 for (i = 0; i < list.length; i++) {
Jian Li83d87a72016-04-20 15:38:24 -07008340 length += list[i].length
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008341 }
8342 }
8343
Jian Li83d87a72016-04-20 15:38:24 -07008344 var buf = new Buffer(length)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008345 var pos = 0
8346 for (i = 0; i < list.length; i++) {
8347 var item = list[i]
8348 item.copy(buf, pos)
8349 pos += item.length
8350 }
8351 return buf
8352}
8353
Jian Li83d87a72016-04-20 15:38:24 -07008354function byteLength (string, encoding) {
8355 if (typeof string !== 'string') string = '' + string
8356
8357 var len = string.length
8358 if (len === 0) return 0
8359
8360 // Use a for loop to avoid recursion
8361 var loweredCase = false
8362 for (;;) {
8363 switch (encoding) {
8364 case 'ascii':
8365 case 'binary':
8366 // Deprecated
8367 case 'raw':
8368 case 'raws':
8369 return len
8370 case 'utf8':
8371 case 'utf-8':
8372 return utf8ToBytes(string).length
8373 case 'ucs2':
8374 case 'ucs-2':
8375 case 'utf16le':
8376 case 'utf-16le':
8377 return len * 2
8378 case 'hex':
8379 return len >>> 1
8380 case 'base64':
8381 return base64ToBytes(string).length
8382 default:
8383 if (loweredCase) return utf8ToBytes(string).length // assume utf8
8384 encoding = ('' + encoding).toLowerCase()
8385 loweredCase = true
8386 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008387 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008388}
Jian Li83d87a72016-04-20 15:38:24 -07008389Buffer.byteLength = byteLength
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008390
8391// pre-set for values that may exist in the future
8392Buffer.prototype.length = undefined
8393Buffer.prototype.parent = undefined
8394
Jian Li83d87a72016-04-20 15:38:24 -07008395function slowToString (encoding, start, end) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008396 var loweredCase = false
8397
Jian Li83d87a72016-04-20 15:38:24 -07008398 start = start | 0
8399 end = end === undefined || end === Infinity ? this.length : end | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008400
8401 if (!encoding) encoding = 'utf8'
8402 if (start < 0) start = 0
8403 if (end > this.length) end = this.length
8404 if (end <= start) return ''
8405
8406 while (true) {
8407 switch (encoding) {
8408 case 'hex':
8409 return hexSlice(this, start, end)
8410
8411 case 'utf8':
8412 case 'utf-8':
8413 return utf8Slice(this, start, end)
8414
8415 case 'ascii':
8416 return asciiSlice(this, start, end)
8417
8418 case 'binary':
8419 return binarySlice(this, start, end)
8420
8421 case 'base64':
8422 return base64Slice(this, start, end)
8423
8424 case 'ucs2':
8425 case 'ucs-2':
8426 case 'utf16le':
8427 case 'utf-16le':
8428 return utf16leSlice(this, start, end)
8429
8430 default:
8431 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
8432 encoding = (encoding + '').toLowerCase()
8433 loweredCase = true
8434 }
8435 }
8436}
8437
Jian Li83d87a72016-04-20 15:38:24 -07008438Buffer.prototype.toString = function toString () {
8439 var length = this.length | 0
8440 if (length === 0) return ''
8441 if (arguments.length === 0) return utf8Slice(this, 0, length)
8442 return slowToString.apply(this, arguments)
8443}
8444
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008445Buffer.prototype.equals = function equals (b) {
8446 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
8447 if (this === b) return true
8448 return Buffer.compare(this, b) === 0
8449}
8450
8451Buffer.prototype.inspect = function inspect () {
8452 var str = ''
8453 var max = exports.INSPECT_MAX_BYTES
8454 if (this.length > 0) {
8455 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
8456 if (this.length > max) str += ' ... '
8457 }
8458 return '<Buffer ' + str + '>'
8459}
8460
8461Buffer.prototype.compare = function compare (b) {
8462 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
8463 if (this === b) return 0
8464 return Buffer.compare(this, b)
8465}
8466
8467Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
8468 if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff
8469 else if (byteOffset < -0x80000000) byteOffset = -0x80000000
8470 byteOffset >>= 0
8471
8472 if (this.length === 0) return -1
8473 if (byteOffset >= this.length) return -1
8474
8475 // Negative offsets start from the end of the buffer
8476 if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0)
8477
8478 if (typeof val === 'string') {
8479 if (val.length === 0) return -1 // special case: looking for empty string always fails
8480 return String.prototype.indexOf.call(this, val, byteOffset)
8481 }
8482 if (Buffer.isBuffer(val)) {
8483 return arrayIndexOf(this, val, byteOffset)
8484 }
8485 if (typeof val === 'number') {
8486 if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {
8487 return Uint8Array.prototype.indexOf.call(this, val, byteOffset)
8488 }
8489 return arrayIndexOf(this, [ val ], byteOffset)
8490 }
8491
8492 function arrayIndexOf (arr, val, byteOffset) {
8493 var foundIndex = -1
8494 for (var i = 0; byteOffset + i < arr.length; i++) {
8495 if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) {
8496 if (foundIndex === -1) foundIndex = i
8497 if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex
8498 } else {
8499 foundIndex = -1
8500 }
8501 }
8502 return -1
8503 }
8504
8505 throw new TypeError('val must be string, number or Buffer')
8506}
8507
Jian Li83d87a72016-04-20 15:38:24 -07008508// `get` is deprecated
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008509Buffer.prototype.get = function get (offset) {
8510 console.log('.get() is deprecated. Access using array indexes instead.')
8511 return this.readUInt8(offset)
8512}
8513
Jian Li83d87a72016-04-20 15:38:24 -07008514// `set` is deprecated
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008515Buffer.prototype.set = function set (v, offset) {
8516 console.log('.set() is deprecated. Access using array indexes instead.')
8517 return this.writeUInt8(v, offset)
8518}
8519
8520function hexWrite (buf, string, offset, length) {
8521 offset = Number(offset) || 0
8522 var remaining = buf.length - offset
8523 if (!length) {
8524 length = remaining
8525 } else {
8526 length = Number(length)
8527 if (length > remaining) {
8528 length = remaining
8529 }
8530 }
8531
8532 // must be an even number of digits
8533 var strLen = string.length
8534 if (strLen % 2 !== 0) throw new Error('Invalid hex string')
8535
8536 if (length > strLen / 2) {
8537 length = strLen / 2
8538 }
8539 for (var i = 0; i < length; i++) {
8540 var parsed = parseInt(string.substr(i * 2, 2), 16)
8541 if (isNaN(parsed)) throw new Error('Invalid hex string')
8542 buf[offset + i] = parsed
8543 }
8544 return i
8545}
8546
8547function utf8Write (buf, string, offset, length) {
Jian Li83d87a72016-04-20 15:38:24 -07008548 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008549}
8550
8551function asciiWrite (buf, string, offset, length) {
Jian Li83d87a72016-04-20 15:38:24 -07008552 return blitBuffer(asciiToBytes(string), buf, offset, length)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008553}
8554
8555function binaryWrite (buf, string, offset, length) {
8556 return asciiWrite(buf, string, offset, length)
8557}
8558
8559function base64Write (buf, string, offset, length) {
Jian Li83d87a72016-04-20 15:38:24 -07008560 return blitBuffer(base64ToBytes(string), buf, offset, length)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008561}
8562
Jian Li83d87a72016-04-20 15:38:24 -07008563function ucs2Write (buf, string, offset, length) {
8564 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008565}
8566
8567Buffer.prototype.write = function write (string, offset, length, encoding) {
Jian Li83d87a72016-04-20 15:38:24 -07008568 // Buffer#write(string)
8569 if (offset === undefined) {
8570 encoding = 'utf8'
8571 length = this.length
8572 offset = 0
8573 // Buffer#write(string, encoding)
8574 } else if (length === undefined && typeof offset === 'string') {
8575 encoding = offset
8576 length = this.length
8577 offset = 0
8578 // Buffer#write(string, offset[, length][, encoding])
8579 } else if (isFinite(offset)) {
8580 offset = offset | 0
8581 if (isFinite(length)) {
8582 length = length | 0
8583 if (encoding === undefined) encoding = 'utf8'
8584 } else {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008585 encoding = length
8586 length = undefined
8587 }
Jian Li83d87a72016-04-20 15:38:24 -07008588 // legacy write(string, encoding, offset, length) - remove in v0.13
8589 } else {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008590 var swap = encoding
8591 encoding = offset
Jian Li83d87a72016-04-20 15:38:24 -07008592 offset = length | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008593 length = swap
8594 }
8595
Jian Li83d87a72016-04-20 15:38:24 -07008596 var remaining = this.length - offset
8597 if (length === undefined || length > remaining) length = remaining
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008598
Jian Li83d87a72016-04-20 15:38:24 -07008599 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008600 throw new RangeError('attempt to write outside buffer bounds')
8601 }
8602
Jian Li83d87a72016-04-20 15:38:24 -07008603 if (!encoding) encoding = 'utf8'
8604
8605 var loweredCase = false
8606 for (;;) {
8607 switch (encoding) {
8608 case 'hex':
8609 return hexWrite(this, string, offset, length)
8610
8611 case 'utf8':
8612 case 'utf-8':
8613 return utf8Write(this, string, offset, length)
8614
8615 case 'ascii':
8616 return asciiWrite(this, string, offset, length)
8617
8618 case 'binary':
8619 return binaryWrite(this, string, offset, length)
8620
8621 case 'base64':
8622 // Warning: maxLength not taken into account in base64Write
8623 return base64Write(this, string, offset, length)
8624
8625 case 'ucs2':
8626 case 'ucs-2':
8627 case 'utf16le':
8628 case 'utf-16le':
8629 return ucs2Write(this, string, offset, length)
8630
8631 default:
8632 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
8633 encoding = ('' + encoding).toLowerCase()
8634 loweredCase = true
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008635 }
8636 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008637}
8638
8639Buffer.prototype.toJSON = function toJSON () {
8640 return {
8641 type: 'Buffer',
8642 data: Array.prototype.slice.call(this._arr || this, 0)
8643 }
8644}
8645
8646function base64Slice (buf, start, end) {
8647 if (start === 0 && end === buf.length) {
8648 return base64.fromByteArray(buf)
8649 } else {
8650 return base64.fromByteArray(buf.slice(start, end))
8651 }
8652}
8653
8654function utf8Slice (buf, start, end) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008655 end = Math.min(buf.length, end)
Jian Li83d87a72016-04-20 15:38:24 -07008656 var res = []
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008657
Jian Li83d87a72016-04-20 15:38:24 -07008658 var i = start
8659 while (i < end) {
8660 var firstByte = buf[i]
8661 var codePoint = null
8662 var bytesPerSequence = (firstByte > 0xEF) ? 4
8663 : (firstByte > 0xDF) ? 3
8664 : (firstByte > 0xBF) ? 2
8665 : 1
8666
8667 if (i + bytesPerSequence <= end) {
8668 var secondByte, thirdByte, fourthByte, tempCodePoint
8669
8670 switch (bytesPerSequence) {
8671 case 1:
8672 if (firstByte < 0x80) {
8673 codePoint = firstByte
8674 }
8675 break
8676 case 2:
8677 secondByte = buf[i + 1]
8678 if ((secondByte & 0xC0) === 0x80) {
8679 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
8680 if (tempCodePoint > 0x7F) {
8681 codePoint = tempCodePoint
8682 }
8683 }
8684 break
8685 case 3:
8686 secondByte = buf[i + 1]
8687 thirdByte = buf[i + 2]
8688 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
8689 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
8690 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
8691 codePoint = tempCodePoint
8692 }
8693 }
8694 break
8695 case 4:
8696 secondByte = buf[i + 1]
8697 thirdByte = buf[i + 2]
8698 fourthByte = buf[i + 3]
8699 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
8700 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
8701 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
8702 codePoint = tempCodePoint
8703 }
8704 }
8705 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008706 }
Jian Li83d87a72016-04-20 15:38:24 -07008707
8708 if (codePoint === null) {
8709 // we did not generate a valid codePoint so insert a
8710 // replacement char (U+FFFD) and advance only 1 byte
8711 codePoint = 0xFFFD
8712 bytesPerSequence = 1
8713 } else if (codePoint > 0xFFFF) {
8714 // encode to utf16 (surrogate pair dance)
8715 codePoint -= 0x10000
8716 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
8717 codePoint = 0xDC00 | codePoint & 0x3FF
8718 }
8719
8720 res.push(codePoint)
8721 i += bytesPerSequence
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008722 }
8723
Jian Li83d87a72016-04-20 15:38:24 -07008724 return decodeCodePointsArray(res)
8725}
8726
8727// Based on http://stackoverflow.com/a/22747272/680742, the browser with
8728// the lowest limit is Chrome, with 0x10000 args.
8729// We go 1 magnitude less, for safety
8730var MAX_ARGUMENTS_LENGTH = 0x1000
8731
8732function decodeCodePointsArray (codePoints) {
8733 var len = codePoints.length
8734 if (len <= MAX_ARGUMENTS_LENGTH) {
8735 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
8736 }
8737
8738 // Decode in chunks to avoid "call stack size exceeded".
8739 var res = ''
8740 var i = 0
8741 while (i < len) {
8742 res += String.fromCharCode.apply(
8743 String,
8744 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
8745 )
8746 }
8747 return res
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008748}
8749
8750function asciiSlice (buf, start, end) {
8751 var ret = ''
8752 end = Math.min(buf.length, end)
8753
8754 for (var i = start; i < end; i++) {
8755 ret += String.fromCharCode(buf[i] & 0x7F)
8756 }
8757 return ret
8758}
8759
8760function binarySlice (buf, start, end) {
8761 var ret = ''
8762 end = Math.min(buf.length, end)
8763
8764 for (var i = start; i < end; i++) {
8765 ret += String.fromCharCode(buf[i])
8766 }
8767 return ret
8768}
8769
8770function hexSlice (buf, start, end) {
8771 var len = buf.length
8772
8773 if (!start || start < 0) start = 0
8774 if (!end || end < 0 || end > len) end = len
8775
8776 var out = ''
8777 for (var i = start; i < end; i++) {
8778 out += toHex(buf[i])
8779 }
8780 return out
8781}
8782
8783function utf16leSlice (buf, start, end) {
8784 var bytes = buf.slice(start, end)
8785 var res = ''
8786 for (var i = 0; i < bytes.length; i += 2) {
8787 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
8788 }
8789 return res
8790}
8791
8792Buffer.prototype.slice = function slice (start, end) {
8793 var len = this.length
8794 start = ~~start
8795 end = end === undefined ? len : ~~end
8796
8797 if (start < 0) {
8798 start += len
8799 if (start < 0) start = 0
8800 } else if (start > len) {
8801 start = len
8802 }
8803
8804 if (end < 0) {
8805 end += len
8806 if (end < 0) end = 0
8807 } else if (end > len) {
8808 end = len
8809 }
8810
8811 if (end < start) end = start
8812
8813 var newBuf
8814 if (Buffer.TYPED_ARRAY_SUPPORT) {
8815 newBuf = Buffer._augment(this.subarray(start, end))
8816 } else {
8817 var sliceLen = end - start
8818 newBuf = new Buffer(sliceLen, undefined)
8819 for (var i = 0; i < sliceLen; i++) {
8820 newBuf[i] = this[i + start]
8821 }
8822 }
8823
8824 if (newBuf.length) newBuf.parent = this.parent || this
8825
8826 return newBuf
8827}
8828
8829/*
8830 * Need to make sure that buffer isn't trying to write out of bounds.
8831 */
8832function checkOffset (offset, ext, length) {
8833 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
8834 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
8835}
8836
8837Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
Jian Li83d87a72016-04-20 15:38:24 -07008838 offset = offset | 0
8839 byteLength = byteLength | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008840 if (!noAssert) checkOffset(offset, byteLength, this.length)
8841
8842 var val = this[offset]
8843 var mul = 1
8844 var i = 0
8845 while (++i < byteLength && (mul *= 0x100)) {
8846 val += this[offset + i] * mul
8847 }
8848
8849 return val
8850}
8851
8852Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
Jian Li83d87a72016-04-20 15:38:24 -07008853 offset = offset | 0
8854 byteLength = byteLength | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008855 if (!noAssert) {
8856 checkOffset(offset, byteLength, this.length)
8857 }
8858
8859 var val = this[offset + --byteLength]
8860 var mul = 1
8861 while (byteLength > 0 && (mul *= 0x100)) {
8862 val += this[offset + --byteLength] * mul
8863 }
8864
8865 return val
8866}
8867
8868Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
8869 if (!noAssert) checkOffset(offset, 1, this.length)
8870 return this[offset]
8871}
8872
8873Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
8874 if (!noAssert) checkOffset(offset, 2, this.length)
8875 return this[offset] | (this[offset + 1] << 8)
8876}
8877
8878Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
8879 if (!noAssert) checkOffset(offset, 2, this.length)
8880 return (this[offset] << 8) | this[offset + 1]
8881}
8882
8883Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
8884 if (!noAssert) checkOffset(offset, 4, this.length)
8885
8886 return ((this[offset]) |
8887 (this[offset + 1] << 8) |
8888 (this[offset + 2] << 16)) +
8889 (this[offset + 3] * 0x1000000)
8890}
8891
8892Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
8893 if (!noAssert) checkOffset(offset, 4, this.length)
8894
8895 return (this[offset] * 0x1000000) +
8896 ((this[offset + 1] << 16) |
8897 (this[offset + 2] << 8) |
8898 this[offset + 3])
8899}
8900
8901Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
Jian Li83d87a72016-04-20 15:38:24 -07008902 offset = offset | 0
8903 byteLength = byteLength | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008904 if (!noAssert) checkOffset(offset, byteLength, this.length)
8905
8906 var val = this[offset]
8907 var mul = 1
8908 var i = 0
8909 while (++i < byteLength && (mul *= 0x100)) {
8910 val += this[offset + i] * mul
8911 }
8912 mul *= 0x80
8913
8914 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
8915
8916 return val
8917}
8918
8919Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
Jian Li83d87a72016-04-20 15:38:24 -07008920 offset = offset | 0
8921 byteLength = byteLength | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07008922 if (!noAssert) checkOffset(offset, byteLength, this.length)
8923
8924 var i = byteLength
8925 var mul = 1
8926 var val = this[offset + --i]
8927 while (i > 0 && (mul *= 0x100)) {
8928 val += this[offset + --i] * mul
8929 }
8930 mul *= 0x80
8931
8932 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
8933
8934 return val
8935}
8936
8937Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
8938 if (!noAssert) checkOffset(offset, 1, this.length)
8939 if (!(this[offset] & 0x80)) return (this[offset])
8940 return ((0xff - this[offset] + 1) * -1)
8941}
8942
8943Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
8944 if (!noAssert) checkOffset(offset, 2, this.length)
8945 var val = this[offset] | (this[offset + 1] << 8)
8946 return (val & 0x8000) ? val | 0xFFFF0000 : val
8947}
8948
8949Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
8950 if (!noAssert) checkOffset(offset, 2, this.length)
8951 var val = this[offset + 1] | (this[offset] << 8)
8952 return (val & 0x8000) ? val | 0xFFFF0000 : val
8953}
8954
8955Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
8956 if (!noAssert) checkOffset(offset, 4, this.length)
8957
8958 return (this[offset]) |
8959 (this[offset + 1] << 8) |
8960 (this[offset + 2] << 16) |
8961 (this[offset + 3] << 24)
8962}
8963
8964Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
8965 if (!noAssert) checkOffset(offset, 4, this.length)
8966
8967 return (this[offset] << 24) |
8968 (this[offset + 1] << 16) |
8969 (this[offset + 2] << 8) |
8970 (this[offset + 3])
8971}
8972
8973Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
8974 if (!noAssert) checkOffset(offset, 4, this.length)
8975 return ieee754.read(this, offset, true, 23, 4)
8976}
8977
8978Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
8979 if (!noAssert) checkOffset(offset, 4, this.length)
8980 return ieee754.read(this, offset, false, 23, 4)
8981}
8982
8983Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
8984 if (!noAssert) checkOffset(offset, 8, this.length)
8985 return ieee754.read(this, offset, true, 52, 8)
8986}
8987
8988Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
8989 if (!noAssert) checkOffset(offset, 8, this.length)
8990 return ieee754.read(this, offset, false, 52, 8)
8991}
8992
8993function checkInt (buf, value, offset, ext, max, min) {
8994 if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')
8995 if (value > max || value < min) throw new RangeError('value is out of bounds')
8996 if (offset + ext > buf.length) throw new RangeError('index out of range')
8997}
8998
8999Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
9000 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009001 offset = offset | 0
9002 byteLength = byteLength | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009003 if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
9004
9005 var mul = 1
9006 var i = 0
9007 this[offset] = value & 0xFF
9008 while (++i < byteLength && (mul *= 0x100)) {
Jian Li83d87a72016-04-20 15:38:24 -07009009 this[offset + i] = (value / mul) & 0xFF
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009010 }
9011
9012 return offset + byteLength
9013}
9014
9015Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
9016 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009017 offset = offset | 0
9018 byteLength = byteLength | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009019 if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
9020
9021 var i = byteLength - 1
9022 var mul = 1
9023 this[offset + i] = value & 0xFF
9024 while (--i >= 0 && (mul *= 0x100)) {
Jian Li83d87a72016-04-20 15:38:24 -07009025 this[offset + i] = (value / mul) & 0xFF
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009026 }
9027
9028 return offset + byteLength
9029}
9030
9031Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
9032 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009033 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009034 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
9035 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
9036 this[offset] = value
9037 return offset + 1
9038}
9039
9040function objectWriteUInt16 (buf, value, offset, littleEndian) {
9041 if (value < 0) value = 0xffff + value + 1
9042 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {
9043 buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
9044 (littleEndian ? i : 1 - i) * 8
9045 }
9046}
9047
9048Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
9049 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009050 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009051 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
9052 if (Buffer.TYPED_ARRAY_SUPPORT) {
9053 this[offset] = value
9054 this[offset + 1] = (value >>> 8)
9055 } else {
9056 objectWriteUInt16(this, value, offset, true)
9057 }
9058 return offset + 2
9059}
9060
9061Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
9062 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009063 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009064 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
9065 if (Buffer.TYPED_ARRAY_SUPPORT) {
9066 this[offset] = (value >>> 8)
9067 this[offset + 1] = value
9068 } else {
9069 objectWriteUInt16(this, value, offset, false)
9070 }
9071 return offset + 2
9072}
9073
9074function objectWriteUInt32 (buf, value, offset, littleEndian) {
9075 if (value < 0) value = 0xffffffff + value + 1
9076 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {
9077 buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
9078 }
9079}
9080
9081Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
9082 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009083 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009084 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
9085 if (Buffer.TYPED_ARRAY_SUPPORT) {
9086 this[offset + 3] = (value >>> 24)
9087 this[offset + 2] = (value >>> 16)
9088 this[offset + 1] = (value >>> 8)
9089 this[offset] = value
9090 } else {
9091 objectWriteUInt32(this, value, offset, true)
9092 }
9093 return offset + 4
9094}
9095
9096Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
9097 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009098 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009099 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
9100 if (Buffer.TYPED_ARRAY_SUPPORT) {
9101 this[offset] = (value >>> 24)
9102 this[offset + 1] = (value >>> 16)
9103 this[offset + 2] = (value >>> 8)
9104 this[offset + 3] = value
9105 } else {
9106 objectWriteUInt32(this, value, offset, false)
9107 }
9108 return offset + 4
9109}
9110
9111Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
9112 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009113 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009114 if (!noAssert) {
Jian Li83d87a72016-04-20 15:38:24 -07009115 var limit = Math.pow(2, 8 * byteLength - 1)
9116
9117 checkInt(this, value, offset, byteLength, limit - 1, -limit)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009118 }
9119
9120 var i = 0
9121 var mul = 1
9122 var sub = value < 0 ? 1 : 0
9123 this[offset] = value & 0xFF
9124 while (++i < byteLength && (mul *= 0x100)) {
9125 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
9126 }
9127
9128 return offset + byteLength
9129}
9130
9131Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
9132 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009133 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009134 if (!noAssert) {
Jian Li83d87a72016-04-20 15:38:24 -07009135 var limit = Math.pow(2, 8 * byteLength - 1)
9136
9137 checkInt(this, value, offset, byteLength, limit - 1, -limit)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009138 }
9139
9140 var i = byteLength - 1
9141 var mul = 1
9142 var sub = value < 0 ? 1 : 0
9143 this[offset + i] = value & 0xFF
9144 while (--i >= 0 && (mul *= 0x100)) {
9145 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
9146 }
9147
9148 return offset + byteLength
9149}
9150
9151Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
9152 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009153 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009154 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
9155 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
9156 if (value < 0) value = 0xff + value + 1
9157 this[offset] = value
9158 return offset + 1
9159}
9160
9161Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
9162 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009163 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009164 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
9165 if (Buffer.TYPED_ARRAY_SUPPORT) {
9166 this[offset] = value
9167 this[offset + 1] = (value >>> 8)
9168 } else {
9169 objectWriteUInt16(this, value, offset, true)
9170 }
9171 return offset + 2
9172}
9173
9174Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
9175 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009176 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009177 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
9178 if (Buffer.TYPED_ARRAY_SUPPORT) {
9179 this[offset] = (value >>> 8)
9180 this[offset + 1] = value
9181 } else {
9182 objectWriteUInt16(this, value, offset, false)
9183 }
9184 return offset + 2
9185}
9186
9187Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
9188 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009189 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009190 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
9191 if (Buffer.TYPED_ARRAY_SUPPORT) {
9192 this[offset] = value
9193 this[offset + 1] = (value >>> 8)
9194 this[offset + 2] = (value >>> 16)
9195 this[offset + 3] = (value >>> 24)
9196 } else {
9197 objectWriteUInt32(this, value, offset, true)
9198 }
9199 return offset + 4
9200}
9201
9202Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
9203 value = +value
Jian Li83d87a72016-04-20 15:38:24 -07009204 offset = offset | 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009205 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
9206 if (value < 0) value = 0xffffffff + value + 1
9207 if (Buffer.TYPED_ARRAY_SUPPORT) {
9208 this[offset] = (value >>> 24)
9209 this[offset + 1] = (value >>> 16)
9210 this[offset + 2] = (value >>> 8)
9211 this[offset + 3] = value
9212 } else {
9213 objectWriteUInt32(this, value, offset, false)
9214 }
9215 return offset + 4
9216}
9217
9218function checkIEEE754 (buf, value, offset, ext, max, min) {
9219 if (value > max || value < min) throw new RangeError('value is out of bounds')
9220 if (offset + ext > buf.length) throw new RangeError('index out of range')
9221 if (offset < 0) throw new RangeError('index out of range')
9222}
9223
9224function writeFloat (buf, value, offset, littleEndian, noAssert) {
9225 if (!noAssert) {
9226 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
9227 }
9228 ieee754.write(buf, value, offset, littleEndian, 23, 4)
9229 return offset + 4
9230}
9231
9232Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
9233 return writeFloat(this, value, offset, true, noAssert)
9234}
9235
9236Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
9237 return writeFloat(this, value, offset, false, noAssert)
9238}
9239
9240function writeDouble (buf, value, offset, littleEndian, noAssert) {
9241 if (!noAssert) {
9242 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
9243 }
9244 ieee754.write(buf, value, offset, littleEndian, 52, 8)
9245 return offset + 8
9246}
9247
9248Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
9249 return writeDouble(this, value, offset, true, noAssert)
9250}
9251
9252Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
9253 return writeDouble(this, value, offset, false, noAssert)
9254}
9255
9256// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Jian Li83d87a72016-04-20 15:38:24 -07009257Buffer.prototype.copy = function copy (target, targetStart, start, end) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009258 if (!start) start = 0
9259 if (!end && end !== 0) end = this.length
Jian Li83d87a72016-04-20 15:38:24 -07009260 if (targetStart >= target.length) targetStart = target.length
9261 if (!targetStart) targetStart = 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009262 if (end > 0 && end < start) end = start
9263
9264 // Copy 0 bytes; we're done
9265 if (end === start) return 0
9266 if (target.length === 0 || this.length === 0) return 0
9267
9268 // Fatal error conditions
Jian Li83d87a72016-04-20 15:38:24 -07009269 if (targetStart < 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009270 throw new RangeError('targetStart out of bounds')
9271 }
9272 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
9273 if (end < 0) throw new RangeError('sourceEnd out of bounds')
9274
9275 // Are we oob?
9276 if (end > this.length) end = this.length
Jian Li83d87a72016-04-20 15:38:24 -07009277 if (target.length - targetStart < end - start) {
9278 end = target.length - targetStart + start
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009279 }
9280
9281 var len = end - start
Jian Li83d87a72016-04-20 15:38:24 -07009282 var i
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009283
Jian Li83d87a72016-04-20 15:38:24 -07009284 if (this === target && start < targetStart && targetStart < end) {
9285 // descending copy from end
9286 for (i = len - 1; i >= 0; i--) {
9287 target[i + targetStart] = this[i + start]
9288 }
9289 } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
9290 // ascending copy from start
9291 for (i = 0; i < len; i++) {
9292 target[i + targetStart] = this[i + start]
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009293 }
9294 } else {
Jian Li83d87a72016-04-20 15:38:24 -07009295 target._set(this.subarray(start, start + len), targetStart)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009296 }
9297
9298 return len
9299}
9300
9301// fill(value, start=0, end=buffer.length)
9302Buffer.prototype.fill = function fill (value, start, end) {
9303 if (!value) value = 0
9304 if (!start) start = 0
9305 if (!end) end = this.length
9306
9307 if (end < start) throw new RangeError('end < start')
9308
9309 // Fill 0 bytes; we're done
9310 if (end === start) return
9311 if (this.length === 0) return
9312
9313 if (start < 0 || start >= this.length) throw new RangeError('start out of bounds')
9314 if (end < 0 || end > this.length) throw new RangeError('end out of bounds')
9315
9316 var i
9317 if (typeof value === 'number') {
9318 for (i = start; i < end; i++) {
9319 this[i] = value
9320 }
9321 } else {
9322 var bytes = utf8ToBytes(value.toString())
9323 var len = bytes.length
9324 for (i = start; i < end; i++) {
9325 this[i] = bytes[i % len]
9326 }
9327 }
9328
9329 return this
9330}
9331
9332/**
9333 * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
9334 * Added in Node 0.12. Only available in browsers that support ArrayBuffer.
9335 */
9336Buffer.prototype.toArrayBuffer = function toArrayBuffer () {
9337 if (typeof Uint8Array !== 'undefined') {
9338 if (Buffer.TYPED_ARRAY_SUPPORT) {
9339 return (new Buffer(this)).buffer
9340 } else {
9341 var buf = new Uint8Array(this.length)
9342 for (var i = 0, len = buf.length; i < len; i += 1) {
9343 buf[i] = this[i]
9344 }
9345 return buf.buffer
9346 }
9347 } else {
9348 throw new TypeError('Buffer.toArrayBuffer not supported in this browser')
9349 }
9350}
9351
9352// HELPER FUNCTIONS
9353// ================
9354
9355var BP = Buffer.prototype
9356
9357/**
9358 * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
9359 */
9360Buffer._augment = function _augment (arr) {
9361 arr.constructor = Buffer
9362 arr._isBuffer = true
9363
9364 // save reference to original Uint8Array set method before overwriting
9365 arr._set = arr.set
9366
Jian Li83d87a72016-04-20 15:38:24 -07009367 // deprecated
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009368 arr.get = BP.get
9369 arr.set = BP.set
9370
9371 arr.write = BP.write
9372 arr.toString = BP.toString
9373 arr.toLocaleString = BP.toString
9374 arr.toJSON = BP.toJSON
9375 arr.equals = BP.equals
9376 arr.compare = BP.compare
9377 arr.indexOf = BP.indexOf
9378 arr.copy = BP.copy
9379 arr.slice = BP.slice
9380 arr.readUIntLE = BP.readUIntLE
9381 arr.readUIntBE = BP.readUIntBE
9382 arr.readUInt8 = BP.readUInt8
9383 arr.readUInt16LE = BP.readUInt16LE
9384 arr.readUInt16BE = BP.readUInt16BE
9385 arr.readUInt32LE = BP.readUInt32LE
9386 arr.readUInt32BE = BP.readUInt32BE
9387 arr.readIntLE = BP.readIntLE
9388 arr.readIntBE = BP.readIntBE
9389 arr.readInt8 = BP.readInt8
9390 arr.readInt16LE = BP.readInt16LE
9391 arr.readInt16BE = BP.readInt16BE
9392 arr.readInt32LE = BP.readInt32LE
9393 arr.readInt32BE = BP.readInt32BE
9394 arr.readFloatLE = BP.readFloatLE
9395 arr.readFloatBE = BP.readFloatBE
9396 arr.readDoubleLE = BP.readDoubleLE
9397 arr.readDoubleBE = BP.readDoubleBE
9398 arr.writeUInt8 = BP.writeUInt8
9399 arr.writeUIntLE = BP.writeUIntLE
9400 arr.writeUIntBE = BP.writeUIntBE
9401 arr.writeUInt16LE = BP.writeUInt16LE
9402 arr.writeUInt16BE = BP.writeUInt16BE
9403 arr.writeUInt32LE = BP.writeUInt32LE
9404 arr.writeUInt32BE = BP.writeUInt32BE
9405 arr.writeIntLE = BP.writeIntLE
9406 arr.writeIntBE = BP.writeIntBE
9407 arr.writeInt8 = BP.writeInt8
9408 arr.writeInt16LE = BP.writeInt16LE
9409 arr.writeInt16BE = BP.writeInt16BE
9410 arr.writeInt32LE = BP.writeInt32LE
9411 arr.writeInt32BE = BP.writeInt32BE
9412 arr.writeFloatLE = BP.writeFloatLE
9413 arr.writeFloatBE = BP.writeFloatBE
9414 arr.writeDoubleLE = BP.writeDoubleLE
9415 arr.writeDoubleBE = BP.writeDoubleBE
9416 arr.fill = BP.fill
9417 arr.inspect = BP.inspect
9418 arr.toArrayBuffer = BP.toArrayBuffer
9419
9420 return arr
9421}
9422
Jian Li83d87a72016-04-20 15:38:24 -07009423var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009424
9425function base64clean (str) {
9426 // Node strips out invalid characters like \n and \t from the string, base64-js does not
9427 str = stringtrim(str).replace(INVALID_BASE64_RE, '')
9428 // Node converts strings with length < 2 to ''
9429 if (str.length < 2) return ''
9430 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
9431 while (str.length % 4 !== 0) {
9432 str = str + '='
9433 }
9434 return str
9435}
9436
9437function stringtrim (str) {
9438 if (str.trim) return str.trim()
9439 return str.replace(/^\s+|\s+$/g, '')
9440}
9441
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009442function toHex (n) {
9443 if (n < 16) return '0' + n.toString(16)
9444 return n.toString(16)
9445}
9446
9447function utf8ToBytes (string, units) {
9448 units = units || Infinity
9449 var codePoint
9450 var length = string.length
9451 var leadSurrogate = null
9452 var bytes = []
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009453
Jian Li83d87a72016-04-20 15:38:24 -07009454 for (var i = 0; i < length; i++) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009455 codePoint = string.charCodeAt(i)
9456
9457 // is surrogate component
9458 if (codePoint > 0xD7FF && codePoint < 0xE000) {
9459 // last char was a lead
Jian Li83d87a72016-04-20 15:38:24 -07009460 if (!leadSurrogate) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009461 // no lead yet
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009462 if (codePoint > 0xDBFF) {
9463 // unexpected trail
9464 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
9465 continue
9466 } else if (i + 1 === length) {
9467 // unpaired lead
9468 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
9469 continue
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009470 }
Jian Li83d87a72016-04-20 15:38:24 -07009471
9472 // valid lead
9473 leadSurrogate = codePoint
9474
9475 continue
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009476 }
Jian Li83d87a72016-04-20 15:38:24 -07009477
9478 // 2 leads in a row
9479 if (codePoint < 0xDC00) {
9480 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
9481 leadSurrogate = codePoint
9482 continue
9483 }
9484
9485 // valid surrogate pair
9486 codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009487 } else if (leadSurrogate) {
9488 // valid bmp char, but last char was a lead
9489 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009490 }
9491
Jian Li83d87a72016-04-20 15:38:24 -07009492 leadSurrogate = null
9493
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009494 // encode utf8
9495 if (codePoint < 0x80) {
9496 if ((units -= 1) < 0) break
9497 bytes.push(codePoint)
9498 } else if (codePoint < 0x800) {
9499 if ((units -= 2) < 0) break
9500 bytes.push(
9501 codePoint >> 0x6 | 0xC0,
9502 codePoint & 0x3F | 0x80
9503 )
9504 } else if (codePoint < 0x10000) {
9505 if ((units -= 3) < 0) break
9506 bytes.push(
9507 codePoint >> 0xC | 0xE0,
9508 codePoint >> 0x6 & 0x3F | 0x80,
9509 codePoint & 0x3F | 0x80
9510 )
Jian Li83d87a72016-04-20 15:38:24 -07009511 } else if (codePoint < 0x110000) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009512 if ((units -= 4) < 0) break
9513 bytes.push(
9514 codePoint >> 0x12 | 0xF0,
9515 codePoint >> 0xC & 0x3F | 0x80,
9516 codePoint >> 0x6 & 0x3F | 0x80,
9517 codePoint & 0x3F | 0x80
9518 )
9519 } else {
9520 throw new Error('Invalid code point')
9521 }
9522 }
9523
9524 return bytes
9525}
9526
9527function asciiToBytes (str) {
9528 var byteArray = []
9529 for (var i = 0; i < str.length; i++) {
9530 // Node's code seems to be doing this and not & 0x7F..
9531 byteArray.push(str.charCodeAt(i) & 0xFF)
9532 }
9533 return byteArray
9534}
9535
9536function utf16leToBytes (str, units) {
9537 var c, hi, lo
9538 var byteArray = []
9539 for (var i = 0; i < str.length; i++) {
9540 if ((units -= 2) < 0) break
9541
9542 c = str.charCodeAt(i)
9543 hi = c >> 8
9544 lo = c % 256
9545 byteArray.push(lo)
9546 byteArray.push(hi)
9547 }
9548
9549 return byteArray
9550}
9551
9552function base64ToBytes (str) {
9553 return base64.toByteArray(base64clean(str))
9554}
9555
9556function blitBuffer (src, dst, offset, length) {
9557 for (var i = 0; i < length; i++) {
9558 if ((i + offset >= dst.length) || (i >= src.length)) break
9559 dst[i + offset] = src[i]
9560 }
9561 return i
9562}
9563
Jian Li8afbbee2016-07-27 19:16:51 +09009564},{"base64-js":15,"ieee754":16,"is-array":17}],15:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009565var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
9566
9567;(function (exports) {
9568 'use strict';
9569
9570 var Arr = (typeof Uint8Array !== 'undefined')
9571 ? Uint8Array
9572 : Array
9573
9574 var PLUS = '+'.charCodeAt(0)
9575 var SLASH = '/'.charCodeAt(0)
9576 var NUMBER = '0'.charCodeAt(0)
9577 var LOWER = 'a'.charCodeAt(0)
9578 var UPPER = 'A'.charCodeAt(0)
9579 var PLUS_URL_SAFE = '-'.charCodeAt(0)
9580 var SLASH_URL_SAFE = '_'.charCodeAt(0)
9581
9582 function decode (elt) {
9583 var code = elt.charCodeAt(0)
9584 if (code === PLUS ||
9585 code === PLUS_URL_SAFE)
9586 return 62 // '+'
9587 if (code === SLASH ||
9588 code === SLASH_URL_SAFE)
9589 return 63 // '/'
9590 if (code < NUMBER)
9591 return -1 //no match
9592 if (code < NUMBER + 10)
9593 return code - NUMBER + 26 + 26
9594 if (code < UPPER + 26)
9595 return code - UPPER
9596 if (code < LOWER + 26)
9597 return code - LOWER + 26
9598 }
9599
9600 function b64ToByteArray (b64) {
9601 var i, j, l, tmp, placeHolders, arr
9602
9603 if (b64.length % 4 > 0) {
9604 throw new Error('Invalid string. Length must be a multiple of 4')
9605 }
9606
9607 // the number of equal signs (place holders)
9608 // if there are two placeholders, than the two characters before it
9609 // represent one byte
9610 // if there is only one, then the three characters before it represent 2 bytes
9611 // this is just a cheap hack to not do indexOf twice
9612 var len = b64.length
9613 placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
9614
9615 // base64 is 4/3 + up to two characters of the original data
9616 arr = new Arr(b64.length * 3 / 4 - placeHolders)
9617
9618 // if there are placeholders, only get up to the last complete 4 chars
9619 l = placeHolders > 0 ? b64.length - 4 : b64.length
9620
9621 var L = 0
9622
9623 function push (v) {
9624 arr[L++] = v
9625 }
9626
9627 for (i = 0, j = 0; i < l; i += 4, j += 3) {
9628 tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
9629 push((tmp & 0xFF0000) >> 16)
9630 push((tmp & 0xFF00) >> 8)
9631 push(tmp & 0xFF)
9632 }
9633
9634 if (placeHolders === 2) {
9635 tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
9636 push(tmp & 0xFF)
9637 } else if (placeHolders === 1) {
9638 tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
9639 push((tmp >> 8) & 0xFF)
9640 push(tmp & 0xFF)
9641 }
9642
9643 return arr
9644 }
9645
9646 function uint8ToBase64 (uint8) {
9647 var i,
9648 extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
9649 output = "",
9650 temp, length
9651
9652 function encode (num) {
9653 return lookup.charAt(num)
9654 }
9655
9656 function tripletToBase64 (num) {
9657 return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
9658 }
9659
9660 // go through the array every three bytes, we'll deal with trailing stuff later
9661 for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
9662 temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
9663 output += tripletToBase64(temp)
9664 }
9665
9666 // pad the end with zeros, but make sure to not forget the extra bytes
9667 switch (extraBytes) {
9668 case 1:
9669 temp = uint8[uint8.length - 1]
9670 output += encode(temp >> 2)
9671 output += encode((temp << 4) & 0x3F)
9672 output += '=='
9673 break
9674 case 2:
9675 temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
9676 output += encode(temp >> 10)
9677 output += encode((temp >> 4) & 0x3F)
9678 output += encode((temp << 2) & 0x3F)
9679 output += '='
9680 break
9681 }
9682
9683 return output
9684 }
9685
9686 exports.toByteArray = b64ToByteArray
9687 exports.fromByteArray = uint8ToBase64
9688}(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
9689
Jian Li8afbbee2016-07-27 19:16:51 +09009690},{}],16:[function(require,module,exports){
Jian Li83d87a72016-04-20 15:38:24 -07009691exports.read = function (buffer, offset, isLE, mLen, nBytes) {
9692 var e, m
9693 var eLen = nBytes * 8 - mLen - 1
9694 var eMax = (1 << eLen) - 1
9695 var eBias = eMax >> 1
9696 var nBits = -7
9697 var i = isLE ? (nBytes - 1) : 0
9698 var d = isLE ? -1 : 1
9699 var s = buffer[offset + i]
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009700
Jian Li83d87a72016-04-20 15:38:24 -07009701 i += d
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009702
Jian Li83d87a72016-04-20 15:38:24 -07009703 e = s & ((1 << (-nBits)) - 1)
9704 s >>= (-nBits)
9705 nBits += eLen
9706 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009707
Jian Li83d87a72016-04-20 15:38:24 -07009708 m = e & ((1 << (-nBits)) - 1)
9709 e >>= (-nBits)
9710 nBits += mLen
9711 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009712
9713 if (e === 0) {
Jian Li83d87a72016-04-20 15:38:24 -07009714 e = 1 - eBias
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009715 } else if (e === eMax) {
Jian Li83d87a72016-04-20 15:38:24 -07009716 return m ? NaN : ((s ? -1 : 1) * Infinity)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009717 } else {
Jian Li83d87a72016-04-20 15:38:24 -07009718 m = m + Math.pow(2, mLen)
9719 e = e - eBias
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009720 }
Jian Li83d87a72016-04-20 15:38:24 -07009721 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
9722}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009723
Jian Li83d87a72016-04-20 15:38:24 -07009724exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
9725 var e, m, c
9726 var eLen = nBytes * 8 - mLen - 1
9727 var eMax = (1 << eLen) - 1
9728 var eBias = eMax >> 1
9729 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
9730 var i = isLE ? 0 : (nBytes - 1)
9731 var d = isLE ? 1 : -1
9732 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009733
Jian Li83d87a72016-04-20 15:38:24 -07009734 value = Math.abs(value)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009735
9736 if (isNaN(value) || value === Infinity) {
Jian Li83d87a72016-04-20 15:38:24 -07009737 m = isNaN(value) ? 1 : 0
9738 e = eMax
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009739 } else {
Jian Li83d87a72016-04-20 15:38:24 -07009740 e = Math.floor(Math.log(value) / Math.LN2)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009741 if (value * (c = Math.pow(2, -e)) < 1) {
Jian Li83d87a72016-04-20 15:38:24 -07009742 e--
9743 c *= 2
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009744 }
9745 if (e + eBias >= 1) {
Jian Li83d87a72016-04-20 15:38:24 -07009746 value += rt / c
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009747 } else {
Jian Li83d87a72016-04-20 15:38:24 -07009748 value += rt * Math.pow(2, 1 - eBias)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009749 }
9750 if (value * c >= 2) {
Jian Li83d87a72016-04-20 15:38:24 -07009751 e++
9752 c /= 2
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009753 }
9754
9755 if (e + eBias >= eMax) {
Jian Li83d87a72016-04-20 15:38:24 -07009756 m = 0
9757 e = eMax
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009758 } else if (e + eBias >= 1) {
Jian Li83d87a72016-04-20 15:38:24 -07009759 m = (value * c - 1) * Math.pow(2, mLen)
9760 e = e + eBias
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009761 } else {
Jian Li83d87a72016-04-20 15:38:24 -07009762 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
9763 e = 0
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009764 }
9765 }
9766
Jian Li83d87a72016-04-20 15:38:24 -07009767 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009768
Jian Li83d87a72016-04-20 15:38:24 -07009769 e = (e << mLen) | m
9770 eLen += mLen
9771 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009772
Jian Li83d87a72016-04-20 15:38:24 -07009773 buffer[offset + i - d] |= s * 128
9774}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009775
Jian Li8afbbee2016-07-27 19:16:51 +09009776},{}],17:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009777
9778/**
9779 * isArray
9780 */
9781
9782var isArray = Array.isArray;
9783
9784/**
9785 * toString
9786 */
9787
9788var str = Object.prototype.toString;
9789
9790/**
9791 * Whether or not the given `val`
9792 * is an array.
9793 *
9794 * example:
9795 *
9796 * isArray([]);
9797 * // > true
9798 * isArray(arguments);
9799 * // > false
9800 * isArray('');
9801 * // > false
9802 *
9803 * @param {mixed} val
9804 * @return {bool}
9805 */
9806
9807module.exports = isArray || function (val) {
9808 return !! val && '[object Array]' == str.call(val);
9809};
9810
Jian Li8afbbee2016-07-27 19:16:51 +09009811},{}],18:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009812/* jshint node: true */
9813(function () {
9814 "use strict";
9815
9816 function CookieAccessInfo(domain, path, secure, script) {
9817 if (this instanceof CookieAccessInfo) {
9818 this.domain = domain || undefined;
9819 this.path = path || "/";
9820 this.secure = !!secure;
9821 this.script = !!script;
9822 return this;
9823 }
9824 return new CookieAccessInfo(domain, path, secure, script);
9825 }
9826 exports.CookieAccessInfo = CookieAccessInfo;
9827
9828 function Cookie(cookiestr, request_domain, request_path) {
9829 if (cookiestr instanceof Cookie) {
9830 return cookiestr;
9831 }
9832 if (this instanceof Cookie) {
9833 this.name = null;
9834 this.value = null;
9835 this.expiration_date = Infinity;
9836 this.path = String(request_path || "/");
9837 this.explicit_path = false;
9838 this.domain = request_domain || null;
9839 this.explicit_domain = false;
9840 this.secure = false; //how to define default?
9841 this.noscript = false; //httponly
9842 if (cookiestr) {
9843 this.parse(cookiestr, request_domain, request_path);
9844 }
9845 return this;
9846 }
Jian Li83d87a72016-04-20 15:38:24 -07009847 return new Cookie(cookiestr, request_domain, request_path);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009848 }
9849 exports.Cookie = Cookie;
9850
9851 Cookie.prototype.toString = function toString() {
9852 var str = [this.name + "=" + this.value];
9853 if (this.expiration_date !== Infinity) {
9854 str.push("expires=" + (new Date(this.expiration_date)).toGMTString());
9855 }
9856 if (this.domain) {
9857 str.push("domain=" + this.domain);
9858 }
9859 if (this.path) {
9860 str.push("path=" + this.path);
9861 }
9862 if (this.secure) {
9863 str.push("secure");
9864 }
9865 if (this.noscript) {
9866 str.push("httponly");
9867 }
9868 return str.join("; ");
9869 };
9870
9871 Cookie.prototype.toValueString = function toValueString() {
9872 return this.name + "=" + this.value;
9873 };
9874
9875 var cookie_str_splitter = /[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;
9876 Cookie.prototype.parse = function parse(str, request_domain, request_path) {
9877 if (this instanceof Cookie) {
9878 var parts = str.split(";").filter(function (value) {
9879 return !!value;
9880 }),
9881 pair = parts[0].match(/([^=]+)=([\s\S]*)/),
9882 key = pair[1],
9883 value = pair[2],
9884 i;
9885 this.name = key;
9886 this.value = value;
9887
9888 for (i = 1; i < parts.length; i += 1) {
9889 pair = parts[i].match(/([^=]+)(?:=([\s\S]*))?/);
9890 key = pair[1].trim().toLowerCase();
9891 value = pair[2];
9892 switch (key) {
9893 case "httponly":
9894 this.noscript = true;
9895 break;
9896 case "expires":
9897 this.expiration_date = value ?
9898 Number(Date.parse(value)) :
9899 Infinity;
9900 break;
9901 case "path":
9902 this.path = value ?
9903 value.trim() :
9904 "";
9905 this.explicit_path = true;
9906 break;
9907 case "domain":
9908 this.domain = value ?
9909 value.trim() :
9910 "";
9911 this.explicit_domain = !!this.domain;
9912 break;
9913 case "secure":
9914 this.secure = true;
9915 break;
9916 }
9917 }
9918
9919 if (!this.explicit_path) {
9920 this.path = request_path || "/";
9921 }
9922 if (!this.explicit_domain) {
9923 this.domain = request_domain;
9924 }
9925
9926 return this;
9927 }
9928 return new Cookie().parse(str, request_domain, request_path);
9929 };
9930
9931 Cookie.prototype.matches = function matches(access_info) {
9932 if (this.noscript && access_info.script ||
9933 this.secure && !access_info.secure ||
9934 !this.collidesWith(access_info)) {
9935 return false;
9936 }
9937 return true;
9938 };
9939
9940 Cookie.prototype.collidesWith = function collidesWith(access_info) {
9941 if ((this.path && !access_info.path) || (this.domain && !access_info.domain)) {
9942 return false;
9943 }
9944 if (this.path && access_info.path.indexOf(this.path) !== 0) {
9945 return false;
9946 }
Jian Li83d87a72016-04-20 15:38:24 -07009947 if (this.explicit_path && access_info.path.indexOf( this.path ) !== 0) {
9948 return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -07009949 }
9950 var access_domain = access_info.domain && access_info.domain.replace(/^[\.]/,'');
9951 var cookie_domain = this.domain && this.domain.replace(/^[\.]/,'');
9952 if (cookie_domain === access_domain) {
9953 return true;
9954 }
9955 if (cookie_domain) {
9956 if (!this.explicit_domain) {
9957 return false; // we already checked if the domains were exactly the same
9958 }
9959 var wildcard = access_domain.indexOf(cookie_domain);
9960 if (wildcard === -1 || wildcard !== access_domain.length - cookie_domain.length) {
9961 return false;
9962 }
9963 return true;
9964 }
9965 return true;
9966 };
9967
9968 function CookieJar() {
9969 var cookies, cookies_list, collidable_cookie;
9970 if (this instanceof CookieJar) {
9971 cookies = Object.create(null); //name: [Cookie]
9972
9973 this.setCookie = function setCookie(cookie, request_domain, request_path) {
9974 var remove, i;
9975 cookie = new Cookie(cookie, request_domain, request_path);
9976 //Delete the cookie if the set is past the current time
9977 remove = cookie.expiration_date <= Date.now();
9978 if (cookies[cookie.name] !== undefined) {
9979 cookies_list = cookies[cookie.name];
9980 for (i = 0; i < cookies_list.length; i += 1) {
9981 collidable_cookie = cookies_list[i];
9982 if (collidable_cookie.collidesWith(cookie)) {
9983 if (remove) {
9984 cookies_list.splice(i, 1);
9985 if (cookies_list.length === 0) {
9986 delete cookies[cookie.name];
9987 }
9988 return false;
9989 }
9990 cookies_list[i] = cookie;
9991 return cookie;
9992 }
9993 }
9994 if (remove) {
9995 return false;
9996 }
9997 cookies_list.push(cookie);
9998 return cookie;
9999 }
10000 if (remove) {
10001 return false;
10002 }
10003 cookies[cookie.name] = [cookie];
10004 return cookies[cookie.name];
10005 };
10006 //returns a cookie
10007 this.getCookie = function getCookie(cookie_name, access_info) {
10008 var cookie, i;
10009 cookies_list = cookies[cookie_name];
10010 if (!cookies_list) {
10011 return;
10012 }
10013 for (i = 0; i < cookies_list.length; i += 1) {
10014 cookie = cookies_list[i];
10015 if (cookie.expiration_date <= Date.now()) {
10016 if (cookies_list.length === 0) {
10017 delete cookies[cookie.name];
10018 }
10019 continue;
10020 }
Jian Li83d87a72016-04-20 15:38:24 -070010021
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010022 if (cookie.matches(access_info)) {
10023 return cookie;
10024 }
10025 }
10026 };
10027 //returns a list of cookies
10028 this.getCookies = function getCookies(access_info) {
10029 var matches = [], cookie_name, cookie;
10030 for (cookie_name in cookies) {
10031 cookie = this.getCookie(cookie_name, access_info);
10032 if (cookie) {
10033 matches.push(cookie);
10034 }
10035 }
10036 matches.toString = function toString() {
10037 return matches.join(":");
10038 };
10039 matches.toValueString = function toValueString() {
10040 return matches.map(function (c) {
10041 return c.toValueString();
10042 }).join(';');
10043 };
10044 return matches;
10045 };
10046
10047 return this;
10048 }
10049 return new CookieJar();
10050 }
10051 exports.CookieJar = CookieJar;
10052
10053 //returns list of cookies that were set correctly. Cookies that are expired and removed are not returned.
10054 CookieJar.prototype.setCookies = function setCookies(cookies, request_domain, request_path) {
10055 cookies = Array.isArray(cookies) ?
10056 cookies :
10057 cookies.split(cookie_str_splitter);
10058 var successful = [],
10059 i,
10060 cookie;
Jian Li83d87a72016-04-20 15:38:24 -070010061 cookies = cookies.map(function(item){
10062 return new Cookie(item, request_domain, request_path);
10063 });
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010064 for (i = 0; i < cookies.length; i += 1) {
10065 cookie = cookies[i];
10066 if (this.setCookie(cookie, request_domain, request_path)) {
10067 successful.push(cookie);
10068 }
10069 }
10070 return successful;
10071 };
10072}());
10073
Jian Li8afbbee2016-07-27 19:16:51 +090010074},{}],19:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010075'use strict';
10076
10077
10078var yaml = require('./lib/js-yaml.js');
10079
10080
10081module.exports = yaml;
10082
Jian Li8afbbee2016-07-27 19:16:51 +090010083},{"./lib/js-yaml.js":20}],20:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010084'use strict';
10085
10086
10087var loader = require('./js-yaml/loader');
10088var dumper = require('./js-yaml/dumper');
10089
10090
10091function deprecated(name) {
10092 return function () {
10093 throw new Error('Function ' + name + ' is deprecated and cannot be used.');
10094 };
10095}
10096
10097
10098module.exports.Type = require('./js-yaml/type');
10099module.exports.Schema = require('./js-yaml/schema');
10100module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe');
10101module.exports.JSON_SCHEMA = require('./js-yaml/schema/json');
10102module.exports.CORE_SCHEMA = require('./js-yaml/schema/core');
10103module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
10104module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full');
10105module.exports.load = loader.load;
10106module.exports.loadAll = loader.loadAll;
10107module.exports.safeLoad = loader.safeLoad;
10108module.exports.safeLoadAll = loader.safeLoadAll;
10109module.exports.dump = dumper.dump;
10110module.exports.safeDump = dumper.safeDump;
10111module.exports.YAMLException = require('./js-yaml/exception');
10112
Jian Li83d87a72016-04-20 15:38:24 -070010113// Deprecated schema names from JS-YAML 2.0.x
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010114module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe');
10115module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
10116module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full');
10117
10118// Deprecated functions from JS-YAML 1.x.x
10119module.exports.scan = deprecated('scan');
10120module.exports.parse = deprecated('parse');
10121module.exports.compose = deprecated('compose');
10122module.exports.addConstructor = deprecated('addConstructor');
10123
Jian Li8afbbee2016-07-27 19:16:51 +090010124},{"./js-yaml/dumper":22,"./js-yaml/exception":23,"./js-yaml/loader":24,"./js-yaml/schema":26,"./js-yaml/schema/core":27,"./js-yaml/schema/default_full":28,"./js-yaml/schema/default_safe":29,"./js-yaml/schema/failsafe":30,"./js-yaml/schema/json":31,"./js-yaml/type":32}],21:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010125'use strict';
10126
10127
10128function isNothing(subject) {
Jian Li8afbbee2016-07-27 19:16:51 +090010129 return (typeof subject === 'undefined') || (subject === null);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010130}
10131
10132
10133function isObject(subject) {
Jian Li8afbbee2016-07-27 19:16:51 +090010134 return (typeof subject === 'object') && (subject !== null);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010135}
10136
10137
10138function toArray(sequence) {
Jian Li8afbbee2016-07-27 19:16:51 +090010139 if (Array.isArray(sequence)) return sequence;
10140 else if (isNothing(sequence)) return [];
10141
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010142 return [ sequence ];
10143}
10144
10145
10146function extend(target, source) {
10147 var index, length, key, sourceKeys;
10148
10149 if (source) {
10150 sourceKeys = Object.keys(source);
10151
10152 for (index = 0, length = sourceKeys.length; index < length; index += 1) {
10153 key = sourceKeys[index];
10154 target[key] = source[key];
10155 }
10156 }
10157
10158 return target;
10159}
10160
10161
10162function repeat(string, count) {
10163 var result = '', cycle;
10164
10165 for (cycle = 0; cycle < count; cycle += 1) {
10166 result += string;
10167 }
10168
10169 return result;
10170}
10171
10172
10173function isNegativeZero(number) {
Jian Li8afbbee2016-07-27 19:16:51 +090010174 return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010175}
10176
10177
10178module.exports.isNothing = isNothing;
10179module.exports.isObject = isObject;
10180module.exports.toArray = toArray;
10181module.exports.repeat = repeat;
10182module.exports.isNegativeZero = isNegativeZero;
10183module.exports.extend = extend;
10184
Jian Li8afbbee2016-07-27 19:16:51 +090010185},{}],22:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010186'use strict';
10187
10188/*eslint-disable no-use-before-define*/
10189
10190var common = require('./common');
10191var YAMLException = require('./exception');
10192var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
10193var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
10194
10195var _toString = Object.prototype.toString;
10196var _hasOwnProperty = Object.prototype.hasOwnProperty;
10197
10198var CHAR_TAB = 0x09; /* Tab */
10199var CHAR_LINE_FEED = 0x0A; /* LF */
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010200var CHAR_SPACE = 0x20; /* Space */
10201var CHAR_EXCLAMATION = 0x21; /* ! */
10202var CHAR_DOUBLE_QUOTE = 0x22; /* " */
10203var CHAR_SHARP = 0x23; /* # */
10204var CHAR_PERCENT = 0x25; /* % */
10205var CHAR_AMPERSAND = 0x26; /* & */
10206var CHAR_SINGLE_QUOTE = 0x27; /* ' */
10207var CHAR_ASTERISK = 0x2A; /* * */
10208var CHAR_COMMA = 0x2C; /* , */
10209var CHAR_MINUS = 0x2D; /* - */
10210var CHAR_COLON = 0x3A; /* : */
10211var CHAR_GREATER_THAN = 0x3E; /* > */
10212var CHAR_QUESTION = 0x3F; /* ? */
10213var CHAR_COMMERCIAL_AT = 0x40; /* @ */
10214var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
10215var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
10216var CHAR_GRAVE_ACCENT = 0x60; /* ` */
10217var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
10218var CHAR_VERTICAL_LINE = 0x7C; /* | */
10219var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
10220
10221var ESCAPE_SEQUENCES = {};
10222
10223ESCAPE_SEQUENCES[0x00] = '\\0';
10224ESCAPE_SEQUENCES[0x07] = '\\a';
10225ESCAPE_SEQUENCES[0x08] = '\\b';
10226ESCAPE_SEQUENCES[0x09] = '\\t';
10227ESCAPE_SEQUENCES[0x0A] = '\\n';
10228ESCAPE_SEQUENCES[0x0B] = '\\v';
10229ESCAPE_SEQUENCES[0x0C] = '\\f';
10230ESCAPE_SEQUENCES[0x0D] = '\\r';
10231ESCAPE_SEQUENCES[0x1B] = '\\e';
10232ESCAPE_SEQUENCES[0x22] = '\\"';
10233ESCAPE_SEQUENCES[0x5C] = '\\\\';
10234ESCAPE_SEQUENCES[0x85] = '\\N';
10235ESCAPE_SEQUENCES[0xA0] = '\\_';
10236ESCAPE_SEQUENCES[0x2028] = '\\L';
10237ESCAPE_SEQUENCES[0x2029] = '\\P';
10238
10239var DEPRECATED_BOOLEANS_SYNTAX = [
10240 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
10241 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
10242];
10243
10244function compileStyleMap(schema, map) {
10245 var result, keys, index, length, tag, style, type;
10246
Jian Li8afbbee2016-07-27 19:16:51 +090010247 if (map === null) return {};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010248
10249 result = {};
10250 keys = Object.keys(map);
10251
10252 for (index = 0, length = keys.length; index < length; index += 1) {
10253 tag = keys[index];
10254 style = String(map[tag]);
10255
Jian Li8afbbee2016-07-27 19:16:51 +090010256 if (tag.slice(0, 2) === '!!') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010257 tag = 'tag:yaml.org,2002:' + tag.slice(2);
10258 }
10259
10260 type = schema.compiledTypeMap[tag];
10261
10262 if (type && _hasOwnProperty.call(type.styleAliases, style)) {
10263 style = type.styleAliases[style];
10264 }
10265
10266 result[tag] = style;
10267 }
10268
10269 return result;
10270}
10271
10272function encodeHex(character) {
10273 var string, handle, length;
10274
10275 string = character.toString(16).toUpperCase();
10276
10277 if (character <= 0xFF) {
10278 handle = 'x';
10279 length = 2;
10280 } else if (character <= 0xFFFF) {
10281 handle = 'u';
10282 length = 4;
10283 } else if (character <= 0xFFFFFFFF) {
10284 handle = 'U';
10285 length = 8;
10286 } else {
10287 throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
10288 }
10289
10290 return '\\' + handle + common.repeat('0', length - string.length) + string;
10291}
10292
10293function State(options) {
Jian Li8afbbee2016-07-27 19:16:51 +090010294 this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
10295 this.indent = Math.max(1, (options['indent'] || 2));
10296 this.skipInvalid = options['skipInvalid'] || false;
10297 this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
10298 this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
10299 this.sortKeys = options['sortKeys'] || false;
Jian Li83d87a72016-04-20 15:38:24 -070010300 this.lineWidth = options['lineWidth'] || 80;
Jian Li8afbbee2016-07-27 19:16:51 +090010301 this.noRefs = options['noRefs'] || false;
10302 this.noCompatMode = options['noCompatMode'] || false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010303
10304 this.implicitTypes = this.schema.compiledImplicit;
10305 this.explicitTypes = this.schema.compiledExplicit;
10306
10307 this.tag = null;
10308 this.result = '';
10309
10310 this.duplicates = [];
10311 this.usedDuplicates = null;
10312}
10313
Jian Li8afbbee2016-07-27 19:16:51 +090010314// Indents every line in a string. Empty lines (\n only) are not indented.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010315function indentString(string, spaces) {
10316 var ind = common.repeat(' ', spaces),
10317 position = 0,
10318 next = -1,
10319 result = '',
10320 line,
10321 length = string.length;
10322
10323 while (position < length) {
10324 next = string.indexOf('\n', position);
10325 if (next === -1) {
10326 line = string.slice(position);
10327 position = length;
10328 } else {
10329 line = string.slice(position, next + 1);
10330 position = next + 1;
10331 }
Jian Li8afbbee2016-07-27 19:16:51 +090010332
10333 if (line.length && line !== '\n') result += ind;
10334
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010335 result += line;
10336 }
10337
10338 return result;
10339}
10340
10341function generateNextLine(state, level) {
10342 return '\n' + common.repeat(' ', state.indent * level);
10343}
10344
10345function testImplicitResolving(state, str) {
10346 var index, length, type;
10347
10348 for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
10349 type = state.implicitTypes[index];
10350
10351 if (type.resolve(str)) {
10352 return true;
10353 }
10354 }
10355
10356 return false;
10357}
10358
Jian Li8afbbee2016-07-27 19:16:51 +090010359// [33] s-white ::= s-space | s-tab
10360function isWhitespace(c) {
10361 return c === CHAR_SPACE || c === CHAR_TAB;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010362}
10363
Jian Li8afbbee2016-07-27 19:16:51 +090010364// Returns true if the character can be printed without escaping.
10365// From YAML 1.2: "any allowed characters known to be non-printable
10366// should also be escaped. [However,] This isn’t mandatory"
10367// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
10368function isPrintable(c) {
10369 return (0x00020 <= c && c <= 0x00007E)
10370 || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
10371 || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */)
10372 || (0x10000 <= c && c <= 0x10FFFF);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010373}
10374
Jian Li8afbbee2016-07-27 19:16:51 +090010375// Simplified test for values allowed after the first character in plain style.
10376function isPlainSafe(c) {
10377 // Uses a subset of nb-char - c-flow-indicator - ":" - "#"
10378 // where nb-char ::= c-printable - b-char - c-byte-order-mark.
10379 return isPrintable(c) && c !== 0xFEFF
10380 // - c-flow-indicator
10381 && c !== CHAR_COMMA
10382 && c !== CHAR_LEFT_SQUARE_BRACKET
10383 && c !== CHAR_RIGHT_SQUARE_BRACKET
10384 && c !== CHAR_LEFT_CURLY_BRACKET
10385 && c !== CHAR_RIGHT_CURLY_BRACKET
10386 // - ":" - "#"
10387 && c !== CHAR_COLON
10388 && c !== CHAR_SHARP;
10389}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010390
Jian Li8afbbee2016-07-27 19:16:51 +090010391// Simplified test for values allowed as the first character in plain style.
10392function isPlainSafeFirst(c) {
10393 // Uses a subset of ns-char - c-indicator
10394 // where ns-char = nb-char - s-white.
10395 return isPrintable(c) && c !== 0xFEFF
10396 && !isWhitespace(c) // - s-white
10397 // - (c-indicator ::=
10398 // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
10399 && c !== CHAR_MINUS
10400 && c !== CHAR_QUESTION
10401 && c !== CHAR_COLON
10402 && c !== CHAR_COMMA
10403 && c !== CHAR_LEFT_SQUARE_BRACKET
10404 && c !== CHAR_RIGHT_SQUARE_BRACKET
10405 && c !== CHAR_LEFT_CURLY_BRACKET
10406 && c !== CHAR_RIGHT_CURLY_BRACKET
10407 // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"”
10408 && c !== CHAR_SHARP
10409 && c !== CHAR_AMPERSAND
10410 && c !== CHAR_ASTERISK
10411 && c !== CHAR_EXCLAMATION
10412 && c !== CHAR_VERTICAL_LINE
10413 && c !== CHAR_GREATER_THAN
10414 && c !== CHAR_SINGLE_QUOTE
10415 && c !== CHAR_DOUBLE_QUOTE
10416 // | “%” | “@” | “`”)
10417 && c !== CHAR_PERCENT
10418 && c !== CHAR_COMMERCIAL_AT
10419 && c !== CHAR_GRAVE_ACCENT;
10420}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010421
Jian Li8afbbee2016-07-27 19:16:51 +090010422var STYLE_PLAIN = 1,
10423 STYLE_SINGLE = 2,
10424 STYLE_LITERAL = 3,
10425 STYLE_FOLDED = 4,
10426 STYLE_DOUBLE = 5;
10427
10428// Determines which scalar styles are possible and returns the preferred style.
10429// lineWidth = -1 => no limit.
10430// Pre-conditions: str.length > 0.
10431// Post-conditions:
10432// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
10433// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
10434// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
10435function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
10436 var i;
10437 var char;
10438 var hasLineBreak = false;
10439 var hasFoldableLine = false; // only checked if shouldTrackWidth
10440 var shouldTrackWidth = lineWidth !== -1;
10441 var previousLineBreak = -1; // count the first line correctly
10442 var plain = isPlainSafeFirst(string.charCodeAt(0))
10443 && !isWhitespace(string.charCodeAt(string.length - 1));
10444
10445 if (singleLineOnly) {
10446 // Case: no block styles.
10447 // Check for disallowed characters to rule out plain and single.
10448 for (i = 0; i < string.length; i++) {
10449 char = string.charCodeAt(i);
10450 if (!isPrintable(char)) {
10451 return STYLE_DOUBLE;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010452 }
Jian Li8afbbee2016-07-27 19:16:51 +090010453 plain = plain && isPlainSafe(char);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010454 }
Jian Li8afbbee2016-07-27 19:16:51 +090010455 } else {
10456 // Case: block styles permitted.
10457 for (i = 0; i < string.length; i++) {
10458 char = string.charCodeAt(i);
10459 if (char === CHAR_LINE_FEED) {
10460 hasLineBreak = true;
10461 // Check if any line can be folded.
10462 if (shouldTrackWidth) {
10463 hasFoldableLine = hasFoldableLine ||
10464 // Foldable line = too long, and not more-indented.
10465 (i - previousLineBreak - 1 > lineWidth &&
10466 string[previousLineBreak + 1] !== ' ');
10467 previousLineBreak = i;
10468 }
10469 } else if (!isPrintable(char)) {
10470 return STYLE_DOUBLE;
10471 }
10472 plain = plain && isPlainSafe(char);
10473 }
10474 // in case the end is missing a \n
10475 hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
10476 (i - previousLineBreak - 1 > lineWidth &&
10477 string[previousLineBreak + 1] !== ' '));
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010478 }
Jian Li8afbbee2016-07-27 19:16:51 +090010479 // Although every style can represent \n without escaping, prefer block styles
10480 // for multiline, since they're more readable and they don't add empty lines.
10481 // Also prefer folding a super-long line.
10482 if (!hasLineBreak && !hasFoldableLine) {
10483 // Strings interpretable as another type have to be quoted;
10484 // e.g. the string 'true' vs. the boolean true.
10485 return plain && !testAmbiguousType(string)
10486 ? STYLE_PLAIN : STYLE_SINGLE;
10487 }
10488 // Edge case: block indentation indicator can only have one digit.
10489 if (string[0] === ' ' && indentPerLevel > 9) {
10490 return STYLE_DOUBLE;
10491 }
10492 // At this point we know block styles are valid.
10493 // Prefer literal style unless we want to fold.
10494 return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
10495}
10496
10497// Note: line breaking/folding is implemented for only the folded style.
10498// NB. We drop the last trailing newline (if any) of a returned block scalar
10499// since the dumper adds its own newline. This always works:
10500// • No ending newline => unaffected; already using strip "-" chomping.
10501// • Ending newline => removed then restored.
10502// Importantly, this keeps the "+" chomp indicator from gaining an extra line.
10503function writeScalar(state, string, level, iskey) {
10504 state.dump = (function () {
10505 if (string.length === 0) {
10506 return "''";
10507 }
10508 if (!state.noCompatMode &&
10509 DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
10510 return "'" + string + "'";
10511 }
10512
10513 var indent = state.indent * Math.max(1, level); // no 0-indent scalars
10514 // As indentation gets deeper, let the width decrease monotonically
10515 // to the lower bound min(state.lineWidth, 40).
10516 // Note that this implies
10517 // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
10518 // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
10519 // This behaves better than a constant minimum width which disallows narrower options,
10520 // or an indent threshold which causes the width to suddenly increase.
10521 var lineWidth = state.lineWidth === -1
10522 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
10523
10524 // Without knowing if keys are implicit/explicit, assume implicit for safety.
10525 var singleLineOnly = iskey
10526 // No block styles in flow mode.
10527 || (state.flowLevel > -1 && level >= state.flowLevel);
10528 function testAmbiguity(string) {
10529 return testImplicitResolving(state, string);
10530 }
10531
10532 switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
10533 case STYLE_PLAIN:
10534 return string;
10535 case STYLE_SINGLE:
10536 return "'" + string.replace(/'/g, "''") + "'";
10537 case STYLE_LITERAL:
10538 return '|' + blockHeader(string, state.indent)
10539 + dropEndingNewline(indentString(string, indent));
10540 case STYLE_FOLDED:
10541 return '>' + blockHeader(string, state.indent)
10542 + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
10543 case STYLE_DOUBLE:
10544 return '"' + escapeString(string, lineWidth) + '"';
10545 default:
10546 throw new YAMLException('impossible error: invalid scalar style');
10547 }
10548 }());
10549}
10550
10551// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
10552function blockHeader(string, indentPerLevel) {
10553 var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';
10554
10555 // note the special case: the string '\n' counts as a "trailing" empty line.
10556 var clip = string[string.length - 1] === '\n';
10557 var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
10558 var chomp = keep ? '+' : (clip ? '' : '-');
10559
10560 return indentIndicator + chomp + '\n';
10561}
10562
10563// (See the note for writeScalar.)
10564function dropEndingNewline(string) {
10565 return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
10566}
10567
10568// Note: a long line without a suitable break point will exceed the width limit.
10569// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
10570function foldString(string, width) {
10571 // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
10572 // unless they're before or after a more-indented line, or at the very
10573 // beginning or end, in which case $k$ maps to $k$.
10574 // Therefore, parse each chunk as newline(s) followed by a content line.
10575 var lineRe = /(\n+)([^\n]*)/g;
10576
10577 // first line (possibly an empty line)
10578 var result = (function () {
10579 var nextLF = string.indexOf('\n');
10580 nextLF = nextLF !== -1 ? nextLF : string.length;
10581 lineRe.lastIndex = nextLF;
10582 return foldLine(string.slice(0, nextLF), width);
10583 }());
10584 // If we haven't reached the first content line yet, don't add an extra \n.
10585 var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
10586 var moreIndented;
10587
10588 // rest of the lines
10589 var match;
10590 while ((match = lineRe.exec(string))) {
10591 var prefix = match[1], line = match[2];
10592 moreIndented = (line[0] === ' ');
10593 result += prefix
10594 + (!prevMoreIndented && !moreIndented && line !== ''
10595 ? '\n' : '')
10596 + foldLine(line, width);
10597 prevMoreIndented = moreIndented;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010598 }
10599
10600 return result;
10601}
10602
Jian Li8afbbee2016-07-27 19:16:51 +090010603// Greedy line breaking.
10604// Picks the longest line under the limit each time,
10605// otherwise settles for the shortest line over the limit.
10606// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
10607function foldLine(line, width) {
10608 if (line === '' || line[0] === ' ') return line;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010609
Jian Li8afbbee2016-07-27 19:16:51 +090010610 // Since a more-indented line adds a \n, breaks can't be followed by a space.
10611 var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
10612 var match;
10613 // start is an inclusive index. end, curr, and next are exclusive.
10614 var start = 0, end, curr = 0, next = 0;
10615 var result = '';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010616
Jian Li8afbbee2016-07-27 19:16:51 +090010617 // Invariants: 0 <= start <= length-1.
10618 // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
10619 // Inside the loop:
10620 // A match implies length >= 2, so curr and next are <= length-2.
10621 while ((match = breakRe.exec(line))) {
10622 next = match.index;
10623 // maintain invariant: curr - start <= width
10624 if (next - start > width) {
10625 end = (curr > start) ? curr : next; // derive end <= length-2
10626 result += '\n' + line.slice(start, end);
10627 // skip the space that was output as \n
10628 start = end + 1; // derive start <= length-1
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010629 }
Jian Li8afbbee2016-07-27 19:16:51 +090010630 curr = next;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010631 }
10632
Jian Li8afbbee2016-07-27 19:16:51 +090010633 // By the invariants, start <= length-1, so there is something left over.
10634 // It is either the whole string or a part starting from non-whitespace.
10635 result += '\n';
10636 // Insert a break if the remainder is too long and there is a break available.
10637 if (line.length - start > width && curr > start) {
10638 result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010639 } else {
Jian Li8afbbee2016-07-27 19:16:51 +090010640 result += line.slice(start);
10641 }
10642
10643 return result.slice(1); // drop extra \n joiner
10644}
10645
10646// Escapes a double-quoted string.
10647function escapeString(string) {
10648 var result = '';
10649 var char;
10650 var escapeSeq;
10651
10652 for (var i = 0; i < string.length; i++) {
10653 char = string.charCodeAt(i);
10654 escapeSeq = ESCAPE_SEQUENCES[char];
10655 result += !escapeSeq && isPrintable(char)
10656 ? string[i]
10657 : escapeSeq || encodeHex(char);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010658 }
10659
10660 return result;
10661}
10662
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010663function writeFlowSequence(state, level, object) {
10664 var _result = '',
10665 _tag = state.tag,
10666 index,
10667 length;
10668
10669 for (index = 0, length = object.length; index < length; index += 1) {
10670 // Write only valid elements.
10671 if (writeNode(state, level, object[index], false, false)) {
Jian Li8afbbee2016-07-27 19:16:51 +090010672 if (index !== 0) _result += ', ';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010673 _result += state.dump;
10674 }
10675 }
10676
10677 state.tag = _tag;
10678 state.dump = '[' + _result + ']';
10679}
10680
10681function writeBlockSequence(state, level, object, compact) {
10682 var _result = '',
10683 _tag = state.tag,
10684 index,
10685 length;
10686
10687 for (index = 0, length = object.length; index < length; index += 1) {
10688 // Write only valid elements.
10689 if (writeNode(state, level + 1, object[index], true, true)) {
Jian Li8afbbee2016-07-27 19:16:51 +090010690 if (!compact || index !== 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010691 _result += generateNextLine(state, level);
10692 }
10693 _result += '- ' + state.dump;
10694 }
10695 }
10696
10697 state.tag = _tag;
10698 state.dump = _result || '[]'; // Empty sequence if no valid values.
10699}
10700
10701function writeFlowMapping(state, level, object) {
10702 var _result = '',
10703 _tag = state.tag,
10704 objectKeyList = Object.keys(object),
10705 index,
10706 length,
10707 objectKey,
10708 objectValue,
10709 pairBuffer;
10710
10711 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
10712 pairBuffer = '';
10713
Jian Li8afbbee2016-07-27 19:16:51 +090010714 if (index !== 0) pairBuffer += ', ';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010715
10716 objectKey = objectKeyList[index];
10717 objectValue = object[objectKey];
10718
10719 if (!writeNode(state, level, objectKey, false, false)) {
10720 continue; // Skip this pair because of invalid key;
10721 }
10722
Jian Li8afbbee2016-07-27 19:16:51 +090010723 if (state.dump.length > 1024) pairBuffer += '? ';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010724
10725 pairBuffer += state.dump + ': ';
10726
10727 if (!writeNode(state, level, objectValue, false, false)) {
10728 continue; // Skip this pair because of invalid value.
10729 }
10730
10731 pairBuffer += state.dump;
10732
10733 // Both key and value are valid.
10734 _result += pairBuffer;
10735 }
10736
10737 state.tag = _tag;
10738 state.dump = '{' + _result + '}';
10739}
10740
10741function writeBlockMapping(state, level, object, compact) {
10742 var _result = '',
10743 _tag = state.tag,
10744 objectKeyList = Object.keys(object),
10745 index,
10746 length,
10747 objectKey,
10748 objectValue,
10749 explicitPair,
10750 pairBuffer;
10751
10752 // Allow sorting keys so that the output file is deterministic
10753 if (state.sortKeys === true) {
10754 // Default sorting
10755 objectKeyList.sort();
10756 } else if (typeof state.sortKeys === 'function') {
10757 // Custom sort function
10758 objectKeyList.sort(state.sortKeys);
10759 } else if (state.sortKeys) {
10760 // Something is wrong
10761 throw new YAMLException('sortKeys must be a boolean or a function');
10762 }
10763
10764 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
10765 pairBuffer = '';
10766
Jian Li8afbbee2016-07-27 19:16:51 +090010767 if (!compact || index !== 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010768 pairBuffer += generateNextLine(state, level);
10769 }
10770
10771 objectKey = objectKeyList[index];
10772 objectValue = object[objectKey];
10773
Jian Li83d87a72016-04-20 15:38:24 -070010774 if (!writeNode(state, level + 1, objectKey, true, true, true)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010775 continue; // Skip this pair because of invalid key.
10776 }
10777
Jian Li8afbbee2016-07-27 19:16:51 +090010778 explicitPair = (state.tag !== null && state.tag !== '?') ||
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010779 (state.dump && state.dump.length > 1024);
10780
10781 if (explicitPair) {
10782 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
10783 pairBuffer += '?';
10784 } else {
10785 pairBuffer += '? ';
10786 }
10787 }
10788
10789 pairBuffer += state.dump;
10790
10791 if (explicitPair) {
10792 pairBuffer += generateNextLine(state, level);
10793 }
10794
10795 if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
10796 continue; // Skip this pair because of invalid value.
10797 }
10798
10799 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
10800 pairBuffer += ':';
10801 } else {
10802 pairBuffer += ': ';
10803 }
10804
10805 pairBuffer += state.dump;
10806
10807 // Both key and value are valid.
10808 _result += pairBuffer;
10809 }
10810
10811 state.tag = _tag;
10812 state.dump = _result || '{}'; // Empty mapping if no valid pairs.
10813}
10814
10815function detectType(state, object, explicit) {
10816 var _result, typeList, index, length, type, style;
10817
10818 typeList = explicit ? state.explicitTypes : state.implicitTypes;
10819
10820 for (index = 0, length = typeList.length; index < length; index += 1) {
10821 type = typeList[index];
10822
10823 if ((type.instanceOf || type.predicate) &&
Jian Li8afbbee2016-07-27 19:16:51 +090010824 (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010825 (!type.predicate || type.predicate(object))) {
10826
10827 state.tag = explicit ? type.tag : '?';
10828
10829 if (type.represent) {
10830 style = state.styleMap[type.tag] || type.defaultStyle;
10831
Jian Li8afbbee2016-07-27 19:16:51 +090010832 if (_toString.call(type.represent) === '[object Function]') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010833 _result = type.represent(object, style);
10834 } else if (_hasOwnProperty.call(type.represent, style)) {
10835 _result = type.represent[style](object, style);
10836 } else {
10837 throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
10838 }
10839
10840 state.dump = _result;
10841 }
10842
10843 return true;
10844 }
10845 }
10846
10847 return false;
10848}
10849
10850// Serializes `object` and writes it to global `result`.
10851// Returns true on success, or false on invalid object.
10852//
Jian Li83d87a72016-04-20 15:38:24 -070010853function writeNode(state, level, object, block, compact, iskey) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010854 state.tag = null;
10855 state.dump = object;
10856
10857 if (!detectType(state, object, false)) {
10858 detectType(state, object, true);
10859 }
10860
10861 var type = _toString.call(state.dump);
10862
10863 if (block) {
Jian Li8afbbee2016-07-27 19:16:51 +090010864 block = (state.flowLevel < 0 || state.flowLevel > level);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010865 }
10866
Jian Li8afbbee2016-07-27 19:16:51 +090010867 var objectOrArray = type === '[object Object]' || type === '[object Array]',
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010868 duplicateIndex,
10869 duplicate;
10870
10871 if (objectOrArray) {
10872 duplicateIndex = state.duplicates.indexOf(object);
10873 duplicate = duplicateIndex !== -1;
10874 }
10875
Jian Li8afbbee2016-07-27 19:16:51 +090010876 if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
Jian Li83d87a72016-04-20 15:38:24 -070010877 compact = false;
10878 }
10879
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010880 if (duplicate && state.usedDuplicates[duplicateIndex]) {
10881 state.dump = '*ref_' + duplicateIndex;
10882 } else {
10883 if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
10884 state.usedDuplicates[duplicateIndex] = true;
10885 }
Jian Li8afbbee2016-07-27 19:16:51 +090010886 if (type === '[object Object]') {
10887 if (block && (Object.keys(state.dump).length !== 0)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010888 writeBlockMapping(state, level, state.dump, compact);
10889 if (duplicate) {
Jian Li83d87a72016-04-20 15:38:24 -070010890 state.dump = '&ref_' + duplicateIndex + state.dump;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010891 }
10892 } else {
10893 writeFlowMapping(state, level, state.dump);
10894 if (duplicate) {
10895 state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
10896 }
10897 }
Jian Li8afbbee2016-07-27 19:16:51 +090010898 } else if (type === '[object Array]') {
10899 if (block && (state.dump.length !== 0)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010900 writeBlockSequence(state, level, state.dump, compact);
10901 if (duplicate) {
Jian Li83d87a72016-04-20 15:38:24 -070010902 state.dump = '&ref_' + duplicateIndex + state.dump;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010903 }
10904 } else {
10905 writeFlowSequence(state, level, state.dump);
10906 if (duplicate) {
10907 state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
10908 }
10909 }
Jian Li8afbbee2016-07-27 19:16:51 +090010910 } else if (type === '[object String]') {
10911 if (state.tag !== '?') {
Jian Li83d87a72016-04-20 15:38:24 -070010912 writeScalar(state, state.dump, level, iskey);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010913 }
10914 } else {
Jian Li8afbbee2016-07-27 19:16:51 +090010915 if (state.skipInvalid) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010916 throw new YAMLException('unacceptable kind of an object to dump ' + type);
10917 }
10918
Jian Li8afbbee2016-07-27 19:16:51 +090010919 if (state.tag !== null && state.tag !== '?') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010920 state.dump = '!<' + state.tag + '> ' + state.dump;
10921 }
10922 }
10923
10924 return true;
10925}
10926
10927function getDuplicateReferences(object, state) {
10928 var objects = [],
10929 duplicatesIndexes = [],
10930 index,
10931 length;
10932
10933 inspectNode(object, objects, duplicatesIndexes);
10934
10935 for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
10936 state.duplicates.push(objects[duplicatesIndexes[index]]);
10937 }
10938 state.usedDuplicates = new Array(length);
10939}
10940
10941function inspectNode(object, objects, duplicatesIndexes) {
Jian Li83d87a72016-04-20 15:38:24 -070010942 var objectKeyList,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010943 index,
10944 length;
10945
Jian Li8afbbee2016-07-27 19:16:51 +090010946 if (object !== null && typeof object === 'object') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010947 index = objects.indexOf(object);
Jian Li8afbbee2016-07-27 19:16:51 +090010948 if (index !== -1) {
10949 if (duplicatesIndexes.indexOf(index) === -1) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010950 duplicatesIndexes.push(index);
10951 }
10952 } else {
10953 objects.push(object);
10954
10955 if (Array.isArray(object)) {
10956 for (index = 0, length = object.length; index < length; index += 1) {
10957 inspectNode(object[index], objects, duplicatesIndexes);
10958 }
10959 } else {
10960 objectKeyList = Object.keys(object);
10961
10962 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
10963 inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
10964 }
10965 }
10966 }
10967 }
10968}
10969
10970function dump(input, options) {
10971 options = options || {};
10972
10973 var state = new State(options);
10974
Jian Li8afbbee2016-07-27 19:16:51 +090010975 if (!state.noRefs) getDuplicateReferences(input, state);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010976
Jian Li8afbbee2016-07-27 19:16:51 +090010977 if (writeNode(state, 0, input, true, true)) return state.dump + '\n';
10978
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010979 return '';
10980}
10981
10982function safeDump(input, options) {
10983 return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
10984}
10985
10986module.exports.dump = dump;
10987module.exports.safeDump = safeDump;
10988
Jian Li8afbbee2016-07-27 19:16:51 +090010989},{"./common":21,"./exception":23,"./schema/default_full":28,"./schema/default_safe":29}],23:[function(require,module,exports){
Jian Li83d87a72016-04-20 15:38:24 -070010990// YAML error class. http://stackoverflow.com/questions/8458984
10991//
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010992'use strict';
10993
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070010994function YAMLException(reason, mark) {
Jian Li83d87a72016-04-20 15:38:24 -070010995 // Super constructor
10996 Error.call(this);
10997
10998 // Include stack trace in error object
10999 if (Error.captureStackTrace) {
11000 // Chrome and NodeJS
11001 Error.captureStackTrace(this, this.constructor);
11002 } else {
11003 // FF, IE 10+ and Safari 6+. Fallback for others
11004 this.stack = (new Error()).stack || '';
11005 }
11006
11007 this.name = 'YAMLException';
11008 this.reason = reason;
11009 this.mark = mark;
11010 this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011011}
11012
11013
Jian Li83d87a72016-04-20 15:38:24 -070011014// Inherit from Error
Jian Li8afbbee2016-07-27 19:16:51 +090011015YAMLException.prototype = Object.create(Error.prototype);
11016YAMLException.prototype.constructor = YAMLException;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011017
Jian Li83d87a72016-04-20 15:38:24 -070011018
11019YAMLException.prototype.toString = function toString(compact) {
11020 var result = this.name + ': ';
11021
11022 result += this.reason || '(unknown reason)';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011023
11024 if (!compact && this.mark) {
11025 result += ' ' + this.mark.toString();
11026 }
11027
11028 return result;
11029};
11030
11031
11032module.exports = YAMLException;
11033
Jian Li8afbbee2016-07-27 19:16:51 +090011034},{}],24:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011035'use strict';
11036
11037/*eslint-disable max-len,no-use-before-define*/
11038
11039var common = require('./common');
11040var YAMLException = require('./exception');
11041var Mark = require('./mark');
11042var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
11043var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
11044
11045
11046var _hasOwnProperty = Object.prototype.hasOwnProperty;
11047
11048
11049var CONTEXT_FLOW_IN = 1;
11050var CONTEXT_FLOW_OUT = 2;
11051var CONTEXT_BLOCK_IN = 3;
11052var CONTEXT_BLOCK_OUT = 4;
11053
11054
11055var CHOMPING_CLIP = 1;
11056var CHOMPING_STRIP = 2;
11057var CHOMPING_KEEP = 3;
11058
11059
11060var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
11061var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
11062var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
11063var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
11064var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
11065
11066
11067function is_EOL(c) {
11068 return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
11069}
11070
11071function is_WHITE_SPACE(c) {
11072 return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
11073}
11074
11075function is_WS_OR_EOL(c) {
11076 return (c === 0x09/* Tab */) ||
11077 (c === 0x20/* Space */) ||
11078 (c === 0x0A/* LF */) ||
11079 (c === 0x0D/* CR */);
11080}
11081
11082function is_FLOW_INDICATOR(c) {
Jian Li8afbbee2016-07-27 19:16:51 +090011083 return c === 0x2C/* , */ ||
11084 c === 0x5B/* [ */ ||
11085 c === 0x5D/* ] */ ||
11086 c === 0x7B/* { */ ||
11087 c === 0x7D/* } */;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011088}
11089
11090function fromHexCode(c) {
11091 var lc;
11092
11093 if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
11094 return c - 0x30;
11095 }
11096
11097 /*eslint-disable no-bitwise*/
11098 lc = c | 0x20;
11099
11100 if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
11101 return lc - 0x61 + 10;
11102 }
11103
11104 return -1;
11105}
11106
11107function escapedHexLen(c) {
11108 if (c === 0x78/* x */) { return 2; }
11109 if (c === 0x75/* u */) { return 4; }
11110 if (c === 0x55/* U */) { return 8; }
11111 return 0;
11112}
11113
11114function fromDecimalCode(c) {
11115 if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
11116 return c - 0x30;
11117 }
11118
11119 return -1;
11120}
11121
11122function simpleEscapeSequence(c) {
11123 return (c === 0x30/* 0 */) ? '\x00' :
11124 (c === 0x61/* a */) ? '\x07' :
11125 (c === 0x62/* b */) ? '\x08' :
11126 (c === 0x74/* t */) ? '\x09' :
11127 (c === 0x09/* Tab */) ? '\x09' :
11128 (c === 0x6E/* n */) ? '\x0A' :
11129 (c === 0x76/* v */) ? '\x0B' :
11130 (c === 0x66/* f */) ? '\x0C' :
11131 (c === 0x72/* r */) ? '\x0D' :
11132 (c === 0x65/* e */) ? '\x1B' :
11133 (c === 0x20/* Space */) ? ' ' :
11134 (c === 0x22/* " */) ? '\x22' :
11135 (c === 0x2F/* / */) ? '/' :
11136 (c === 0x5C/* \ */) ? '\x5C' :
11137 (c === 0x4E/* N */) ? '\x85' :
11138 (c === 0x5F/* _ */) ? '\xA0' :
11139 (c === 0x4C/* L */) ? '\u2028' :
11140 (c === 0x50/* P */) ? '\u2029' : '';
11141}
11142
11143function charFromCodepoint(c) {
11144 if (c <= 0xFFFF) {
11145 return String.fromCharCode(c);
11146 }
11147 // Encode UTF-16 surrogate pair
11148 // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
11149 return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800,
11150 ((c - 0x010000) & 0x03FF) + 0xDC00);
11151}
11152
11153var simpleEscapeCheck = new Array(256); // integer, for fast access
11154var simpleEscapeMap = new Array(256);
11155for (var i = 0; i < 256; i++) {
11156 simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
11157 simpleEscapeMap[i] = simpleEscapeSequence(i);
11158}
11159
11160
11161function State(input, options) {
11162 this.input = input;
11163
11164 this.filename = options['filename'] || null;
11165 this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
11166 this.onWarning = options['onWarning'] || null;
11167 this.legacy = options['legacy'] || false;
Jian Li8afbbee2016-07-27 19:16:51 +090011168 this.json = options['json'] || false;
11169 this.listener = options['listener'] || null;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011170
11171 this.implicitTypes = this.schema.compiledImplicit;
11172 this.typeMap = this.schema.compiledTypeMap;
11173
11174 this.length = input.length;
11175 this.position = 0;
11176 this.line = 0;
11177 this.lineStart = 0;
11178 this.lineIndent = 0;
11179
11180 this.documents = [];
11181
11182 /*
11183 this.version;
11184 this.checkLineBreaks;
11185 this.tagMap;
11186 this.anchorMap;
11187 this.tag;
11188 this.anchor;
11189 this.kind;
11190 this.result;*/
11191
11192}
11193
11194
11195function generateError(state, message) {
11196 return new YAMLException(
11197 message,
11198 new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
11199}
11200
11201function throwError(state, message) {
11202 throw generateError(state, message);
11203}
11204
11205function throwWarning(state, message) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011206 if (state.onWarning) {
Jian Li83d87a72016-04-20 15:38:24 -070011207 state.onWarning.call(null, generateError(state, message));
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011208 }
11209}
11210
11211
11212var directiveHandlers = {
11213
11214 YAML: function handleYamlDirective(state, name, args) {
11215
Jian Li8afbbee2016-07-27 19:16:51 +090011216 var match, major, minor;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011217
Jian Li8afbbee2016-07-27 19:16:51 +090011218 if (state.version !== null) {
11219 throwError(state, 'duplication of %YAML directive');
11220 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011221
Jian Li8afbbee2016-07-27 19:16:51 +090011222 if (args.length !== 1) {
11223 throwError(state, 'YAML directive accepts exactly one argument');
11224 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011225
Jian Li8afbbee2016-07-27 19:16:51 +090011226 match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011227
Jian Li8afbbee2016-07-27 19:16:51 +090011228 if (match === null) {
11229 throwError(state, 'ill-formed argument of the YAML directive');
11230 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011231
Jian Li8afbbee2016-07-27 19:16:51 +090011232 major = parseInt(match[1], 10);
11233 minor = parseInt(match[2], 10);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011234
Jian Li8afbbee2016-07-27 19:16:51 +090011235 if (major !== 1) {
11236 throwError(state, 'unacceptable YAML version of the document');
11237 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011238
Jian Li8afbbee2016-07-27 19:16:51 +090011239 state.version = args[0];
11240 state.checkLineBreaks = (minor < 2);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011241
Jian Li8afbbee2016-07-27 19:16:51 +090011242 if (minor !== 1 && minor !== 2) {
11243 throwWarning(state, 'unsupported YAML version of the document');
11244 }
11245 },
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011246
11247 TAG: function handleTagDirective(state, name, args) {
11248
Jian Li8afbbee2016-07-27 19:16:51 +090011249 var handle, prefix;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011250
Jian Li8afbbee2016-07-27 19:16:51 +090011251 if (args.length !== 2) {
11252 throwError(state, 'TAG directive accepts exactly two arguments');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011253 }
Jian Li8afbbee2016-07-27 19:16:51 +090011254
11255 handle = args[0];
11256 prefix = args[1];
11257
11258 if (!PATTERN_TAG_HANDLE.test(handle)) {
11259 throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
11260 }
11261
11262 if (_hasOwnProperty.call(state.tagMap, handle)) {
11263 throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
11264 }
11265
11266 if (!PATTERN_TAG_URI.test(prefix)) {
11267 throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
11268 }
11269
11270 state.tagMap[handle] = prefix;
11271 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011272};
11273
11274
11275function captureSegment(state, start, end, checkJson) {
11276 var _position, _length, _character, _result;
11277
11278 if (start < end) {
11279 _result = state.input.slice(start, end);
11280
11281 if (checkJson) {
11282 for (_position = 0, _length = _result.length;
11283 _position < _length;
11284 _position += 1) {
11285 _character = _result.charCodeAt(_position);
Jian Li8afbbee2016-07-27 19:16:51 +090011286 if (!(_character === 0x09 ||
11287 (0x20 <= _character && _character <= 0x10FFFF))) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011288 throwError(state, 'expected valid JSON character');
11289 }
11290 }
Jian Li83d87a72016-04-20 15:38:24 -070011291 } else if (PATTERN_NON_PRINTABLE.test(_result)) {
11292 throwError(state, 'the stream contains non-printable characters');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011293 }
11294
11295 state.result += _result;
11296 }
11297}
11298
Jian Li8afbbee2016-07-27 19:16:51 +090011299function mergeMappings(state, destination, source, overridableKeys) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011300 var sourceKeys, key, index, quantity;
11301
11302 if (!common.isObject(source)) {
11303 throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
11304 }
11305
11306 sourceKeys = Object.keys(source);
11307
11308 for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
11309 key = sourceKeys[index];
11310
11311 if (!_hasOwnProperty.call(destination, key)) {
11312 destination[key] = source[key];
Jian Li8afbbee2016-07-27 19:16:51 +090011313 overridableKeys[key] = true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011314 }
11315 }
11316}
11317
Jian Li8afbbee2016-07-27 19:16:51 +090011318function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011319 var index, quantity;
11320
11321 keyNode = String(keyNode);
11322
Jian Li8afbbee2016-07-27 19:16:51 +090011323 if (_result === null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011324 _result = {};
11325 }
11326
Jian Li8afbbee2016-07-27 19:16:51 +090011327 if (keyTag === 'tag:yaml.org,2002:merge') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011328 if (Array.isArray(valueNode)) {
11329 for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
Jian Li8afbbee2016-07-27 19:16:51 +090011330 mergeMappings(state, _result, valueNode[index], overridableKeys);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011331 }
11332 } else {
Jian Li8afbbee2016-07-27 19:16:51 +090011333 mergeMappings(state, _result, valueNode, overridableKeys);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011334 }
11335 } else {
Jian Li8afbbee2016-07-27 19:16:51 +090011336 if (!state.json &&
11337 !_hasOwnProperty.call(overridableKeys, keyNode) &&
11338 _hasOwnProperty.call(_result, keyNode)) {
11339 throwError(state, 'duplicated mapping key');
11340 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011341 _result[keyNode] = valueNode;
Jian Li8afbbee2016-07-27 19:16:51 +090011342 delete overridableKeys[keyNode];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011343 }
11344
11345 return _result;
11346}
11347
11348function readLineBreak(state) {
11349 var ch;
11350
11351 ch = state.input.charCodeAt(state.position);
11352
Jian Li8afbbee2016-07-27 19:16:51 +090011353 if (ch === 0x0A/* LF */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011354 state.position++;
Jian Li8afbbee2016-07-27 19:16:51 +090011355 } else if (ch === 0x0D/* CR */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011356 state.position++;
Jian Li8afbbee2016-07-27 19:16:51 +090011357 if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011358 state.position++;
11359 }
11360 } else {
11361 throwError(state, 'a line break is expected');
11362 }
11363
11364 state.line += 1;
11365 state.lineStart = state.position;
11366}
11367
11368function skipSeparationSpace(state, allowComments, checkIndent) {
11369 var lineBreaks = 0,
11370 ch = state.input.charCodeAt(state.position);
11371
Jian Li8afbbee2016-07-27 19:16:51 +090011372 while (ch !== 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011373 while (is_WHITE_SPACE(ch)) {
11374 ch = state.input.charCodeAt(++state.position);
11375 }
11376
Jian Li8afbbee2016-07-27 19:16:51 +090011377 if (allowComments && ch === 0x23/* # */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011378 do {
11379 ch = state.input.charCodeAt(++state.position);
Jian Li8afbbee2016-07-27 19:16:51 +090011380 } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011381 }
11382
11383 if (is_EOL(ch)) {
11384 readLineBreak(state);
11385
11386 ch = state.input.charCodeAt(state.position);
11387 lineBreaks++;
11388 state.lineIndent = 0;
11389
Jian Li8afbbee2016-07-27 19:16:51 +090011390 while (ch === 0x20/* Space */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011391 state.lineIndent++;
11392 ch = state.input.charCodeAt(++state.position);
11393 }
11394 } else {
11395 break;
11396 }
11397 }
11398
Jian Li8afbbee2016-07-27 19:16:51 +090011399 if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011400 throwWarning(state, 'deficient indentation');
11401 }
11402
11403 return lineBreaks;
11404}
11405
11406function testDocumentSeparator(state) {
11407 var _position = state.position,
11408 ch;
11409
11410 ch = state.input.charCodeAt(_position);
11411
11412 // Condition state.position === state.lineStart is tested
11413 // in parent on each call, for efficiency. No needs to test here again.
Jian Li8afbbee2016-07-27 19:16:51 +090011414 if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
11415 ch === state.input.charCodeAt(_position + 1) &&
11416 ch === state.input.charCodeAt(_position + 2)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011417
11418 _position += 3;
11419
11420 ch = state.input.charCodeAt(_position);
11421
11422 if (ch === 0 || is_WS_OR_EOL(ch)) {
11423 return true;
11424 }
11425 }
11426
11427 return false;
11428}
11429
11430function writeFoldedLines(state, count) {
Jian Li8afbbee2016-07-27 19:16:51 +090011431 if (count === 1) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011432 state.result += ' ';
11433 } else if (count > 1) {
11434 state.result += common.repeat('\n', count - 1);
11435 }
11436}
11437
11438
11439function readPlainScalar(state, nodeIndent, withinFlowCollection) {
11440 var preceding,
11441 following,
11442 captureStart,
11443 captureEnd,
11444 hasPendingContent,
11445 _line,
11446 _lineStart,
11447 _lineIndent,
11448 _kind = state.kind,
11449 _result = state.result,
11450 ch;
11451
11452 ch = state.input.charCodeAt(state.position);
11453
Jian Li8afbbee2016-07-27 19:16:51 +090011454 if (is_WS_OR_EOL(ch) ||
11455 is_FLOW_INDICATOR(ch) ||
11456 ch === 0x23/* # */ ||
11457 ch === 0x26/* & */ ||
11458 ch === 0x2A/* * */ ||
11459 ch === 0x21/* ! */ ||
11460 ch === 0x7C/* | */ ||
11461 ch === 0x3E/* > */ ||
11462 ch === 0x27/* ' */ ||
11463 ch === 0x22/* " */ ||
11464 ch === 0x25/* % */ ||
11465 ch === 0x40/* @ */ ||
11466 ch === 0x60/* ` */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011467 return false;
11468 }
11469
Jian Li8afbbee2016-07-27 19:16:51 +090011470 if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011471 following = state.input.charCodeAt(state.position + 1);
11472
11473 if (is_WS_OR_EOL(following) ||
11474 withinFlowCollection && is_FLOW_INDICATOR(following)) {
11475 return false;
11476 }
11477 }
11478
11479 state.kind = 'scalar';
11480 state.result = '';
11481 captureStart = captureEnd = state.position;
11482 hasPendingContent = false;
11483
Jian Li8afbbee2016-07-27 19:16:51 +090011484 while (ch !== 0) {
11485 if (ch === 0x3A/* : */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011486 following = state.input.charCodeAt(state.position + 1);
11487
11488 if (is_WS_OR_EOL(following) ||
11489 withinFlowCollection && is_FLOW_INDICATOR(following)) {
11490 break;
11491 }
11492
Jian Li8afbbee2016-07-27 19:16:51 +090011493 } else if (ch === 0x23/* # */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011494 preceding = state.input.charCodeAt(state.position - 1);
11495
11496 if (is_WS_OR_EOL(preceding)) {
11497 break;
11498 }
11499
11500 } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
11501 withinFlowCollection && is_FLOW_INDICATOR(ch)) {
11502 break;
11503
11504 } else if (is_EOL(ch)) {
11505 _line = state.line;
11506 _lineStart = state.lineStart;
11507 _lineIndent = state.lineIndent;
11508 skipSeparationSpace(state, false, -1);
11509
11510 if (state.lineIndent >= nodeIndent) {
11511 hasPendingContent = true;
11512 ch = state.input.charCodeAt(state.position);
11513 continue;
11514 } else {
11515 state.position = captureEnd;
11516 state.line = _line;
11517 state.lineStart = _lineStart;
11518 state.lineIndent = _lineIndent;
11519 break;
11520 }
11521 }
11522
11523 if (hasPendingContent) {
11524 captureSegment(state, captureStart, captureEnd, false);
11525 writeFoldedLines(state, state.line - _line);
11526 captureStart = captureEnd = state.position;
11527 hasPendingContent = false;
11528 }
11529
11530 if (!is_WHITE_SPACE(ch)) {
11531 captureEnd = state.position + 1;
11532 }
11533
11534 ch = state.input.charCodeAt(++state.position);
11535 }
11536
11537 captureSegment(state, captureStart, captureEnd, false);
11538
11539 if (state.result) {
11540 return true;
11541 }
11542
11543 state.kind = _kind;
11544 state.result = _result;
11545 return false;
11546}
11547
11548function readSingleQuotedScalar(state, nodeIndent) {
11549 var ch,
11550 captureStart, captureEnd;
11551
11552 ch = state.input.charCodeAt(state.position);
11553
Jian Li8afbbee2016-07-27 19:16:51 +090011554 if (ch !== 0x27/* ' */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011555 return false;
11556 }
11557
11558 state.kind = 'scalar';
11559 state.result = '';
11560 state.position++;
11561 captureStart = captureEnd = state.position;
11562
Jian Li8afbbee2016-07-27 19:16:51 +090011563 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
11564 if (ch === 0x27/* ' */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011565 captureSegment(state, captureStart, state.position, true);
11566 ch = state.input.charCodeAt(++state.position);
11567
Jian Li8afbbee2016-07-27 19:16:51 +090011568 if (ch === 0x27/* ' */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011569 captureStart = captureEnd = state.position;
11570 state.position++;
11571 } else {
11572 return true;
11573 }
11574
11575 } else if (is_EOL(ch)) {
11576 captureSegment(state, captureStart, captureEnd, true);
11577 writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
11578 captureStart = captureEnd = state.position;
11579
11580 } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
11581 throwError(state, 'unexpected end of the document within a single quoted scalar');
11582
11583 } else {
11584 state.position++;
11585 captureEnd = state.position;
11586 }
11587 }
11588
11589 throwError(state, 'unexpected end of the stream within a single quoted scalar');
11590}
11591
11592function readDoubleQuotedScalar(state, nodeIndent) {
11593 var captureStart,
11594 captureEnd,
11595 hexLength,
11596 hexResult,
Jian Li83d87a72016-04-20 15:38:24 -070011597 tmp,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011598 ch;
11599
11600 ch = state.input.charCodeAt(state.position);
11601
Jian Li8afbbee2016-07-27 19:16:51 +090011602 if (ch !== 0x22/* " */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011603 return false;
11604 }
11605
11606 state.kind = 'scalar';
11607 state.result = '';
11608 state.position++;
11609 captureStart = captureEnd = state.position;
11610
Jian Li8afbbee2016-07-27 19:16:51 +090011611 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
11612 if (ch === 0x22/* " */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011613 captureSegment(state, captureStart, state.position, true);
11614 state.position++;
11615 return true;
11616
Jian Li8afbbee2016-07-27 19:16:51 +090011617 } else if (ch === 0x5C/* \ */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011618 captureSegment(state, captureStart, state.position, true);
11619 ch = state.input.charCodeAt(++state.position);
11620
11621 if (is_EOL(ch)) {
11622 skipSeparationSpace(state, false, nodeIndent);
11623
11624 // TODO: rework to inline fn with no type cast?
11625 } else if (ch < 256 && simpleEscapeCheck[ch]) {
11626 state.result += simpleEscapeMap[ch];
11627 state.position++;
11628
11629 } else if ((tmp = escapedHexLen(ch)) > 0) {
11630 hexLength = tmp;
11631 hexResult = 0;
11632
11633 for (; hexLength > 0; hexLength--) {
11634 ch = state.input.charCodeAt(++state.position);
11635
11636 if ((tmp = fromHexCode(ch)) >= 0) {
11637 hexResult = (hexResult << 4) + tmp;
11638
11639 } else {
11640 throwError(state, 'expected hexadecimal character');
11641 }
11642 }
11643
11644 state.result += charFromCodepoint(hexResult);
11645
11646 state.position++;
11647
11648 } else {
11649 throwError(state, 'unknown escape sequence');
11650 }
11651
11652 captureStart = captureEnd = state.position;
11653
11654 } else if (is_EOL(ch)) {
11655 captureSegment(state, captureStart, captureEnd, true);
11656 writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
11657 captureStart = captureEnd = state.position;
11658
11659 } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
11660 throwError(state, 'unexpected end of the document within a double quoted scalar');
11661
11662 } else {
11663 state.position++;
11664 captureEnd = state.position;
11665 }
11666 }
11667
11668 throwError(state, 'unexpected end of the stream within a double quoted scalar');
11669}
11670
11671function readFlowCollection(state, nodeIndent) {
11672 var readNext = true,
11673 _line,
11674 _tag = state.tag,
11675 _result,
11676 _anchor = state.anchor,
11677 following,
11678 terminator,
11679 isPair,
11680 isExplicitPair,
11681 isMapping,
Jian Li8afbbee2016-07-27 19:16:51 +090011682 overridableKeys = {},
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011683 keyNode,
11684 keyTag,
11685 valueNode,
11686 ch;
11687
11688 ch = state.input.charCodeAt(state.position);
11689
11690 if (ch === 0x5B/* [ */) {
11691 terminator = 0x5D;/* ] */
11692 isMapping = false;
11693 _result = [];
11694 } else if (ch === 0x7B/* { */) {
11695 terminator = 0x7D;/* } */
11696 isMapping = true;
11697 _result = {};
11698 } else {
11699 return false;
11700 }
11701
Jian Li8afbbee2016-07-27 19:16:51 +090011702 if (state.anchor !== null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011703 state.anchorMap[state.anchor] = _result;
11704 }
11705
11706 ch = state.input.charCodeAt(++state.position);
11707
Jian Li8afbbee2016-07-27 19:16:51 +090011708 while (ch !== 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011709 skipSeparationSpace(state, true, nodeIndent);
11710
11711 ch = state.input.charCodeAt(state.position);
11712
11713 if (ch === terminator) {
11714 state.position++;
11715 state.tag = _tag;
11716 state.anchor = _anchor;
11717 state.kind = isMapping ? 'mapping' : 'sequence';
11718 state.result = _result;
11719 return true;
11720 } else if (!readNext) {
11721 throwError(state, 'missed comma between flow collection entries');
11722 }
11723
11724 keyTag = keyNode = valueNode = null;
11725 isPair = isExplicitPair = false;
11726
Jian Li8afbbee2016-07-27 19:16:51 +090011727 if (ch === 0x3F/* ? */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011728 following = state.input.charCodeAt(state.position + 1);
11729
11730 if (is_WS_OR_EOL(following)) {
11731 isPair = isExplicitPair = true;
11732 state.position++;
11733 skipSeparationSpace(state, true, nodeIndent);
11734 }
11735 }
11736
11737 _line = state.line;
11738 composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
11739 keyTag = state.tag;
11740 keyNode = state.result;
11741 skipSeparationSpace(state, true, nodeIndent);
11742
11743 ch = state.input.charCodeAt(state.position);
11744
Jian Li8afbbee2016-07-27 19:16:51 +090011745 if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011746 isPair = true;
11747 ch = state.input.charCodeAt(++state.position);
11748 skipSeparationSpace(state, true, nodeIndent);
11749 composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
11750 valueNode = state.result;
11751 }
11752
11753 if (isMapping) {
Jian Li8afbbee2016-07-27 19:16:51 +090011754 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011755 } else if (isPair) {
Jian Li8afbbee2016-07-27 19:16:51 +090011756 _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011757 } else {
11758 _result.push(keyNode);
11759 }
11760
11761 skipSeparationSpace(state, true, nodeIndent);
11762
11763 ch = state.input.charCodeAt(state.position);
11764
Jian Li8afbbee2016-07-27 19:16:51 +090011765 if (ch === 0x2C/* , */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011766 readNext = true;
11767 ch = state.input.charCodeAt(++state.position);
11768 } else {
11769 readNext = false;
11770 }
11771 }
11772
11773 throwError(state, 'unexpected end of the stream within a flow collection');
11774}
11775
11776function readBlockScalar(state, nodeIndent) {
11777 var captureStart,
11778 folding,
11779 chomping = CHOMPING_CLIP,
Jian Li8afbbee2016-07-27 19:16:51 +090011780 didReadContent = false,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011781 detectedIndent = false,
11782 textIndent = nodeIndent,
11783 emptyLines = 0,
11784 atMoreIndented = false,
11785 tmp,
11786 ch;
11787
11788 ch = state.input.charCodeAt(state.position);
11789
11790 if (ch === 0x7C/* | */) {
11791 folding = false;
11792 } else if (ch === 0x3E/* > */) {
11793 folding = true;
11794 } else {
11795 return false;
11796 }
11797
11798 state.kind = 'scalar';
11799 state.result = '';
11800
Jian Li8afbbee2016-07-27 19:16:51 +090011801 while (ch !== 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011802 ch = state.input.charCodeAt(++state.position);
11803
Jian Li8afbbee2016-07-27 19:16:51 +090011804 if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011805 if (CHOMPING_CLIP === chomping) {
Jian Li8afbbee2016-07-27 19:16:51 +090011806 chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011807 } else {
11808 throwError(state, 'repeat of a chomping mode identifier');
11809 }
11810
11811 } else if ((tmp = fromDecimalCode(ch)) >= 0) {
11812 if (tmp === 0) {
11813 throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
11814 } else if (!detectedIndent) {
11815 textIndent = nodeIndent + tmp - 1;
11816 detectedIndent = true;
11817 } else {
11818 throwError(state, 'repeat of an indentation width identifier');
11819 }
11820
11821 } else {
11822 break;
11823 }
11824 }
11825
11826 if (is_WHITE_SPACE(ch)) {
11827 do { ch = state.input.charCodeAt(++state.position); }
11828 while (is_WHITE_SPACE(ch));
11829
Jian Li8afbbee2016-07-27 19:16:51 +090011830 if (ch === 0x23/* # */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011831 do { ch = state.input.charCodeAt(++state.position); }
Jian Li8afbbee2016-07-27 19:16:51 +090011832 while (!is_EOL(ch) && (ch !== 0));
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011833 }
11834 }
11835
Jian Li8afbbee2016-07-27 19:16:51 +090011836 while (ch !== 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011837 readLineBreak(state);
11838 state.lineIndent = 0;
11839
11840 ch = state.input.charCodeAt(state.position);
11841
11842 while ((!detectedIndent || state.lineIndent < textIndent) &&
Jian Li8afbbee2016-07-27 19:16:51 +090011843 (ch === 0x20/* Space */)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011844 state.lineIndent++;
11845 ch = state.input.charCodeAt(++state.position);
11846 }
11847
11848 if (!detectedIndent && state.lineIndent > textIndent) {
11849 textIndent = state.lineIndent;
11850 }
11851
11852 if (is_EOL(ch)) {
11853 emptyLines++;
11854 continue;
11855 }
11856
11857 // End of the scalar.
11858 if (state.lineIndent < textIndent) {
11859
11860 // Perform the chomping.
11861 if (chomping === CHOMPING_KEEP) {
Jian Li8afbbee2016-07-27 19:16:51 +090011862 state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011863 } else if (chomping === CHOMPING_CLIP) {
Jian Li8afbbee2016-07-27 19:16:51 +090011864 if (didReadContent) { // i.e. only if the scalar is not empty.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011865 state.result += '\n';
11866 }
11867 }
11868
11869 // Break this `while` cycle and go to the funciton's epilogue.
11870 break;
11871 }
11872
11873 // Folded style: use fancy rules to handle line breaks.
11874 if (folding) {
11875
11876 // Lines starting with white space characters (more-indented lines) are not folded.
11877 if (is_WHITE_SPACE(ch)) {
11878 atMoreIndented = true;
Jian Li8afbbee2016-07-27 19:16:51 +090011879 // except for the first content line (cf. Example 8.1)
11880 state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011881
11882 // End of more-indented block.
11883 } else if (atMoreIndented) {
11884 atMoreIndented = false;
11885 state.result += common.repeat('\n', emptyLines + 1);
11886
11887 // Just one line break - perceive as the same line.
Jian Li8afbbee2016-07-27 19:16:51 +090011888 } else if (emptyLines === 0) {
11889 if (didReadContent) { // i.e. only if we have already read some scalar content.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011890 state.result += ' ';
11891 }
11892
11893 // Several line breaks - perceive as different lines.
11894 } else {
11895 state.result += common.repeat('\n', emptyLines);
11896 }
11897
11898 // Literal style: just add exact number of line breaks between content lines.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011899 } else {
Jian Li8afbbee2016-07-27 19:16:51 +090011900 // Keep all line breaks except the header line break.
11901 state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011902 }
11903
Jian Li8afbbee2016-07-27 19:16:51 +090011904 didReadContent = true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011905 detectedIndent = true;
11906 emptyLines = 0;
11907 captureStart = state.position;
11908
Jian Li8afbbee2016-07-27 19:16:51 +090011909 while (!is_EOL(ch) && (ch !== 0)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011910 ch = state.input.charCodeAt(++state.position);
11911 }
11912
11913 captureSegment(state, captureStart, state.position, false);
11914 }
11915
11916 return true;
11917}
11918
11919function readBlockSequence(state, nodeIndent) {
11920 var _line,
11921 _tag = state.tag,
11922 _anchor = state.anchor,
11923 _result = [],
11924 following,
11925 detected = false,
11926 ch;
11927
Jian Li8afbbee2016-07-27 19:16:51 +090011928 if (state.anchor !== null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011929 state.anchorMap[state.anchor] = _result;
11930 }
11931
11932 ch = state.input.charCodeAt(state.position);
11933
Jian Li8afbbee2016-07-27 19:16:51 +090011934 while (ch !== 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011935
Jian Li8afbbee2016-07-27 19:16:51 +090011936 if (ch !== 0x2D/* - */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011937 break;
11938 }
11939
11940 following = state.input.charCodeAt(state.position + 1);
11941
11942 if (!is_WS_OR_EOL(following)) {
11943 break;
11944 }
11945
11946 detected = true;
11947 state.position++;
11948
11949 if (skipSeparationSpace(state, true, -1)) {
11950 if (state.lineIndent <= nodeIndent) {
11951 _result.push(null);
11952 ch = state.input.charCodeAt(state.position);
11953 continue;
11954 }
11955 }
11956
11957 _line = state.line;
11958 composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
11959 _result.push(state.result);
11960 skipSeparationSpace(state, true, -1);
11961
11962 ch = state.input.charCodeAt(state.position);
11963
Jian Li8afbbee2016-07-27 19:16:51 +090011964 if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011965 throwError(state, 'bad indentation of a sequence entry');
11966 } else if (state.lineIndent < nodeIndent) {
11967 break;
11968 }
11969 }
11970
11971 if (detected) {
11972 state.tag = _tag;
11973 state.anchor = _anchor;
11974 state.kind = 'sequence';
11975 state.result = _result;
11976 return true;
11977 }
11978 return false;
11979}
11980
11981function readBlockMapping(state, nodeIndent, flowIndent) {
11982 var following,
11983 allowCompact,
11984 _line,
11985 _tag = state.tag,
11986 _anchor = state.anchor,
11987 _result = {},
Jian Li8afbbee2016-07-27 19:16:51 +090011988 overridableKeys = {},
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011989 keyTag = null,
11990 keyNode = null,
11991 valueNode = null,
11992 atExplicitKey = false,
11993 detected = false,
11994 ch;
11995
Jian Li8afbbee2016-07-27 19:16:51 +090011996 if (state.anchor !== null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070011997 state.anchorMap[state.anchor] = _result;
11998 }
11999
12000 ch = state.input.charCodeAt(state.position);
12001
Jian Li8afbbee2016-07-27 19:16:51 +090012002 while (ch !== 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012003 following = state.input.charCodeAt(state.position + 1);
12004 _line = state.line; // Save the current line.
12005
12006 //
12007 // Explicit notation case. There are two separate blocks:
12008 // first for the key (denoted by "?") and second for the value (denoted by ":")
12009 //
Jian Li8afbbee2016-07-27 19:16:51 +090012010 if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012011
Jian Li8afbbee2016-07-27 19:16:51 +090012012 if (ch === 0x3F/* ? */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012013 if (atExplicitKey) {
Jian Li8afbbee2016-07-27 19:16:51 +090012014 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012015 keyTag = keyNode = valueNode = null;
12016 }
12017
12018 detected = true;
12019 atExplicitKey = true;
12020 allowCompact = true;
12021
12022 } else if (atExplicitKey) {
12023 // i.e. 0x3A/* : */ === character after the explicit key.
12024 atExplicitKey = false;
12025 allowCompact = true;
12026
12027 } else {
12028 throwError(state, 'incomplete explicit mapping pair; a key node is missed');
12029 }
12030
12031 state.position += 1;
12032 ch = following;
12033
12034 //
12035 // Implicit notation case. Flow-style node as the key first, then ":", and the value.
12036 //
12037 } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
12038
12039 if (state.line === _line) {
12040 ch = state.input.charCodeAt(state.position);
12041
12042 while (is_WHITE_SPACE(ch)) {
12043 ch = state.input.charCodeAt(++state.position);
12044 }
12045
Jian Li8afbbee2016-07-27 19:16:51 +090012046 if (ch === 0x3A/* : */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012047 ch = state.input.charCodeAt(++state.position);
12048
12049 if (!is_WS_OR_EOL(ch)) {
12050 throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
12051 }
12052
12053 if (atExplicitKey) {
Jian Li8afbbee2016-07-27 19:16:51 +090012054 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012055 keyTag = keyNode = valueNode = null;
12056 }
12057
12058 detected = true;
12059 atExplicitKey = false;
12060 allowCompact = false;
12061 keyTag = state.tag;
12062 keyNode = state.result;
12063
12064 } else if (detected) {
12065 throwError(state, 'can not read an implicit mapping pair; a colon is missed');
12066
12067 } else {
12068 state.tag = _tag;
12069 state.anchor = _anchor;
12070 return true; // Keep the result of `composeNode`.
12071 }
12072
12073 } else if (detected) {
12074 throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
12075
12076 } else {
12077 state.tag = _tag;
12078 state.anchor = _anchor;
12079 return true; // Keep the result of `composeNode`.
12080 }
12081
12082 } else {
12083 break; // Reading is done. Go to the epilogue.
12084 }
12085
12086 //
12087 // Common reading code for both explicit and implicit notations.
12088 //
12089 if (state.line === _line || state.lineIndent > nodeIndent) {
12090 if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
12091 if (atExplicitKey) {
12092 keyNode = state.result;
12093 } else {
12094 valueNode = state.result;
12095 }
12096 }
12097
12098 if (!atExplicitKey) {
Jian Li8afbbee2016-07-27 19:16:51 +090012099 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012100 keyTag = keyNode = valueNode = null;
12101 }
12102
12103 skipSeparationSpace(state, true, -1);
12104 ch = state.input.charCodeAt(state.position);
12105 }
12106
Jian Li8afbbee2016-07-27 19:16:51 +090012107 if (state.lineIndent > nodeIndent && (ch !== 0)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012108 throwError(state, 'bad indentation of a mapping entry');
12109 } else if (state.lineIndent < nodeIndent) {
12110 break;
12111 }
12112 }
12113
12114 //
12115 // Epilogue.
12116 //
12117
12118 // Special case: last mapping's node contains only the key in explicit notation.
12119 if (atExplicitKey) {
Jian Li8afbbee2016-07-27 19:16:51 +090012120 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012121 }
12122
12123 // Expose the resulting mapping.
12124 if (detected) {
12125 state.tag = _tag;
12126 state.anchor = _anchor;
12127 state.kind = 'mapping';
12128 state.result = _result;
12129 }
12130
12131 return detected;
12132}
12133
12134function readTagProperty(state) {
12135 var _position,
12136 isVerbatim = false,
12137 isNamed = false,
12138 tagHandle,
12139 tagName,
12140 ch;
12141
12142 ch = state.input.charCodeAt(state.position);
12143
Jian Li8afbbee2016-07-27 19:16:51 +090012144 if (ch !== 0x21/* ! */) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012145
Jian Li8afbbee2016-07-27 19:16:51 +090012146 if (state.tag !== null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012147 throwError(state, 'duplication of a tag property');
12148 }
12149
12150 ch = state.input.charCodeAt(++state.position);
12151
Jian Li8afbbee2016-07-27 19:16:51 +090012152 if (ch === 0x3C/* < */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012153 isVerbatim = true;
12154 ch = state.input.charCodeAt(++state.position);
12155
Jian Li8afbbee2016-07-27 19:16:51 +090012156 } else if (ch === 0x21/* ! */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012157 isNamed = true;
12158 tagHandle = '!!';
12159 ch = state.input.charCodeAt(++state.position);
12160
12161 } else {
12162 tagHandle = '!';
12163 }
12164
12165 _position = state.position;
12166
12167 if (isVerbatim) {
12168 do { ch = state.input.charCodeAt(++state.position); }
Jian Li8afbbee2016-07-27 19:16:51 +090012169 while (ch !== 0 && ch !== 0x3E/* > */);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012170
12171 if (state.position < state.length) {
12172 tagName = state.input.slice(_position, state.position);
12173 ch = state.input.charCodeAt(++state.position);
12174 } else {
12175 throwError(state, 'unexpected end of the stream within a verbatim tag');
12176 }
12177 } else {
Jian Li8afbbee2016-07-27 19:16:51 +090012178 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012179
Jian Li8afbbee2016-07-27 19:16:51 +090012180 if (ch === 0x21/* ! */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012181 if (!isNamed) {
12182 tagHandle = state.input.slice(_position - 1, state.position + 1);
12183
12184 if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
12185 throwError(state, 'named tag handle cannot contain such characters');
12186 }
12187
12188 isNamed = true;
12189 _position = state.position + 1;
12190 } else {
12191 throwError(state, 'tag suffix cannot contain exclamation marks');
12192 }
12193 }
12194
12195 ch = state.input.charCodeAt(++state.position);
12196 }
12197
12198 tagName = state.input.slice(_position, state.position);
12199
12200 if (PATTERN_FLOW_INDICATORS.test(tagName)) {
12201 throwError(state, 'tag suffix cannot contain flow indicator characters');
12202 }
12203 }
12204
12205 if (tagName && !PATTERN_TAG_URI.test(tagName)) {
12206 throwError(state, 'tag name cannot contain such characters: ' + tagName);
12207 }
12208
12209 if (isVerbatim) {
12210 state.tag = tagName;
12211
12212 } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
12213 state.tag = state.tagMap[tagHandle] + tagName;
12214
Jian Li8afbbee2016-07-27 19:16:51 +090012215 } else if (tagHandle === '!') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012216 state.tag = '!' + tagName;
12217
Jian Li8afbbee2016-07-27 19:16:51 +090012218 } else if (tagHandle === '!!') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012219 state.tag = 'tag:yaml.org,2002:' + tagName;
12220
12221 } else {
12222 throwError(state, 'undeclared tag handle "' + tagHandle + '"');
12223 }
12224
12225 return true;
12226}
12227
12228function readAnchorProperty(state) {
12229 var _position,
12230 ch;
12231
12232 ch = state.input.charCodeAt(state.position);
12233
Jian Li8afbbee2016-07-27 19:16:51 +090012234 if (ch !== 0x26/* & */) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012235
Jian Li8afbbee2016-07-27 19:16:51 +090012236 if (state.anchor !== null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012237 throwError(state, 'duplication of an anchor property');
12238 }
12239
12240 ch = state.input.charCodeAt(++state.position);
12241 _position = state.position;
12242
Jian Li8afbbee2016-07-27 19:16:51 +090012243 while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012244 ch = state.input.charCodeAt(++state.position);
12245 }
12246
12247 if (state.position === _position) {
12248 throwError(state, 'name of an anchor node must contain at least one character');
12249 }
12250
12251 state.anchor = state.input.slice(_position, state.position);
12252 return true;
12253}
12254
12255function readAlias(state) {
12256 var _position, alias,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012257 ch;
12258
12259 ch = state.input.charCodeAt(state.position);
12260
Jian Li8afbbee2016-07-27 19:16:51 +090012261 if (ch !== 0x2A/* * */) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012262
12263 ch = state.input.charCodeAt(++state.position);
12264 _position = state.position;
12265
Jian Li8afbbee2016-07-27 19:16:51 +090012266 while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012267 ch = state.input.charCodeAt(++state.position);
12268 }
12269
12270 if (state.position === _position) {
12271 throwError(state, 'name of an alias node must contain at least one character');
12272 }
12273
12274 alias = state.input.slice(_position, state.position);
12275
12276 if (!state.anchorMap.hasOwnProperty(alias)) {
12277 throwError(state, 'unidentified alias "' + alias + '"');
12278 }
12279
12280 state.result = state.anchorMap[alias];
12281 skipSeparationSpace(state, true, -1);
12282 return true;
12283}
12284
12285function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
12286 var allowBlockStyles,
12287 allowBlockScalars,
12288 allowBlockCollections,
12289 indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
12290 atNewLine = false,
12291 hasContent = false,
12292 typeIndex,
12293 typeQuantity,
12294 type,
12295 flowIndent,
Jian Li83d87a72016-04-20 15:38:24 -070012296 blockIndent;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012297
Jian Li8afbbee2016-07-27 19:16:51 +090012298 if (state.listener !== null) {
12299 state.listener('open', state);
12300 }
12301
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012302 state.tag = null;
12303 state.anchor = null;
12304 state.kind = null;
12305 state.result = null;
12306
12307 allowBlockStyles = allowBlockScalars = allowBlockCollections =
12308 CONTEXT_BLOCK_OUT === nodeContext ||
12309 CONTEXT_BLOCK_IN === nodeContext;
12310
12311 if (allowToSeek) {
12312 if (skipSeparationSpace(state, true, -1)) {
12313 atNewLine = true;
12314
12315 if (state.lineIndent > parentIndent) {
12316 indentStatus = 1;
12317 } else if (state.lineIndent === parentIndent) {
12318 indentStatus = 0;
12319 } else if (state.lineIndent < parentIndent) {
12320 indentStatus = -1;
12321 }
12322 }
12323 }
12324
Jian Li8afbbee2016-07-27 19:16:51 +090012325 if (indentStatus === 1) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012326 while (readTagProperty(state) || readAnchorProperty(state)) {
12327 if (skipSeparationSpace(state, true, -1)) {
12328 atNewLine = true;
12329 allowBlockCollections = allowBlockStyles;
12330
12331 if (state.lineIndent > parentIndent) {
12332 indentStatus = 1;
12333 } else if (state.lineIndent === parentIndent) {
12334 indentStatus = 0;
12335 } else if (state.lineIndent < parentIndent) {
12336 indentStatus = -1;
12337 }
12338 } else {
12339 allowBlockCollections = false;
12340 }
12341 }
12342 }
12343
12344 if (allowBlockCollections) {
12345 allowBlockCollections = atNewLine || allowCompact;
12346 }
12347
Jian Li8afbbee2016-07-27 19:16:51 +090012348 if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012349 if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
12350 flowIndent = parentIndent;
12351 } else {
12352 flowIndent = parentIndent + 1;
12353 }
12354
12355 blockIndent = state.position - state.lineStart;
12356
Jian Li8afbbee2016-07-27 19:16:51 +090012357 if (indentStatus === 1) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012358 if (allowBlockCollections &&
12359 (readBlockSequence(state, blockIndent) ||
12360 readBlockMapping(state, blockIndent, flowIndent)) ||
12361 readFlowCollection(state, flowIndent)) {
12362 hasContent = true;
12363 } else {
12364 if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
12365 readSingleQuotedScalar(state, flowIndent) ||
12366 readDoubleQuotedScalar(state, flowIndent)) {
12367 hasContent = true;
12368
12369 } else if (readAlias(state)) {
12370 hasContent = true;
12371
Jian Li8afbbee2016-07-27 19:16:51 +090012372 if (state.tag !== null || state.anchor !== null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012373 throwError(state, 'alias node should not have any properties');
12374 }
12375
12376 } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
12377 hasContent = true;
12378
Jian Li8afbbee2016-07-27 19:16:51 +090012379 if (state.tag === null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012380 state.tag = '?';
12381 }
12382 }
12383
Jian Li8afbbee2016-07-27 19:16:51 +090012384 if (state.anchor !== null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012385 state.anchorMap[state.anchor] = state.result;
12386 }
12387 }
Jian Li8afbbee2016-07-27 19:16:51 +090012388 } else if (indentStatus === 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012389 // Special case: block sequences are allowed to have same indentation level as the parent.
12390 // http://www.yaml.org/spec/1.2/spec.html#id2799784
12391 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
12392 }
12393 }
12394
Jian Li8afbbee2016-07-27 19:16:51 +090012395 if (state.tag !== null && state.tag !== '!') {
12396 if (state.tag === '?') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012397 for (typeIndex = 0, typeQuantity = state.implicitTypes.length;
12398 typeIndex < typeQuantity;
12399 typeIndex += 1) {
12400 type = state.implicitTypes[typeIndex];
12401
12402 // Implicit resolving is not allowed for non-scalar types, and '?'
12403 // non-specific tag is only assigned to plain scalars. So, it isn't
12404 // needed to check for 'kind' conformity.
12405
12406 if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
12407 state.result = type.construct(state.result);
12408 state.tag = type.tag;
Jian Li8afbbee2016-07-27 19:16:51 +090012409 if (state.anchor !== null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012410 state.anchorMap[state.anchor] = state.result;
12411 }
12412 break;
12413 }
12414 }
12415 } else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
12416 type = state.typeMap[state.tag];
12417
Jian Li8afbbee2016-07-27 19:16:51 +090012418 if (state.result !== null && type.kind !== state.kind) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012419 throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
12420 }
12421
12422 if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
12423 throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
12424 } else {
12425 state.result = type.construct(state.result);
Jian Li8afbbee2016-07-27 19:16:51 +090012426 if (state.anchor !== null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012427 state.anchorMap[state.anchor] = state.result;
12428 }
12429 }
12430 } else {
Jian Li83d87a72016-04-20 15:38:24 -070012431 throwError(state, 'unknown tag !<' + state.tag + '>');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012432 }
12433 }
12434
Jian Li8afbbee2016-07-27 19:16:51 +090012435 if (state.listener !== null) {
12436 state.listener('close', state);
12437 }
12438 return state.tag !== null || state.anchor !== null || hasContent;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012439}
12440
12441function readDocument(state) {
12442 var documentStart = state.position,
12443 _position,
12444 directiveName,
12445 directiveArgs,
12446 hasDirectives = false,
12447 ch;
12448
12449 state.version = null;
12450 state.checkLineBreaks = state.legacy;
12451 state.tagMap = {};
12452 state.anchorMap = {};
12453
Jian Li8afbbee2016-07-27 19:16:51 +090012454 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012455 skipSeparationSpace(state, true, -1);
12456
12457 ch = state.input.charCodeAt(state.position);
12458
Jian Li8afbbee2016-07-27 19:16:51 +090012459 if (state.lineIndent > 0 || ch !== 0x25/* % */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012460 break;
12461 }
12462
12463 hasDirectives = true;
12464 ch = state.input.charCodeAt(++state.position);
12465 _position = state.position;
12466
Jian Li8afbbee2016-07-27 19:16:51 +090012467 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012468 ch = state.input.charCodeAt(++state.position);
12469 }
12470
12471 directiveName = state.input.slice(_position, state.position);
12472 directiveArgs = [];
12473
12474 if (directiveName.length < 1) {
12475 throwError(state, 'directive name must not be less than one character in length');
12476 }
12477
Jian Li8afbbee2016-07-27 19:16:51 +090012478 while (ch !== 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012479 while (is_WHITE_SPACE(ch)) {
12480 ch = state.input.charCodeAt(++state.position);
12481 }
12482
Jian Li8afbbee2016-07-27 19:16:51 +090012483 if (ch === 0x23/* # */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012484 do { ch = state.input.charCodeAt(++state.position); }
Jian Li8afbbee2016-07-27 19:16:51 +090012485 while (ch !== 0 && !is_EOL(ch));
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012486 break;
12487 }
12488
Jian Li8afbbee2016-07-27 19:16:51 +090012489 if (is_EOL(ch)) break;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012490
12491 _position = state.position;
12492
Jian Li8afbbee2016-07-27 19:16:51 +090012493 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012494 ch = state.input.charCodeAt(++state.position);
12495 }
12496
12497 directiveArgs.push(state.input.slice(_position, state.position));
12498 }
12499
Jian Li8afbbee2016-07-27 19:16:51 +090012500 if (ch !== 0) readLineBreak(state);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012501
12502 if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
12503 directiveHandlers[directiveName](state, directiveName, directiveArgs);
12504 } else {
12505 throwWarning(state, 'unknown document directive "' + directiveName + '"');
12506 }
12507 }
12508
12509 skipSeparationSpace(state, true, -1);
12510
Jian Li8afbbee2016-07-27 19:16:51 +090012511 if (state.lineIndent === 0 &&
12512 state.input.charCodeAt(state.position) === 0x2D/* - */ &&
12513 state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
12514 state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012515 state.position += 3;
12516 skipSeparationSpace(state, true, -1);
12517
12518 } else if (hasDirectives) {
12519 throwError(state, 'directives end mark is expected');
12520 }
12521
12522 composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
12523 skipSeparationSpace(state, true, -1);
12524
12525 if (state.checkLineBreaks &&
12526 PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
12527 throwWarning(state, 'non-ASCII line breaks are interpreted as content');
12528 }
12529
12530 state.documents.push(state.result);
12531
12532 if (state.position === state.lineStart && testDocumentSeparator(state)) {
12533
Jian Li8afbbee2016-07-27 19:16:51 +090012534 if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012535 state.position += 3;
12536 skipSeparationSpace(state, true, -1);
12537 }
12538 return;
12539 }
12540
12541 if (state.position < (state.length - 1)) {
12542 throwError(state, 'end of the stream or a document separator is expected');
12543 } else {
12544 return;
12545 }
12546}
12547
12548
12549function loadDocuments(input, options) {
12550 input = String(input);
12551 options = options || {};
12552
12553 if (input.length !== 0) {
12554
12555 // Add tailing `\n` if not exists
Jian Li8afbbee2016-07-27 19:16:51 +090012556 if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
12557 input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012558 input += '\n';
12559 }
12560
12561 // Strip BOM
12562 if (input.charCodeAt(0) === 0xFEFF) {
12563 input = input.slice(1);
12564 }
12565 }
12566
12567 var state = new State(input, options);
12568
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012569 // Use 0 as string terminator. That significantly simplifies bounds check.
12570 state.input += '\0';
12571
Jian Li8afbbee2016-07-27 19:16:51 +090012572 while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012573 state.lineIndent += 1;
12574 state.position += 1;
12575 }
12576
12577 while (state.position < (state.length - 1)) {
12578 readDocument(state);
12579 }
12580
12581 return state.documents;
12582}
12583
12584
12585function loadAll(input, iterator, options) {
12586 var documents = loadDocuments(input, options), index, length;
12587
12588 for (index = 0, length = documents.length; index < length; index += 1) {
12589 iterator(documents[index]);
12590 }
12591}
12592
12593
12594function load(input, options) {
Jian Li83d87a72016-04-20 15:38:24 -070012595 var documents = loadDocuments(input, options);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012596
Jian Li8afbbee2016-07-27 19:16:51 +090012597 if (documents.length === 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012598 /*eslint-disable no-undefined*/
12599 return undefined;
Jian Li8afbbee2016-07-27 19:16:51 +090012600 } else if (documents.length === 1) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012601 return documents[0];
12602 }
12603 throw new YAMLException('expected a single document in the stream, but found more');
12604}
12605
12606
12607function safeLoadAll(input, output, options) {
12608 loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
12609}
12610
12611
12612function safeLoad(input, options) {
12613 return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
12614}
12615
12616
12617module.exports.loadAll = loadAll;
12618module.exports.load = load;
12619module.exports.safeLoadAll = safeLoadAll;
12620module.exports.safeLoad = safeLoad;
12621
Jian Li8afbbee2016-07-27 19:16:51 +090012622},{"./common":21,"./exception":23,"./mark":25,"./schema/default_full":28,"./schema/default_safe":29}],25:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012623'use strict';
12624
12625
12626var common = require('./common');
12627
12628
12629function Mark(name, buffer, position, line, column) {
12630 this.name = name;
12631 this.buffer = buffer;
12632 this.position = position;
12633 this.line = line;
12634 this.column = column;
12635}
12636
12637
12638Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
12639 var head, start, tail, end, snippet;
12640
Jian Li8afbbee2016-07-27 19:16:51 +090012641 if (!this.buffer) return null;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012642
12643 indent = indent || 4;
12644 maxLength = maxLength || 75;
12645
12646 head = '';
12647 start = this.position;
12648
Jian Li8afbbee2016-07-27 19:16:51 +090012649 while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012650 start -= 1;
12651 if (this.position - start > (maxLength / 2 - 1)) {
12652 head = ' ... ';
12653 start += 5;
12654 break;
12655 }
12656 }
12657
12658 tail = '';
12659 end = this.position;
12660
Jian Li8afbbee2016-07-27 19:16:51 +090012661 while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012662 end += 1;
12663 if (end - this.position > (maxLength / 2 - 1)) {
12664 tail = ' ... ';
12665 end -= 5;
12666 break;
12667 }
12668 }
12669
12670 snippet = this.buffer.slice(start, end);
12671
12672 return common.repeat(' ', indent) + head + snippet + tail + '\n' +
12673 common.repeat(' ', indent + this.position - start + head.length) + '^';
12674};
12675
12676
12677Mark.prototype.toString = function toString(compact) {
12678 var snippet, where = '';
12679
12680 if (this.name) {
12681 where += 'in "' + this.name + '" ';
12682 }
12683
12684 where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
12685
12686 if (!compact) {
12687 snippet = this.getSnippet();
12688
12689 if (snippet) {
12690 where += ':\n' + snippet;
12691 }
12692 }
12693
12694 return where;
12695};
12696
12697
12698module.exports = Mark;
12699
Jian Li8afbbee2016-07-27 19:16:51 +090012700},{"./common":21}],26:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012701'use strict';
12702
12703/*eslint-disable max-len*/
12704
12705var common = require('./common');
12706var YAMLException = require('./exception');
12707var Type = require('./type');
12708
12709
12710function compileList(schema, name, result) {
12711 var exclude = [];
12712
12713 schema.include.forEach(function (includedSchema) {
12714 result = compileList(includedSchema, name, result);
12715 });
12716
12717 schema[name].forEach(function (currentType) {
12718 result.forEach(function (previousType, previousIndex) {
12719 if (previousType.tag === currentType.tag) {
12720 exclude.push(previousIndex);
12721 }
12722 });
12723
12724 result.push(currentType);
12725 });
12726
12727 return result.filter(function (type, index) {
Jian Li8afbbee2016-07-27 19:16:51 +090012728 return exclude.indexOf(index) === -1;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012729 });
12730}
12731
12732
12733function compileMap(/* lists... */) {
12734 var result = {}, index, length;
12735
12736 function collectType(type) {
12737 result[type.tag] = type;
12738 }
12739
12740 for (index = 0, length = arguments.length; index < length; index += 1) {
12741 arguments[index].forEach(collectType);
12742 }
12743
12744 return result;
12745}
12746
12747
12748function Schema(definition) {
12749 this.include = definition.include || [];
12750 this.implicit = definition.implicit || [];
12751 this.explicit = definition.explicit || [];
12752
12753 this.implicit.forEach(function (type) {
Jian Li8afbbee2016-07-27 19:16:51 +090012754 if (type.loadKind && type.loadKind !== 'scalar') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012755 throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
12756 }
12757 });
12758
12759 this.compiledImplicit = compileList(this, 'implicit', []);
12760 this.compiledExplicit = compileList(this, 'explicit', []);
12761 this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
12762}
12763
12764
12765Schema.DEFAULT = null;
12766
12767
12768Schema.create = function createSchema() {
12769 var schemas, types;
12770
12771 switch (arguments.length) {
Jian Li8afbbee2016-07-27 19:16:51 +090012772 case 1:
12773 schemas = Schema.DEFAULT;
12774 types = arguments[0];
12775 break;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012776
Jian Li8afbbee2016-07-27 19:16:51 +090012777 case 2:
12778 schemas = arguments[0];
12779 types = arguments[1];
12780 break;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012781
Jian Li8afbbee2016-07-27 19:16:51 +090012782 default:
12783 throw new YAMLException('Wrong number of arguments for Schema.create function');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012784 }
12785
12786 schemas = common.toArray(schemas);
12787 types = common.toArray(types);
12788
12789 if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
12790 throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
12791 }
12792
12793 if (!types.every(function (type) { return type instanceof Type; })) {
12794 throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
12795 }
12796
12797 return new Schema({
12798 include: schemas,
12799 explicit: types
12800 });
12801};
12802
12803
12804module.exports = Schema;
12805
Jian Li8afbbee2016-07-27 19:16:51 +090012806},{"./common":21,"./exception":23,"./type":32}],27:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012807// Standard YAML's Core schema.
12808// http://www.yaml.org/spec/1.2/spec.html#id2804923
12809//
12810// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
12811// So, Core schema has no distinctions from JSON schema is JS-YAML.
12812
12813
12814'use strict';
12815
12816
12817var Schema = require('../schema');
12818
12819
12820module.exports = new Schema({
12821 include: [
12822 require('./json')
12823 ]
12824});
12825
Jian Li8afbbee2016-07-27 19:16:51 +090012826},{"../schema":26,"./json":31}],28:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012827// JS-YAML's default schema for `load` function.
12828// It is not described in the YAML specification.
12829//
12830// This schema is based on JS-YAML's default safe schema and includes
12831// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
12832//
12833// Also this schema is used as default base schema at `Schema.create` function.
12834
12835
12836'use strict';
12837
12838
12839var Schema = require('../schema');
12840
12841
12842module.exports = Schema.DEFAULT = new Schema({
12843 include: [
12844 require('./default_safe')
12845 ],
12846 explicit: [
12847 require('../type/js/undefined'),
12848 require('../type/js/regexp'),
12849 require('../type/js/function')
12850 ]
12851});
12852
Jian Li8afbbee2016-07-27 19:16:51 +090012853},{"../schema":26,"../type/js/function":37,"../type/js/regexp":38,"../type/js/undefined":39,"./default_safe":29}],29:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012854// JS-YAML's default schema for `safeLoad` function.
12855// It is not described in the YAML specification.
12856//
12857// This schema is based on standard YAML's Core schema and includes most of
12858// extra types described at YAML tag repository. (http://yaml.org/type/)
12859
12860
12861'use strict';
12862
12863
12864var Schema = require('../schema');
12865
12866
12867module.exports = new Schema({
12868 include: [
12869 require('./core')
12870 ],
12871 implicit: [
12872 require('../type/timestamp'),
12873 require('../type/merge')
12874 ],
12875 explicit: [
12876 require('../type/binary'),
12877 require('../type/omap'),
12878 require('../type/pairs'),
12879 require('../type/set')
12880 ]
12881});
12882
Jian Li8afbbee2016-07-27 19:16:51 +090012883},{"../schema":26,"../type/binary":33,"../type/merge":41,"../type/omap":43,"../type/pairs":44,"../type/set":46,"../type/timestamp":48,"./core":27}],30:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012884// Standard YAML's Failsafe schema.
12885// http://www.yaml.org/spec/1.2/spec.html#id2802346
12886
12887
12888'use strict';
12889
12890
12891var Schema = require('../schema');
12892
12893
12894module.exports = new Schema({
12895 explicit: [
12896 require('../type/str'),
12897 require('../type/seq'),
12898 require('../type/map')
12899 ]
12900});
12901
Jian Li8afbbee2016-07-27 19:16:51 +090012902},{"../schema":26,"../type/map":40,"../type/seq":45,"../type/str":47}],31:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012903// Standard YAML's JSON schema.
12904// http://www.yaml.org/spec/1.2/spec.html#id2803231
12905//
12906// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
12907// So, this schema is not such strict as defined in the YAML specification.
12908// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
12909
12910
12911'use strict';
12912
12913
12914var Schema = require('../schema');
12915
12916
12917module.exports = new Schema({
12918 include: [
12919 require('./failsafe')
12920 ],
12921 implicit: [
12922 require('../type/null'),
12923 require('../type/bool'),
12924 require('../type/int'),
12925 require('../type/float')
12926 ]
12927});
12928
Jian Li8afbbee2016-07-27 19:16:51 +090012929},{"../schema":26,"../type/bool":34,"../type/float":35,"../type/int":36,"../type/null":42,"./failsafe":30}],32:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012930'use strict';
12931
12932var YAMLException = require('./exception');
12933
12934var TYPE_CONSTRUCTOR_OPTIONS = [
12935 'kind',
12936 'resolve',
12937 'construct',
12938 'instanceOf',
12939 'predicate',
12940 'represent',
12941 'defaultStyle',
12942 'styleAliases'
12943];
12944
12945var YAML_NODE_KINDS = [
12946 'scalar',
12947 'sequence',
12948 'mapping'
12949];
12950
12951function compileStyleAliases(map) {
12952 var result = {};
12953
Jian Li8afbbee2016-07-27 19:16:51 +090012954 if (map !== null) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012955 Object.keys(map).forEach(function (style) {
12956 map[style].forEach(function (alias) {
12957 result[String(alias)] = style;
12958 });
12959 });
12960 }
12961
12962 return result;
12963}
12964
12965function Type(tag, options) {
12966 options = options || {};
12967
12968 Object.keys(options).forEach(function (name) {
Jian Li8afbbee2016-07-27 19:16:51 +090012969 if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012970 throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
12971 }
12972 });
12973
12974 // TODO: Add tag format check.
12975 this.tag = tag;
12976 this.kind = options['kind'] || null;
12977 this.resolve = options['resolve'] || function () { return true; };
12978 this.construct = options['construct'] || function (data) { return data; };
12979 this.instanceOf = options['instanceOf'] || null;
12980 this.predicate = options['predicate'] || null;
12981 this.represent = options['represent'] || null;
12982 this.defaultStyle = options['defaultStyle'] || null;
12983 this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
12984
Jian Li8afbbee2016-07-27 19:16:51 +090012985 if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012986 throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
12987 }
12988}
12989
12990module.exports = Type;
12991
Jian Li8afbbee2016-07-27 19:16:51 +090012992},{"./exception":23}],33:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070012993'use strict';
12994
12995/*eslint-disable no-bitwise*/
12996
Jian Li8afbbee2016-07-27 19:16:51 +090012997var NodeBuffer;
12998
12999try {
13000 // A trick for browserified version, to not include `Buffer` shim
13001 var _require = require;
13002 NodeBuffer = _require('buffer').Buffer;
13003} catch (__) {}
13004
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013005var Type = require('../type');
13006
13007
13008// [ 64, 65, 66 ] -> [ padding, CR, LF ]
13009var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
13010
13011
13012function resolveYamlBinary(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013013 if (data === null) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013014
Jian Li83d87a72016-04-20 15:38:24 -070013015 var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013016
13017 // Convert one by one.
13018 for (idx = 0; idx < max; idx++) {
13019 code = map.indexOf(data.charAt(idx));
13020
13021 // Skip CR/LF
Jian Li8afbbee2016-07-27 19:16:51 +090013022 if (code > 64) continue;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013023
13024 // Fail on illegal characters
Jian Li8afbbee2016-07-27 19:16:51 +090013025 if (code < 0) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013026
13027 bitlen += 6;
13028 }
13029
13030 // If there are any bits left, source was corrupted
13031 return (bitlen % 8) === 0;
13032}
13033
13034function constructYamlBinary(data) {
Jian Li83d87a72016-04-20 15:38:24 -070013035 var idx, tailbits,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013036 input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
13037 max = input.length,
13038 map = BASE64_MAP,
13039 bits = 0,
13040 result = [];
13041
13042 // Collect by 6*4 bits (3 bytes)
13043
13044 for (idx = 0; idx < max; idx++) {
13045 if ((idx % 4 === 0) && idx) {
13046 result.push((bits >> 16) & 0xFF);
13047 result.push((bits >> 8) & 0xFF);
13048 result.push(bits & 0xFF);
13049 }
13050
13051 bits = (bits << 6) | map.indexOf(input.charAt(idx));
13052 }
13053
13054 // Dump tail
13055
13056 tailbits = (max % 4) * 6;
13057
13058 if (tailbits === 0) {
13059 result.push((bits >> 16) & 0xFF);
13060 result.push((bits >> 8) & 0xFF);
13061 result.push(bits & 0xFF);
13062 } else if (tailbits === 18) {
13063 result.push((bits >> 10) & 0xFF);
13064 result.push((bits >> 2) & 0xFF);
13065 } else if (tailbits === 12) {
13066 result.push((bits >> 4) & 0xFF);
13067 }
13068
13069 // Wrap into Buffer for NodeJS and leave Array for browser
Jian Li8afbbee2016-07-27 19:16:51 +090013070 if (NodeBuffer) return new NodeBuffer(result);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013071
13072 return result;
13073}
13074
13075function representYamlBinary(object /*, style*/) {
13076 var result = '', bits = 0, idx, tail,
13077 max = object.length,
13078 map = BASE64_MAP;
13079
13080 // Convert every three bytes to 4 ASCII characters.
13081
13082 for (idx = 0; idx < max; idx++) {
13083 if ((idx % 3 === 0) && idx) {
13084 result += map[(bits >> 18) & 0x3F];
13085 result += map[(bits >> 12) & 0x3F];
13086 result += map[(bits >> 6) & 0x3F];
13087 result += map[bits & 0x3F];
13088 }
13089
13090 bits = (bits << 8) + object[idx];
13091 }
13092
13093 // Dump tail
13094
13095 tail = max % 3;
13096
13097 if (tail === 0) {
13098 result += map[(bits >> 18) & 0x3F];
13099 result += map[(bits >> 12) & 0x3F];
13100 result += map[(bits >> 6) & 0x3F];
13101 result += map[bits & 0x3F];
13102 } else if (tail === 2) {
13103 result += map[(bits >> 10) & 0x3F];
13104 result += map[(bits >> 4) & 0x3F];
13105 result += map[(bits << 2) & 0x3F];
13106 result += map[64];
13107 } else if (tail === 1) {
13108 result += map[(bits >> 2) & 0x3F];
13109 result += map[(bits << 4) & 0x3F];
13110 result += map[64];
13111 result += map[64];
13112 }
13113
13114 return result;
13115}
13116
13117function isBinary(object) {
13118 return NodeBuffer && NodeBuffer.isBuffer(object);
13119}
13120
13121module.exports = new Type('tag:yaml.org,2002:binary', {
13122 kind: 'scalar',
13123 resolve: resolveYamlBinary,
13124 construct: constructYamlBinary,
13125 predicate: isBinary,
13126 represent: representYamlBinary
13127});
13128
Jian Li8afbbee2016-07-27 19:16:51 +090013129},{"../type":32}],34:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013130'use strict';
13131
13132var Type = require('../type');
13133
13134function resolveYamlBoolean(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013135 if (data === null) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013136
13137 var max = data.length;
13138
13139 return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
13140 (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
13141}
13142
13143function constructYamlBoolean(data) {
13144 return data === 'true' ||
13145 data === 'True' ||
13146 data === 'TRUE';
13147}
13148
13149function isBoolean(object) {
Jian Li8afbbee2016-07-27 19:16:51 +090013150 return Object.prototype.toString.call(object) === '[object Boolean]';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013151}
13152
13153module.exports = new Type('tag:yaml.org,2002:bool', {
13154 kind: 'scalar',
13155 resolve: resolveYamlBoolean,
13156 construct: constructYamlBoolean,
13157 predicate: isBoolean,
13158 represent: {
13159 lowercase: function (object) { return object ? 'true' : 'false'; },
13160 uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
13161 camelcase: function (object) { return object ? 'True' : 'False'; }
13162 },
13163 defaultStyle: 'lowercase'
13164});
13165
Jian Li8afbbee2016-07-27 19:16:51 +090013166},{"../type":32}],35:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013167'use strict';
13168
13169var common = require('../common');
13170var Type = require('../type');
13171
13172var YAML_FLOAT_PATTERN = new RegExp(
13173 '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' +
13174 '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' +
13175 '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
13176 '|[-+]?\\.(?:inf|Inf|INF)' +
13177 '|\\.(?:nan|NaN|NAN))$');
13178
13179function resolveYamlFloat(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013180 if (data === null) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013181
Jian Li8afbbee2016-07-27 19:16:51 +090013182 if (!YAML_FLOAT_PATTERN.test(data)) return false;
13183
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013184 return true;
13185}
13186
13187function constructYamlFloat(data) {
13188 var value, sign, base, digits;
13189
13190 value = data.replace(/_/g, '').toLowerCase();
Jian Li8afbbee2016-07-27 19:16:51 +090013191 sign = value[0] === '-' ? -1 : 1;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013192 digits = [];
13193
Jian Li8afbbee2016-07-27 19:16:51 +090013194 if ('+-'.indexOf(value[0]) >= 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013195 value = value.slice(1);
13196 }
13197
Jian Li8afbbee2016-07-27 19:16:51 +090013198 if (value === '.inf') {
13199 return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013200
Jian Li8afbbee2016-07-27 19:16:51 +090013201 } else if (value === '.nan') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013202 return NaN;
13203
Jian Li8afbbee2016-07-27 19:16:51 +090013204 } else if (value.indexOf(':') >= 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013205 value.split(':').forEach(function (v) {
13206 digits.unshift(parseFloat(v, 10));
13207 });
13208
13209 value = 0.0;
13210 base = 1;
13211
13212 digits.forEach(function (d) {
13213 value += d * base;
13214 base *= 60;
13215 });
13216
13217 return sign * value;
13218
13219 }
13220 return sign * parseFloat(value, 10);
13221}
13222
Jian Li83d87a72016-04-20 15:38:24 -070013223
13224var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
13225
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013226function representYamlFloat(object, style) {
Jian Li83d87a72016-04-20 15:38:24 -070013227 var res;
13228
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013229 if (isNaN(object)) {
13230 switch (style) {
Jian Li8afbbee2016-07-27 19:16:51 +090013231 case 'lowercase': return '.nan';
13232 case 'uppercase': return '.NAN';
13233 case 'camelcase': return '.NaN';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013234 }
13235 } else if (Number.POSITIVE_INFINITY === object) {
13236 switch (style) {
Jian Li8afbbee2016-07-27 19:16:51 +090013237 case 'lowercase': return '.inf';
13238 case 'uppercase': return '.INF';
13239 case 'camelcase': return '.Inf';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013240 }
13241 } else if (Number.NEGATIVE_INFINITY === object) {
13242 switch (style) {
Jian Li8afbbee2016-07-27 19:16:51 +090013243 case 'lowercase': return '-.inf';
13244 case 'uppercase': return '-.INF';
13245 case 'camelcase': return '-.Inf';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013246 }
13247 } else if (common.isNegativeZero(object)) {
13248 return '-0.0';
13249 }
Jian Li83d87a72016-04-20 15:38:24 -070013250
13251 res = object.toString(10);
13252
13253 // JS stringifier can build scientific format without dots: 5e-100,
13254 // while YAML requres dot: 5.e-100. Fix it with simple hack
13255
13256 return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013257}
13258
13259function isFloat(object) {
Jian Li8afbbee2016-07-27 19:16:51 +090013260 return (Object.prototype.toString.call(object) === '[object Number]') &&
13261 (object % 1 !== 0 || common.isNegativeZero(object));
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013262}
13263
13264module.exports = new Type('tag:yaml.org,2002:float', {
13265 kind: 'scalar',
13266 resolve: resolveYamlFloat,
13267 construct: constructYamlFloat,
13268 predicate: isFloat,
13269 represent: representYamlFloat,
13270 defaultStyle: 'lowercase'
13271});
13272
Jian Li8afbbee2016-07-27 19:16:51 +090013273},{"../common":21,"../type":32}],36:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013274'use strict';
13275
13276var common = require('../common');
13277var Type = require('../type');
13278
13279function isHexCode(c) {
13280 return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
13281 ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
13282 ((0x61/* a */ <= c) && (c <= 0x66/* f */));
13283}
13284
13285function isOctCode(c) {
13286 return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
13287}
13288
13289function isDecCode(c) {
13290 return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
13291}
13292
13293function resolveYamlInteger(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013294 if (data === null) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013295
13296 var max = data.length,
13297 index = 0,
13298 hasDigits = false,
13299 ch;
13300
Jian Li8afbbee2016-07-27 19:16:51 +090013301 if (!max) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013302
13303 ch = data[index];
13304
13305 // sign
13306 if (ch === '-' || ch === '+') {
13307 ch = data[++index];
13308 }
13309
13310 if (ch === '0') {
13311 // 0
Jian Li8afbbee2016-07-27 19:16:51 +090013312 if (index + 1 === max) return true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013313 ch = data[++index];
13314
13315 // base 2, base 8, base 16
13316
13317 if (ch === 'b') {
13318 // base 2
13319 index++;
13320
13321 for (; index < max; index++) {
13322 ch = data[index];
Jian Li8afbbee2016-07-27 19:16:51 +090013323 if (ch === '_') continue;
13324 if (ch !== '0' && ch !== '1') return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013325 hasDigits = true;
13326 }
13327 return hasDigits;
13328 }
13329
13330
13331 if (ch === 'x') {
13332 // base 16
13333 index++;
13334
13335 for (; index < max; index++) {
13336 ch = data[index];
Jian Li8afbbee2016-07-27 19:16:51 +090013337 if (ch === '_') continue;
13338 if (!isHexCode(data.charCodeAt(index))) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013339 hasDigits = true;
13340 }
13341 return hasDigits;
13342 }
13343
13344 // base 8
13345 for (; index < max; index++) {
13346 ch = data[index];
Jian Li8afbbee2016-07-27 19:16:51 +090013347 if (ch === '_') continue;
13348 if (!isOctCode(data.charCodeAt(index))) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013349 hasDigits = true;
13350 }
13351 return hasDigits;
13352 }
13353
13354 // base 10 (except 0) or base 60
13355
13356 for (; index < max; index++) {
13357 ch = data[index];
Jian Li8afbbee2016-07-27 19:16:51 +090013358 if (ch === '_') continue;
13359 if (ch === ':') break;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013360 if (!isDecCode(data.charCodeAt(index))) {
13361 return false;
13362 }
13363 hasDigits = true;
13364 }
13365
Jian Li8afbbee2016-07-27 19:16:51 +090013366 if (!hasDigits) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013367
13368 // if !base60 - done;
Jian Li8afbbee2016-07-27 19:16:51 +090013369 if (ch !== ':') return true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013370
13371 // base60 almost not used, no needs to optimize
13372 return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
13373}
13374
13375function constructYamlInteger(data) {
13376 var value = data, sign = 1, ch, base, digits = [];
13377
13378 if (value.indexOf('_') !== -1) {
13379 value = value.replace(/_/g, '');
13380 }
13381
13382 ch = value[0];
13383
13384 if (ch === '-' || ch === '+') {
Jian Li8afbbee2016-07-27 19:16:51 +090013385 if (ch === '-') sign = -1;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013386 value = value.slice(1);
13387 ch = value[0];
13388 }
13389
Jian Li8afbbee2016-07-27 19:16:51 +090013390 if (value === '0') return 0;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013391
13392 if (ch === '0') {
Jian Li8afbbee2016-07-27 19:16:51 +090013393 if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
13394 if (value[1] === 'x') return sign * parseInt(value, 16);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013395 return sign * parseInt(value, 8);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013396 }
13397
13398 if (value.indexOf(':') !== -1) {
13399 value.split(':').forEach(function (v) {
13400 digits.unshift(parseInt(v, 10));
13401 });
13402
13403 value = 0;
13404 base = 1;
13405
13406 digits.forEach(function (d) {
13407 value += (d * base);
13408 base *= 60;
13409 });
13410
13411 return sign * value;
13412
13413 }
13414
13415 return sign * parseInt(value, 10);
13416}
13417
13418function isInteger(object) {
Jian Li8afbbee2016-07-27 19:16:51 +090013419 return (Object.prototype.toString.call(object)) === '[object Number]' &&
13420 (object % 1 === 0 && !common.isNegativeZero(object));
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013421}
13422
13423module.exports = new Type('tag:yaml.org,2002:int', {
13424 kind: 'scalar',
13425 resolve: resolveYamlInteger,
13426 construct: constructYamlInteger,
13427 predicate: isInteger,
13428 represent: {
13429 binary: function (object) { return '0b' + object.toString(2); },
13430 octal: function (object) { return '0' + object.toString(8); },
13431 decimal: function (object) { return object.toString(10); },
13432 hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
13433 },
13434 defaultStyle: 'decimal',
13435 styleAliases: {
13436 binary: [ 2, 'bin' ],
13437 octal: [ 8, 'oct' ],
13438 decimal: [ 10, 'dec' ],
13439 hexadecimal: [ 16, 'hex' ]
13440 }
13441});
13442
Jian Li8afbbee2016-07-27 19:16:51 +090013443},{"../common":21,"../type":32}],37:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013444'use strict';
13445
13446var esprima;
13447
13448// Browserified version does not have esprima
13449//
13450// 1. For node.js just require module as deps
13451// 2. For browser try to require mudule via external AMD system.
13452// If not found - try to fallback to window.esprima. If not
13453// found too - then fail to parse.
13454//
13455try {
Jian Li8afbbee2016-07-27 19:16:51 +090013456 // workaround to exclude package from browserify list.
13457 var _require = require;
13458 esprima = _require('esprima');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013459} catch (_) {
13460 /*global window */
Jian Li8afbbee2016-07-27 19:16:51 +090013461 if (typeof window !== 'undefined') esprima = window.esprima;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013462}
13463
13464var Type = require('../../type');
13465
13466function resolveJavascriptFunction(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013467 if (data === null) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013468
13469 try {
13470 var source = '(' + data + ')',
Jian Li83d87a72016-04-20 15:38:24 -070013471 ast = esprima.parse(source, { range: true });
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013472
Jian Li8afbbee2016-07-27 19:16:51 +090013473 if (ast.type !== 'Program' ||
13474 ast.body.length !== 1 ||
13475 ast.body[0].type !== 'ExpressionStatement' ||
13476 ast.body[0].expression.type !== 'FunctionExpression') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013477 return false;
13478 }
13479
13480 return true;
13481 } catch (err) {
13482 return false;
13483 }
13484}
13485
13486function constructJavascriptFunction(data) {
13487 /*jslint evil:true*/
13488
13489 var source = '(' + data + ')',
13490 ast = esprima.parse(source, { range: true }),
13491 params = [],
13492 body;
13493
Jian Li8afbbee2016-07-27 19:16:51 +090013494 if (ast.type !== 'Program' ||
13495 ast.body.length !== 1 ||
13496 ast.body[0].type !== 'ExpressionStatement' ||
13497 ast.body[0].expression.type !== 'FunctionExpression') {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013498 throw new Error('Failed to resolve function');
13499 }
13500
13501 ast.body[0].expression.params.forEach(function (param) {
13502 params.push(param.name);
13503 });
13504
13505 body = ast.body[0].expression.body.range;
13506
13507 // Esprima's ranges include the first '{' and the last '}' characters on
13508 // function expressions. So cut them out.
13509 /*eslint-disable no-new-func*/
13510 return new Function(params, source.slice(body[0] + 1, body[1] - 1));
13511}
13512
13513function representJavascriptFunction(object /*, style*/) {
13514 return object.toString();
13515}
13516
13517function isFunction(object) {
Jian Li8afbbee2016-07-27 19:16:51 +090013518 return Object.prototype.toString.call(object) === '[object Function]';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013519}
13520
13521module.exports = new Type('tag:yaml.org,2002:js/function', {
13522 kind: 'scalar',
13523 resolve: resolveJavascriptFunction,
13524 construct: constructJavascriptFunction,
13525 predicate: isFunction,
13526 represent: representJavascriptFunction
13527});
13528
Jian Li8afbbee2016-07-27 19:16:51 +090013529},{"../../type":32}],38:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013530'use strict';
13531
13532var Type = require('../../type');
13533
13534function resolveJavascriptRegExp(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013535 if (data === null) return false;
13536 if (data.length === 0) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013537
13538 var regexp = data,
13539 tail = /\/([gim]*)$/.exec(data),
13540 modifiers = '';
13541
13542 // if regexp starts with '/' it can have modifiers and must be properly closed
13543 // `/foo/gim` - modifiers tail can be maximum 3 chars
Jian Li8afbbee2016-07-27 19:16:51 +090013544 if (regexp[0] === '/') {
13545 if (tail) modifiers = tail[1];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013546
Jian Li8afbbee2016-07-27 19:16:51 +090013547 if (modifiers.length > 3) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013548 // if expression starts with /, is should be properly terminated
Jian Li8afbbee2016-07-27 19:16:51 +090013549 if (regexp[regexp.length - modifiers.length - 1] !== '/') return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013550 }
13551
Jian Li8afbbee2016-07-27 19:16:51 +090013552 return true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013553}
13554
13555function constructJavascriptRegExp(data) {
13556 var regexp = data,
13557 tail = /\/([gim]*)$/.exec(data),
13558 modifiers = '';
13559
13560 // `/foo/gim` - tail can be maximum 4 chars
Jian Li8afbbee2016-07-27 19:16:51 +090013561 if (regexp[0] === '/') {
13562 if (tail) modifiers = tail[1];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013563 regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
13564 }
13565
13566 return new RegExp(regexp, modifiers);
13567}
13568
13569function representJavascriptRegExp(object /*, style*/) {
13570 var result = '/' + object.source + '/';
13571
Jian Li8afbbee2016-07-27 19:16:51 +090013572 if (object.global) result += 'g';
13573 if (object.multiline) result += 'm';
13574 if (object.ignoreCase) result += 'i';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013575
13576 return result;
13577}
13578
13579function isRegExp(object) {
Jian Li8afbbee2016-07-27 19:16:51 +090013580 return Object.prototype.toString.call(object) === '[object RegExp]';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013581}
13582
13583module.exports = new Type('tag:yaml.org,2002:js/regexp', {
13584 kind: 'scalar',
13585 resolve: resolveJavascriptRegExp,
13586 construct: constructJavascriptRegExp,
13587 predicate: isRegExp,
13588 represent: representJavascriptRegExp
13589});
13590
Jian Li8afbbee2016-07-27 19:16:51 +090013591},{"../../type":32}],39:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013592'use strict';
13593
13594var Type = require('../../type');
13595
13596function resolveJavascriptUndefined() {
13597 return true;
13598}
13599
13600function constructJavascriptUndefined() {
13601 /*eslint-disable no-undefined*/
13602 return undefined;
13603}
13604
13605function representJavascriptUndefined() {
13606 return '';
13607}
13608
13609function isUndefined(object) {
Jian Li8afbbee2016-07-27 19:16:51 +090013610 return typeof object === 'undefined';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013611}
13612
13613module.exports = new Type('tag:yaml.org,2002:js/undefined', {
13614 kind: 'scalar',
13615 resolve: resolveJavascriptUndefined,
13616 construct: constructJavascriptUndefined,
13617 predicate: isUndefined,
13618 represent: representJavascriptUndefined
13619});
13620
Jian Li8afbbee2016-07-27 19:16:51 +090013621},{"../../type":32}],40:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013622'use strict';
13623
13624var Type = require('../type');
13625
13626module.exports = new Type('tag:yaml.org,2002:map', {
13627 kind: 'mapping',
Jian Li8afbbee2016-07-27 19:16:51 +090013628 construct: function (data) { return data !== null ? data : {}; }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013629});
13630
Jian Li8afbbee2016-07-27 19:16:51 +090013631},{"../type":32}],41:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013632'use strict';
13633
13634var Type = require('../type');
13635
13636function resolveYamlMerge(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013637 return data === '<<' || data === null;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013638}
13639
13640module.exports = new Type('tag:yaml.org,2002:merge', {
13641 kind: 'scalar',
13642 resolve: resolveYamlMerge
13643});
13644
Jian Li8afbbee2016-07-27 19:16:51 +090013645},{"../type":32}],42:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013646'use strict';
13647
13648var Type = require('../type');
13649
13650function resolveYamlNull(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013651 if (data === null) return true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013652
13653 var max = data.length;
13654
13655 return (max === 1 && data === '~') ||
13656 (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
13657}
13658
13659function constructYamlNull() {
13660 return null;
13661}
13662
13663function isNull(object) {
Jian Li8afbbee2016-07-27 19:16:51 +090013664 return object === null;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013665}
13666
13667module.exports = new Type('tag:yaml.org,2002:null', {
13668 kind: 'scalar',
13669 resolve: resolveYamlNull,
13670 construct: constructYamlNull,
13671 predicate: isNull,
13672 represent: {
13673 canonical: function () { return '~'; },
13674 lowercase: function () { return 'null'; },
13675 uppercase: function () { return 'NULL'; },
13676 camelcase: function () { return 'Null'; }
13677 },
13678 defaultStyle: 'lowercase'
13679});
13680
Jian Li8afbbee2016-07-27 19:16:51 +090013681},{"../type":32}],43:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013682'use strict';
13683
13684var Type = require('../type');
13685
13686var _hasOwnProperty = Object.prototype.hasOwnProperty;
13687var _toString = Object.prototype.toString;
13688
13689function resolveYamlOmap(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013690 if (data === null) return true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013691
13692 var objectKeys = [], index, length, pair, pairKey, pairHasKey,
13693 object = data;
13694
13695 for (index = 0, length = object.length; index < length; index += 1) {
13696 pair = object[index];
13697 pairHasKey = false;
13698
Jian Li8afbbee2016-07-27 19:16:51 +090013699 if (_toString.call(pair) !== '[object Object]') return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013700
13701 for (pairKey in pair) {
13702 if (_hasOwnProperty.call(pair, pairKey)) {
Jian Li8afbbee2016-07-27 19:16:51 +090013703 if (!pairHasKey) pairHasKey = true;
13704 else return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013705 }
13706 }
13707
Jian Li8afbbee2016-07-27 19:16:51 +090013708 if (!pairHasKey) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013709
Jian Li8afbbee2016-07-27 19:16:51 +090013710 if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
13711 else return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013712 }
13713
13714 return true;
13715}
13716
13717function constructYamlOmap(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013718 return data !== null ? data : [];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013719}
13720
13721module.exports = new Type('tag:yaml.org,2002:omap', {
13722 kind: 'sequence',
13723 resolve: resolveYamlOmap,
13724 construct: constructYamlOmap
13725});
13726
Jian Li8afbbee2016-07-27 19:16:51 +090013727},{"../type":32}],44:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013728'use strict';
13729
13730var Type = require('../type');
13731
13732var _toString = Object.prototype.toString;
13733
13734function resolveYamlPairs(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013735 if (data === null) return true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013736
13737 var index, length, pair, keys, result,
13738 object = data;
13739
13740 result = new Array(object.length);
13741
13742 for (index = 0, length = object.length; index < length; index += 1) {
13743 pair = object[index];
13744
Jian Li8afbbee2016-07-27 19:16:51 +090013745 if (_toString.call(pair) !== '[object Object]') return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013746
13747 keys = Object.keys(pair);
13748
Jian Li8afbbee2016-07-27 19:16:51 +090013749 if (keys.length !== 1) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013750
13751 result[index] = [ keys[0], pair[keys[0]] ];
13752 }
13753
13754 return true;
13755}
13756
13757function constructYamlPairs(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013758 if (data === null) return [];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013759
13760 var index, length, pair, keys, result,
13761 object = data;
13762
13763 result = new Array(object.length);
13764
13765 for (index = 0, length = object.length; index < length; index += 1) {
13766 pair = object[index];
13767
13768 keys = Object.keys(pair);
13769
13770 result[index] = [ keys[0], pair[keys[0]] ];
13771 }
13772
13773 return result;
13774}
13775
13776module.exports = new Type('tag:yaml.org,2002:pairs', {
13777 kind: 'sequence',
13778 resolve: resolveYamlPairs,
13779 construct: constructYamlPairs
13780});
13781
Jian Li8afbbee2016-07-27 19:16:51 +090013782},{"../type":32}],45:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013783'use strict';
13784
13785var Type = require('../type');
13786
13787module.exports = new Type('tag:yaml.org,2002:seq', {
13788 kind: 'sequence',
Jian Li8afbbee2016-07-27 19:16:51 +090013789 construct: function (data) { return data !== null ? data : []; }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013790});
13791
Jian Li8afbbee2016-07-27 19:16:51 +090013792},{"../type":32}],46:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013793'use strict';
13794
13795var Type = require('../type');
13796
13797var _hasOwnProperty = Object.prototype.hasOwnProperty;
13798
13799function resolveYamlSet(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013800 if (data === null) return true;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013801
13802 var key, object = data;
13803
13804 for (key in object) {
13805 if (_hasOwnProperty.call(object, key)) {
Jian Li8afbbee2016-07-27 19:16:51 +090013806 if (object[key] !== null) return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013807 }
13808 }
13809
13810 return true;
13811}
13812
13813function constructYamlSet(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013814 return data !== null ? data : {};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013815}
13816
13817module.exports = new Type('tag:yaml.org,2002:set', {
13818 kind: 'mapping',
13819 resolve: resolveYamlSet,
13820 construct: constructYamlSet
13821});
13822
Jian Li8afbbee2016-07-27 19:16:51 +090013823},{"../type":32}],47:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013824'use strict';
13825
13826var Type = require('../type');
13827
13828module.exports = new Type('tag:yaml.org,2002:str', {
13829 kind: 'scalar',
Jian Li8afbbee2016-07-27 19:16:51 +090013830 construct: function (data) { return data !== null ? data : ''; }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013831});
13832
Jian Li8afbbee2016-07-27 19:16:51 +090013833},{"../type":32}],48:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013834'use strict';
13835
13836var Type = require('../type');
13837
Jian Li8afbbee2016-07-27 19:16:51 +090013838var YAML_DATE_REGEXP = new RegExp(
13839 '^([0-9][0-9][0-9][0-9])' + // [1] year
13840 '-([0-9][0-9])' + // [2] month
13841 '-([0-9][0-9])$'); // [3] day
13842
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013843var YAML_TIMESTAMP_REGEXP = new RegExp(
13844 '^([0-9][0-9][0-9][0-9])' + // [1] year
13845 '-([0-9][0-9]?)' + // [2] month
13846 '-([0-9][0-9]?)' + // [3] day
Jian Li8afbbee2016-07-27 19:16:51 +090013847 '(?:[Tt]|[ \\t]+)' + // ...
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013848 '([0-9][0-9]?)' + // [4] hour
13849 ':([0-9][0-9])' + // [5] minute
13850 ':([0-9][0-9])' + // [6] second
13851 '(?:\\.([0-9]*))?' + // [7] fraction
13852 '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
Jian Li8afbbee2016-07-27 19:16:51 +090013853 '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013854
13855function resolveYamlTimestamp(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090013856 if (data === null) return false;
13857 if (YAML_DATE_REGEXP.exec(data) !== null) return true;
13858 if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
13859 return false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013860}
13861
13862function constructYamlTimestamp(data) {
13863 var match, year, month, day, hour, minute, second, fraction = 0,
13864 delta = null, tz_hour, tz_minute, date;
13865
Jian Li8afbbee2016-07-27 19:16:51 +090013866 match = YAML_DATE_REGEXP.exec(data);
13867 if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013868
Jian Li8afbbee2016-07-27 19:16:51 +090013869 if (match === null) throw new Error('Date resolve error');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013870
13871 // match: [1] year [2] month [3] day
13872
13873 year = +(match[1]);
13874 month = +(match[2]) - 1; // JS month starts with 0
13875 day = +(match[3]);
13876
13877 if (!match[4]) { // no hour
13878 return new Date(Date.UTC(year, month, day));
13879 }
13880
13881 // match: [4] hour [5] minute [6] second [7] fraction
13882
13883 hour = +(match[4]);
13884 minute = +(match[5]);
13885 second = +(match[6]);
13886
13887 if (match[7]) {
13888 fraction = match[7].slice(0, 3);
13889 while (fraction.length < 3) { // milli-seconds
13890 fraction += '0';
13891 }
13892 fraction = +fraction;
13893 }
13894
13895 // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
13896
13897 if (match[9]) {
13898 tz_hour = +(match[10]);
13899 tz_minute = +(match[11] || 0);
13900 delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
Jian Li8afbbee2016-07-27 19:16:51 +090013901 if (match[9] === '-') delta = -delta;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013902 }
13903
13904 date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
13905
Jian Li8afbbee2016-07-27 19:16:51 +090013906 if (delta) date.setTime(date.getTime() - delta);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013907
13908 return date;
13909}
13910
13911function representYamlTimestamp(object /*, style*/) {
13912 return object.toISOString();
13913}
13914
13915module.exports = new Type('tag:yaml.org,2002:timestamp', {
13916 kind: 'scalar',
13917 resolve: resolveYamlTimestamp,
13918 construct: constructYamlTimestamp,
13919 instanceOf: Date,
13920 represent: representYamlTimestamp
13921});
13922
Jian Li8afbbee2016-07-27 19:16:51 +090013923},{"../type":32}],49:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013924var baseIndexOf = require('../internal/baseIndexOf'),
13925 binaryIndex = require('../internal/binaryIndex');
13926
13927/* Native method references for those with the same name as other `lodash` methods. */
13928var nativeMax = Math.max;
13929
13930/**
13931 * Gets the index at which the first occurrence of `value` is found in `array`
Jian Li83d87a72016-04-20 15:38:24 -070013932 * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
13933 * for equality comparisons. If `fromIndex` is negative, it's used as the offset
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013934 * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
13935 * performs a faster binary search.
13936 *
13937 * @static
13938 * @memberOf _
13939 * @category Array
13940 * @param {Array} array The array to search.
13941 * @param {*} value The value to search for.
13942 * @param {boolean|number} [fromIndex=0] The index to search from or `true`
13943 * to perform a binary search on a sorted array.
13944 * @returns {number} Returns the index of the matched value, else `-1`.
13945 * @example
13946 *
13947 * _.indexOf([1, 2, 1, 2], 2);
13948 * // => 1
13949 *
13950 * // using `fromIndex`
13951 * _.indexOf([1, 2, 1, 2], 2, 2);
13952 * // => 3
13953 *
13954 * // performing a binary search
13955 * _.indexOf([1, 1, 2, 2], 2, true);
13956 * // => 2
13957 */
13958function indexOf(array, value, fromIndex) {
13959 var length = array ? array.length : 0;
13960 if (!length) {
13961 return -1;
13962 }
13963 if (typeof fromIndex == 'number') {
13964 fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
13965 } else if (fromIndex) {
Jian Li83d87a72016-04-20 15:38:24 -070013966 var index = binaryIndex(array, value);
13967 if (index < length &&
13968 (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013969 return index;
13970 }
13971 return -1;
13972 }
13973 return baseIndexOf(array, value, fromIndex || 0);
13974}
13975
13976module.exports = indexOf;
13977
Jian Li8afbbee2016-07-27 19:16:51 +090013978},{"../internal/baseIndexOf":78,"../internal/binaryIndex":92}],50:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070013979/**
13980 * Gets the last element of `array`.
13981 *
13982 * @static
13983 * @memberOf _
13984 * @category Array
13985 * @param {Array} array The array to query.
13986 * @returns {*} Returns the last element of `array`.
13987 * @example
13988 *
13989 * _.last([1, 2, 3]);
13990 * // => 3
13991 */
13992function last(array) {
13993 var length = array ? array.length : 0;
13994 return length ? array[length - 1] : undefined;
13995}
13996
13997module.exports = last;
13998
Jian Li8afbbee2016-07-27 19:16:51 +090013999},{}],51:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014000var LazyWrapper = require('../internal/LazyWrapper'),
14001 LodashWrapper = require('../internal/LodashWrapper'),
14002 baseLodash = require('../internal/baseLodash'),
14003 isArray = require('../lang/isArray'),
14004 isObjectLike = require('../internal/isObjectLike'),
14005 wrapperClone = require('../internal/wrapperClone');
14006
14007/** Used for native method references. */
14008var objectProto = Object.prototype;
14009
14010/** Used to check objects for own properties. */
14011var hasOwnProperty = objectProto.hasOwnProperty;
14012
14013/**
14014 * Creates a `lodash` object which wraps `value` to enable implicit chaining.
14015 * Methods that operate on and return arrays, collections, and functions can
Jian Li83d87a72016-04-20 15:38:24 -070014016 * be chained together. Methods that retrieve a single value or may return a
14017 * primitive value will automatically end the chain returning the unwrapped
14018 * value. Explicit chaining may be enabled using `_.chain`. The execution of
14019 * chained methods is lazy, that is, execution is deferred until `_#value`
14020 * is implicitly or explicitly called.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014021 *
14022 * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
Jian Li83d87a72016-04-20 15:38:24 -070014023 * fusion is an optimization strategy which merge iteratee calls; this can help
14024 * to avoid the creation of intermediate data structures and greatly reduce the
14025 * number of iteratee executions.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014026 *
14027 * Chaining is supported in custom builds as long as the `_#value` method is
14028 * directly or indirectly included in the build.
14029 *
14030 * In addition to lodash methods, wrappers have `Array` and `String` methods.
14031 *
14032 * The wrapper `Array` methods are:
14033 * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
14034 * `splice`, and `unshift`
14035 *
14036 * The wrapper `String` methods are:
14037 * `replace` and `split`
14038 *
14039 * The wrapper methods that support shortcut fusion are:
14040 * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
14041 * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
14042 * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
14043 * and `where`
14044 *
14045 * The chainable wrapper methods are:
14046 * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
14047 * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
Jian Li83d87a72016-04-20 15:38:24 -070014048 * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,
14049 * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,
14050 * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,
14051 * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
14052 * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
14053 * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,
14054 * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,
14055 * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
14056 * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
14057 * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,
14058 * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,
14059 * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,
14060 * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
14061 * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
14062 * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014063 *
14064 * The wrapper methods that are **not** chainable by default are:
Jian Li83d87a72016-04-20 15:38:24 -070014065 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
14066 * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
14067 * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
14068 * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
14069 * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
14070 * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
14071 * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
14072 * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
14073 * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
14074 * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
14075 * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
14076 * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
14077 * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
14078 * `unescape`, `uniqueId`, `value`, and `words`
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014079 *
14080 * The wrapper method `sample` will return a wrapped value when `n` is provided,
14081 * otherwise an unwrapped value is returned.
14082 *
14083 * @name _
14084 * @constructor
14085 * @category Chain
14086 * @param {*} value The value to wrap in a `lodash` instance.
14087 * @returns {Object} Returns the new `lodash` wrapper instance.
14088 * @example
14089 *
14090 * var wrapped = _([1, 2, 3]);
14091 *
14092 * // returns an unwrapped value
14093 * wrapped.reduce(function(total, n) {
14094 * return total + n;
14095 * });
14096 * // => 6
14097 *
14098 * // returns a wrapped value
14099 * var squares = wrapped.map(function(n) {
14100 * return n * n;
14101 * });
14102 *
14103 * _.isArray(squares);
14104 * // => false
14105 *
14106 * _.isArray(squares.value());
14107 * // => true
14108 */
14109function lodash(value) {
14110 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
14111 if (value instanceof LodashWrapper) {
14112 return value;
14113 }
14114 if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
14115 return wrapperClone(value);
14116 }
14117 }
14118 return new LodashWrapper(value);
14119}
14120
14121// Ensure wrappers are instances of `baseLodash`.
14122lodash.prototype = baseLodash.prototype;
14123
14124module.exports = lodash;
14125
Jian Li8afbbee2016-07-27 19:16:51 +090014126},{"../internal/LazyWrapper":60,"../internal/LodashWrapper":61,"../internal/baseLodash":82,"../internal/isObjectLike":126,"../internal/wrapperClone":137,"../lang/isArray":140}],52:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014127module.exports = require('./forEach');
14128
Jian Li8afbbee2016-07-27 19:16:51 +090014129},{"./forEach":54}],53:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014130var baseEach = require('../internal/baseEach'),
14131 createFind = require('../internal/createFind');
14132
14133/**
14134 * Iterates over elements of `collection`, returning the first element
14135 * `predicate` returns truthy for. The predicate is bound to `thisArg` and
14136 * invoked with three arguments: (value, index|key, collection).
14137 *
14138 * If a property name is provided for `predicate` the created `_.property`
14139 * style callback returns the property value of the given element.
14140 *
14141 * If a value is also provided for `thisArg` the created `_.matchesProperty`
14142 * style callback returns `true` for elements that have a matching property
14143 * value, else `false`.
14144 *
14145 * If an object is provided for `predicate` the created `_.matches` style
14146 * callback returns `true` for elements that have the properties of the given
14147 * object, else `false`.
14148 *
14149 * @static
14150 * @memberOf _
14151 * @alias detect
14152 * @category Collection
14153 * @param {Array|Object|string} collection The collection to search.
14154 * @param {Function|Object|string} [predicate=_.identity] The function invoked
14155 * per iteration.
14156 * @param {*} [thisArg] The `this` binding of `predicate`.
14157 * @returns {*} Returns the matched element, else `undefined`.
14158 * @example
14159 *
14160 * var users = [
14161 * { 'user': 'barney', 'age': 36, 'active': true },
14162 * { 'user': 'fred', 'age': 40, 'active': false },
14163 * { 'user': 'pebbles', 'age': 1, 'active': true }
14164 * ];
14165 *
14166 * _.result(_.find(users, function(chr) {
14167 * return chr.age < 40;
14168 * }), 'user');
14169 * // => 'barney'
14170 *
14171 * // using the `_.matches` callback shorthand
14172 * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
14173 * // => 'pebbles'
14174 *
14175 * // using the `_.matchesProperty` callback shorthand
14176 * _.result(_.find(users, 'active', false), 'user');
14177 * // => 'fred'
14178 *
14179 * // using the `_.property` callback shorthand
14180 * _.result(_.find(users, 'active'), 'user');
14181 * // => 'barney'
14182 */
14183var find = createFind(baseEach);
14184
14185module.exports = find;
14186
Jian Li8afbbee2016-07-27 19:16:51 +090014187},{"../internal/baseEach":71,"../internal/createFind":102}],54:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014188var arrayEach = require('../internal/arrayEach'),
14189 baseEach = require('../internal/baseEach'),
14190 createForEach = require('../internal/createForEach');
14191
14192/**
14193 * Iterates over elements of `collection` invoking `iteratee` for each element.
14194 * The `iteratee` is bound to `thisArg` and invoked with three arguments:
14195 * (value, index|key, collection). Iteratee functions may exit iteration early
14196 * by explicitly returning `false`.
14197 *
14198 * **Note:** As with other "Collections" methods, objects with a "length" property
14199 * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
14200 * may be used for object iteration.
14201 *
14202 * @static
14203 * @memberOf _
14204 * @alias each
14205 * @category Collection
14206 * @param {Array|Object|string} collection The collection to iterate over.
14207 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
14208 * @param {*} [thisArg] The `this` binding of `iteratee`.
14209 * @returns {Array|Object|string} Returns `collection`.
14210 * @example
14211 *
14212 * _([1, 2]).forEach(function(n) {
14213 * console.log(n);
14214 * }).value();
14215 * // => logs each value from left to right and returns the array
14216 *
14217 * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
14218 * console.log(n, key);
14219 * });
14220 * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
14221 */
14222var forEach = createForEach(arrayEach, baseEach);
14223
14224module.exports = forEach;
14225
Jian Li8afbbee2016-07-27 19:16:51 +090014226},{"../internal/arrayEach":63,"../internal/baseEach":71,"../internal/createForEach":103}],55:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014227var baseIndexOf = require('../internal/baseIndexOf'),
14228 getLength = require('../internal/getLength'),
14229 isArray = require('../lang/isArray'),
14230 isIterateeCall = require('../internal/isIterateeCall'),
14231 isLength = require('../internal/isLength'),
14232 isString = require('../lang/isString'),
14233 values = require('../object/values');
14234
14235/* Native method references for those with the same name as other `lodash` methods. */
14236var nativeMax = Math.max;
14237
14238/**
Jian Li83d87a72016-04-20 15:38:24 -070014239 * Checks if `target` is in `collection` using
14240 * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
14241 * for equality comparisons. If `fromIndex` is negative, it's used as the offset
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014242 * from the end of `collection`.
14243 *
14244 * @static
14245 * @memberOf _
14246 * @alias contains, include
14247 * @category Collection
14248 * @param {Array|Object|string} collection The collection to search.
14249 * @param {*} target The value to search for.
14250 * @param {number} [fromIndex=0] The index to search from.
14251 * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
14252 * @returns {boolean} Returns `true` if a matching element is found, else `false`.
14253 * @example
14254 *
14255 * _.includes([1, 2, 3], 1);
14256 * // => true
14257 *
14258 * _.includes([1, 2, 3], 1, 2);
14259 * // => false
14260 *
14261 * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
14262 * // => true
14263 *
14264 * _.includes('pebbles', 'eb');
14265 * // => true
14266 */
14267function includes(collection, target, fromIndex, guard) {
14268 var length = collection ? getLength(collection) : 0;
14269 if (!isLength(length)) {
14270 collection = values(collection);
14271 length = collection.length;
14272 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014273 if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
14274 fromIndex = 0;
14275 } else {
14276 fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
14277 }
14278 return (typeof collection == 'string' || !isArray(collection) && isString(collection))
Jian Li83d87a72016-04-20 15:38:24 -070014279 ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1)
14280 : (!!length && baseIndexOf(collection, target, fromIndex) > -1);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014281}
14282
14283module.exports = includes;
14284
Jian Li8afbbee2016-07-27 19:16:51 +090014285},{"../internal/baseIndexOf":78,"../internal/getLength":112,"../internal/isIterateeCall":122,"../internal/isLength":125,"../lang/isArray":140,"../lang/isString":146,"../object/values":152}],56:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014286var arrayMap = require('../internal/arrayMap'),
14287 baseCallback = require('../internal/baseCallback'),
14288 baseMap = require('../internal/baseMap'),
14289 isArray = require('../lang/isArray');
14290
14291/**
14292 * Creates an array of values by running each element in `collection` through
14293 * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
14294 * arguments: (value, index|key, collection).
14295 *
14296 * If a property name is provided for `iteratee` the created `_.property`
14297 * style callback returns the property value of the given element.
14298 *
14299 * If a value is also provided for `thisArg` the created `_.matchesProperty`
14300 * style callback returns `true` for elements that have a matching property
14301 * value, else `false`.
14302 *
14303 * If an object is provided for `iteratee` the created `_.matches` style
14304 * callback returns `true` for elements that have the properties of the given
14305 * object, else `false`.
14306 *
14307 * Many lodash methods are guarded to work as iteratees for methods like
14308 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
14309 *
14310 * The guarded methods are:
14311 * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
14312 * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
14313 * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
14314 * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
14315 * `sum`, `uniq`, and `words`
14316 *
14317 * @static
14318 * @memberOf _
14319 * @alias collect
14320 * @category Collection
14321 * @param {Array|Object|string} collection The collection to iterate over.
14322 * @param {Function|Object|string} [iteratee=_.identity] The function invoked
14323 * per iteration.
14324 * @param {*} [thisArg] The `this` binding of `iteratee`.
14325 * @returns {Array} Returns the new mapped array.
14326 * @example
14327 *
14328 * function timesThree(n) {
14329 * return n * 3;
14330 * }
14331 *
14332 * _.map([1, 2], timesThree);
14333 * // => [3, 6]
14334 *
14335 * _.map({ 'a': 1, 'b': 2 }, timesThree);
14336 * // => [3, 6] (iteration order is not guaranteed)
14337 *
14338 * var users = [
14339 * { 'user': 'barney' },
14340 * { 'user': 'fred' }
14341 * ];
14342 *
14343 * // using the `_.property` callback shorthand
14344 * _.map(users, 'user');
14345 * // => ['barney', 'fred']
14346 */
14347function map(collection, iteratee, thisArg) {
14348 var func = isArray(collection) ? arrayMap : baseMap;
14349 iteratee = baseCallback(iteratee, thisArg, 3);
14350 return func(collection, iteratee);
14351}
14352
14353module.exports = map;
14354
Jian Li8afbbee2016-07-27 19:16:51 +090014355},{"../internal/arrayMap":64,"../internal/baseCallback":67,"../internal/baseMap":83,"../lang/isArray":140}],57:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014356var getNative = require('../internal/getNative');
14357
14358/* Native method references for those with the same name as other `lodash` methods. */
14359var nativeNow = getNative(Date, 'now');
14360
14361/**
14362 * Gets the number of milliseconds that have elapsed since the Unix epoch
14363 * (1 January 1970 00:00:00 UTC).
14364 *
14365 * @static
14366 * @memberOf _
14367 * @category Date
14368 * @example
14369 *
14370 * _.defer(function(stamp) {
14371 * console.log(_.now() - stamp);
14372 * }, _.now());
14373 * // => logs the number of milliseconds it took for the deferred function to be invoked
14374 */
14375var now = nativeNow || function() {
14376 return new Date().getTime();
14377};
14378
14379module.exports = now;
14380
Jian Li8afbbee2016-07-27 19:16:51 +090014381},{"../internal/getNative":114}],58:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014382var createWrapper = require('../internal/createWrapper'),
14383 replaceHolders = require('../internal/replaceHolders'),
14384 restParam = require('./restParam');
14385
14386/** Used to compose bitmasks for wrapper metadata. */
14387var BIND_FLAG = 1,
14388 PARTIAL_FLAG = 32;
14389
14390/**
14391 * Creates a function that invokes `func` with the `this` binding of `thisArg`
14392 * and prepends any additional `_.bind` arguments to those provided to the
14393 * bound function.
14394 *
14395 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
14396 * may be used as a placeholder for partially applied arguments.
14397 *
14398 * **Note:** Unlike native `Function#bind` this method does not set the "length"
14399 * property of bound functions.
14400 *
14401 * @static
14402 * @memberOf _
14403 * @category Function
14404 * @param {Function} func The function to bind.
14405 * @param {*} thisArg The `this` binding of `func`.
14406 * @param {...*} [partials] The arguments to be partially applied.
14407 * @returns {Function} Returns the new bound function.
14408 * @example
14409 *
14410 * var greet = function(greeting, punctuation) {
14411 * return greeting + ' ' + this.user + punctuation;
14412 * };
14413 *
14414 * var object = { 'user': 'fred' };
14415 *
14416 * var bound = _.bind(greet, object, 'hi');
14417 * bound('!');
14418 * // => 'hi fred!'
14419 *
14420 * // using placeholders
14421 * var bound = _.bind(greet, object, _, '!');
14422 * bound('hi');
14423 * // => 'hi fred!'
14424 */
14425var bind = restParam(function(func, thisArg, partials) {
14426 var bitmask = BIND_FLAG;
14427 if (partials.length) {
14428 var holders = replaceHolders(partials, bind.placeholder);
14429 bitmask |= PARTIAL_FLAG;
14430 }
14431 return createWrapper(func, bitmask, thisArg, partials, holders);
14432});
14433
14434// Assign default placeholders.
14435bind.placeholder = {};
14436
14437module.exports = bind;
14438
Jian Li8afbbee2016-07-27 19:16:51 +090014439},{"../internal/createWrapper":106,"../internal/replaceHolders":132,"./restParam":59}],59:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014440/** Used as the `TypeError` message for "Functions" methods. */
14441var FUNC_ERROR_TEXT = 'Expected a function';
14442
14443/* Native method references for those with the same name as other `lodash` methods. */
14444var nativeMax = Math.max;
14445
14446/**
14447 * Creates a function that invokes `func` with the `this` binding of the
14448 * created function and arguments from `start` and beyond provided as an array.
14449 *
Jian Li83d87a72016-04-20 15:38:24 -070014450 * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014451 *
14452 * @static
14453 * @memberOf _
14454 * @category Function
14455 * @param {Function} func The function to apply a rest parameter to.
14456 * @param {number} [start=func.length-1] The start position of the rest parameter.
14457 * @returns {Function} Returns the new function.
14458 * @example
14459 *
14460 * var say = _.restParam(function(what, names) {
14461 * return what + ' ' + _.initial(names).join(', ') +
14462 * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
14463 * });
14464 *
14465 * say('hello', 'fred', 'barney', 'pebbles');
14466 * // => 'hello fred, barney, & pebbles'
14467 */
14468function restParam(func, start) {
14469 if (typeof func != 'function') {
14470 throw new TypeError(FUNC_ERROR_TEXT);
14471 }
14472 start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
14473 return function() {
14474 var args = arguments,
14475 index = -1,
14476 length = nativeMax(args.length - start, 0),
14477 rest = Array(length);
14478
14479 while (++index < length) {
14480 rest[index] = args[start + index];
14481 }
14482 switch (start) {
14483 case 0: return func.call(this, rest);
14484 case 1: return func.call(this, args[0], rest);
14485 case 2: return func.call(this, args[0], args[1], rest);
14486 }
14487 var otherArgs = Array(start + 1);
14488 index = -1;
14489 while (++index < start) {
14490 otherArgs[index] = args[index];
14491 }
14492 otherArgs[start] = rest;
14493 return func.apply(this, otherArgs);
14494 };
14495}
14496
14497module.exports = restParam;
14498
Jian Li8afbbee2016-07-27 19:16:51 +090014499},{}],60:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014500var baseCreate = require('./baseCreate'),
14501 baseLodash = require('./baseLodash');
14502
14503/** Used as references for `-Infinity` and `Infinity`. */
14504var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
14505
14506/**
14507 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
14508 *
14509 * @private
14510 * @param {*} value The value to wrap.
14511 */
14512function LazyWrapper(value) {
14513 this.__wrapped__ = value;
Jian Li83d87a72016-04-20 15:38:24 -070014514 this.__actions__ = [];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014515 this.__dir__ = 1;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014516 this.__filtered__ = false;
Jian Li83d87a72016-04-20 15:38:24 -070014517 this.__iteratees__ = [];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014518 this.__takeCount__ = POSITIVE_INFINITY;
Jian Li83d87a72016-04-20 15:38:24 -070014519 this.__views__ = [];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014520}
14521
14522LazyWrapper.prototype = baseCreate(baseLodash.prototype);
14523LazyWrapper.prototype.constructor = LazyWrapper;
14524
14525module.exports = LazyWrapper;
14526
Jian Li8afbbee2016-07-27 19:16:51 +090014527},{"./baseCreate":70,"./baseLodash":82}],61:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014528var baseCreate = require('./baseCreate'),
14529 baseLodash = require('./baseLodash');
14530
14531/**
14532 * The base constructor for creating `lodash` wrapper objects.
14533 *
14534 * @private
14535 * @param {*} value The value to wrap.
14536 * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
14537 * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
14538 */
14539function LodashWrapper(value, chainAll, actions) {
14540 this.__wrapped__ = value;
14541 this.__actions__ = actions || [];
14542 this.__chain__ = !!chainAll;
14543}
14544
14545LodashWrapper.prototype = baseCreate(baseLodash.prototype);
14546LodashWrapper.prototype.constructor = LodashWrapper;
14547
14548module.exports = LodashWrapper;
14549
Jian Li8afbbee2016-07-27 19:16:51 +090014550},{"./baseCreate":70,"./baseLodash":82}],62:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014551/**
14552 * Copies the values of `source` to `array`.
14553 *
14554 * @private
14555 * @param {Array} source The array to copy values from.
14556 * @param {Array} [array=[]] The array to copy values to.
14557 * @returns {Array} Returns `array`.
14558 */
14559function arrayCopy(source, array) {
14560 var index = -1,
14561 length = source.length;
14562
14563 array || (array = Array(length));
14564 while (++index < length) {
14565 array[index] = source[index];
14566 }
14567 return array;
14568}
14569
14570module.exports = arrayCopy;
14571
Jian Li8afbbee2016-07-27 19:16:51 +090014572},{}],63:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014573/**
14574 * A specialized version of `_.forEach` for arrays without support for callback
14575 * shorthands and `this` binding.
14576 *
14577 * @private
14578 * @param {Array} array The array to iterate over.
14579 * @param {Function} iteratee The function invoked per iteration.
14580 * @returns {Array} Returns `array`.
14581 */
14582function arrayEach(array, iteratee) {
14583 var index = -1,
14584 length = array.length;
14585
14586 while (++index < length) {
14587 if (iteratee(array[index], index, array) === false) {
14588 break;
14589 }
14590 }
14591 return array;
14592}
14593
14594module.exports = arrayEach;
14595
Jian Li8afbbee2016-07-27 19:16:51 +090014596},{}],64:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014597/**
14598 * A specialized version of `_.map` for arrays without support for callback
14599 * shorthands and `this` binding.
14600 *
14601 * @private
14602 * @param {Array} array The array to iterate over.
14603 * @param {Function} iteratee The function invoked per iteration.
14604 * @returns {Array} Returns the new mapped array.
14605 */
14606function arrayMap(array, iteratee) {
14607 var index = -1,
14608 length = array.length,
14609 result = Array(length);
14610
14611 while (++index < length) {
14612 result[index] = iteratee(array[index], index, array);
14613 }
14614 return result;
14615}
14616
14617module.exports = arrayMap;
14618
Jian Li8afbbee2016-07-27 19:16:51 +090014619},{}],65:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014620/**
14621 * A specialized version of `_.some` for arrays without support for callback
14622 * shorthands and `this` binding.
14623 *
14624 * @private
14625 * @param {Array} array The array to iterate over.
14626 * @param {Function} predicate The function invoked per iteration.
14627 * @returns {boolean} Returns `true` if any element passes the predicate check,
14628 * else `false`.
14629 */
14630function arraySome(array, predicate) {
14631 var index = -1,
14632 length = array.length;
14633
14634 while (++index < length) {
14635 if (predicate(array[index], index, array)) {
14636 return true;
14637 }
14638 }
14639 return false;
14640}
14641
14642module.exports = arraySome;
14643
Jian Li8afbbee2016-07-27 19:16:51 +090014644},{}],66:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014645var baseCopy = require('./baseCopy'),
14646 keys = require('../object/keys');
14647
14648/**
14649 * The base implementation of `_.assign` without support for argument juggling,
14650 * multiple sources, and `customizer` functions.
14651 *
14652 * @private
14653 * @param {Object} object The destination object.
14654 * @param {Object} source The source object.
14655 * @returns {Object} Returns `object`.
14656 */
14657function baseAssign(object, source) {
14658 return source == null
14659 ? object
14660 : baseCopy(source, keys(source), object);
14661}
14662
14663module.exports = baseAssign;
14664
Jian Li8afbbee2016-07-27 19:16:51 +090014665},{"../object/keys":149,"./baseCopy":69}],67:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014666var baseMatches = require('./baseMatches'),
14667 baseMatchesProperty = require('./baseMatchesProperty'),
14668 bindCallback = require('./bindCallback'),
14669 identity = require('../utility/identity'),
14670 property = require('../utility/property');
14671
14672/**
14673 * The base implementation of `_.callback` which supports specifying the
14674 * number of arguments to provide to `func`.
14675 *
14676 * @private
14677 * @param {*} [func=_.identity] The value to convert to a callback.
14678 * @param {*} [thisArg] The `this` binding of `func`.
14679 * @param {number} [argCount] The number of arguments to provide to `func`.
14680 * @returns {Function} Returns the callback.
14681 */
14682function baseCallback(func, thisArg, argCount) {
14683 var type = typeof func;
14684 if (type == 'function') {
14685 return thisArg === undefined
14686 ? func
14687 : bindCallback(func, thisArg, argCount);
14688 }
14689 if (func == null) {
14690 return identity;
14691 }
14692 if (type == 'object') {
14693 return baseMatches(func);
14694 }
14695 return thisArg === undefined
14696 ? property(func)
14697 : baseMatchesProperty(func, thisArg);
14698}
14699
14700module.exports = baseCallback;
14701
Jian Li8afbbee2016-07-27 19:16:51 +090014702},{"../utility/identity":154,"../utility/property":156,"./baseMatches":84,"./baseMatchesProperty":85,"./bindCallback":94}],68:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014703var arrayCopy = require('./arrayCopy'),
14704 arrayEach = require('./arrayEach'),
14705 baseAssign = require('./baseAssign'),
14706 baseForOwn = require('./baseForOwn'),
14707 initCloneArray = require('./initCloneArray'),
14708 initCloneByTag = require('./initCloneByTag'),
14709 initCloneObject = require('./initCloneObject'),
14710 isArray = require('../lang/isArray'),
14711 isHostObject = require('./isHostObject'),
14712 isObject = require('../lang/isObject');
14713
14714/** `Object#toString` result references. */
14715var argsTag = '[object Arguments]',
14716 arrayTag = '[object Array]',
14717 boolTag = '[object Boolean]',
14718 dateTag = '[object Date]',
14719 errorTag = '[object Error]',
14720 funcTag = '[object Function]',
14721 mapTag = '[object Map]',
14722 numberTag = '[object Number]',
14723 objectTag = '[object Object]',
14724 regexpTag = '[object RegExp]',
14725 setTag = '[object Set]',
14726 stringTag = '[object String]',
14727 weakMapTag = '[object WeakMap]';
14728
14729var arrayBufferTag = '[object ArrayBuffer]',
14730 float32Tag = '[object Float32Array]',
14731 float64Tag = '[object Float64Array]',
14732 int8Tag = '[object Int8Array]',
14733 int16Tag = '[object Int16Array]',
14734 int32Tag = '[object Int32Array]',
14735 uint8Tag = '[object Uint8Array]',
14736 uint8ClampedTag = '[object Uint8ClampedArray]',
14737 uint16Tag = '[object Uint16Array]',
14738 uint32Tag = '[object Uint32Array]';
14739
14740/** Used to identify `toStringTag` values supported by `_.clone`. */
14741var cloneableTags = {};
14742cloneableTags[argsTag] = cloneableTags[arrayTag] =
14743cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
14744cloneableTags[dateTag] = cloneableTags[float32Tag] =
14745cloneableTags[float64Tag] = cloneableTags[int8Tag] =
14746cloneableTags[int16Tag] = cloneableTags[int32Tag] =
14747cloneableTags[numberTag] = cloneableTags[objectTag] =
14748cloneableTags[regexpTag] = cloneableTags[stringTag] =
14749cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
14750cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
14751cloneableTags[errorTag] = cloneableTags[funcTag] =
14752cloneableTags[mapTag] = cloneableTags[setTag] =
14753cloneableTags[weakMapTag] = false;
14754
14755/** Used for native method references. */
14756var objectProto = Object.prototype;
14757
14758/**
Jian Li83d87a72016-04-20 15:38:24 -070014759 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014760 * of values.
14761 */
14762var objToString = objectProto.toString;
14763
14764/**
14765 * The base implementation of `_.clone` without support for argument juggling
14766 * and `this` binding `customizer` functions.
14767 *
14768 * @private
14769 * @param {*} value The value to clone.
14770 * @param {boolean} [isDeep] Specify a deep clone.
14771 * @param {Function} [customizer] The function to customize cloning values.
14772 * @param {string} [key] The key of `value`.
14773 * @param {Object} [object] The object `value` belongs to.
14774 * @param {Array} [stackA=[]] Tracks traversed source objects.
14775 * @param {Array} [stackB=[]] Associates clones with source counterparts.
14776 * @returns {*} Returns the cloned value.
14777 */
14778function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
14779 var result;
14780 if (customizer) {
14781 result = object ? customizer(value, key, object) : customizer(value);
14782 }
14783 if (result !== undefined) {
14784 return result;
14785 }
14786 if (!isObject(value)) {
14787 return value;
14788 }
14789 var isArr = isArray(value);
14790 if (isArr) {
14791 result = initCloneArray(value);
14792 if (!isDeep) {
14793 return arrayCopy(value, result);
14794 }
14795 } else {
14796 var tag = objToString.call(value),
14797 isFunc = tag == funcTag;
14798
14799 if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
14800 if (isHostObject(value)) {
14801 return object ? value : {};
14802 }
14803 result = initCloneObject(isFunc ? {} : value);
14804 if (!isDeep) {
14805 return baseAssign(result, value);
14806 }
14807 } else {
14808 return cloneableTags[tag]
14809 ? initCloneByTag(value, tag, isDeep)
14810 : (object ? value : {});
14811 }
14812 }
Jian Li83d87a72016-04-20 15:38:24 -070014813 // Check for circular references and return its corresponding clone.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014814 stackA || (stackA = []);
14815 stackB || (stackB = []);
14816
14817 var length = stackA.length;
14818 while (length--) {
14819 if (stackA[length] == value) {
14820 return stackB[length];
14821 }
14822 }
14823 // Add the source value to the stack of traversed objects and associate it with its clone.
14824 stackA.push(value);
14825 stackB.push(result);
14826
14827 // Recursively populate clone (susceptible to call stack limits).
14828 (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
14829 result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
14830 });
14831 return result;
14832}
14833
14834module.exports = baseClone;
14835
Jian Li8afbbee2016-07-27 19:16:51 +090014836},{"../lang/isArray":140,"../lang/isObject":144,"./arrayCopy":62,"./arrayEach":63,"./baseAssign":66,"./baseForOwn":76,"./initCloneArray":116,"./initCloneByTag":117,"./initCloneObject":118,"./isHostObject":120}],69:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014837/**
14838 * Copies properties of `source` to `object`.
14839 *
14840 * @private
14841 * @param {Object} source The object to copy properties from.
14842 * @param {Array} props The property names to copy.
14843 * @param {Object} [object={}] The object to copy properties to.
14844 * @returns {Object} Returns `object`.
14845 */
14846function baseCopy(source, props, object) {
14847 object || (object = {});
14848
14849 var index = -1,
14850 length = props.length;
14851
14852 while (++index < length) {
14853 var key = props[index];
14854 object[key] = source[key];
14855 }
14856 return object;
14857}
14858
14859module.exports = baseCopy;
14860
Jian Li8afbbee2016-07-27 19:16:51 +090014861},{}],70:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014862var isObject = require('../lang/isObject');
14863
14864/**
14865 * The base implementation of `_.create` without support for assigning
14866 * properties to the created object.
14867 *
14868 * @private
14869 * @param {Object} prototype The object to inherit from.
14870 * @returns {Object} Returns the new object.
14871 */
14872var baseCreate = (function() {
14873 function object() {}
14874 return function(prototype) {
14875 if (isObject(prototype)) {
14876 object.prototype = prototype;
14877 var result = new object;
Jian Li83d87a72016-04-20 15:38:24 -070014878 object.prototype = undefined;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014879 }
14880 return result || {};
14881 };
14882}());
14883
14884module.exports = baseCreate;
14885
Jian Li8afbbee2016-07-27 19:16:51 +090014886},{"../lang/isObject":144}],71:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014887var baseForOwn = require('./baseForOwn'),
14888 createBaseEach = require('./createBaseEach');
14889
14890/**
14891 * The base implementation of `_.forEach` without support for callback
14892 * shorthands and `this` binding.
14893 *
14894 * @private
14895 * @param {Array|Object|string} collection The collection to iterate over.
14896 * @param {Function} iteratee The function invoked per iteration.
14897 * @returns {Array|Object|string} Returns `collection`.
14898 */
14899var baseEach = createBaseEach(baseForOwn);
14900
14901module.exports = baseEach;
14902
Jian Li8afbbee2016-07-27 19:16:51 +090014903},{"./baseForOwn":76,"./createBaseEach":98}],72:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014904/**
14905 * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
14906 * without support for callback shorthands and `this` binding, which iterates
14907 * over `collection` using the provided `eachFunc`.
14908 *
14909 * @private
14910 * @param {Array|Object|string} collection The collection to search.
14911 * @param {Function} predicate The function invoked per iteration.
14912 * @param {Function} eachFunc The function to iterate over `collection`.
14913 * @param {boolean} [retKey] Specify returning the key of the found element
14914 * instead of the element itself.
14915 * @returns {*} Returns the found element or its key, else `undefined`.
14916 */
14917function baseFind(collection, predicate, eachFunc, retKey) {
14918 var result;
14919 eachFunc(collection, function(value, key, collection) {
14920 if (predicate(value, key, collection)) {
14921 result = retKey ? key : value;
14922 return false;
14923 }
14924 });
14925 return result;
14926}
14927
14928module.exports = baseFind;
14929
Jian Li8afbbee2016-07-27 19:16:51 +090014930},{}],73:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014931/**
14932 * The base implementation of `_.findIndex` and `_.findLastIndex` without
14933 * support for callback shorthands and `this` binding.
14934 *
14935 * @private
14936 * @param {Array} array The array to search.
14937 * @param {Function} predicate The function invoked per iteration.
14938 * @param {boolean} [fromRight] Specify iterating from right to left.
14939 * @returns {number} Returns the index of the matched value, else `-1`.
14940 */
14941function baseFindIndex(array, predicate, fromRight) {
14942 var length = array.length,
14943 index = fromRight ? length : -1;
14944
14945 while ((fromRight ? index-- : ++index < length)) {
14946 if (predicate(array[index], index, array)) {
14947 return index;
14948 }
14949 }
14950 return -1;
14951}
14952
14953module.exports = baseFindIndex;
14954
Jian Li8afbbee2016-07-27 19:16:51 +090014955},{}],74:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014956var createBaseFor = require('./createBaseFor');
14957
14958/**
14959 * The base implementation of `baseForIn` and `baseForOwn` which iterates
14960 * over `object` properties returned by `keysFunc` invoking `iteratee` for
14961 * each property. Iteratee functions may exit iteration early by explicitly
14962 * returning `false`.
14963 *
14964 * @private
14965 * @param {Object} object The object to iterate over.
14966 * @param {Function} iteratee The function invoked per iteration.
14967 * @param {Function} keysFunc The function to get the keys of `object`.
14968 * @returns {Object} Returns `object`.
14969 */
14970var baseFor = createBaseFor();
14971
14972module.exports = baseFor;
14973
Jian Li8afbbee2016-07-27 19:16:51 +090014974},{"./createBaseFor":99}],75:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014975var baseFor = require('./baseFor'),
14976 keysIn = require('../object/keysIn');
14977
14978/**
14979 * The base implementation of `_.forIn` without support for callback
14980 * shorthands and `this` binding.
14981 *
14982 * @private
14983 * @param {Object} object The object to iterate over.
14984 * @param {Function} iteratee The function invoked per iteration.
14985 * @returns {Object} Returns `object`.
14986 */
14987function baseForIn(object, iteratee) {
14988 return baseFor(object, iteratee, keysIn);
14989}
14990
14991module.exports = baseForIn;
14992
Jian Li8afbbee2016-07-27 19:16:51 +090014993},{"../object/keysIn":150,"./baseFor":74}],76:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070014994var baseFor = require('./baseFor'),
14995 keys = require('../object/keys');
14996
14997/**
14998 * The base implementation of `_.forOwn` without support for callback
14999 * shorthands and `this` binding.
15000 *
15001 * @private
15002 * @param {Object} object The object to iterate over.
15003 * @param {Function} iteratee The function invoked per iteration.
15004 * @returns {Object} Returns `object`.
15005 */
15006function baseForOwn(object, iteratee) {
15007 return baseFor(object, iteratee, keys);
15008}
15009
15010module.exports = baseForOwn;
15011
Jian Li8afbbee2016-07-27 19:16:51 +090015012},{"../object/keys":149,"./baseFor":74}],77:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015013var toObject = require('./toObject');
15014
15015/**
15016 * The base implementation of `get` without support for string paths
15017 * and default values.
15018 *
15019 * @private
15020 * @param {Object} object The object to query.
15021 * @param {Array} path The path of the property to get.
15022 * @param {string} [pathKey] The key representation of path.
15023 * @returns {*} Returns the resolved value.
15024 */
15025function baseGet(object, path, pathKey) {
15026 if (object == null) {
15027 return;
15028 }
15029 object = toObject(object);
15030 if (pathKey !== undefined && pathKey in object) {
15031 path = [pathKey];
15032 }
15033 var index = 0,
15034 length = path.length;
15035
15036 while (object != null && index < length) {
15037 object = toObject(object)[path[index++]];
15038 }
15039 return (index && index == length) ? object : undefined;
15040}
15041
15042module.exports = baseGet;
15043
Jian Li8afbbee2016-07-27 19:16:51 +090015044},{"./toObject":135}],78:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015045var indexOfNaN = require('./indexOfNaN');
15046
15047/**
15048 * The base implementation of `_.indexOf` without support for binary searches.
15049 *
15050 * @private
15051 * @param {Array} array The array to search.
15052 * @param {*} value The value to search for.
15053 * @param {number} fromIndex The index to search from.
15054 * @returns {number} Returns the index of the matched value, else `-1`.
15055 */
15056function baseIndexOf(array, value, fromIndex) {
15057 if (value !== value) {
15058 return indexOfNaN(array, fromIndex);
15059 }
15060 var index = fromIndex - 1,
15061 length = array.length;
15062
15063 while (++index < length) {
15064 if (array[index] === value) {
15065 return index;
15066 }
15067 }
15068 return -1;
15069}
15070
15071module.exports = baseIndexOf;
15072
Jian Li8afbbee2016-07-27 19:16:51 +090015073},{"./indexOfNaN":115}],79:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015074var baseIsEqualDeep = require('./baseIsEqualDeep'),
15075 isObject = require('../lang/isObject'),
15076 isObjectLike = require('./isObjectLike');
15077
15078/**
15079 * The base implementation of `_.isEqual` without support for `this` binding
15080 * `customizer` functions.
15081 *
15082 * @private
15083 * @param {*} value The value to compare.
15084 * @param {*} other The other value to compare.
15085 * @param {Function} [customizer] The function to customize comparing values.
15086 * @param {boolean} [isLoose] Specify performing partial comparisons.
15087 * @param {Array} [stackA] Tracks traversed `value` objects.
15088 * @param {Array} [stackB] Tracks traversed `other` objects.
15089 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
15090 */
15091function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
15092 if (value === other) {
15093 return true;
15094 }
15095 if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
15096 return value !== value && other !== other;
15097 }
15098 return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
15099}
15100
15101module.exports = baseIsEqual;
15102
Jian Li8afbbee2016-07-27 19:16:51 +090015103},{"../lang/isObject":144,"./baseIsEqualDeep":80,"./isObjectLike":126}],80:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015104var equalArrays = require('./equalArrays'),
15105 equalByTag = require('./equalByTag'),
15106 equalObjects = require('./equalObjects'),
15107 isArray = require('../lang/isArray'),
15108 isHostObject = require('./isHostObject'),
15109 isTypedArray = require('../lang/isTypedArray');
15110
15111/** `Object#toString` result references. */
15112var argsTag = '[object Arguments]',
15113 arrayTag = '[object Array]',
15114 objectTag = '[object Object]';
15115
15116/** Used for native method references. */
15117var objectProto = Object.prototype;
15118
15119/** Used to check objects for own properties. */
15120var hasOwnProperty = objectProto.hasOwnProperty;
15121
15122/**
Jian Li83d87a72016-04-20 15:38:24 -070015123 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015124 * of values.
15125 */
15126var objToString = objectProto.toString;
15127
15128/**
15129 * A specialized version of `baseIsEqual` for arrays and objects which performs
15130 * deep comparisons and tracks traversed objects enabling objects with circular
15131 * references to be compared.
15132 *
15133 * @private
15134 * @param {Object} object The object to compare.
15135 * @param {Object} other The other object to compare.
15136 * @param {Function} equalFunc The function to determine equivalents of values.
15137 * @param {Function} [customizer] The function to customize comparing objects.
15138 * @param {boolean} [isLoose] Specify performing partial comparisons.
15139 * @param {Array} [stackA=[]] Tracks traversed `value` objects.
15140 * @param {Array} [stackB=[]] Tracks traversed `other` objects.
15141 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
15142 */
15143function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
15144 var objIsArr = isArray(object),
15145 othIsArr = isArray(other),
15146 objTag = arrayTag,
15147 othTag = arrayTag;
15148
15149 if (!objIsArr) {
15150 objTag = objToString.call(object);
15151 if (objTag == argsTag) {
15152 objTag = objectTag;
15153 } else if (objTag != objectTag) {
15154 objIsArr = isTypedArray(object);
15155 }
15156 }
15157 if (!othIsArr) {
15158 othTag = objToString.call(other);
15159 if (othTag == argsTag) {
15160 othTag = objectTag;
15161 } else if (othTag != objectTag) {
15162 othIsArr = isTypedArray(other);
15163 }
15164 }
15165 var objIsObj = objTag == objectTag && !isHostObject(object),
15166 othIsObj = othTag == objectTag && !isHostObject(other),
15167 isSameTag = objTag == othTag;
15168
15169 if (isSameTag && !(objIsArr || objIsObj)) {
15170 return equalByTag(object, other, objTag);
15171 }
15172 if (!isLoose) {
15173 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
15174 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
15175
15176 if (objIsWrapped || othIsWrapped) {
15177 return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
15178 }
15179 }
15180 if (!isSameTag) {
15181 return false;
15182 }
15183 // Assume cyclic values are equal.
15184 // For more information on detecting circular references see https://es5.github.io/#JO.
15185 stackA || (stackA = []);
15186 stackB || (stackB = []);
15187
15188 var length = stackA.length;
15189 while (length--) {
15190 if (stackA[length] == object) {
15191 return stackB[length] == other;
15192 }
15193 }
15194 // Add `object` and `other` to the stack of traversed objects.
15195 stackA.push(object);
15196 stackB.push(other);
15197
15198 var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
15199
15200 stackA.pop();
15201 stackB.pop();
15202
15203 return result;
15204}
15205
15206module.exports = baseIsEqualDeep;
15207
Jian Li8afbbee2016-07-27 19:16:51 +090015208},{"../lang/isArray":140,"../lang/isTypedArray":147,"./equalArrays":107,"./equalByTag":108,"./equalObjects":109,"./isHostObject":120}],81:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015209var baseIsEqual = require('./baseIsEqual'),
15210 toObject = require('./toObject');
15211
15212/**
15213 * The base implementation of `_.isMatch` without support for callback
15214 * shorthands and `this` binding.
15215 *
15216 * @private
15217 * @param {Object} object The object to inspect.
15218 * @param {Array} matchData The propery names, values, and compare flags to match.
15219 * @param {Function} [customizer] The function to customize comparing objects.
15220 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
15221 */
15222function baseIsMatch(object, matchData, customizer) {
15223 var index = matchData.length,
15224 length = index,
15225 noCustomizer = !customizer;
15226
15227 if (object == null) {
15228 return !length;
15229 }
15230 object = toObject(object);
15231 while (index--) {
15232 var data = matchData[index];
15233 if ((noCustomizer && data[2])
15234 ? data[1] !== object[data[0]]
15235 : !(data[0] in object)
15236 ) {
15237 return false;
15238 }
15239 }
15240 while (++index < length) {
15241 data = matchData[index];
15242 var key = data[0],
15243 objValue = object[key],
15244 srcValue = data[1];
15245
15246 if (noCustomizer && data[2]) {
15247 if (objValue === undefined && !(key in object)) {
15248 return false;
15249 }
15250 } else {
15251 var result = customizer ? customizer(objValue, srcValue, key) : undefined;
15252 if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
15253 return false;
15254 }
15255 }
15256 }
15257 return true;
15258}
15259
15260module.exports = baseIsMatch;
15261
Jian Li8afbbee2016-07-27 19:16:51 +090015262},{"./baseIsEqual":79,"./toObject":135}],82:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015263/**
15264 * The function whose prototype all chaining wrappers inherit from.
15265 *
15266 * @private
15267 */
15268function baseLodash() {
15269 // No operation performed.
15270}
15271
15272module.exports = baseLodash;
15273
Jian Li8afbbee2016-07-27 19:16:51 +090015274},{}],83:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015275var baseEach = require('./baseEach'),
15276 isArrayLike = require('./isArrayLike');
15277
15278/**
15279 * The base implementation of `_.map` without support for callback shorthands
15280 * and `this` binding.
15281 *
15282 * @private
15283 * @param {Array|Object|string} collection The collection to iterate over.
15284 * @param {Function} iteratee The function invoked per iteration.
15285 * @returns {Array} Returns the new mapped array.
15286 */
15287function baseMap(collection, iteratee) {
15288 var index = -1,
15289 result = isArrayLike(collection) ? Array(collection.length) : [];
15290
15291 baseEach(collection, function(value, key, collection) {
15292 result[++index] = iteratee(value, key, collection);
15293 });
15294 return result;
15295}
15296
15297module.exports = baseMap;
15298
Jian Li8afbbee2016-07-27 19:16:51 +090015299},{"./baseEach":71,"./isArrayLike":119}],84:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015300var baseIsMatch = require('./baseIsMatch'),
15301 getMatchData = require('./getMatchData'),
15302 toObject = require('./toObject');
15303
15304/**
15305 * The base implementation of `_.matches` which does not clone `source`.
15306 *
15307 * @private
15308 * @param {Object} source The object of property values to match.
15309 * @returns {Function} Returns the new function.
15310 */
15311function baseMatches(source) {
15312 var matchData = getMatchData(source);
15313 if (matchData.length == 1 && matchData[0][2]) {
15314 var key = matchData[0][0],
15315 value = matchData[0][1];
15316
15317 return function(object) {
15318 if (object == null) {
15319 return false;
15320 }
15321 object = toObject(object);
15322 return object[key] === value && (value !== undefined || (key in object));
15323 };
15324 }
15325 return function(object) {
15326 return baseIsMatch(object, matchData);
15327 };
15328}
15329
15330module.exports = baseMatches;
15331
Jian Li8afbbee2016-07-27 19:16:51 +090015332},{"./baseIsMatch":81,"./getMatchData":113,"./toObject":135}],85:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015333var baseGet = require('./baseGet'),
15334 baseIsEqual = require('./baseIsEqual'),
15335 baseSlice = require('./baseSlice'),
15336 isArray = require('../lang/isArray'),
15337 isKey = require('./isKey'),
15338 isStrictComparable = require('./isStrictComparable'),
15339 last = require('../array/last'),
15340 toObject = require('./toObject'),
15341 toPath = require('./toPath');
15342
15343/**
15344 * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
15345 *
15346 * @private
15347 * @param {string} path The path of the property to get.
15348 * @param {*} srcValue The value to compare.
15349 * @returns {Function} Returns the new function.
15350 */
15351function baseMatchesProperty(path, srcValue) {
15352 var isArr = isArray(path),
15353 isCommon = isKey(path) && isStrictComparable(srcValue),
15354 pathKey = (path + '');
15355
15356 path = toPath(path);
15357 return function(object) {
15358 if (object == null) {
15359 return false;
15360 }
15361 var key = pathKey;
15362 object = toObject(object);
15363 if ((isArr || !isCommon) && !(key in object)) {
15364 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
15365 if (object == null) {
15366 return false;
15367 }
15368 key = last(path);
15369 object = toObject(object);
15370 }
15371 return object[key] === srcValue
15372 ? (srcValue !== undefined || (key in object))
15373 : baseIsEqual(srcValue, object[key], undefined, true);
15374 };
15375}
15376
15377module.exports = baseMatchesProperty;
15378
Jian Li8afbbee2016-07-27 19:16:51 +090015379},{"../array/last":50,"../lang/isArray":140,"./baseGet":77,"./baseIsEqual":79,"./baseSlice":89,"./isKey":123,"./isStrictComparable":127,"./toObject":135,"./toPath":136}],86:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015380var toObject = require('./toObject');
15381
15382/**
15383 * The base implementation of `_.property` without support for deep paths.
15384 *
15385 * @private
15386 * @param {string} key The key of the property to get.
15387 * @returns {Function} Returns the new function.
15388 */
15389function baseProperty(key) {
15390 return function(object) {
15391 return object == null ? undefined : toObject(object)[key];
15392 };
15393}
15394
15395module.exports = baseProperty;
15396
Jian Li8afbbee2016-07-27 19:16:51 +090015397},{"./toObject":135}],87:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015398var baseGet = require('./baseGet'),
15399 toPath = require('./toPath');
15400
15401/**
15402 * A specialized version of `baseProperty` which supports deep paths.
15403 *
15404 * @private
15405 * @param {Array|string} path The path of the property to get.
15406 * @returns {Function} Returns the new function.
15407 */
15408function basePropertyDeep(path) {
15409 var pathKey = (path + '');
15410 path = toPath(path);
15411 return function(object) {
15412 return baseGet(object, path, pathKey);
15413 };
15414}
15415
15416module.exports = basePropertyDeep;
15417
Jian Li8afbbee2016-07-27 19:16:51 +090015418},{"./baseGet":77,"./toPath":136}],88:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015419var identity = require('../utility/identity'),
15420 metaMap = require('./metaMap');
15421
15422/**
15423 * The base implementation of `setData` without support for hot loop detection.
15424 *
15425 * @private
15426 * @param {Function} func The function to associate metadata with.
15427 * @param {*} data The metadata.
15428 * @returns {Function} Returns `func`.
15429 */
15430var baseSetData = !metaMap ? identity : function(func, data) {
15431 metaMap.set(func, data);
15432 return func;
15433};
15434
15435module.exports = baseSetData;
15436
Jian Li8afbbee2016-07-27 19:16:51 +090015437},{"../utility/identity":154,"./metaMap":129}],89:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015438/**
15439 * The base implementation of `_.slice` without an iteratee call guard.
15440 *
15441 * @private
15442 * @param {Array} array The array to slice.
15443 * @param {number} [start=0] The start position.
15444 * @param {number} [end=array.length] The end position.
15445 * @returns {Array} Returns the slice of `array`.
15446 */
15447function baseSlice(array, start, end) {
15448 var index = -1,
15449 length = array.length;
15450
15451 start = start == null ? 0 : (+start || 0);
15452 if (start < 0) {
15453 start = -start > length ? 0 : (length + start);
15454 }
15455 end = (end === undefined || end > length) ? length : (+end || 0);
15456 if (end < 0) {
15457 end += length;
15458 }
15459 length = start > end ? 0 : ((end - start) >>> 0);
15460 start >>>= 0;
15461
15462 var result = Array(length);
15463 while (++index < length) {
15464 result[index] = array[index + start];
15465 }
15466 return result;
15467}
15468
15469module.exports = baseSlice;
15470
Jian Li8afbbee2016-07-27 19:16:51 +090015471},{}],90:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015472/**
15473 * Converts `value` to a string if it's not one. An empty string is returned
15474 * for `null` or `undefined` values.
15475 *
15476 * @private
15477 * @param {*} value The value to process.
15478 * @returns {string} Returns the string.
15479 */
15480function baseToString(value) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015481 return value == null ? '' : (value + '');
15482}
15483
15484module.exports = baseToString;
15485
Jian Li8afbbee2016-07-27 19:16:51 +090015486},{}],91:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015487/**
15488 * The base implementation of `_.values` and `_.valuesIn` which creates an
15489 * array of `object` property values corresponding to the property names
15490 * of `props`.
15491 *
15492 * @private
15493 * @param {Object} object The object to query.
15494 * @param {Array} props The property names to get values for.
15495 * @returns {Object} Returns the array of property values.
15496 */
15497function baseValues(object, props) {
15498 var index = -1,
15499 length = props.length,
15500 result = Array(length);
15501
15502 while (++index < length) {
15503 result[index] = object[props[index]];
15504 }
15505 return result;
15506}
15507
15508module.exports = baseValues;
15509
Jian Li8afbbee2016-07-27 19:16:51 +090015510},{}],92:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015511var binaryIndexBy = require('./binaryIndexBy'),
15512 identity = require('../utility/identity');
15513
15514/** Used as references for the maximum length and index of an array. */
15515var MAX_ARRAY_LENGTH = 4294967295,
15516 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
15517
15518/**
15519 * Performs a binary search of `array` to determine the index at which `value`
15520 * should be inserted into `array` in order to maintain its sort order.
15521 *
15522 * @private
15523 * @param {Array} array The sorted array to inspect.
15524 * @param {*} value The value to evaluate.
15525 * @param {boolean} [retHighest] Specify returning the highest qualified index.
15526 * @returns {number} Returns the index at which `value` should be inserted
15527 * into `array`.
15528 */
15529function binaryIndex(array, value, retHighest) {
15530 var low = 0,
15531 high = array ? array.length : low;
15532
15533 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
15534 while (low < high) {
15535 var mid = (low + high) >>> 1,
15536 computed = array[mid];
15537
15538 if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
15539 low = mid + 1;
15540 } else {
15541 high = mid;
15542 }
15543 }
15544 return high;
15545 }
15546 return binaryIndexBy(array, value, identity, retHighest);
15547}
15548
15549module.exports = binaryIndex;
15550
Jian Li8afbbee2016-07-27 19:16:51 +090015551},{"../utility/identity":154,"./binaryIndexBy":93}],93:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015552/* Native method references for those with the same name as other `lodash` methods. */
Jian Li83d87a72016-04-20 15:38:24 -070015553var nativeFloor = Math.floor,
15554 nativeMin = Math.min;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015555
15556/** Used as references for the maximum length and index of an array. */
15557var MAX_ARRAY_LENGTH = 4294967295,
15558 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
15559
15560/**
15561 * This function is like `binaryIndex` except that it invokes `iteratee` for
15562 * `value` and each element of `array` to compute their sort ranking. The
15563 * iteratee is invoked with one argument; (value).
15564 *
15565 * @private
15566 * @param {Array} array The sorted array to inspect.
15567 * @param {*} value The value to evaluate.
15568 * @param {Function} iteratee The function invoked per iteration.
15569 * @param {boolean} [retHighest] Specify returning the highest qualified index.
15570 * @returns {number} Returns the index at which `value` should be inserted
15571 * into `array`.
15572 */
15573function binaryIndexBy(array, value, iteratee, retHighest) {
15574 value = iteratee(value);
15575
15576 var low = 0,
15577 high = array ? array.length : 0,
15578 valIsNaN = value !== value,
15579 valIsNull = value === null,
15580 valIsUndef = value === undefined;
15581
15582 while (low < high) {
Jian Li83d87a72016-04-20 15:38:24 -070015583 var mid = nativeFloor((low + high) / 2),
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015584 computed = iteratee(array[mid]),
15585 isDef = computed !== undefined,
15586 isReflexive = computed === computed;
15587
15588 if (valIsNaN) {
15589 var setLow = isReflexive || retHighest;
15590 } else if (valIsNull) {
15591 setLow = isReflexive && isDef && (retHighest || computed != null);
15592 } else if (valIsUndef) {
15593 setLow = isReflexive && (retHighest || isDef);
15594 } else if (computed == null) {
15595 setLow = false;
15596 } else {
15597 setLow = retHighest ? (computed <= value) : (computed < value);
15598 }
15599 if (setLow) {
15600 low = mid + 1;
15601 } else {
15602 high = mid;
15603 }
15604 }
15605 return nativeMin(high, MAX_ARRAY_INDEX);
15606}
15607
15608module.exports = binaryIndexBy;
15609
Jian Li8afbbee2016-07-27 19:16:51 +090015610},{}],94:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015611var identity = require('../utility/identity');
15612
15613/**
15614 * A specialized version of `baseCallback` which only supports `this` binding
15615 * and specifying the number of arguments to provide to `func`.
15616 *
15617 * @private
15618 * @param {Function} func The function to bind.
15619 * @param {*} thisArg The `this` binding of `func`.
15620 * @param {number} [argCount] The number of arguments to provide to `func`.
15621 * @returns {Function} Returns the callback.
15622 */
15623function bindCallback(func, thisArg, argCount) {
15624 if (typeof func != 'function') {
15625 return identity;
15626 }
15627 if (thisArg === undefined) {
15628 return func;
15629 }
15630 switch (argCount) {
15631 case 1: return function(value) {
15632 return func.call(thisArg, value);
15633 };
15634 case 3: return function(value, index, collection) {
15635 return func.call(thisArg, value, index, collection);
15636 };
15637 case 4: return function(accumulator, value, index, collection) {
15638 return func.call(thisArg, accumulator, value, index, collection);
15639 };
15640 case 5: return function(value, other, key, object, source) {
15641 return func.call(thisArg, value, other, key, object, source);
15642 };
15643 }
15644 return function() {
15645 return func.apply(thisArg, arguments);
15646 };
15647}
15648
15649module.exports = bindCallback;
15650
Jian Li8afbbee2016-07-27 19:16:51 +090015651},{"../utility/identity":154}],95:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015652(function (global){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015653/** Native method references. */
Jian Li83d87a72016-04-20 15:38:24 -070015654var ArrayBuffer = global.ArrayBuffer,
15655 Uint8Array = global.Uint8Array;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015656
15657/**
15658 * Creates a clone of the given array buffer.
15659 *
15660 * @private
15661 * @param {ArrayBuffer} buffer The array buffer to clone.
15662 * @returns {ArrayBuffer} Returns the cloned array buffer.
15663 */
15664function bufferClone(buffer) {
Jian Li83d87a72016-04-20 15:38:24 -070015665 var result = new ArrayBuffer(buffer.byteLength),
15666 view = new Uint8Array(result);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015667
Jian Li83d87a72016-04-20 15:38:24 -070015668 view.set(new Uint8Array(buffer));
15669 return result;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015670}
15671
15672module.exports = bufferClone;
15673
15674}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
Jian Li1c94b9d2017-02-08 15:47:21 +090015675
Jian Li8afbbee2016-07-27 19:16:51 +090015676},{}],96:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015677/* Native method references for those with the same name as other `lodash` methods. */
15678var nativeMax = Math.max;
15679
15680/**
15681 * Creates an array that is the composition of partially applied arguments,
15682 * placeholders, and provided arguments into a single array of arguments.
15683 *
15684 * @private
15685 * @param {Array|Object} args The provided arguments.
15686 * @param {Array} partials The arguments to prepend to those provided.
15687 * @param {Array} holders The `partials` placeholder indexes.
15688 * @returns {Array} Returns the new array of composed arguments.
15689 */
15690function composeArgs(args, partials, holders) {
15691 var holdersLength = holders.length,
15692 argsIndex = -1,
15693 argsLength = nativeMax(args.length - holdersLength, 0),
15694 leftIndex = -1,
15695 leftLength = partials.length,
Jian Li83d87a72016-04-20 15:38:24 -070015696 result = Array(leftLength + argsLength);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015697
15698 while (++leftIndex < leftLength) {
15699 result[leftIndex] = partials[leftIndex];
15700 }
15701 while (++argsIndex < holdersLength) {
15702 result[holders[argsIndex]] = args[argsIndex];
15703 }
15704 while (argsLength--) {
15705 result[leftIndex++] = args[argsIndex++];
15706 }
15707 return result;
15708}
15709
15710module.exports = composeArgs;
15711
Jian Li8afbbee2016-07-27 19:16:51 +090015712},{}],97:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015713/* Native method references for those with the same name as other `lodash` methods. */
15714var nativeMax = Math.max;
15715
15716/**
15717 * This function is like `composeArgs` except that the arguments composition
15718 * is tailored for `_.partialRight`.
15719 *
15720 * @private
15721 * @param {Array|Object} args The provided arguments.
15722 * @param {Array} partials The arguments to append to those provided.
15723 * @param {Array} holders The `partials` placeholder indexes.
15724 * @returns {Array} Returns the new array of composed arguments.
15725 */
15726function composeArgsRight(args, partials, holders) {
15727 var holdersIndex = -1,
15728 holdersLength = holders.length,
15729 argsIndex = -1,
15730 argsLength = nativeMax(args.length - holdersLength, 0),
15731 rightIndex = -1,
15732 rightLength = partials.length,
15733 result = Array(argsLength + rightLength);
15734
15735 while (++argsIndex < argsLength) {
15736 result[argsIndex] = args[argsIndex];
15737 }
15738 var offset = argsIndex;
15739 while (++rightIndex < rightLength) {
15740 result[offset + rightIndex] = partials[rightIndex];
15741 }
15742 while (++holdersIndex < holdersLength) {
15743 result[offset + holders[holdersIndex]] = args[argsIndex++];
15744 }
15745 return result;
15746}
15747
15748module.exports = composeArgsRight;
15749
Jian Li8afbbee2016-07-27 19:16:51 +090015750},{}],98:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015751var getLength = require('./getLength'),
15752 isLength = require('./isLength'),
15753 toObject = require('./toObject');
15754
15755/**
15756 * Creates a `baseEach` or `baseEachRight` function.
15757 *
15758 * @private
15759 * @param {Function} eachFunc The function to iterate over a collection.
15760 * @param {boolean} [fromRight] Specify iterating from right to left.
15761 * @returns {Function} Returns the new base function.
15762 */
15763function createBaseEach(eachFunc, fromRight) {
15764 return function(collection, iteratee) {
15765 var length = collection ? getLength(collection) : 0;
15766 if (!isLength(length)) {
15767 return eachFunc(collection, iteratee);
15768 }
15769 var index = fromRight ? length : -1,
15770 iterable = toObject(collection);
15771
15772 while ((fromRight ? index-- : ++index < length)) {
15773 if (iteratee(iterable[index], index, iterable) === false) {
15774 break;
15775 }
15776 }
15777 return collection;
15778 };
15779}
15780
15781module.exports = createBaseEach;
15782
Jian Li8afbbee2016-07-27 19:16:51 +090015783},{"./getLength":112,"./isLength":125,"./toObject":135}],99:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015784var toObject = require('./toObject');
15785
15786/**
15787 * Creates a base function for `_.forIn` or `_.forInRight`.
15788 *
15789 * @private
15790 * @param {boolean} [fromRight] Specify iterating from right to left.
15791 * @returns {Function} Returns the new base function.
15792 */
15793function createBaseFor(fromRight) {
15794 return function(object, iteratee, keysFunc) {
15795 var iterable = toObject(object),
15796 props = keysFunc(object),
15797 length = props.length,
15798 index = fromRight ? length : -1;
15799
15800 while ((fromRight ? index-- : ++index < length)) {
15801 var key = props[index];
15802 if (iteratee(iterable[key], key, iterable) === false) {
15803 break;
15804 }
15805 }
15806 return object;
15807 };
15808}
15809
15810module.exports = createBaseFor;
15811
Jian Li8afbbee2016-07-27 19:16:51 +090015812},{"./toObject":135}],100:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015813(function (global){
15814var createCtorWrapper = require('./createCtorWrapper');
15815
15816/**
15817 * Creates a function that wraps `func` and invokes it with the `this`
15818 * binding of `thisArg`.
15819 *
15820 * @private
15821 * @param {Function} func The function to bind.
15822 * @param {*} [thisArg] The `this` binding of `func`.
15823 * @returns {Function} Returns the new bound function.
15824 */
15825function createBindWrapper(func, thisArg) {
15826 var Ctor = createCtorWrapper(func);
15827
15828 function wrapper() {
15829 var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
15830 return fn.apply(thisArg, arguments);
15831 }
15832 return wrapper;
15833}
15834
15835module.exports = createBindWrapper;
15836
15837}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
Jian Li1c94b9d2017-02-08 15:47:21 +090015838
Jian Li8afbbee2016-07-27 19:16:51 +090015839},{"./createCtorWrapper":101}],101:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015840var baseCreate = require('./baseCreate'),
15841 isObject = require('../lang/isObject');
15842
15843/**
15844 * Creates a function that produces an instance of `Ctor` regardless of
15845 * whether it was invoked as part of a `new` expression or by `call` or `apply`.
15846 *
15847 * @private
15848 * @param {Function} Ctor The constructor to wrap.
15849 * @returns {Function} Returns the new wrapped function.
15850 */
15851function createCtorWrapper(Ctor) {
15852 return function() {
15853 // Use a `switch` statement to work with class constructors.
Jian Li83d87a72016-04-20 15:38:24 -070015854 // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015855 // for more details.
15856 var args = arguments;
15857 switch (args.length) {
15858 case 0: return new Ctor;
15859 case 1: return new Ctor(args[0]);
15860 case 2: return new Ctor(args[0], args[1]);
15861 case 3: return new Ctor(args[0], args[1], args[2]);
15862 case 4: return new Ctor(args[0], args[1], args[2], args[3]);
15863 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
Jian Li83d87a72016-04-20 15:38:24 -070015864 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
15865 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015866 }
15867 var thisBinding = baseCreate(Ctor.prototype),
15868 result = Ctor.apply(thisBinding, args);
15869
15870 // Mimic the constructor's `return` behavior.
15871 // See https://es5.github.io/#x13.2.2 for more details.
15872 return isObject(result) ? result : thisBinding;
15873 };
15874}
15875
15876module.exports = createCtorWrapper;
15877
Jian Li8afbbee2016-07-27 19:16:51 +090015878},{"../lang/isObject":144,"./baseCreate":70}],102:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015879var baseCallback = require('./baseCallback'),
15880 baseFind = require('./baseFind'),
15881 baseFindIndex = require('./baseFindIndex'),
15882 isArray = require('../lang/isArray');
15883
15884/**
15885 * Creates a `_.find` or `_.findLast` function.
15886 *
15887 * @private
15888 * @param {Function} eachFunc The function to iterate over a collection.
15889 * @param {boolean} [fromRight] Specify iterating from right to left.
15890 * @returns {Function} Returns the new find function.
15891 */
15892function createFind(eachFunc, fromRight) {
15893 return function(collection, predicate, thisArg) {
15894 predicate = baseCallback(predicate, thisArg, 3);
15895 if (isArray(collection)) {
15896 var index = baseFindIndex(collection, predicate, fromRight);
15897 return index > -1 ? collection[index] : undefined;
15898 }
15899 return baseFind(collection, predicate, eachFunc);
15900 };
15901}
15902
15903module.exports = createFind;
15904
Jian Li8afbbee2016-07-27 19:16:51 +090015905},{"../lang/isArray":140,"./baseCallback":67,"./baseFind":72,"./baseFindIndex":73}],103:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015906var bindCallback = require('./bindCallback'),
15907 isArray = require('../lang/isArray');
15908
15909/**
15910 * Creates a function for `_.forEach` or `_.forEachRight`.
15911 *
15912 * @private
15913 * @param {Function} arrayFunc The function to iterate over an array.
15914 * @param {Function} eachFunc The function to iterate over a collection.
15915 * @returns {Function} Returns the new each function.
15916 */
15917function createForEach(arrayFunc, eachFunc) {
15918 return function(collection, iteratee, thisArg) {
15919 return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
15920 ? arrayFunc(collection, iteratee)
15921 : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
15922 };
15923}
15924
15925module.exports = createForEach;
15926
Jian Li8afbbee2016-07-27 19:16:51 +090015927},{"../lang/isArray":140,"./bindCallback":94}],104:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015928(function (global){
15929var arrayCopy = require('./arrayCopy'),
15930 composeArgs = require('./composeArgs'),
15931 composeArgsRight = require('./composeArgsRight'),
15932 createCtorWrapper = require('./createCtorWrapper'),
15933 isLaziable = require('./isLaziable'),
15934 reorder = require('./reorder'),
15935 replaceHolders = require('./replaceHolders'),
15936 setData = require('./setData');
15937
15938/** Used to compose bitmasks for wrapper metadata. */
15939var BIND_FLAG = 1,
15940 BIND_KEY_FLAG = 2,
15941 CURRY_BOUND_FLAG = 4,
15942 CURRY_FLAG = 8,
15943 CURRY_RIGHT_FLAG = 16,
15944 PARTIAL_FLAG = 32,
15945 PARTIAL_RIGHT_FLAG = 64,
15946 ARY_FLAG = 128;
15947
15948/* Native method references for those with the same name as other `lodash` methods. */
15949var nativeMax = Math.max;
15950
15951/**
15952 * Creates a function that wraps `func` and invokes it with optional `this`
15953 * binding of, partial application, and currying.
15954 *
15955 * @private
15956 * @param {Function|string} func The function or method name to reference.
15957 * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
15958 * @param {*} [thisArg] The `this` binding of `func`.
15959 * @param {Array} [partials] The arguments to prepend to those provided to the new function.
15960 * @param {Array} [holders] The `partials` placeholder indexes.
15961 * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
15962 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
15963 * @param {Array} [argPos] The argument positions of the new function.
15964 * @param {number} [ary] The arity cap of `func`.
15965 * @param {number} [arity] The arity of `func`.
15966 * @returns {Function} Returns the new wrapped function.
15967 */
15968function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
15969 var isAry = bitmask & ARY_FLAG,
15970 isBind = bitmask & BIND_FLAG,
15971 isBindKey = bitmask & BIND_KEY_FLAG,
15972 isCurry = bitmask & CURRY_FLAG,
15973 isCurryBound = bitmask & CURRY_BOUND_FLAG,
15974 isCurryRight = bitmask & CURRY_RIGHT_FLAG,
Jian Li83d87a72016-04-20 15:38:24 -070015975 Ctor = isBindKey ? undefined : createCtorWrapper(func);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070015976
15977 function wrapper() {
15978 // Avoid `arguments` object use disqualifying optimizations by
15979 // converting it to an array before providing it to other functions.
15980 var length = arguments.length,
15981 index = length,
15982 args = Array(length);
15983
15984 while (index--) {
15985 args[index] = arguments[index];
15986 }
15987 if (partials) {
15988 args = composeArgs(args, partials, holders);
15989 }
15990 if (partialsRight) {
15991 args = composeArgsRight(args, partialsRight, holdersRight);
15992 }
15993 if (isCurry || isCurryRight) {
15994 var placeholder = wrapper.placeholder,
15995 argsHolders = replaceHolders(args, placeholder);
15996
15997 length -= argsHolders.length;
15998 if (length < arity) {
Jian Li83d87a72016-04-20 15:38:24 -070015999 var newArgPos = argPos ? arrayCopy(argPos) : undefined,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016000 newArity = nativeMax(arity - length, 0),
Jian Li83d87a72016-04-20 15:38:24 -070016001 newsHolders = isCurry ? argsHolders : undefined,
16002 newHoldersRight = isCurry ? undefined : argsHolders,
16003 newPartials = isCurry ? args : undefined,
16004 newPartialsRight = isCurry ? undefined : args;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016005
16006 bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
16007 bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
16008
16009 if (!isCurryBound) {
16010 bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
16011 }
16012 var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
16013 result = createHybridWrapper.apply(undefined, newData);
16014
16015 if (isLaziable(func)) {
16016 setData(result, newData);
16017 }
16018 result.placeholder = placeholder;
16019 return result;
16020 }
16021 }
16022 var thisBinding = isBind ? thisArg : this,
16023 fn = isBindKey ? thisBinding[func] : func;
16024
16025 if (argPos) {
16026 args = reorder(args, argPos);
16027 }
16028 if (isAry && ary < args.length) {
16029 args.length = ary;
16030 }
16031 if (this && this !== global && this instanceof wrapper) {
16032 fn = Ctor || createCtorWrapper(func);
16033 }
16034 return fn.apply(thisBinding, args);
16035 }
16036 return wrapper;
16037}
16038
16039module.exports = createHybridWrapper;
16040
16041}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
Jian Li1c94b9d2017-02-08 15:47:21 +090016042
Jian Li8afbbee2016-07-27 19:16:51 +090016043},{"./arrayCopy":62,"./composeArgs":96,"./composeArgsRight":97,"./createCtorWrapper":101,"./isLaziable":124,"./reorder":131,"./replaceHolders":132,"./setData":133}],105:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016044(function (global){
16045var createCtorWrapper = require('./createCtorWrapper');
16046
16047/** Used to compose bitmasks for wrapper metadata. */
16048var BIND_FLAG = 1;
16049
16050/**
16051 * Creates a function that wraps `func` and invokes it with the optional `this`
16052 * binding of `thisArg` and the `partials` prepended to those provided to
16053 * the wrapper.
16054 *
16055 * @private
16056 * @param {Function} func The function to partially apply arguments to.
16057 * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
16058 * @param {*} thisArg The `this` binding of `func`.
16059 * @param {Array} partials The arguments to prepend to those provided to the new function.
16060 * @returns {Function} Returns the new bound function.
16061 */
16062function createPartialWrapper(func, bitmask, thisArg, partials) {
16063 var isBind = bitmask & BIND_FLAG,
16064 Ctor = createCtorWrapper(func);
16065
16066 function wrapper() {
16067 // Avoid `arguments` object use disqualifying optimizations by
16068 // converting it to an array before providing it `func`.
16069 var argsIndex = -1,
16070 argsLength = arguments.length,
16071 leftIndex = -1,
16072 leftLength = partials.length,
Jian Li83d87a72016-04-20 15:38:24 -070016073 args = Array(leftLength + argsLength);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016074
16075 while (++leftIndex < leftLength) {
16076 args[leftIndex] = partials[leftIndex];
16077 }
16078 while (argsLength--) {
16079 args[leftIndex++] = arguments[++argsIndex];
16080 }
16081 var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
16082 return fn.apply(isBind ? thisArg : this, args);
16083 }
16084 return wrapper;
16085}
16086
16087module.exports = createPartialWrapper;
16088
16089}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
Jian Li1c94b9d2017-02-08 15:47:21 +090016090
Jian Li8afbbee2016-07-27 19:16:51 +090016091},{"./createCtorWrapper":101}],106:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016092var baseSetData = require('./baseSetData'),
16093 createBindWrapper = require('./createBindWrapper'),
16094 createHybridWrapper = require('./createHybridWrapper'),
16095 createPartialWrapper = require('./createPartialWrapper'),
16096 getData = require('./getData'),
16097 mergeData = require('./mergeData'),
16098 setData = require('./setData');
16099
16100/** Used to compose bitmasks for wrapper metadata. */
16101var BIND_FLAG = 1,
16102 BIND_KEY_FLAG = 2,
16103 PARTIAL_FLAG = 32,
16104 PARTIAL_RIGHT_FLAG = 64;
16105
16106/** Used as the `TypeError` message for "Functions" methods. */
16107var FUNC_ERROR_TEXT = 'Expected a function';
16108
16109/* Native method references for those with the same name as other `lodash` methods. */
16110var nativeMax = Math.max;
16111
16112/**
16113 * Creates a function that either curries or invokes `func` with optional
16114 * `this` binding and partially applied arguments.
16115 *
16116 * @private
16117 * @param {Function|string} func The function or method name to reference.
16118 * @param {number} bitmask The bitmask of flags.
16119 * The bitmask may be composed of the following flags:
16120 * 1 - `_.bind`
16121 * 2 - `_.bindKey`
16122 * 4 - `_.curry` or `_.curryRight` of a bound function
16123 * 8 - `_.curry`
16124 * 16 - `_.curryRight`
16125 * 32 - `_.partial`
16126 * 64 - `_.partialRight`
16127 * 128 - `_.rearg`
16128 * 256 - `_.ary`
16129 * @param {*} [thisArg] The `this` binding of `func`.
16130 * @param {Array} [partials] The arguments to be partially applied.
16131 * @param {Array} [holders] The `partials` placeholder indexes.
16132 * @param {Array} [argPos] The argument positions of the new function.
16133 * @param {number} [ary] The arity cap of `func`.
16134 * @param {number} [arity] The arity of `func`.
16135 * @returns {Function} Returns the new wrapped function.
16136 */
16137function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
16138 var isBindKey = bitmask & BIND_KEY_FLAG;
16139 if (!isBindKey && typeof func != 'function') {
16140 throw new TypeError(FUNC_ERROR_TEXT);
16141 }
16142 var length = partials ? partials.length : 0;
16143 if (!length) {
16144 bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
Jian Li83d87a72016-04-20 15:38:24 -070016145 partials = holders = undefined;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016146 }
16147 length -= (holders ? holders.length : 0);
16148 if (bitmask & PARTIAL_RIGHT_FLAG) {
16149 var partialsRight = partials,
16150 holdersRight = holders;
16151
Jian Li83d87a72016-04-20 15:38:24 -070016152 partials = holders = undefined;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016153 }
Jian Li83d87a72016-04-20 15:38:24 -070016154 var data = isBindKey ? undefined : getData(func),
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016155 newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
16156
16157 if (data) {
16158 mergeData(newData, data);
16159 bitmask = newData[1];
16160 arity = newData[9];
16161 }
16162 newData[9] = arity == null
16163 ? (isBindKey ? 0 : func.length)
16164 : (nativeMax(arity - length, 0) || 0);
16165
16166 if (bitmask == BIND_FLAG) {
16167 var result = createBindWrapper(newData[0], newData[2]);
16168 } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
16169 result = createPartialWrapper.apply(undefined, newData);
16170 } else {
16171 result = createHybridWrapper.apply(undefined, newData);
16172 }
16173 var setter = data ? baseSetData : setData;
16174 return setter(result, newData);
16175}
16176
16177module.exports = createWrapper;
16178
Jian Li8afbbee2016-07-27 19:16:51 +090016179},{"./baseSetData":88,"./createBindWrapper":100,"./createHybridWrapper":104,"./createPartialWrapper":105,"./getData":110,"./mergeData":128,"./setData":133}],107:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016180var arraySome = require('./arraySome');
16181
16182/**
16183 * A specialized version of `baseIsEqualDeep` for arrays with support for
16184 * partial deep comparisons.
16185 *
16186 * @private
16187 * @param {Array} array The array to compare.
16188 * @param {Array} other The other array to compare.
16189 * @param {Function} equalFunc The function to determine equivalents of values.
16190 * @param {Function} [customizer] The function to customize comparing arrays.
16191 * @param {boolean} [isLoose] Specify performing partial comparisons.
16192 * @param {Array} [stackA] Tracks traversed `value` objects.
16193 * @param {Array} [stackB] Tracks traversed `other` objects.
16194 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
16195 */
16196function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
16197 var index = -1,
16198 arrLength = array.length,
16199 othLength = other.length;
16200
16201 if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
16202 return false;
16203 }
16204 // Ignore non-index properties.
16205 while (++index < arrLength) {
16206 var arrValue = array[index],
16207 othValue = other[index],
16208 result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
16209
16210 if (result !== undefined) {
16211 if (result) {
16212 continue;
16213 }
16214 return false;
16215 }
16216 // Recursively compare arrays (susceptible to call stack limits).
16217 if (isLoose) {
16218 if (!arraySome(other, function(othValue) {
16219 return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
16220 })) {
16221 return false;
16222 }
16223 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
16224 return false;
16225 }
16226 }
16227 return true;
16228}
16229
16230module.exports = equalArrays;
16231
Jian Li8afbbee2016-07-27 19:16:51 +090016232},{"./arraySome":65}],108:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016233/** `Object#toString` result references. */
16234var boolTag = '[object Boolean]',
16235 dateTag = '[object Date]',
16236 errorTag = '[object Error]',
16237 numberTag = '[object Number]',
16238 regexpTag = '[object RegExp]',
16239 stringTag = '[object String]';
16240
16241/**
16242 * A specialized version of `baseIsEqualDeep` for comparing objects of
16243 * the same `toStringTag`.
16244 *
16245 * **Note:** This function only supports comparing values with tags of
16246 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
16247 *
16248 * @private
Jian Li83d87a72016-04-20 15:38:24 -070016249 * @param {Object} object The object to compare.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016250 * @param {Object} other The other object to compare.
16251 * @param {string} tag The `toStringTag` of the objects to compare.
16252 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
16253 */
16254function equalByTag(object, other, tag) {
16255 switch (tag) {
16256 case boolTag:
16257 case dateTag:
16258 // Coerce dates and booleans to numbers, dates to milliseconds and booleans
16259 // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
16260 return +object == +other;
16261
16262 case errorTag:
16263 return object.name == other.name && object.message == other.message;
16264
16265 case numberTag:
16266 // Treat `NaN` vs. `NaN` as equal.
16267 return (object != +object)
16268 ? other != +other
16269 : object == +other;
16270
16271 case regexpTag:
16272 case stringTag:
16273 // Coerce regexes to strings and treat strings primitives and string
16274 // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
16275 return object == (other + '');
16276 }
16277 return false;
16278}
16279
16280module.exports = equalByTag;
16281
Jian Li8afbbee2016-07-27 19:16:51 +090016282},{}],109:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016283var keys = require('../object/keys');
16284
16285/** Used for native method references. */
16286var objectProto = Object.prototype;
16287
16288/** Used to check objects for own properties. */
16289var hasOwnProperty = objectProto.hasOwnProperty;
16290
16291/**
16292 * A specialized version of `baseIsEqualDeep` for objects with support for
16293 * partial deep comparisons.
16294 *
16295 * @private
16296 * @param {Object} object The object to compare.
16297 * @param {Object} other The other object to compare.
16298 * @param {Function} equalFunc The function to determine equivalents of values.
16299 * @param {Function} [customizer] The function to customize comparing values.
16300 * @param {boolean} [isLoose] Specify performing partial comparisons.
16301 * @param {Array} [stackA] Tracks traversed `value` objects.
16302 * @param {Array} [stackB] Tracks traversed `other` objects.
16303 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
16304 */
16305function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
16306 var objProps = keys(object),
16307 objLength = objProps.length,
16308 othProps = keys(other),
16309 othLength = othProps.length;
16310
16311 if (objLength != othLength && !isLoose) {
16312 return false;
16313 }
16314 var index = objLength;
16315 while (index--) {
16316 var key = objProps[index];
16317 if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
16318 return false;
16319 }
16320 }
16321 var skipCtor = isLoose;
16322 while (++index < objLength) {
16323 key = objProps[index];
16324 var objValue = object[key],
16325 othValue = other[key],
16326 result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
16327
16328 // Recursively compare objects (susceptible to call stack limits).
16329 if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
16330 return false;
16331 }
16332 skipCtor || (skipCtor = key == 'constructor');
16333 }
16334 if (!skipCtor) {
16335 var objCtor = object.constructor,
16336 othCtor = other.constructor;
16337
16338 // Non `Object` object instances with different constructors are not equal.
16339 if (objCtor != othCtor &&
16340 ('constructor' in object && 'constructor' in other) &&
16341 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
16342 typeof othCtor == 'function' && othCtor instanceof othCtor)) {
16343 return false;
16344 }
16345 }
16346 return true;
16347}
16348
16349module.exports = equalObjects;
16350
Jian Li8afbbee2016-07-27 19:16:51 +090016351},{"../object/keys":149}],110:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016352var metaMap = require('./metaMap'),
16353 noop = require('../utility/noop');
16354
16355/**
16356 * Gets metadata for `func`.
16357 *
16358 * @private
16359 * @param {Function} func The function to query.
16360 * @returns {*} Returns the metadata for `func`.
16361 */
16362var getData = !metaMap ? noop : function(func) {
16363 return metaMap.get(func);
16364};
16365
16366module.exports = getData;
16367
Jian Li8afbbee2016-07-27 19:16:51 +090016368},{"../utility/noop":155,"./metaMap":129}],111:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016369var realNames = require('./realNames');
16370
16371/**
16372 * Gets the name of `func`.
16373 *
16374 * @private
16375 * @param {Function} func The function to query.
16376 * @returns {string} Returns the function name.
16377 */
16378function getFuncName(func) {
Jian Li83d87a72016-04-20 15:38:24 -070016379 var result = (func.name + ''),
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016380 array = realNames[result],
16381 length = array ? array.length : 0;
16382
16383 while (length--) {
16384 var data = array[length],
16385 otherFunc = data.func;
16386 if (otherFunc == null || otherFunc == func) {
16387 return data.name;
16388 }
16389 }
16390 return result;
16391}
16392
16393module.exports = getFuncName;
16394
Jian Li8afbbee2016-07-27 19:16:51 +090016395},{"./realNames":130}],112:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016396var baseProperty = require('./baseProperty');
16397
16398/**
16399 * Gets the "length" property value of `object`.
16400 *
16401 * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
16402 * that affects Safari on at least iOS 8.1-8.3 ARM64.
16403 *
16404 * @private
16405 * @param {Object} object The object to query.
16406 * @returns {*} Returns the "length" value.
16407 */
16408var getLength = baseProperty('length');
16409
16410module.exports = getLength;
16411
Jian Li8afbbee2016-07-27 19:16:51 +090016412},{"./baseProperty":86}],113:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016413var isStrictComparable = require('./isStrictComparable'),
16414 pairs = require('../object/pairs');
16415
16416/**
16417 * Gets the propery names, values, and compare flags of `object`.
16418 *
16419 * @private
16420 * @param {Object} object The object to query.
16421 * @returns {Array} Returns the match data of `object`.
16422 */
16423function getMatchData(object) {
16424 var result = pairs(object),
16425 length = result.length;
16426
16427 while (length--) {
16428 result[length][2] = isStrictComparable(result[length][1]);
16429 }
16430 return result;
16431}
16432
16433module.exports = getMatchData;
16434
Jian Li8afbbee2016-07-27 19:16:51 +090016435},{"../object/pairs":151,"./isStrictComparable":127}],114:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016436var isNative = require('../lang/isNative');
16437
16438/**
16439 * Gets the native function at `key` of `object`.
16440 *
16441 * @private
16442 * @param {Object} object The object to query.
16443 * @param {string} key The key of the method to get.
16444 * @returns {*} Returns the function if it's native, else `undefined`.
16445 */
16446function getNative(object, key) {
16447 var value = object == null ? undefined : object[key];
16448 return isNative(value) ? value : undefined;
16449}
16450
16451module.exports = getNative;
16452
Jian Li8afbbee2016-07-27 19:16:51 +090016453},{"../lang/isNative":143}],115:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016454/**
16455 * Gets the index at which the first occurrence of `NaN` is found in `array`.
16456 *
16457 * @private
16458 * @param {Array} array The array to search.
16459 * @param {number} fromIndex The index to search from.
16460 * @param {boolean} [fromRight] Specify iterating from right to left.
16461 * @returns {number} Returns the index of the matched `NaN`, else `-1`.
16462 */
16463function indexOfNaN(array, fromIndex, fromRight) {
16464 var length = array.length,
16465 index = fromIndex + (fromRight ? 0 : -1);
16466
16467 while ((fromRight ? index-- : ++index < length)) {
16468 var other = array[index];
16469 if (other !== other) {
16470 return index;
16471 }
16472 }
16473 return -1;
16474}
16475
16476module.exports = indexOfNaN;
16477
Jian Li8afbbee2016-07-27 19:16:51 +090016478},{}],116:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016479/** Used for native method references. */
16480var objectProto = Object.prototype;
16481
16482/** Used to check objects for own properties. */
16483var hasOwnProperty = objectProto.hasOwnProperty;
16484
16485/**
16486 * Initializes an array clone.
16487 *
16488 * @private
16489 * @param {Array} array The array to clone.
16490 * @returns {Array} Returns the initialized clone.
16491 */
16492function initCloneArray(array) {
16493 var length = array.length,
16494 result = new array.constructor(length);
16495
16496 // Add array properties assigned by `RegExp#exec`.
16497 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
16498 result.index = array.index;
16499 result.input = array.input;
16500 }
16501 return result;
16502}
16503
16504module.exports = initCloneArray;
16505
Jian Li8afbbee2016-07-27 19:16:51 +090016506},{}],117:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016507(function (global){
16508var bufferClone = require('./bufferClone');
16509
16510/** `Object#toString` result references. */
16511var boolTag = '[object Boolean]',
16512 dateTag = '[object Date]',
16513 numberTag = '[object Number]',
16514 regexpTag = '[object RegExp]',
16515 stringTag = '[object String]';
16516
16517var arrayBufferTag = '[object ArrayBuffer]',
16518 float32Tag = '[object Float32Array]',
16519 float64Tag = '[object Float64Array]',
16520 int8Tag = '[object Int8Array]',
16521 int16Tag = '[object Int16Array]',
16522 int32Tag = '[object Int32Array]',
16523 uint8Tag = '[object Uint8Array]',
16524 uint8ClampedTag = '[object Uint8ClampedArray]',
16525 uint16Tag = '[object Uint16Array]',
16526 uint32Tag = '[object Uint32Array]';
16527
16528/** Used to match `RegExp` flags from their coerced string values. */
16529var reFlags = /\w*$/;
16530
Jian Li83d87a72016-04-20 15:38:24 -070016531/** Native method references. */
16532var Uint8Array = global.Uint8Array;
16533
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016534/** Used to lookup a type array constructors by `toStringTag`. */
16535var ctorByTag = {};
16536ctorByTag[float32Tag] = global.Float32Array;
16537ctorByTag[float64Tag] = global.Float64Array;
16538ctorByTag[int8Tag] = global.Int8Array;
16539ctorByTag[int16Tag] = global.Int16Array;
16540ctorByTag[int32Tag] = global.Int32Array;
Jian Li83d87a72016-04-20 15:38:24 -070016541ctorByTag[uint8Tag] = Uint8Array;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016542ctorByTag[uint8ClampedTag] = global.Uint8ClampedArray;
16543ctorByTag[uint16Tag] = global.Uint16Array;
16544ctorByTag[uint32Tag] = global.Uint32Array;
16545
16546/**
16547 * Initializes an object clone based on its `toStringTag`.
16548 *
16549 * **Note:** This function only supports cloning values with tags of
16550 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
16551 *
16552 * @private
16553 * @param {Object} object The object to clone.
16554 * @param {string} tag The `toStringTag` of the object to clone.
16555 * @param {boolean} [isDeep] Specify a deep clone.
16556 * @returns {Object} Returns the initialized clone.
16557 */
16558function initCloneByTag(object, tag, isDeep) {
16559 var Ctor = object.constructor;
16560 switch (tag) {
16561 case arrayBufferTag:
16562 return bufferClone(object);
16563
16564 case boolTag:
16565 case dateTag:
16566 return new Ctor(+object);
16567
16568 case float32Tag: case float64Tag:
16569 case int8Tag: case int16Tag: case int32Tag:
16570 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
16571 // Safari 5 mobile incorrectly has `Object` as the constructor of typed arrays.
16572 if (Ctor instanceof Ctor) {
16573 Ctor = ctorByTag[tag];
16574 }
16575 var buffer = object.buffer;
16576 return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
16577
16578 case numberTag:
16579 case stringTag:
16580 return new Ctor(object);
16581
16582 case regexpTag:
16583 var result = new Ctor(object.source, reFlags.exec(object));
16584 result.lastIndex = object.lastIndex;
16585 }
16586 return result;
16587}
16588
16589module.exports = initCloneByTag;
16590
16591}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
Jian Li1c94b9d2017-02-08 15:47:21 +090016592
Jian Li8afbbee2016-07-27 19:16:51 +090016593},{"./bufferClone":95}],118:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016594/**
16595 * Initializes an object clone.
16596 *
16597 * @private
16598 * @param {Object} object The object to clone.
16599 * @returns {Object} Returns the initialized clone.
16600 */
16601function initCloneObject(object) {
16602 var Ctor = object.constructor;
16603 if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
16604 Ctor = Object;
16605 }
16606 return new Ctor;
16607}
16608
16609module.exports = initCloneObject;
16610
Jian Li8afbbee2016-07-27 19:16:51 +090016611},{}],119:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016612var getLength = require('./getLength'),
16613 isLength = require('./isLength');
16614
16615/**
16616 * Checks if `value` is array-like.
16617 *
16618 * @private
16619 * @param {*} value The value to check.
16620 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
16621 */
16622function isArrayLike(value) {
16623 return value != null && isLength(getLength(value));
16624}
16625
16626module.exports = isArrayLike;
16627
Jian Li8afbbee2016-07-27 19:16:51 +090016628},{"./getLength":112,"./isLength":125}],120:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016629/**
16630 * Checks if `value` is a host object in IE < 9.
16631 *
16632 * @private
16633 * @param {*} value The value to check.
16634 * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
16635 */
16636var isHostObject = (function() {
16637 try {
16638 Object({ 'toString': 0 } + '');
16639 } catch(e) {
16640 return function() { return false; };
16641 }
16642 return function(value) {
16643 // IE < 9 presents many host objects as `Object` objects that can coerce
16644 // to strings despite having improperly defined `toString` methods.
16645 return typeof value.toString != 'function' && typeof (value + '') == 'string';
16646 };
16647}());
16648
16649module.exports = isHostObject;
16650
Jian Li8afbbee2016-07-27 19:16:51 +090016651},{}],121:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016652/** Used to detect unsigned integer values. */
16653var reIsUint = /^\d+$/;
16654
16655/**
Jian Li83d87a72016-04-20 15:38:24 -070016656 * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016657 * of an array-like value.
16658 */
16659var MAX_SAFE_INTEGER = 9007199254740991;
16660
16661/**
16662 * Checks if `value` is a valid array-like index.
16663 *
16664 * @private
16665 * @param {*} value The value to check.
16666 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
16667 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
16668 */
16669function isIndex(value, length) {
16670 value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
16671 length = length == null ? MAX_SAFE_INTEGER : length;
16672 return value > -1 && value % 1 == 0 && value < length;
16673}
16674
16675module.exports = isIndex;
16676
Jian Li8afbbee2016-07-27 19:16:51 +090016677},{}],122:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016678var isArrayLike = require('./isArrayLike'),
16679 isIndex = require('./isIndex'),
16680 isObject = require('../lang/isObject');
16681
16682/**
16683 * Checks if the provided arguments are from an iteratee call.
16684 *
16685 * @private
16686 * @param {*} value The potential iteratee value argument.
16687 * @param {*} index The potential iteratee index or key argument.
16688 * @param {*} object The potential iteratee object argument.
16689 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
16690 */
16691function isIterateeCall(value, index, object) {
16692 if (!isObject(object)) {
16693 return false;
16694 }
16695 var type = typeof index;
16696 if (type == 'number'
16697 ? (isArrayLike(object) && isIndex(index, object.length))
16698 : (type == 'string' && index in object)) {
16699 var other = object[index];
16700 return value === value ? (value === other) : (other !== other);
16701 }
16702 return false;
16703}
16704
16705module.exports = isIterateeCall;
16706
Jian Li8afbbee2016-07-27 19:16:51 +090016707},{"../lang/isObject":144,"./isArrayLike":119,"./isIndex":121}],123:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016708var isArray = require('../lang/isArray'),
16709 toObject = require('./toObject');
16710
16711/** Used to match property names within property paths. */
16712var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
16713 reIsPlainProp = /^\w*$/;
16714
16715/**
16716 * Checks if `value` is a property name and not a property path.
16717 *
16718 * @private
16719 * @param {*} value The value to check.
16720 * @param {Object} [object] The object to query keys on.
16721 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
16722 */
16723function isKey(value, object) {
16724 var type = typeof value;
16725 if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
16726 return true;
16727 }
16728 if (isArray(value)) {
16729 return false;
16730 }
16731 var result = !reIsDeepProp.test(value);
16732 return result || (object != null && value in toObject(object));
16733}
16734
16735module.exports = isKey;
16736
Jian Li8afbbee2016-07-27 19:16:51 +090016737},{"../lang/isArray":140,"./toObject":135}],124:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016738var LazyWrapper = require('./LazyWrapper'),
16739 getData = require('./getData'),
16740 getFuncName = require('./getFuncName'),
16741 lodash = require('../chain/lodash');
16742
16743/**
16744 * Checks if `func` has a lazy counterpart.
16745 *
16746 * @private
16747 * @param {Function} func The function to check.
16748 * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
16749 */
16750function isLaziable(func) {
Jian Li83d87a72016-04-20 15:38:24 -070016751 var funcName = getFuncName(func),
16752 other = lodash[funcName];
16753
16754 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016755 return false;
16756 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016757 if (func === other) {
16758 return true;
16759 }
16760 var data = getData(other);
16761 return !!data && func === data[0];
16762}
16763
16764module.exports = isLaziable;
16765
Jian Li8afbbee2016-07-27 19:16:51 +090016766},{"../chain/lodash":51,"./LazyWrapper":60,"./getData":110,"./getFuncName":111}],125:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016767/**
Jian Li83d87a72016-04-20 15:38:24 -070016768 * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016769 * of an array-like value.
16770 */
16771var MAX_SAFE_INTEGER = 9007199254740991;
16772
16773/**
16774 * Checks if `value` is a valid array-like length.
16775 *
Jian Li83d87a72016-04-20 15:38:24 -070016776 * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016777 *
16778 * @private
16779 * @param {*} value The value to check.
16780 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
16781 */
16782function isLength(value) {
16783 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
16784}
16785
16786module.exports = isLength;
16787
Jian Li8afbbee2016-07-27 19:16:51 +090016788},{}],126:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016789/**
16790 * Checks if `value` is object-like.
16791 *
16792 * @private
16793 * @param {*} value The value to check.
16794 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
16795 */
16796function isObjectLike(value) {
16797 return !!value && typeof value == 'object';
16798}
16799
16800module.exports = isObjectLike;
16801
Jian Li8afbbee2016-07-27 19:16:51 +090016802},{}],127:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016803var isObject = require('../lang/isObject');
16804
16805/**
16806 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
16807 *
16808 * @private
16809 * @param {*} value The value to check.
16810 * @returns {boolean} Returns `true` if `value` if suitable for strict
16811 * equality comparisons, else `false`.
16812 */
16813function isStrictComparable(value) {
16814 return value === value && !isObject(value);
16815}
16816
16817module.exports = isStrictComparable;
16818
Jian Li8afbbee2016-07-27 19:16:51 +090016819},{"../lang/isObject":144}],128:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016820var arrayCopy = require('./arrayCopy'),
16821 composeArgs = require('./composeArgs'),
16822 composeArgsRight = require('./composeArgsRight'),
16823 replaceHolders = require('./replaceHolders');
16824
16825/** Used to compose bitmasks for wrapper metadata. */
16826var BIND_FLAG = 1,
16827 CURRY_BOUND_FLAG = 4,
16828 CURRY_FLAG = 8,
16829 ARY_FLAG = 128,
16830 REARG_FLAG = 256;
16831
16832/** Used as the internal argument placeholder. */
16833var PLACEHOLDER = '__lodash_placeholder__';
16834
16835/* Native method references for those with the same name as other `lodash` methods. */
16836var nativeMin = Math.min;
16837
16838/**
16839 * Merges the function metadata of `source` into `data`.
16840 *
16841 * Merging metadata reduces the number of wrappers required to invoke a function.
16842 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
16843 * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
16844 * augment function arguments, making the order in which they are executed important,
16845 * preventing the merging of metadata. However, we make an exception for a safe
16846 * common case where curried functions have `_.ary` and or `_.rearg` applied.
16847 *
16848 * @private
16849 * @param {Array} data The destination metadata.
16850 * @param {Array} source The source metadata.
16851 * @returns {Array} Returns `data`.
16852 */
16853function mergeData(data, source) {
16854 var bitmask = data[1],
16855 srcBitmask = source[1],
16856 newBitmask = bitmask | srcBitmask,
16857 isCommon = newBitmask < ARY_FLAG;
16858
16859 var isCombo =
16860 (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
16861 (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
16862 (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
16863
16864 // Exit early if metadata can't be merged.
16865 if (!(isCommon || isCombo)) {
16866 return data;
16867 }
16868 // Use source `thisArg` if available.
16869 if (srcBitmask & BIND_FLAG) {
16870 data[2] = source[2];
16871 // Set when currying a bound function.
16872 newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
16873 }
16874 // Compose partial arguments.
16875 var value = source[3];
16876 if (value) {
16877 var partials = data[3];
16878 data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
16879 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
16880 }
16881 // Compose partial right arguments.
16882 value = source[5];
16883 if (value) {
16884 partials = data[5];
16885 data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
16886 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
16887 }
16888 // Use source `argPos` if available.
16889 value = source[7];
16890 if (value) {
16891 data[7] = arrayCopy(value);
16892 }
16893 // Use source `ary` if it's smaller.
16894 if (srcBitmask & ARY_FLAG) {
16895 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
16896 }
16897 // Use source `arity` if one is not provided.
16898 if (data[9] == null) {
16899 data[9] = source[9];
16900 }
16901 // Use source `func` and merge bitmasks.
16902 data[0] = source[0];
16903 data[1] = newBitmask;
16904
16905 return data;
16906}
16907
16908module.exports = mergeData;
16909
Jian Li8afbbee2016-07-27 19:16:51 +090016910},{"./arrayCopy":62,"./composeArgs":96,"./composeArgsRight":97,"./replaceHolders":132}],129:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016911(function (global){
16912var getNative = require('./getNative');
16913
16914/** Native method references. */
16915var WeakMap = getNative(global, 'WeakMap');
16916
16917/** Used to store function metadata. */
16918var metaMap = WeakMap && new WeakMap;
16919
16920module.exports = metaMap;
16921
16922}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
Jian Li1c94b9d2017-02-08 15:47:21 +090016923
Jian Li8afbbee2016-07-27 19:16:51 +090016924},{"./getNative":114}],130:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016925/** Used to lookup unminified function names. */
16926var realNames = {};
16927
16928module.exports = realNames;
16929
Jian Li8afbbee2016-07-27 19:16:51 +090016930},{}],131:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016931var arrayCopy = require('./arrayCopy'),
16932 isIndex = require('./isIndex');
16933
16934/* Native method references for those with the same name as other `lodash` methods. */
16935var nativeMin = Math.min;
16936
16937/**
16938 * Reorder `array` according to the specified indexes where the element at
16939 * the first index is assigned as the first element, the element at
16940 * the second index is assigned as the second element, and so on.
16941 *
16942 * @private
16943 * @param {Array} array The array to reorder.
16944 * @param {Array} indexes The arranged array indexes.
16945 * @returns {Array} Returns `array`.
16946 */
16947function reorder(array, indexes) {
16948 var arrLength = array.length,
16949 length = nativeMin(indexes.length, arrLength),
16950 oldArray = arrayCopy(array);
16951
16952 while (length--) {
16953 var index = indexes[length];
16954 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
16955 }
16956 return array;
16957}
16958
16959module.exports = reorder;
16960
Jian Li8afbbee2016-07-27 19:16:51 +090016961},{"./arrayCopy":62,"./isIndex":121}],132:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016962/** Used as the internal argument placeholder. */
16963var PLACEHOLDER = '__lodash_placeholder__';
16964
16965/**
16966 * Replaces all `placeholder` elements in `array` with an internal placeholder
16967 * and returns an array of their indexes.
16968 *
16969 * @private
16970 * @param {Array} array The array to modify.
16971 * @param {*} placeholder The placeholder to replace.
16972 * @returns {Array} Returns the new array of placeholder indexes.
16973 */
16974function replaceHolders(array, placeholder) {
16975 var index = -1,
16976 length = array.length,
16977 resIndex = -1,
16978 result = [];
16979
16980 while (++index < length) {
16981 if (array[index] === placeholder) {
16982 array[index] = PLACEHOLDER;
16983 result[++resIndex] = index;
16984 }
16985 }
16986 return result;
16987}
16988
16989module.exports = replaceHolders;
16990
Jian Li8afbbee2016-07-27 19:16:51 +090016991},{}],133:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070016992var baseSetData = require('./baseSetData'),
16993 now = require('../date/now');
16994
16995/** Used to detect when a function becomes hot. */
16996var HOT_COUNT = 150,
16997 HOT_SPAN = 16;
16998
16999/**
17000 * Sets metadata for `func`.
17001 *
17002 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
17003 * period of time, it will trip its breaker and transition to an identity function
17004 * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
17005 * for more details.
17006 *
17007 * @private
17008 * @param {Function} func The function to associate metadata with.
17009 * @param {*} data The metadata.
17010 * @returns {Function} Returns `func`.
17011 */
17012var setData = (function() {
17013 var count = 0,
17014 lastCalled = 0;
17015
17016 return function(key, value) {
17017 var stamp = now(),
17018 remaining = HOT_SPAN - (stamp - lastCalled);
17019
17020 lastCalled = stamp;
17021 if (remaining > 0) {
17022 if (++count >= HOT_COUNT) {
17023 return key;
17024 }
17025 } else {
17026 count = 0;
17027 }
17028 return baseSetData(key, value);
17029 };
17030}());
17031
17032module.exports = setData;
17033
Jian Li8afbbee2016-07-27 19:16:51 +090017034},{"../date/now":57,"./baseSetData":88}],134:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017035var isArguments = require('../lang/isArguments'),
17036 isArray = require('../lang/isArray'),
17037 isIndex = require('./isIndex'),
17038 isLength = require('./isLength'),
17039 isString = require('../lang/isString'),
17040 keysIn = require('../object/keysIn');
17041
17042/** Used for native method references. */
17043var objectProto = Object.prototype;
17044
17045/** Used to check objects for own properties. */
17046var hasOwnProperty = objectProto.hasOwnProperty;
17047
17048/**
17049 * A fallback implementation of `Object.keys` which creates an array of the
17050 * own enumerable property names of `object`.
17051 *
17052 * @private
17053 * @param {Object} object The object to query.
17054 * @returns {Array} Returns the array of property names.
17055 */
17056function shimKeys(object) {
17057 var props = keysIn(object),
17058 propsLength = props.length,
17059 length = propsLength && object.length;
17060
17061 var allowIndexes = !!length && isLength(length) &&
17062 (isArray(object) || isArguments(object) || isString(object));
17063
17064 var index = -1,
17065 result = [];
17066
17067 while (++index < propsLength) {
17068 var key = props[index];
17069 if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
17070 result.push(key);
17071 }
17072 }
17073 return result;
17074}
17075
17076module.exports = shimKeys;
17077
Jian Li8afbbee2016-07-27 19:16:51 +090017078},{"../lang/isArguments":139,"../lang/isArray":140,"../lang/isString":146,"../object/keysIn":150,"./isIndex":121,"./isLength":125}],135:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017079var isObject = require('../lang/isObject'),
17080 isString = require('../lang/isString'),
17081 support = require('../support');
17082
17083/**
17084 * Converts `value` to an object if it's not one.
17085 *
17086 * @private
17087 * @param {*} value The value to process.
17088 * @returns {Object} Returns the object.
17089 */
17090function toObject(value) {
17091 if (support.unindexedChars && isString(value)) {
17092 var index = -1,
17093 length = value.length,
17094 result = Object(value);
17095
17096 while (++index < length) {
17097 result[index] = value.charAt(index);
17098 }
17099 return result;
17100 }
17101 return isObject(value) ? value : Object(value);
17102}
17103
17104module.exports = toObject;
17105
Jian Li8afbbee2016-07-27 19:16:51 +090017106},{"../lang/isObject":144,"../lang/isString":146,"../support":153}],136:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017107var baseToString = require('./baseToString'),
17108 isArray = require('../lang/isArray');
17109
17110/** Used to match property names within property paths. */
17111var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
17112
17113/** Used to match backslashes in property paths. */
17114var reEscapeChar = /\\(\\)?/g;
17115
17116/**
17117 * Converts `value` to property path array if it's not one.
17118 *
17119 * @private
17120 * @param {*} value The value to process.
17121 * @returns {Array} Returns the property path array.
17122 */
17123function toPath(value) {
17124 if (isArray(value)) {
17125 return value;
17126 }
17127 var result = [];
17128 baseToString(value).replace(rePropName, function(match, number, quote, string) {
17129 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
17130 });
17131 return result;
17132}
17133
17134module.exports = toPath;
17135
Jian Li8afbbee2016-07-27 19:16:51 +090017136},{"../lang/isArray":140,"./baseToString":90}],137:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017137var LazyWrapper = require('./LazyWrapper'),
17138 LodashWrapper = require('./LodashWrapper'),
17139 arrayCopy = require('./arrayCopy');
17140
17141/**
17142 * Creates a clone of `wrapper`.
17143 *
17144 * @private
17145 * @param {Object} wrapper The wrapper to clone.
17146 * @returns {Object} Returns the cloned wrapper.
17147 */
17148function wrapperClone(wrapper) {
17149 return wrapper instanceof LazyWrapper
17150 ? wrapper.clone()
17151 : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
17152}
17153
17154module.exports = wrapperClone;
17155
Jian Li8afbbee2016-07-27 19:16:51 +090017156},{"./LazyWrapper":60,"./LodashWrapper":61,"./arrayCopy":62}],138:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017157var baseClone = require('../internal/baseClone'),
17158 bindCallback = require('../internal/bindCallback');
17159
17160/**
Jian Li83d87a72016-04-20 15:38:24 -070017161 * Creates a deep clone of `value`. If `customizer` is provided it's invoked
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017162 * to produce the cloned values. If `customizer` returns `undefined` cloning
17163 * is handled by the method instead. The `customizer` is bound to `thisArg`
Jian Li83d87a72016-04-20 15:38:24 -070017164 * and invoked with up to three argument; (value [, index|key, object]).
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017165 *
17166 * **Note:** This method is loosely based on the
17167 * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
17168 * The enumerable properties of `arguments` objects and objects created by
17169 * constructors other than `Object` are cloned to plain `Object` objects. An
17170 * empty object is returned for uncloneable values such as functions, DOM nodes,
17171 * Maps, Sets, and WeakMaps.
17172 *
17173 * @static
17174 * @memberOf _
17175 * @category Lang
17176 * @param {*} value The value to deep clone.
17177 * @param {Function} [customizer] The function to customize cloning values.
17178 * @param {*} [thisArg] The `this` binding of `customizer`.
17179 * @returns {*} Returns the deep cloned value.
17180 * @example
17181 *
17182 * var users = [
17183 * { 'user': 'barney' },
17184 * { 'user': 'fred' }
17185 * ];
17186 *
17187 * var deep = _.cloneDeep(users);
17188 * deep[0] === users[0];
17189 * // => false
17190 *
17191 * // using a customizer callback
17192 * var el = _.cloneDeep(document.body, function(value) {
17193 * if (_.isElement(value)) {
17194 * return value.cloneNode(true);
17195 * }
17196 * });
17197 *
17198 * el === document.body
17199 * // => false
17200 * el.nodeName
17201 * // => BODY
17202 * el.childNodes.length;
17203 * // => 20
17204 */
17205function cloneDeep(value, customizer, thisArg) {
17206 return typeof customizer == 'function'
Jian Li83d87a72016-04-20 15:38:24 -070017207 ? baseClone(value, true, bindCallback(customizer, thisArg, 3))
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017208 : baseClone(value, true);
17209}
17210
17211module.exports = cloneDeep;
17212
Jian Li8afbbee2016-07-27 19:16:51 +090017213},{"../internal/baseClone":68,"../internal/bindCallback":94}],139:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017214var isArrayLike = require('../internal/isArrayLike'),
Jian Li83d87a72016-04-20 15:38:24 -070017215 isObjectLike = require('../internal/isObjectLike');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017216
17217/** Used for native method references. */
17218var objectProto = Object.prototype;
17219
17220/** Used to check objects for own properties. */
17221var hasOwnProperty = objectProto.hasOwnProperty;
17222
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017223/** Native method references. */
17224var propertyIsEnumerable = objectProto.propertyIsEnumerable;
17225
17226/**
17227 * Checks if `value` is classified as an `arguments` object.
17228 *
17229 * @static
17230 * @memberOf _
17231 * @category Lang
17232 * @param {*} value The value to check.
17233 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
17234 * @example
17235 *
17236 * _.isArguments(function() { return arguments; }());
17237 * // => true
17238 *
17239 * _.isArguments([1, 2, 3]);
17240 * // => false
17241 */
17242function isArguments(value) {
Jian Li83d87a72016-04-20 15:38:24 -070017243 return isObjectLike(value) && isArrayLike(value) &&
17244 hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017245}
17246
17247module.exports = isArguments;
17248
Jian Li8afbbee2016-07-27 19:16:51 +090017249},{"../internal/isArrayLike":119,"../internal/isObjectLike":126}],140:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017250var getNative = require('../internal/getNative'),
17251 isLength = require('../internal/isLength'),
17252 isObjectLike = require('../internal/isObjectLike');
17253
17254/** `Object#toString` result references. */
17255var arrayTag = '[object Array]';
17256
17257/** Used for native method references. */
17258var objectProto = Object.prototype;
17259
17260/**
Jian Li83d87a72016-04-20 15:38:24 -070017261 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017262 * of values.
17263 */
17264var objToString = objectProto.toString;
17265
17266/* Native method references for those with the same name as other `lodash` methods. */
17267var nativeIsArray = getNative(Array, 'isArray');
17268
17269/**
17270 * Checks if `value` is classified as an `Array` object.
17271 *
17272 * @static
17273 * @memberOf _
17274 * @category Lang
17275 * @param {*} value The value to check.
17276 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
17277 * @example
17278 *
17279 * _.isArray([1, 2, 3]);
17280 * // => true
17281 *
17282 * _.isArray(function() { return arguments; }());
17283 * // => false
17284 */
17285var isArray = nativeIsArray || function(value) {
17286 return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
17287};
17288
17289module.exports = isArray;
17290
Jian Li8afbbee2016-07-27 19:16:51 +090017291},{"../internal/getNative":114,"../internal/isLength":125,"../internal/isObjectLike":126}],141:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017292var isArguments = require('./isArguments'),
17293 isArray = require('./isArray'),
17294 isArrayLike = require('../internal/isArrayLike'),
17295 isFunction = require('./isFunction'),
17296 isObjectLike = require('../internal/isObjectLike'),
17297 isString = require('./isString'),
17298 keys = require('../object/keys');
17299
17300/**
Jian Li83d87a72016-04-20 15:38:24 -070017301 * Checks if `value` is empty. A value is considered empty unless it's an
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017302 * `arguments` object, array, string, or jQuery-like collection with a length
17303 * greater than `0` or an object with own enumerable properties.
17304 *
17305 * @static
17306 * @memberOf _
17307 * @category Lang
17308 * @param {Array|Object|string} value The value to inspect.
17309 * @returns {boolean} Returns `true` if `value` is empty, else `false`.
17310 * @example
17311 *
17312 * _.isEmpty(null);
17313 * // => true
17314 *
17315 * _.isEmpty(true);
17316 * // => true
17317 *
17318 * _.isEmpty(1);
17319 * // => true
17320 *
17321 * _.isEmpty([1, 2, 3]);
17322 * // => false
17323 *
17324 * _.isEmpty({ 'a': 1 });
17325 * // => false
17326 */
17327function isEmpty(value) {
17328 if (value == null) {
17329 return true;
17330 }
17331 if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
17332 (isObjectLike(value) && isFunction(value.splice)))) {
17333 return !value.length;
17334 }
17335 return !keys(value).length;
17336}
17337
17338module.exports = isEmpty;
17339
Jian Li8afbbee2016-07-27 19:16:51 +090017340},{"../internal/isArrayLike":119,"../internal/isObjectLike":126,"../object/keys":149,"./isArguments":139,"./isArray":140,"./isFunction":142,"./isString":146}],142:[function(require,module,exports){
Jian Li83d87a72016-04-20 15:38:24 -070017341var isObject = require('./isObject');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017342
17343/** `Object#toString` result references. */
17344var funcTag = '[object Function]';
17345
17346/** Used for native method references. */
17347var objectProto = Object.prototype;
17348
17349/**
Jian Li83d87a72016-04-20 15:38:24 -070017350 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017351 * of values.
17352 */
17353var objToString = objectProto.toString;
17354
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017355/**
17356 * Checks if `value` is classified as a `Function` object.
17357 *
17358 * @static
17359 * @memberOf _
17360 * @category Lang
17361 * @param {*} value The value to check.
17362 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
17363 * @example
17364 *
17365 * _.isFunction(_);
17366 * // => true
17367 *
17368 * _.isFunction(/abc/);
17369 * // => false
17370 */
Jian Li83d87a72016-04-20 15:38:24 -070017371function isFunction(value) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017372 // The use of `Object#toString` avoids issues with the `typeof` operator
17373 // in older versions of Chrome and Safari which return 'function' for regexes
Jian Li83d87a72016-04-20 15:38:24 -070017374 // and Safari 8 which returns 'object' for typed array constructors.
17375 return isObject(value) && objToString.call(value) == funcTag;
17376}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017377
17378module.exports = isFunction;
17379
Jian Li8afbbee2016-07-27 19:16:51 +090017380},{"./isObject":144}],143:[function(require,module,exports){
Jian Li83d87a72016-04-20 15:38:24 -070017381var isFunction = require('./isFunction'),
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017382 isHostObject = require('../internal/isHostObject'),
17383 isObjectLike = require('../internal/isObjectLike');
17384
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017385/** Used to detect host constructors (Safari > 5). */
17386var reIsHostCtor = /^\[object .+?Constructor\]$/;
17387
17388/** Used for native method references. */
17389var objectProto = Object.prototype;
17390
17391/** Used to resolve the decompiled source of functions. */
17392var fnToString = Function.prototype.toString;
17393
17394/** Used to check objects for own properties. */
17395var hasOwnProperty = objectProto.hasOwnProperty;
17396
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017397/** Used to detect if a method is native. */
17398var reIsNative = RegExp('^' +
Jian Li83d87a72016-04-20 15:38:24 -070017399 fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017400 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
17401);
17402
17403/**
17404 * Checks if `value` is a native function.
17405 *
17406 * @static
17407 * @memberOf _
17408 * @category Lang
17409 * @param {*} value The value to check.
17410 * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
17411 * @example
17412 *
17413 * _.isNative(Array.prototype.push);
17414 * // => true
17415 *
17416 * _.isNative(_);
17417 * // => false
17418 */
17419function isNative(value) {
17420 if (value == null) {
17421 return false;
17422 }
Jian Li83d87a72016-04-20 15:38:24 -070017423 if (isFunction(value)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017424 return reIsNative.test(fnToString.call(value));
17425 }
17426 return isObjectLike(value) && (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);
17427}
17428
17429module.exports = isNative;
17430
Jian Li8afbbee2016-07-27 19:16:51 +090017431},{"../internal/isHostObject":120,"../internal/isObjectLike":126,"./isFunction":142}],144:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017432/**
17433 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
17434 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
17435 *
17436 * @static
17437 * @memberOf _
17438 * @category Lang
17439 * @param {*} value The value to check.
17440 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
17441 * @example
17442 *
17443 * _.isObject({});
17444 * // => true
17445 *
17446 * _.isObject([1, 2, 3]);
17447 * // => true
17448 *
17449 * _.isObject(1);
17450 * // => false
17451 */
17452function isObject(value) {
17453 // Avoid a V8 JIT bug in Chrome 19-20.
17454 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
17455 var type = typeof value;
17456 return !!value && (type == 'object' || type == 'function');
17457}
17458
17459module.exports = isObject;
17460
Jian Li8afbbee2016-07-27 19:16:51 +090017461},{}],145:[function(require,module,exports){
Jian Li83d87a72016-04-20 15:38:24 -070017462var baseForIn = require('../internal/baseForIn'),
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017463 isArguments = require('./isArguments'),
Jian Li83d87a72016-04-20 15:38:24 -070017464 isHostObject = require('../internal/isHostObject'),
17465 isObjectLike = require('../internal/isObjectLike'),
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017466 support = require('../support');
17467
17468/** `Object#toString` result references. */
17469var objectTag = '[object Object]';
17470
17471/** Used for native method references. */
17472var objectProto = Object.prototype;
17473
Jian Li83d87a72016-04-20 15:38:24 -070017474/** Used to check objects for own properties. */
17475var hasOwnProperty = objectProto.hasOwnProperty;
17476
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017477/**
Jian Li83d87a72016-04-20 15:38:24 -070017478 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017479 * of values.
17480 */
17481var objToString = objectProto.toString;
17482
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017483/**
17484 * Checks if `value` is a plain object, that is, an object created by the
17485 * `Object` constructor or one with a `[[Prototype]]` of `null`.
17486 *
17487 * **Note:** This method assumes objects created by the `Object` constructor
17488 * have no inherited enumerable properties.
17489 *
17490 * @static
17491 * @memberOf _
17492 * @category Lang
17493 * @param {*} value The value to check.
17494 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
17495 * @example
17496 *
17497 * function Foo() {
17498 * this.a = 1;
17499 * }
17500 *
17501 * _.isPlainObject(new Foo);
17502 * // => false
17503 *
17504 * _.isPlainObject([1, 2, 3]);
17505 * // => false
17506 *
17507 * _.isPlainObject({ 'x': 0, 'y': 0 });
17508 * // => true
17509 *
17510 * _.isPlainObject(Object.create(null));
17511 * // => true
17512 */
Jian Li83d87a72016-04-20 15:38:24 -070017513function isPlainObject(value) {
17514 var Ctor;
17515
17516 // Exit early for non `Object` objects.
17517 if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isHostObject(value) && !isArguments(value)) ||
17518 (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017519 return false;
17520 }
Jian Li83d87a72016-04-20 15:38:24 -070017521 // IE < 9 iterates inherited properties before own properties. If the first
17522 // iterated property is an object's own property then there are no inherited
17523 // enumerable properties.
17524 var result;
17525 if (support.ownLast) {
17526 baseForIn(value, function(subValue, key, object) {
17527 result = hasOwnProperty.call(object, key);
17528 return false;
17529 });
17530 return result !== false;
17531 }
17532 // In most environments an object's own properties are iterated before
17533 // its inherited properties. If the last iterated property is an object's
17534 // own property then there are no inherited enumerable properties.
17535 baseForIn(value, function(subValue, key) {
17536 result = key;
17537 });
17538 return result === undefined || hasOwnProperty.call(value, result);
17539}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017540
17541module.exports = isPlainObject;
17542
Jian Li8afbbee2016-07-27 19:16:51 +090017543},{"../internal/baseForIn":75,"../internal/isHostObject":120,"../internal/isObjectLike":126,"../support":153,"./isArguments":139}],146:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017544var isObjectLike = require('../internal/isObjectLike');
17545
17546/** `Object#toString` result references. */
17547var stringTag = '[object String]';
17548
17549/** Used for native method references. */
17550var objectProto = Object.prototype;
17551
17552/**
Jian Li83d87a72016-04-20 15:38:24 -070017553 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017554 * of values.
17555 */
17556var objToString = objectProto.toString;
17557
17558/**
17559 * Checks if `value` is classified as a `String` primitive or object.
17560 *
17561 * @static
17562 * @memberOf _
17563 * @category Lang
17564 * @param {*} value The value to check.
17565 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
17566 * @example
17567 *
17568 * _.isString('abc');
17569 * // => true
17570 *
17571 * _.isString(1);
17572 * // => false
17573 */
17574function isString(value) {
17575 return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
17576}
17577
17578module.exports = isString;
17579
Jian Li8afbbee2016-07-27 19:16:51 +090017580},{"../internal/isObjectLike":126}],147:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017581var isLength = require('../internal/isLength'),
17582 isObjectLike = require('../internal/isObjectLike');
17583
17584/** `Object#toString` result references. */
17585var argsTag = '[object Arguments]',
17586 arrayTag = '[object Array]',
17587 boolTag = '[object Boolean]',
17588 dateTag = '[object Date]',
17589 errorTag = '[object Error]',
17590 funcTag = '[object Function]',
17591 mapTag = '[object Map]',
17592 numberTag = '[object Number]',
17593 objectTag = '[object Object]',
17594 regexpTag = '[object RegExp]',
17595 setTag = '[object Set]',
17596 stringTag = '[object String]',
17597 weakMapTag = '[object WeakMap]';
17598
17599var arrayBufferTag = '[object ArrayBuffer]',
17600 float32Tag = '[object Float32Array]',
17601 float64Tag = '[object Float64Array]',
17602 int8Tag = '[object Int8Array]',
17603 int16Tag = '[object Int16Array]',
17604 int32Tag = '[object Int32Array]',
17605 uint8Tag = '[object Uint8Array]',
17606 uint8ClampedTag = '[object Uint8ClampedArray]',
17607 uint16Tag = '[object Uint16Array]',
17608 uint32Tag = '[object Uint32Array]';
17609
17610/** Used to identify `toStringTag` values of typed arrays. */
17611var typedArrayTags = {};
17612typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
17613typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
17614typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
17615typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
17616typedArrayTags[uint32Tag] = true;
17617typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
17618typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
17619typedArrayTags[dateTag] = typedArrayTags[errorTag] =
17620typedArrayTags[funcTag] = typedArrayTags[mapTag] =
17621typedArrayTags[numberTag] = typedArrayTags[objectTag] =
17622typedArrayTags[regexpTag] = typedArrayTags[setTag] =
17623typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
17624
17625/** Used for native method references. */
17626var objectProto = Object.prototype;
17627
17628/**
Jian Li83d87a72016-04-20 15:38:24 -070017629 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017630 * of values.
17631 */
17632var objToString = objectProto.toString;
17633
17634/**
17635 * Checks if `value` is classified as a typed array.
17636 *
17637 * @static
17638 * @memberOf _
17639 * @category Lang
17640 * @param {*} value The value to check.
17641 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
17642 * @example
17643 *
17644 * _.isTypedArray(new Uint8Array);
17645 * // => true
17646 *
17647 * _.isTypedArray([]);
17648 * // => false
17649 */
17650function isTypedArray(value) {
17651 return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
17652}
17653
17654module.exports = isTypedArray;
17655
Jian Li8afbbee2016-07-27 19:16:51 +090017656},{"../internal/isLength":125,"../internal/isObjectLike":126}],148:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017657/**
17658 * Checks if `value` is `undefined`.
17659 *
17660 * @static
17661 * @memberOf _
17662 * @category Lang
17663 * @param {*} value The value to check.
17664 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
17665 * @example
17666 *
17667 * _.isUndefined(void 0);
17668 * // => true
17669 *
17670 * _.isUndefined(null);
17671 * // => false
17672 */
17673function isUndefined(value) {
17674 return value === undefined;
17675}
17676
17677module.exports = isUndefined;
17678
Jian Li8afbbee2016-07-27 19:16:51 +090017679},{}],149:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017680var getNative = require('../internal/getNative'),
17681 isArrayLike = require('../internal/isArrayLike'),
17682 isObject = require('../lang/isObject'),
17683 shimKeys = require('../internal/shimKeys'),
17684 support = require('../support');
17685
17686/* Native method references for those with the same name as other `lodash` methods. */
17687var nativeKeys = getNative(Object, 'keys');
17688
17689/**
17690 * Creates an array of the own enumerable property names of `object`.
17691 *
17692 * **Note:** Non-object values are coerced to objects. See the
Jian Li83d87a72016-04-20 15:38:24 -070017693 * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017694 * for more details.
17695 *
17696 * @static
17697 * @memberOf _
17698 * @category Object
17699 * @param {Object} object The object to query.
17700 * @returns {Array} Returns the array of property names.
17701 * @example
17702 *
17703 * function Foo() {
17704 * this.a = 1;
17705 * this.b = 2;
17706 * }
17707 *
17708 * Foo.prototype.c = 3;
17709 *
17710 * _.keys(new Foo);
17711 * // => ['a', 'b'] (iteration order is not guaranteed)
17712 *
17713 * _.keys('hi');
17714 * // => ['0', '1']
17715 */
17716var keys = !nativeKeys ? shimKeys : function(object) {
Jian Li83d87a72016-04-20 15:38:24 -070017717 var Ctor = object == null ? undefined : object.constructor;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017718 if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
17719 (typeof object == 'function' ? support.enumPrototypes : isArrayLike(object))) {
17720 return shimKeys(object);
17721 }
17722 return isObject(object) ? nativeKeys(object) : [];
17723};
17724
17725module.exports = keys;
17726
Jian Li8afbbee2016-07-27 19:16:51 +090017727},{"../internal/getNative":114,"../internal/isArrayLike":119,"../internal/shimKeys":134,"../lang/isObject":144,"../support":153}],150:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017728var arrayEach = require('../internal/arrayEach'),
17729 isArguments = require('../lang/isArguments'),
17730 isArray = require('../lang/isArray'),
17731 isFunction = require('../lang/isFunction'),
17732 isIndex = require('../internal/isIndex'),
17733 isLength = require('../internal/isLength'),
17734 isObject = require('../lang/isObject'),
17735 isString = require('../lang/isString'),
17736 support = require('../support');
17737
17738/** `Object#toString` result references. */
17739var arrayTag = '[object Array]',
17740 boolTag = '[object Boolean]',
17741 dateTag = '[object Date]',
17742 errorTag = '[object Error]',
17743 funcTag = '[object Function]',
17744 numberTag = '[object Number]',
17745 objectTag = '[object Object]',
17746 regexpTag = '[object RegExp]',
17747 stringTag = '[object String]';
17748
17749/** Used to fix the JScript `[[DontEnum]]` bug. */
17750var shadowProps = [
17751 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',
17752 'toLocaleString', 'toString', 'valueOf'
17753];
17754
17755/** Used for native method references. */
17756var errorProto = Error.prototype,
17757 objectProto = Object.prototype,
17758 stringProto = String.prototype;
17759
17760/** Used to check objects for own properties. */
17761var hasOwnProperty = objectProto.hasOwnProperty;
17762
17763/**
Jian Li83d87a72016-04-20 15:38:24 -070017764 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017765 * of values.
17766 */
17767var objToString = objectProto.toString;
17768
17769/** Used to avoid iterating over non-enumerable properties in IE < 9. */
17770var nonEnumProps = {};
17771nonEnumProps[arrayTag] = nonEnumProps[dateTag] = nonEnumProps[numberTag] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
17772nonEnumProps[boolTag] = nonEnumProps[stringTag] = { 'constructor': true, 'toString': true, 'valueOf': true };
17773nonEnumProps[errorTag] = nonEnumProps[funcTag] = nonEnumProps[regexpTag] = { 'constructor': true, 'toString': true };
17774nonEnumProps[objectTag] = { 'constructor': true };
17775
17776arrayEach(shadowProps, function(key) {
17777 for (var tag in nonEnumProps) {
17778 if (hasOwnProperty.call(nonEnumProps, tag)) {
17779 var props = nonEnumProps[tag];
17780 props[key] = hasOwnProperty.call(props, key);
17781 }
17782 }
17783});
17784
17785/**
17786 * Creates an array of the own and inherited enumerable property names of `object`.
17787 *
17788 * **Note:** Non-object values are coerced to objects.
17789 *
17790 * @static
17791 * @memberOf _
17792 * @category Object
17793 * @param {Object} object The object to query.
17794 * @returns {Array} Returns the array of property names.
17795 * @example
17796 *
17797 * function Foo() {
17798 * this.a = 1;
17799 * this.b = 2;
17800 * }
17801 *
17802 * Foo.prototype.c = 3;
17803 *
17804 * _.keysIn(new Foo);
17805 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
17806 */
17807function keysIn(object) {
17808 if (object == null) {
17809 return [];
17810 }
17811 if (!isObject(object)) {
17812 object = Object(object);
17813 }
17814 var length = object.length;
17815
17816 length = (length && isLength(length) &&
17817 (isArray(object) || isArguments(object) || isString(object)) && length) || 0;
17818
17819 var Ctor = object.constructor,
17820 index = -1,
17821 proto = (isFunction(Ctor) && Ctor.prototype) || objectProto,
17822 isProto = proto === object,
17823 result = Array(length),
17824 skipIndexes = length > 0,
17825 skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error),
17826 skipProto = support.enumPrototypes && isFunction(object);
17827
17828 while (++index < length) {
17829 result[index] = (index + '');
17830 }
Jian Li83d87a72016-04-20 15:38:24 -070017831 // lodash skips the `constructor` property when it infers it's iterating
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017832 // over a `prototype` object because IE < 9 can't set the `[[Enumerable]]`
17833 // attribute of an existing property and the `constructor` property of a
17834 // prototype defaults to non-enumerable.
17835 for (var key in object) {
17836 if (!(skipProto && key == 'prototype') &&
17837 !(skipErrorProps && (key == 'message' || key == 'name')) &&
17838 !(skipIndexes && isIndex(key, length)) &&
17839 !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
17840 result.push(key);
17841 }
17842 }
17843 if (support.nonEnumShadows && object !== objectProto) {
17844 var tag = object === stringProto ? stringTag : (object === errorProto ? errorTag : objToString.call(object)),
17845 nonEnums = nonEnumProps[tag] || nonEnumProps[objectTag];
17846
17847 if (tag == objectTag) {
17848 proto = objectProto;
17849 }
17850 length = shadowProps.length;
17851 while (length--) {
17852 key = shadowProps[length];
17853 var nonEnum = nonEnums[key];
17854 if (!(isProto && nonEnum) &&
17855 (nonEnum ? hasOwnProperty.call(object, key) : object[key] !== proto[key])) {
17856 result.push(key);
17857 }
17858 }
17859 }
17860 return result;
17861}
17862
17863module.exports = keysIn;
17864
Jian Li8afbbee2016-07-27 19:16:51 +090017865},{"../internal/arrayEach":63,"../internal/isIndex":121,"../internal/isLength":125,"../lang/isArguments":139,"../lang/isArray":140,"../lang/isFunction":142,"../lang/isObject":144,"../lang/isString":146,"../support":153}],151:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017866var keys = require('./keys'),
17867 toObject = require('../internal/toObject');
17868
17869/**
17870 * Creates a two dimensional array of the key-value pairs for `object`,
17871 * e.g. `[[key1, value1], [key2, value2]]`.
17872 *
17873 * @static
17874 * @memberOf _
17875 * @category Object
17876 * @param {Object} object The object to query.
17877 * @returns {Array} Returns the new array of key-value pairs.
17878 * @example
17879 *
17880 * _.pairs({ 'barney': 36, 'fred': 40 });
17881 * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
17882 */
17883function pairs(object) {
17884 object = toObject(object);
17885
17886 var index = -1,
17887 props = keys(object),
17888 length = props.length,
17889 result = Array(length);
17890
17891 while (++index < length) {
17892 var key = props[index];
17893 result[index] = [key, object[key]];
17894 }
17895 return result;
17896}
17897
17898module.exports = pairs;
17899
Jian Li8afbbee2016-07-27 19:16:51 +090017900},{"../internal/toObject":135,"./keys":149}],152:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017901var baseValues = require('../internal/baseValues'),
17902 keys = require('./keys');
17903
17904/**
17905 * Creates an array of the own enumerable property values of `object`.
17906 *
17907 * **Note:** Non-object values are coerced to objects.
17908 *
17909 * @static
17910 * @memberOf _
17911 * @category Object
17912 * @param {Object} object The object to query.
17913 * @returns {Array} Returns the array of property values.
17914 * @example
17915 *
17916 * function Foo() {
17917 * this.a = 1;
17918 * this.b = 2;
17919 * }
17920 *
17921 * Foo.prototype.c = 3;
17922 *
17923 * _.values(new Foo);
17924 * // => [1, 2] (iteration order is not guaranteed)
17925 *
17926 * _.values('hi');
17927 * // => ['h', 'i']
17928 */
17929function values(object) {
17930 return baseValues(object, keys(object));
17931}
17932
17933module.exports = values;
17934
Jian Li8afbbee2016-07-27 19:16:51 +090017935},{"../internal/baseValues":91,"./keys":149}],153:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017936/** Used for native method references. */
17937var arrayProto = Array.prototype,
17938 errorProto = Error.prototype,
17939 objectProto = Object.prototype;
17940
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017941/** Native method references. */
17942var propertyIsEnumerable = objectProto.propertyIsEnumerable,
17943 splice = arrayProto.splice;
17944
17945/**
17946 * An object environment feature flags.
17947 *
17948 * @static
17949 * @memberOf _
17950 * @type Object
17951 */
17952var support = {};
17953
17954(function(x) {
17955 var Ctor = function() { this.x = x; },
17956 object = { '0': x, 'length': x },
17957 props = [];
17958
17959 Ctor.prototype = { 'valueOf': x, 'y': x };
17960 for (var key in new Ctor) { props.push(key); }
17961
17962 /**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017963 * Detect if `name` or `message` properties of `Error.prototype` are
17964 * enumerable by default (IE < 9, Safari < 5.1).
17965 *
17966 * @memberOf _.support
17967 * @type boolean
17968 */
17969 support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') ||
17970 propertyIsEnumerable.call(errorProto, 'name');
17971
17972 /**
17973 * Detect if `prototype` properties are enumerable by default.
17974 *
17975 * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1
17976 * (if the prototype or a property on the prototype has been set)
17977 * incorrectly set the `[[Enumerable]]` value of a function's `prototype`
17978 * property to `true`.
17979 *
17980 * @memberOf _.support
17981 * @type boolean
17982 */
17983 support.enumPrototypes = propertyIsEnumerable.call(Ctor, 'prototype');
17984
17985 /**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070017986 * Detect if properties shadowing those on `Object.prototype` are non-enumerable.
17987 *
17988 * In IE < 9 an object's own properties, shadowing non-enumerable ones,
17989 * are made non-enumerable as well (a.k.a the JScript `[[DontEnum]]` bug).
17990 *
17991 * @memberOf _.support
17992 * @type boolean
17993 */
17994 support.nonEnumShadows = !/valueOf/.test(props);
17995
17996 /**
17997 * Detect if own properties are iterated after inherited properties (IE < 9).
17998 *
17999 * @memberOf _.support
18000 * @type boolean
18001 */
18002 support.ownLast = props[0] != 'x';
18003
18004 /**
18005 * Detect if `Array#shift` and `Array#splice` augment array-like objects
18006 * correctly.
18007 *
18008 * Firefox < 10, compatibility modes of IE 8, and IE < 9 have buggy Array
18009 * `shift()` and `splice()` functions that fail to remove the last element,
18010 * `value[0]`, of array-like objects even though the "length" property is
18011 * set to `0`. The `shift()` method is buggy in compatibility modes of IE 8,
18012 * while `splice()` is buggy regardless of mode in IE < 9.
18013 *
18014 * @memberOf _.support
18015 * @type boolean
18016 */
18017 support.spliceObjects = (splice.call(object, 0, 1), !object[0]);
18018
18019 /**
18020 * Detect lack of support for accessing string characters by index.
18021 *
18022 * IE < 8 can't access characters by index. IE 8 can only access characters
18023 * by index on string literals, not string objects.
18024 *
18025 * @memberOf _.support
18026 * @type boolean
18027 */
18028 support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070018029}(1, 0));
18030
18031module.exports = support;
18032
Jian Li8afbbee2016-07-27 19:16:51 +090018033},{}],154:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070018034/**
18035 * This method returns the first argument provided to it.
18036 *
18037 * @static
18038 * @memberOf _
18039 * @category Utility
18040 * @param {*} value Any value.
18041 * @returns {*} Returns `value`.
18042 * @example
18043 *
18044 * var object = { 'user': 'fred' };
18045 *
18046 * _.identity(object) === object;
18047 * // => true
18048 */
18049function identity(value) {
18050 return value;
18051}
18052
18053module.exports = identity;
18054
Jian Li8afbbee2016-07-27 19:16:51 +090018055},{}],155:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070018056/**
18057 * A no-operation function that returns `undefined` regardless of the
18058 * arguments it receives.
18059 *
18060 * @static
18061 * @memberOf _
18062 * @category Utility
18063 * @example
18064 *
18065 * var object = { 'user': 'fred' };
18066 *
18067 * _.noop(object) === undefined;
18068 * // => true
18069 */
18070function noop() {
18071 // No operation performed.
18072}
18073
18074module.exports = noop;
18075
Jian Li8afbbee2016-07-27 19:16:51 +090018076},{}],156:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070018077var baseProperty = require('../internal/baseProperty'),
18078 basePropertyDeep = require('../internal/basePropertyDeep'),
18079 isKey = require('../internal/isKey');
18080
18081/**
18082 * Creates a function that returns the property value at `path` on a
18083 * given object.
18084 *
18085 * @static
18086 * @memberOf _
18087 * @category Utility
18088 * @param {Array|string} path The path of the property to get.
18089 * @returns {Function} Returns the new function.
18090 * @example
18091 *
18092 * var objects = [
18093 * { 'a': { 'b': { 'c': 2 } } },
18094 * { 'a': { 'b': { 'c': 1 } } }
18095 * ];
18096 *
18097 * _.map(objects, _.property('a.b.c'));
18098 * // => [2, 1]
18099 *
18100 * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
18101 * // => [1, 2]
18102 */
18103function property(path) {
18104 return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
18105}
18106
18107module.exports = property;
18108
Jian Li8afbbee2016-07-27 19:16:51 +090018109},{"../internal/baseProperty":86,"../internal/basePropertyDeep":87,"../internal/isKey":123}],157:[function(require,module,exports){
Jian Li83d87a72016-04-20 15:38:24 -070018110(function (process){
18111// vim:ts=4:sts=4:sw=4:
18112/*!
18113 *
18114 * Copyright 2009-2012 Kris Kowal under the terms of the MIT
18115 * license found at http://github.com/kriskowal/q/raw/master/LICENSE
18116 *
18117 * With parts by Tyler Close
18118 * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found
18119 * at http://www.opensource.org/licenses/mit-license.html
18120 * Forked at ref_send.js version: 2009-05-11
18121 *
18122 * With parts by Mark Miller
18123 * Copyright (C) 2011 Google Inc.
18124 *
18125 * Licensed under the Apache License, Version 2.0 (the "License");
18126 * you may not use this file except in compliance with the License.
18127 * You may obtain a copy of the License at
18128 *
18129 * http://www.apache.org/licenses/LICENSE-2.0
18130 *
18131 * Unless required by applicable law or agreed to in writing, software
18132 * distributed under the License is distributed on an "AS IS" BASIS,
18133 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18134 * See the License for the specific language governing permissions and
18135 * limitations under the License.
18136 *
18137 */
18138
18139(function (definition) {
18140 "use strict";
18141
18142 // This file will function properly as a <script> tag, or a module
18143 // using CommonJS and NodeJS or RequireJS module formats. In
18144 // Common/Node/RequireJS, the module exports the Q API and when
18145 // executed as a simple <script>, it creates a Q global instead.
18146
18147 // Montage Require
18148 if (typeof bootstrap === "function") {
18149 bootstrap("promise", definition);
18150
18151 // CommonJS
18152 } else if (typeof exports === "object" && typeof module === "object") {
18153 module.exports = definition();
18154
18155 // RequireJS
18156 } else if (typeof define === "function" && define.amd) {
18157 define(definition);
18158
18159 // SES (Secure EcmaScript)
18160 } else if (typeof ses !== "undefined") {
18161 if (!ses.ok()) {
18162 return;
18163 } else {
18164 ses.makeQ = definition;
18165 }
18166
18167 // <script>
18168 } else if (typeof window !== "undefined" || typeof self !== "undefined") {
18169 // Prefer window over self for add-on scripts. Use self for
18170 // non-windowed contexts.
18171 var global = typeof window !== "undefined" ? window : self;
18172
18173 // Get the `window` object, save the previous Q global
18174 // and initialize Q as a global.
18175 var previousQ = global.Q;
18176 global.Q = definition();
18177
18178 // Add a noConflict function so Q can be removed from the
18179 // global namespace.
18180 global.Q.noConflict = function () {
18181 global.Q = previousQ;
18182 return this;
18183 };
18184
18185 } else {
18186 throw new Error("This environment was not anticipated by Q. Please file a bug.");
18187 }
18188
18189})(function () {
18190"use strict";
18191
18192var hasStacks = false;
18193try {
18194 throw new Error();
18195} catch (e) {
18196 hasStacks = !!e.stack;
18197}
18198
18199// All code after this point will be filtered from stack traces reported
18200// by Q.
18201var qStartingLine = captureLine();
18202var qFileName;
18203
18204// shims
18205
18206// used for fallback in "allResolved"
18207var noop = function () {};
18208
18209// Use the fastest possible means to execute a task in a future turn
18210// of the event loop.
18211var nextTick =(function () {
18212 // linked list of tasks (single, with head node)
18213 var head = {task: void 0, next: null};
18214 var tail = head;
18215 var flushing = false;
18216 var requestTick = void 0;
18217 var isNodeJS = false;
18218 // queue for late tasks, used by unhandled rejection tracking
18219 var laterQueue = [];
18220
18221 function flush() {
18222 /* jshint loopfunc: true */
18223 var task, domain;
18224
18225 while (head.next) {
18226 head = head.next;
18227 task = head.task;
18228 head.task = void 0;
18229 domain = head.domain;
18230
18231 if (domain) {
18232 head.domain = void 0;
18233 domain.enter();
18234 }
18235 runSingle(task, domain);
18236
18237 }
18238 while (laterQueue.length) {
18239 task = laterQueue.pop();
18240 runSingle(task);
18241 }
18242 flushing = false;
18243 }
18244 // runs a single function in the async queue
18245 function runSingle(task, domain) {
18246 try {
18247 task();
18248
18249 } catch (e) {
18250 if (isNodeJS) {
18251 // In node, uncaught exceptions are considered fatal errors.
18252 // Re-throw them synchronously to interrupt flushing!
18253
18254 // Ensure continuation if the uncaught exception is suppressed
18255 // listening "uncaughtException" events (as domains does).
18256 // Continue in next event to avoid tick recursion.
18257 if (domain) {
18258 domain.exit();
18259 }
18260 setTimeout(flush, 0);
18261 if (domain) {
18262 domain.enter();
18263 }
18264
18265 throw e;
18266
18267 } else {
18268 // In browsers, uncaught exceptions are not fatal.
18269 // Re-throw them asynchronously to avoid slow-downs.
18270 setTimeout(function () {
18271 throw e;
18272 }, 0);
18273 }
18274 }
18275
18276 if (domain) {
18277 domain.exit();
18278 }
18279 }
18280
18281 nextTick = function (task) {
18282 tail = tail.next = {
18283 task: task,
18284 domain: isNodeJS && process.domain,
18285 next: null
18286 };
18287
18288 if (!flushing) {
18289 flushing = true;
18290 requestTick();
18291 }
18292 };
18293
18294 if (typeof process === "object" &&
18295 process.toString() === "[object process]" && process.nextTick) {
18296 // Ensure Q is in a real Node environment, with a `process.nextTick`.
18297 // To see through fake Node environments:
18298 // * Mocha test runner - exposes a `process` global without a `nextTick`
18299 // * Browserify - exposes a `process.nexTick` function that uses
18300 // `setTimeout`. In this case `setImmediate` is preferred because
18301 // it is faster. Browserify's `process.toString()` yields
18302 // "[object Object]", while in a real Node environment
18303 // `process.nextTick()` yields "[object process]".
18304 isNodeJS = true;
18305
18306 requestTick = function () {
18307 process.nextTick(flush);
18308 };
18309
18310 } else if (typeof setImmediate === "function") {
18311 // In IE10, Node.js 0.9+, or https://github.com/NobleJS/setImmediate
18312 if (typeof window !== "undefined") {
18313 requestTick = setImmediate.bind(window, flush);
18314 } else {
18315 requestTick = function () {
18316 setImmediate(flush);
18317 };
18318 }
18319
18320 } else if (typeof MessageChannel !== "undefined") {
18321 // modern browsers
18322 // http://www.nonblocking.io/2011/06/windownexttick.html
18323 var channel = new MessageChannel();
18324 // At least Safari Version 6.0.5 (8536.30.1) intermittently cannot create
18325 // working message ports the first time a page loads.
18326 channel.port1.onmessage = function () {
18327 requestTick = requestPortTick;
18328 channel.port1.onmessage = flush;
18329 flush();
18330 };
18331 var requestPortTick = function () {
18332 // Opera requires us to provide a message payload, regardless of
18333 // whether we use it.
18334 channel.port2.postMessage(0);
18335 };
18336 requestTick = function () {
18337 setTimeout(flush, 0);
18338 requestPortTick();
18339 };
18340
18341 } else {
18342 // old browsers
18343 requestTick = function () {
18344 setTimeout(flush, 0);
18345 };
18346 }
18347 // runs a task after all other tasks have been run
18348 // this is useful for unhandled rejection tracking that needs to happen
18349 // after all `then`d tasks have been run.
18350 nextTick.runAfter = function (task) {
18351 laterQueue.push(task);
18352 if (!flushing) {
18353 flushing = true;
18354 requestTick();
18355 }
18356 };
18357 return nextTick;
18358})();
18359
18360// Attempt to make generics safe in the face of downstream
18361// modifications.
18362// There is no situation where this is necessary.
18363// If you need a security guarantee, these primordials need to be
18364// deeply frozen anyway, and if you don’t need a security guarantee,
18365// this is just plain paranoid.
18366// However, this **might** have the nice side-effect of reducing the size of
18367// the minified code by reducing x.call() to merely x()
18368// See Mark Miller’s explanation of what this does.
18369// http://wiki.ecmascript.org/doku.php?id=conventions:safe_meta_programming
18370var call = Function.call;
18371function uncurryThis(f) {
18372 return function () {
18373 return call.apply(f, arguments);
18374 };
18375}
18376// This is equivalent, but slower:
18377// uncurryThis = Function_bind.bind(Function_bind.call);
18378// http://jsperf.com/uncurrythis
18379
18380var array_slice = uncurryThis(Array.prototype.slice);
18381
18382var array_reduce = uncurryThis(
18383 Array.prototype.reduce || function (callback, basis) {
18384 var index = 0,
18385 length = this.length;
18386 // concerning the initial value, if one is not provided
18387 if (arguments.length === 1) {
18388 // seek to the first value in the array, accounting
18389 // for the possibility that is is a sparse array
18390 do {
18391 if (index in this) {
18392 basis = this[index++];
18393 break;
18394 }
18395 if (++index >= length) {
18396 throw new TypeError();
18397 }
18398 } while (1);
18399 }
18400 // reduce
18401 for (; index < length; index++) {
18402 // account for the possibility that the array is sparse
18403 if (index in this) {
18404 basis = callback(basis, this[index], index);
18405 }
18406 }
18407 return basis;
18408 }
18409);
18410
18411var array_indexOf = uncurryThis(
18412 Array.prototype.indexOf || function (value) {
18413 // not a very good shim, but good enough for our one use of it
18414 for (var i = 0; i < this.length; i++) {
18415 if (this[i] === value) {
18416 return i;
18417 }
18418 }
18419 return -1;
18420 }
18421);
18422
18423var array_map = uncurryThis(
18424 Array.prototype.map || function (callback, thisp) {
18425 var self = this;
18426 var collect = [];
18427 array_reduce(self, function (undefined, value, index) {
18428 collect.push(callback.call(thisp, value, index, self));
18429 }, void 0);
18430 return collect;
18431 }
18432);
18433
18434var object_create = Object.create || function (prototype) {
18435 function Type() { }
18436 Type.prototype = prototype;
18437 return new Type();
18438};
18439
18440var object_hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);
18441
18442var object_keys = Object.keys || function (object) {
18443 var keys = [];
18444 for (var key in object) {
18445 if (object_hasOwnProperty(object, key)) {
18446 keys.push(key);
18447 }
18448 }
18449 return keys;
18450};
18451
18452var object_toString = uncurryThis(Object.prototype.toString);
18453
18454function isObject(value) {
18455 return value === Object(value);
18456}
18457
18458// generator related shims
18459
18460// FIXME: Remove this function once ES6 generators are in SpiderMonkey.
18461function isStopIteration(exception) {
18462 return (
18463 object_toString(exception) === "[object StopIteration]" ||
18464 exception instanceof QReturnValue
18465 );
18466}
18467
18468// FIXME: Remove this helper and Q.return once ES6 generators are in
18469// SpiderMonkey.
18470var QReturnValue;
18471if (typeof ReturnValue !== "undefined") {
18472 QReturnValue = ReturnValue;
18473} else {
18474 QReturnValue = function (value) {
18475 this.value = value;
18476 };
18477}
18478
18479// long stack traces
18480
18481var STACK_JUMP_SEPARATOR = "From previous event:";
18482
18483function makeStackTraceLong(error, promise) {
18484 // If possible, transform the error stack trace by removing Node and Q
18485 // cruft, then concatenating with the stack trace of `promise`. See #57.
18486 if (hasStacks &&
18487 promise.stack &&
18488 typeof error === "object" &&
18489 error !== null &&
18490 error.stack &&
18491 error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
18492 ) {
18493 var stacks = [];
18494 for (var p = promise; !!p; p = p.source) {
18495 if (p.stack) {
18496 stacks.unshift(p.stack);
18497 }
18498 }
18499 stacks.unshift(error.stack);
18500
18501 var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
18502 error.stack = filterStackString(concatedStacks);
18503 }
18504}
18505
18506function filterStackString(stackString) {
18507 var lines = stackString.split("\n");
18508 var desiredLines = [];
18509 for (var i = 0; i < lines.length; ++i) {
18510 var line = lines[i];
18511
18512 if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
18513 desiredLines.push(line);
18514 }
18515 }
18516 return desiredLines.join("\n");
18517}
18518
18519function isNodeFrame(stackLine) {
18520 return stackLine.indexOf("(module.js:") !== -1 ||
18521 stackLine.indexOf("(node.js:") !== -1;
18522}
18523
18524function getFileNameAndLineNumber(stackLine) {
18525 // Named functions: "at functionName (filename:lineNumber:columnNumber)"
18526 // In IE10 function name can have spaces ("Anonymous function") O_o
18527 var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
18528 if (attempt1) {
18529 return [attempt1[1], Number(attempt1[2])];
18530 }
18531
18532 // Anonymous functions: "at filename:lineNumber:columnNumber"
18533 var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
18534 if (attempt2) {
18535 return [attempt2[1], Number(attempt2[2])];
18536 }
18537
18538 // Firefox style: "function@filename:lineNumber or @filename:lineNumber"
18539 var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
18540 if (attempt3) {
18541 return [attempt3[1], Number(attempt3[2])];
18542 }
18543}
18544
18545function isInternalFrame(stackLine) {
18546 var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
18547
18548 if (!fileNameAndLineNumber) {
18549 return false;
18550 }
18551
18552 var fileName = fileNameAndLineNumber[0];
18553 var lineNumber = fileNameAndLineNumber[1];
18554
18555 return fileName === qFileName &&
18556 lineNumber >= qStartingLine &&
18557 lineNumber <= qEndingLine;
18558}
18559
18560// discover own file name and line number range for filtering stack
18561// traces
18562function captureLine() {
18563 if (!hasStacks) {
18564 return;
18565 }
18566
18567 try {
18568 throw new Error();
18569 } catch (e) {
18570 var lines = e.stack.split("\n");
18571 var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
18572 var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
18573 if (!fileNameAndLineNumber) {
18574 return;
18575 }
18576
18577 qFileName = fileNameAndLineNumber[0];
18578 return fileNameAndLineNumber[1];
18579 }
18580}
18581
18582function deprecate(callback, name, alternative) {
18583 return function () {
18584 if (typeof console !== "undefined" &&
18585 typeof console.warn === "function") {
18586 console.warn(name + " is deprecated, use " + alternative +
18587 " instead.", new Error("").stack);
18588 }
18589 return callback.apply(callback, arguments);
18590 };
18591}
18592
18593// end of shims
18594// beginning of real work
18595
18596/**
18597 * Constructs a promise for an immediate reference, passes promises through, or
18598 * coerces promises from different systems.
18599 * @param value immediate reference or promise
18600 */
18601function Q(value) {
18602 // If the object is already a Promise, return it directly. This enables
18603 // the resolve function to both be used to created references from objects,
18604 // but to tolerably coerce non-promises to promises.
18605 if (value instanceof Promise) {
18606 return value;
18607 }
18608
18609 // assimilate thenables
18610 if (isPromiseAlike(value)) {
18611 return coerce(value);
18612 } else {
18613 return fulfill(value);
18614 }
18615}
18616Q.resolve = Q;
18617
18618/**
18619 * Performs a task in a future turn of the event loop.
18620 * @param {Function} task
18621 */
18622Q.nextTick = nextTick;
18623
18624/**
18625 * Controls whether or not long stack traces will be on
18626 */
18627Q.longStackSupport = false;
18628
18629// enable long stacks if Q_DEBUG is set
18630if (typeof process === "object" && process && process.env && process.env.Q_DEBUG) {
18631 Q.longStackSupport = true;
18632}
18633
18634/**
18635 * Constructs a {promise, resolve, reject} object.
18636 *
18637 * `resolve` is a callback to invoke with a more resolved value for the
18638 * promise. To fulfill the promise, invoke `resolve` with any value that is
18639 * not a thenable. To reject the promise, invoke `resolve` with a rejected
18640 * thenable, or invoke `reject` with the reason directly. To resolve the
18641 * promise to another thenable, thus putting it in the same state, invoke
18642 * `resolve` with that other thenable.
18643 */
18644Q.defer = defer;
18645function defer() {
18646 // if "messages" is an "Array", that indicates that the promise has not yet
18647 // been resolved. If it is "undefined", it has been resolved. Each
18648 // element of the messages array is itself an array of complete arguments to
18649 // forward to the resolved promise. We coerce the resolution value to a
18650 // promise using the `resolve` function because it handles both fully
18651 // non-thenable values and other thenables gracefully.
18652 var messages = [], progressListeners = [], resolvedPromise;
18653
18654 var deferred = object_create(defer.prototype);
18655 var promise = object_create(Promise.prototype);
18656
18657 promise.promiseDispatch = function (resolve, op, operands) {
18658 var args = array_slice(arguments);
18659 if (messages) {
18660 messages.push(args);
18661 if (op === "when" && operands[1]) { // progress operand
18662 progressListeners.push(operands[1]);
18663 }
18664 } else {
18665 Q.nextTick(function () {
18666 resolvedPromise.promiseDispatch.apply(resolvedPromise, args);
18667 });
18668 }
18669 };
18670
18671 // XXX deprecated
18672 promise.valueOf = function () {
18673 if (messages) {
18674 return promise;
18675 }
18676 var nearerValue = nearer(resolvedPromise);
18677 if (isPromise(nearerValue)) {
18678 resolvedPromise = nearerValue; // shorten chain
18679 }
18680 return nearerValue;
18681 };
18682
18683 promise.inspect = function () {
18684 if (!resolvedPromise) {
18685 return { state: "pending" };
18686 }
18687 return resolvedPromise.inspect();
18688 };
18689
18690 if (Q.longStackSupport && hasStacks) {
18691 try {
18692 throw new Error();
18693 } catch (e) {
18694 // NOTE: don't try to use `Error.captureStackTrace` or transfer the
18695 // accessor around; that causes memory leaks as per GH-111. Just
18696 // reify the stack trace as a string ASAP.
18697 //
18698 // At the same time, cut off the first line; it's always just
18699 // "[object Promise]\n", as per the `toString`.
18700 promise.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
18701 }
18702 }
18703
18704 // NOTE: we do the checks for `resolvedPromise` in each method, instead of
18705 // consolidating them into `become`, since otherwise we'd create new
18706 // promises with the lines `become(whatever(value))`. See e.g. GH-252.
18707
18708 function become(newPromise) {
18709 resolvedPromise = newPromise;
18710 promise.source = newPromise;
18711
18712 array_reduce(messages, function (undefined, message) {
18713 Q.nextTick(function () {
18714 newPromise.promiseDispatch.apply(newPromise, message);
18715 });
18716 }, void 0);
18717
18718 messages = void 0;
18719 progressListeners = void 0;
18720 }
18721
18722 deferred.promise = promise;
18723 deferred.resolve = function (value) {
18724 if (resolvedPromise) {
18725 return;
18726 }
18727
18728 become(Q(value));
18729 };
18730
18731 deferred.fulfill = function (value) {
18732 if (resolvedPromise) {
18733 return;
18734 }
18735
18736 become(fulfill(value));
18737 };
18738 deferred.reject = function (reason) {
18739 if (resolvedPromise) {
18740 return;
18741 }
18742
18743 become(reject(reason));
18744 };
18745 deferred.notify = function (progress) {
18746 if (resolvedPromise) {
18747 return;
18748 }
18749
18750 array_reduce(progressListeners, function (undefined, progressListener) {
18751 Q.nextTick(function () {
18752 progressListener(progress);
18753 });
18754 }, void 0);
18755 };
18756
18757 return deferred;
18758}
18759
18760/**
18761 * Creates a Node-style callback that will resolve or reject the deferred
18762 * promise.
18763 * @returns a nodeback
18764 */
18765defer.prototype.makeNodeResolver = function () {
18766 var self = this;
18767 return function (error, value) {
18768 if (error) {
18769 self.reject(error);
18770 } else if (arguments.length > 2) {
18771 self.resolve(array_slice(arguments, 1));
18772 } else {
18773 self.resolve(value);
18774 }
18775 };
18776};
18777
18778/**
18779 * @param resolver {Function} a function that returns nothing and accepts
18780 * the resolve, reject, and notify functions for a deferred.
18781 * @returns a promise that may be resolved with the given resolve and reject
18782 * functions, or rejected by a thrown exception in resolver
18783 */
18784Q.Promise = promise; // ES6
18785Q.promise = promise;
18786function promise(resolver) {
18787 if (typeof resolver !== "function") {
18788 throw new TypeError("resolver must be a function.");
18789 }
18790 var deferred = defer();
18791 try {
18792 resolver(deferred.resolve, deferred.reject, deferred.notify);
18793 } catch (reason) {
18794 deferred.reject(reason);
18795 }
18796 return deferred.promise;
18797}
18798
18799promise.race = race; // ES6
18800promise.all = all; // ES6
18801promise.reject = reject; // ES6
18802promise.resolve = Q; // ES6
18803
18804// XXX experimental. This method is a way to denote that a local value is
18805// serializable and should be immediately dispatched to a remote upon request,
18806// instead of passing a reference.
18807Q.passByCopy = function (object) {
18808 //freeze(object);
18809 //passByCopies.set(object, true);
18810 return object;
18811};
18812
18813Promise.prototype.passByCopy = function () {
18814 //freeze(object);
18815 //passByCopies.set(object, true);
18816 return this;
18817};
18818
18819/**
18820 * If two promises eventually fulfill to the same value, promises that value,
18821 * but otherwise rejects.
18822 * @param x {Any*}
18823 * @param y {Any*}
18824 * @returns {Any*} a promise for x and y if they are the same, but a rejection
18825 * otherwise.
18826 *
18827 */
18828Q.join = function (x, y) {
18829 return Q(x).join(y);
18830};
18831
18832Promise.prototype.join = function (that) {
18833 return Q([this, that]).spread(function (x, y) {
18834 if (x === y) {
18835 // TODO: "===" should be Object.is or equiv
18836 return x;
18837 } else {
18838 throw new Error("Can't join: not the same: " + x + " " + y);
18839 }
18840 });
18841};
18842
18843/**
18844 * Returns a promise for the first of an array of promises to become settled.
18845 * @param answers {Array[Any*]} promises to race
18846 * @returns {Any*} the first promise to be settled
18847 */
18848Q.race = race;
18849function race(answerPs) {
18850 return promise(function (resolve, reject) {
18851 // Switch to this once we can assume at least ES5
18852 // answerPs.forEach(function (answerP) {
18853 // Q(answerP).then(resolve, reject);
18854 // });
18855 // Use this in the meantime
18856 for (var i = 0, len = answerPs.length; i < len; i++) {
18857 Q(answerPs[i]).then(resolve, reject);
18858 }
18859 });
18860}
18861
18862Promise.prototype.race = function () {
18863 return this.then(Q.race);
18864};
18865
18866/**
18867 * Constructs a Promise with a promise descriptor object and optional fallback
18868 * function. The descriptor contains methods like when(rejected), get(name),
18869 * set(name, value), post(name, args), and delete(name), which all
18870 * return either a value, a promise for a value, or a rejection. The fallback
18871 * accepts the operation name, a resolver, and any further arguments that would
18872 * have been forwarded to the appropriate method above had a method been
18873 * provided with the proper name. The API makes no guarantees about the nature
18874 * of the returned object, apart from that it is usable whereever promises are
18875 * bought and sold.
18876 */
18877Q.makePromise = Promise;
18878function Promise(descriptor, fallback, inspect) {
18879 if (fallback === void 0) {
18880 fallback = function (op) {
18881 return reject(new Error(
18882 "Promise does not support operation: " + op
18883 ));
18884 };
18885 }
18886 if (inspect === void 0) {
18887 inspect = function () {
18888 return {state: "unknown"};
18889 };
18890 }
18891
18892 var promise = object_create(Promise.prototype);
18893
18894 promise.promiseDispatch = function (resolve, op, args) {
18895 var result;
18896 try {
18897 if (descriptor[op]) {
18898 result = descriptor[op].apply(promise, args);
18899 } else {
18900 result = fallback.call(promise, op, args);
18901 }
18902 } catch (exception) {
18903 result = reject(exception);
18904 }
18905 if (resolve) {
18906 resolve(result);
18907 }
18908 };
18909
18910 promise.inspect = inspect;
18911
18912 // XXX deprecated `valueOf` and `exception` support
18913 if (inspect) {
18914 var inspected = inspect();
18915 if (inspected.state === "rejected") {
18916 promise.exception = inspected.reason;
18917 }
18918
18919 promise.valueOf = function () {
18920 var inspected = inspect();
18921 if (inspected.state === "pending" ||
18922 inspected.state === "rejected") {
18923 return promise;
18924 }
18925 return inspected.value;
18926 };
18927 }
18928
18929 return promise;
18930}
18931
18932Promise.prototype.toString = function () {
18933 return "[object Promise]";
18934};
18935
18936Promise.prototype.then = function (fulfilled, rejected, progressed) {
18937 var self = this;
18938 var deferred = defer();
18939 var done = false; // ensure the untrusted promise makes at most a
18940 // single call to one of the callbacks
18941
18942 function _fulfilled(value) {
18943 try {
18944 return typeof fulfilled === "function" ? fulfilled(value) : value;
18945 } catch (exception) {
18946 return reject(exception);
18947 }
18948 }
18949
18950 function _rejected(exception) {
18951 if (typeof rejected === "function") {
18952 makeStackTraceLong(exception, self);
18953 try {
18954 return rejected(exception);
18955 } catch (newException) {
18956 return reject(newException);
18957 }
18958 }
18959 return reject(exception);
18960 }
18961
18962 function _progressed(value) {
18963 return typeof progressed === "function" ? progressed(value) : value;
18964 }
18965
18966 Q.nextTick(function () {
18967 self.promiseDispatch(function (value) {
18968 if (done) {
18969 return;
18970 }
18971 done = true;
18972
18973 deferred.resolve(_fulfilled(value));
18974 }, "when", [function (exception) {
18975 if (done) {
18976 return;
18977 }
18978 done = true;
18979
18980 deferred.resolve(_rejected(exception));
18981 }]);
18982 });
18983
18984 // Progress propagator need to be attached in the current tick.
18985 self.promiseDispatch(void 0, "when", [void 0, function (value) {
18986 var newValue;
18987 var threw = false;
18988 try {
18989 newValue = _progressed(value);
18990 } catch (e) {
18991 threw = true;
18992 if (Q.onerror) {
18993 Q.onerror(e);
18994 } else {
18995 throw e;
18996 }
18997 }
18998
18999 if (!threw) {
19000 deferred.notify(newValue);
19001 }
19002 }]);
19003
19004 return deferred.promise;
19005};
19006
19007Q.tap = function (promise, callback) {
19008 return Q(promise).tap(callback);
19009};
19010
19011/**
19012 * Works almost like "finally", but not called for rejections.
19013 * Original resolution value is passed through callback unaffected.
19014 * Callback may return a promise that will be awaited for.
19015 * @param {Function} callback
19016 * @returns {Q.Promise}
19017 * @example
19018 * doSomething()
19019 * .then(...)
19020 * .tap(console.log)
19021 * .then(...);
19022 */
19023Promise.prototype.tap = function (callback) {
19024 callback = Q(callback);
19025
19026 return this.then(function (value) {
19027 return callback.fcall(value).thenResolve(value);
19028 });
19029};
19030
19031/**
19032 * Registers an observer on a promise.
19033 *
19034 * Guarantees:
19035 *
19036 * 1. that fulfilled and rejected will be called only once.
19037 * 2. that either the fulfilled callback or the rejected callback will be
19038 * called, but not both.
19039 * 3. that fulfilled and rejected will not be called in this turn.
19040 *
19041 * @param value promise or immediate reference to observe
19042 * @param fulfilled function to be called with the fulfilled value
19043 * @param rejected function to be called with the rejection exception
19044 * @param progressed function to be called on any progress notifications
19045 * @return promise for the return value from the invoked callback
19046 */
19047Q.when = when;
19048function when(value, fulfilled, rejected, progressed) {
19049 return Q(value).then(fulfilled, rejected, progressed);
19050}
19051
19052Promise.prototype.thenResolve = function (value) {
19053 return this.then(function () { return value; });
19054};
19055
19056Q.thenResolve = function (promise, value) {
19057 return Q(promise).thenResolve(value);
19058};
19059
19060Promise.prototype.thenReject = function (reason) {
19061 return this.then(function () { throw reason; });
19062};
19063
19064Q.thenReject = function (promise, reason) {
19065 return Q(promise).thenReject(reason);
19066};
19067
19068/**
19069 * If an object is not a promise, it is as "near" as possible.
19070 * If a promise is rejected, it is as "near" as possible too.
19071 * If it’s a fulfilled promise, the fulfillment value is nearer.
19072 * If it’s a deferred promise and the deferred has been resolved, the
19073 * resolution is "nearer".
19074 * @param object
19075 * @returns most resolved (nearest) form of the object
19076 */
19077
19078// XXX should we re-do this?
19079Q.nearer = nearer;
19080function nearer(value) {
19081 if (isPromise(value)) {
19082 var inspected = value.inspect();
19083 if (inspected.state === "fulfilled") {
19084 return inspected.value;
19085 }
19086 }
19087 return value;
19088}
19089
19090/**
19091 * @returns whether the given object is a promise.
19092 * Otherwise it is a fulfilled value.
19093 */
19094Q.isPromise = isPromise;
19095function isPromise(object) {
19096 return object instanceof Promise;
19097}
19098
19099Q.isPromiseAlike = isPromiseAlike;
19100function isPromiseAlike(object) {
19101 return isObject(object) && typeof object.then === "function";
19102}
19103
19104/**
19105 * @returns whether the given object is a pending promise, meaning not
19106 * fulfilled or rejected.
19107 */
19108Q.isPending = isPending;
19109function isPending(object) {
19110 return isPromise(object) && object.inspect().state === "pending";
19111}
19112
19113Promise.prototype.isPending = function () {
19114 return this.inspect().state === "pending";
19115};
19116
19117/**
19118 * @returns whether the given object is a value or fulfilled
19119 * promise.
19120 */
19121Q.isFulfilled = isFulfilled;
19122function isFulfilled(object) {
19123 return !isPromise(object) || object.inspect().state === "fulfilled";
19124}
19125
19126Promise.prototype.isFulfilled = function () {
19127 return this.inspect().state === "fulfilled";
19128};
19129
19130/**
19131 * @returns whether the given object is a rejected promise.
19132 */
19133Q.isRejected = isRejected;
19134function isRejected(object) {
19135 return isPromise(object) && object.inspect().state === "rejected";
19136}
19137
19138Promise.prototype.isRejected = function () {
19139 return this.inspect().state === "rejected";
19140};
19141
19142//// BEGIN UNHANDLED REJECTION TRACKING
19143
19144// This promise library consumes exceptions thrown in handlers so they can be
19145// handled by a subsequent promise. The exceptions get added to this array when
19146// they are created, and removed when they are handled. Note that in ES6 or
19147// shimmed environments, this would naturally be a `Set`.
19148var unhandledReasons = [];
19149var unhandledRejections = [];
19150var reportedUnhandledRejections = [];
19151var trackUnhandledRejections = true;
19152
19153function resetUnhandledRejections() {
19154 unhandledReasons.length = 0;
19155 unhandledRejections.length = 0;
19156
19157 if (!trackUnhandledRejections) {
19158 trackUnhandledRejections = true;
19159 }
19160}
19161
19162function trackRejection(promise, reason) {
19163 if (!trackUnhandledRejections) {
19164 return;
19165 }
19166 if (typeof process === "object" && typeof process.emit === "function") {
19167 Q.nextTick.runAfter(function () {
19168 if (array_indexOf(unhandledRejections, promise) !== -1) {
19169 process.emit("unhandledRejection", reason, promise);
19170 reportedUnhandledRejections.push(promise);
19171 }
19172 });
19173 }
19174
19175 unhandledRejections.push(promise);
19176 if (reason && typeof reason.stack !== "undefined") {
19177 unhandledReasons.push(reason.stack);
19178 } else {
19179 unhandledReasons.push("(no stack) " + reason);
19180 }
19181}
19182
19183function untrackRejection(promise) {
19184 if (!trackUnhandledRejections) {
19185 return;
19186 }
19187
19188 var at = array_indexOf(unhandledRejections, promise);
19189 if (at !== -1) {
19190 if (typeof process === "object" && typeof process.emit === "function") {
19191 Q.nextTick.runAfter(function () {
19192 var atReport = array_indexOf(reportedUnhandledRejections, promise);
19193 if (atReport !== -1) {
19194 process.emit("rejectionHandled", unhandledReasons[at], promise);
19195 reportedUnhandledRejections.splice(atReport, 1);
19196 }
19197 });
19198 }
19199 unhandledRejections.splice(at, 1);
19200 unhandledReasons.splice(at, 1);
19201 }
19202}
19203
19204Q.resetUnhandledRejections = resetUnhandledRejections;
19205
19206Q.getUnhandledReasons = function () {
19207 // Make a copy so that consumers can't interfere with our internal state.
19208 return unhandledReasons.slice();
19209};
19210
19211Q.stopUnhandledRejectionTracking = function () {
19212 resetUnhandledRejections();
19213 trackUnhandledRejections = false;
19214};
19215
19216resetUnhandledRejections();
19217
19218//// END UNHANDLED REJECTION TRACKING
19219
19220/**
19221 * Constructs a rejected promise.
19222 * @param reason value describing the failure
19223 */
19224Q.reject = reject;
19225function reject(reason) {
19226 var rejection = Promise({
19227 "when": function (rejected) {
19228 // note that the error has been handled
19229 if (rejected) {
19230 untrackRejection(this);
19231 }
19232 return rejected ? rejected(reason) : this;
19233 }
19234 }, function fallback() {
19235 return this;
19236 }, function inspect() {
19237 return { state: "rejected", reason: reason };
19238 });
19239
19240 // Note that the reason has not been handled.
19241 trackRejection(rejection, reason);
19242
19243 return rejection;
19244}
19245
19246/**
19247 * Constructs a fulfilled promise for an immediate reference.
19248 * @param value immediate reference
19249 */
19250Q.fulfill = fulfill;
19251function fulfill(value) {
19252 return Promise({
19253 "when": function () {
19254 return value;
19255 },
19256 "get": function (name) {
19257 return value[name];
19258 },
19259 "set": function (name, rhs) {
19260 value[name] = rhs;
19261 },
19262 "delete": function (name) {
19263 delete value[name];
19264 },
19265 "post": function (name, args) {
19266 // Mark Miller proposes that post with no name should apply a
19267 // promised function.
19268 if (name === null || name === void 0) {
19269 return value.apply(void 0, args);
19270 } else {
19271 return value[name].apply(value, args);
19272 }
19273 },
19274 "apply": function (thisp, args) {
19275 return value.apply(thisp, args);
19276 },
19277 "keys": function () {
19278 return object_keys(value);
19279 }
19280 }, void 0, function inspect() {
19281 return { state: "fulfilled", value: value };
19282 });
19283}
19284
19285/**
19286 * Converts thenables to Q promises.
19287 * @param promise thenable promise
19288 * @returns a Q promise
19289 */
19290function coerce(promise) {
19291 var deferred = defer();
19292 Q.nextTick(function () {
19293 try {
19294 promise.then(deferred.resolve, deferred.reject, deferred.notify);
19295 } catch (exception) {
19296 deferred.reject(exception);
19297 }
19298 });
19299 return deferred.promise;
19300}
19301
19302/**
19303 * Annotates an object such that it will never be
19304 * transferred away from this process over any promise
19305 * communication channel.
19306 * @param object
19307 * @returns promise a wrapping of that object that
19308 * additionally responds to the "isDef" message
19309 * without a rejection.
19310 */
19311Q.master = master;
19312function master(object) {
19313 return Promise({
19314 "isDef": function () {}
19315 }, function fallback(op, args) {
19316 return dispatch(object, op, args);
19317 }, function () {
19318 return Q(object).inspect();
19319 });
19320}
19321
19322/**
19323 * Spreads the values of a promised array of arguments into the
19324 * fulfillment callback.
19325 * @param fulfilled callback that receives variadic arguments from the
19326 * promised array
19327 * @param rejected callback that receives the exception if the promise
19328 * is rejected.
19329 * @returns a promise for the return value or thrown exception of
19330 * either callback.
19331 */
19332Q.spread = spread;
19333function spread(value, fulfilled, rejected) {
19334 return Q(value).spread(fulfilled, rejected);
19335}
19336
19337Promise.prototype.spread = function (fulfilled, rejected) {
19338 return this.all().then(function (array) {
19339 return fulfilled.apply(void 0, array);
19340 }, rejected);
19341};
19342
19343/**
19344 * The async function is a decorator for generator functions, turning
19345 * them into asynchronous generators. Although generators are only part
19346 * of the newest ECMAScript 6 drafts, this code does not cause syntax
19347 * errors in older engines. This code should continue to work and will
19348 * in fact improve over time as the language improves.
19349 *
19350 * ES6 generators are currently part of V8 version 3.19 with the
19351 * --harmony-generators runtime flag enabled. SpiderMonkey has had them
19352 * for longer, but under an older Python-inspired form. This function
19353 * works on both kinds of generators.
19354 *
19355 * Decorates a generator function such that:
19356 * - it may yield promises
19357 * - execution will continue when that promise is fulfilled
19358 * - the value of the yield expression will be the fulfilled value
19359 * - it returns a promise for the return value (when the generator
19360 * stops iterating)
19361 * - the decorated function returns a promise for the return value
19362 * of the generator or the first rejected promise among those
19363 * yielded.
19364 * - if an error is thrown in the generator, it propagates through
19365 * every following yield until it is caught, or until it escapes
19366 * the generator function altogether, and is translated into a
19367 * rejection for the promise returned by the decorated generator.
19368 */
19369Q.async = async;
19370function async(makeGenerator) {
19371 return function () {
19372 // when verb is "send", arg is a value
19373 // when verb is "throw", arg is an exception
19374 function continuer(verb, arg) {
19375 var result;
19376
19377 // Until V8 3.19 / Chromium 29 is released, SpiderMonkey is the only
19378 // engine that has a deployed base of browsers that support generators.
19379 // However, SM's generators use the Python-inspired semantics of
19380 // outdated ES6 drafts. We would like to support ES6, but we'd also
19381 // like to make it possible to use generators in deployed browsers, so
19382 // we also support Python-style generators. At some point we can remove
19383 // this block.
19384
19385 if (typeof StopIteration === "undefined") {
19386 // ES6 Generators
19387 try {
19388 result = generator[verb](arg);
19389 } catch (exception) {
19390 return reject(exception);
19391 }
19392 if (result.done) {
19393 return Q(result.value);
19394 } else {
19395 return when(result.value, callback, errback);
19396 }
19397 } else {
19398 // SpiderMonkey Generators
19399 // FIXME: Remove this case when SM does ES6 generators.
19400 try {
19401 result = generator[verb](arg);
19402 } catch (exception) {
19403 if (isStopIteration(exception)) {
19404 return Q(exception.value);
19405 } else {
19406 return reject(exception);
19407 }
19408 }
19409 return when(result, callback, errback);
19410 }
19411 }
19412 var generator = makeGenerator.apply(this, arguments);
19413 var callback = continuer.bind(continuer, "next");
19414 var errback = continuer.bind(continuer, "throw");
19415 return callback();
19416 };
19417}
19418
19419/**
19420 * The spawn function is a small wrapper around async that immediately
19421 * calls the generator and also ends the promise chain, so that any
19422 * unhandled errors are thrown instead of forwarded to the error
19423 * handler. This is useful because it's extremely common to run
19424 * generators at the top-level to work with libraries.
19425 */
19426Q.spawn = spawn;
19427function spawn(makeGenerator) {
19428 Q.done(Q.async(makeGenerator)());
19429}
19430
19431// FIXME: Remove this interface once ES6 generators are in SpiderMonkey.
19432/**
19433 * Throws a ReturnValue exception to stop an asynchronous generator.
19434 *
19435 * This interface is a stop-gap measure to support generator return
19436 * values in older Firefox/SpiderMonkey. In browsers that support ES6
19437 * generators like Chromium 29, just use "return" in your generator
19438 * functions.
19439 *
19440 * @param value the return value for the surrounding generator
19441 * @throws ReturnValue exception with the value.
19442 * @example
19443 * // ES6 style
19444 * Q.async(function* () {
19445 * var foo = yield getFooPromise();
19446 * var bar = yield getBarPromise();
19447 * return foo + bar;
19448 * })
19449 * // Older SpiderMonkey style
19450 * Q.async(function () {
19451 * var foo = yield getFooPromise();
19452 * var bar = yield getBarPromise();
19453 * Q.return(foo + bar);
19454 * })
19455 */
19456Q["return"] = _return;
19457function _return(value) {
19458 throw new QReturnValue(value);
19459}
19460
19461/**
19462 * The promised function decorator ensures that any promise arguments
19463 * are settled and passed as values (`this` is also settled and passed
19464 * as a value). It will also ensure that the result of a function is
19465 * always a promise.
19466 *
19467 * @example
19468 * var add = Q.promised(function (a, b) {
19469 * return a + b;
19470 * });
19471 * add(Q(a), Q(B));
19472 *
19473 * @param {function} callback The function to decorate
19474 * @returns {function} a function that has been decorated.
19475 */
19476Q.promised = promised;
19477function promised(callback) {
19478 return function () {
19479 return spread([this, all(arguments)], function (self, args) {
19480 return callback.apply(self, args);
19481 });
19482 };
19483}
19484
19485/**
19486 * sends a message to a value in a future turn
19487 * @param object* the recipient
19488 * @param op the name of the message operation, e.g., "when",
19489 * @param args further arguments to be forwarded to the operation
19490 * @returns result {Promise} a promise for the result of the operation
19491 */
19492Q.dispatch = dispatch;
19493function dispatch(object, op, args) {
19494 return Q(object).dispatch(op, args);
19495}
19496
19497Promise.prototype.dispatch = function (op, args) {
19498 var self = this;
19499 var deferred = defer();
19500 Q.nextTick(function () {
19501 self.promiseDispatch(deferred.resolve, op, args);
19502 });
19503 return deferred.promise;
19504};
19505
19506/**
19507 * Gets the value of a property in a future turn.
19508 * @param object promise or immediate reference for target object
19509 * @param name name of property to get
19510 * @return promise for the property value
19511 */
19512Q.get = function (object, key) {
19513 return Q(object).dispatch("get", [key]);
19514};
19515
19516Promise.prototype.get = function (key) {
19517 return this.dispatch("get", [key]);
19518};
19519
19520/**
19521 * Sets the value of a property in a future turn.
19522 * @param object promise or immediate reference for object object
19523 * @param name name of property to set
19524 * @param value new value of property
19525 * @return promise for the return value
19526 */
19527Q.set = function (object, key, value) {
19528 return Q(object).dispatch("set", [key, value]);
19529};
19530
19531Promise.prototype.set = function (key, value) {
19532 return this.dispatch("set", [key, value]);
19533};
19534
19535/**
19536 * Deletes a property in a future turn.
19537 * @param object promise or immediate reference for target object
19538 * @param name name of property to delete
19539 * @return promise for the return value
19540 */
19541Q.del = // XXX legacy
19542Q["delete"] = function (object, key) {
19543 return Q(object).dispatch("delete", [key]);
19544};
19545
19546Promise.prototype.del = // XXX legacy
19547Promise.prototype["delete"] = function (key) {
19548 return this.dispatch("delete", [key]);
19549};
19550
19551/**
19552 * Invokes a method in a future turn.
19553 * @param object promise or immediate reference for target object
19554 * @param name name of method to invoke
19555 * @param value a value to post, typically an array of
19556 * invocation arguments for promises that
19557 * are ultimately backed with `resolve` values,
19558 * as opposed to those backed with URLs
19559 * wherein the posted value can be any
19560 * JSON serializable object.
19561 * @return promise for the return value
19562 */
19563// bound locally because it is used by other methods
19564Q.mapply = // XXX As proposed by "Redsandro"
19565Q.post = function (object, name, args) {
19566 return Q(object).dispatch("post", [name, args]);
19567};
19568
19569Promise.prototype.mapply = // XXX As proposed by "Redsandro"
19570Promise.prototype.post = function (name, args) {
19571 return this.dispatch("post", [name, args]);
19572};
19573
19574/**
19575 * Invokes a method in a future turn.
19576 * @param object promise or immediate reference for target object
19577 * @param name name of method to invoke
19578 * @param ...args array of invocation arguments
19579 * @return promise for the return value
19580 */
19581Q.send = // XXX Mark Miller's proposed parlance
19582Q.mcall = // XXX As proposed by "Redsandro"
19583Q.invoke = function (object, name /*...args*/) {
19584 return Q(object).dispatch("post", [name, array_slice(arguments, 2)]);
19585};
19586
19587Promise.prototype.send = // XXX Mark Miller's proposed parlance
19588Promise.prototype.mcall = // XXX As proposed by "Redsandro"
19589Promise.prototype.invoke = function (name /*...args*/) {
19590 return this.dispatch("post", [name, array_slice(arguments, 1)]);
19591};
19592
19593/**
19594 * Applies the promised function in a future turn.
19595 * @param object promise or immediate reference for target function
19596 * @param args array of application arguments
19597 */
19598Q.fapply = function (object, args) {
19599 return Q(object).dispatch("apply", [void 0, args]);
19600};
19601
19602Promise.prototype.fapply = function (args) {
19603 return this.dispatch("apply", [void 0, args]);
19604};
19605
19606/**
19607 * Calls the promised function in a future turn.
19608 * @param object promise or immediate reference for target function
19609 * @param ...args array of application arguments
19610 */
19611Q["try"] =
19612Q.fcall = function (object /* ...args*/) {
19613 return Q(object).dispatch("apply", [void 0, array_slice(arguments, 1)]);
19614};
19615
19616Promise.prototype.fcall = function (/*...args*/) {
19617 return this.dispatch("apply", [void 0, array_slice(arguments)]);
19618};
19619
19620/**
19621 * Binds the promised function, transforming return values into a fulfilled
19622 * promise and thrown errors into a rejected one.
19623 * @param object promise or immediate reference for target function
19624 * @param ...args array of application arguments
19625 */
19626Q.fbind = function (object /*...args*/) {
19627 var promise = Q(object);
19628 var args = array_slice(arguments, 1);
19629 return function fbound() {
19630 return promise.dispatch("apply", [
19631 this,
19632 args.concat(array_slice(arguments))
19633 ]);
19634 };
19635};
19636Promise.prototype.fbind = function (/*...args*/) {
19637 var promise = this;
19638 var args = array_slice(arguments);
19639 return function fbound() {
19640 return promise.dispatch("apply", [
19641 this,
19642 args.concat(array_slice(arguments))
19643 ]);
19644 };
19645};
19646
19647/**
19648 * Requests the names of the owned properties of a promised
19649 * object in a future turn.
19650 * @param object promise or immediate reference for target object
19651 * @return promise for the keys of the eventually settled object
19652 */
19653Q.keys = function (object) {
19654 return Q(object).dispatch("keys", []);
19655};
19656
19657Promise.prototype.keys = function () {
19658 return this.dispatch("keys", []);
19659};
19660
19661/**
19662 * Turns an array of promises into a promise for an array. If any of
19663 * the promises gets rejected, the whole array is rejected immediately.
19664 * @param {Array*} an array (or promise for an array) of values (or
19665 * promises for values)
19666 * @returns a promise for an array of the corresponding values
19667 */
19668// By Mark Miller
19669// http://wiki.ecmascript.org/doku.php?id=strawman:concurrency&rev=1308776521#allfulfilled
19670Q.all = all;
19671function all(promises) {
19672 return when(promises, function (promises) {
19673 var pendingCount = 0;
19674 var deferred = defer();
19675 array_reduce(promises, function (undefined, promise, index) {
19676 var snapshot;
19677 if (
19678 isPromise(promise) &&
19679 (snapshot = promise.inspect()).state === "fulfilled"
19680 ) {
19681 promises[index] = snapshot.value;
19682 } else {
19683 ++pendingCount;
19684 when(
19685 promise,
19686 function (value) {
19687 promises[index] = value;
19688 if (--pendingCount === 0) {
19689 deferred.resolve(promises);
19690 }
19691 },
19692 deferred.reject,
19693 function (progress) {
19694 deferred.notify({ index: index, value: progress });
19695 }
19696 );
19697 }
19698 }, void 0);
19699 if (pendingCount === 0) {
19700 deferred.resolve(promises);
19701 }
19702 return deferred.promise;
19703 });
19704}
19705
19706Promise.prototype.all = function () {
19707 return all(this);
19708};
19709
19710/**
19711 * Returns the first resolved promise of an array. Prior rejected promises are
19712 * ignored. Rejects only if all promises are rejected.
19713 * @param {Array*} an array containing values or promises for values
19714 * @returns a promise fulfilled with the value of the first resolved promise,
19715 * or a rejected promise if all promises are rejected.
19716 */
19717Q.any = any;
19718
19719function any(promises) {
19720 if (promises.length === 0) {
19721 return Q.resolve();
19722 }
19723
19724 var deferred = Q.defer();
19725 var pendingCount = 0;
19726 array_reduce(promises, function (prev, current, index) {
19727 var promise = promises[index];
19728
19729 pendingCount++;
19730
19731 when(promise, onFulfilled, onRejected, onProgress);
19732 function onFulfilled(result) {
19733 deferred.resolve(result);
19734 }
19735 function onRejected() {
19736 pendingCount--;
19737 if (pendingCount === 0) {
19738 deferred.reject(new Error(
19739 "Can't get fulfillment value from any promise, all " +
19740 "promises were rejected."
19741 ));
19742 }
19743 }
19744 function onProgress(progress) {
19745 deferred.notify({
19746 index: index,
19747 value: progress
19748 });
19749 }
19750 }, undefined);
19751
19752 return deferred.promise;
19753}
19754
19755Promise.prototype.any = function () {
19756 return any(this);
19757};
19758
19759/**
19760 * Waits for all promises to be settled, either fulfilled or
19761 * rejected. This is distinct from `all` since that would stop
19762 * waiting at the first rejection. The promise returned by
19763 * `allResolved` will never be rejected.
19764 * @param promises a promise for an array (or an array) of promises
19765 * (or values)
19766 * @return a promise for an array of promises
19767 */
19768Q.allResolved = deprecate(allResolved, "allResolved", "allSettled");
19769function allResolved(promises) {
19770 return when(promises, function (promises) {
19771 promises = array_map(promises, Q);
19772 return when(all(array_map(promises, function (promise) {
19773 return when(promise, noop, noop);
19774 })), function () {
19775 return promises;
19776 });
19777 });
19778}
19779
19780Promise.prototype.allResolved = function () {
19781 return allResolved(this);
19782};
19783
19784/**
19785 * @see Promise#allSettled
19786 */
19787Q.allSettled = allSettled;
19788function allSettled(promises) {
19789 return Q(promises).allSettled();
19790}
19791
19792/**
19793 * Turns an array of promises into a promise for an array of their states (as
19794 * returned by `inspect`) when they have all settled.
19795 * @param {Array[Any*]} values an array (or promise for an array) of values (or
19796 * promises for values)
19797 * @returns {Array[State]} an array of states for the respective values.
19798 */
19799Promise.prototype.allSettled = function () {
19800 return this.then(function (promises) {
19801 return all(array_map(promises, function (promise) {
19802 promise = Q(promise);
19803 function regardless() {
19804 return promise.inspect();
19805 }
19806 return promise.then(regardless, regardless);
19807 }));
19808 });
19809};
19810
19811/**
19812 * Captures the failure of a promise, giving an oportunity to recover
19813 * with a callback. If the given promise is fulfilled, the returned
19814 * promise is fulfilled.
19815 * @param {Any*} promise for something
19816 * @param {Function} callback to fulfill the returned promise if the
19817 * given promise is rejected
19818 * @returns a promise for the return value of the callback
19819 */
19820Q.fail = // XXX legacy
19821Q["catch"] = function (object, rejected) {
19822 return Q(object).then(void 0, rejected);
19823};
19824
19825Promise.prototype.fail = // XXX legacy
19826Promise.prototype["catch"] = function (rejected) {
19827 return this.then(void 0, rejected);
19828};
19829
19830/**
19831 * Attaches a listener that can respond to progress notifications from a
19832 * promise's originating deferred. This listener receives the exact arguments
19833 * passed to ``deferred.notify``.
19834 * @param {Any*} promise for something
19835 * @param {Function} callback to receive any progress notifications
19836 * @returns the given promise, unchanged
19837 */
19838Q.progress = progress;
19839function progress(object, progressed) {
19840 return Q(object).then(void 0, void 0, progressed);
19841}
19842
19843Promise.prototype.progress = function (progressed) {
19844 return this.then(void 0, void 0, progressed);
19845};
19846
19847/**
19848 * Provides an opportunity to observe the settling of a promise,
19849 * regardless of whether the promise is fulfilled or rejected. Forwards
19850 * the resolution to the returned promise when the callback is done.
19851 * The callback can return a promise to defer completion.
19852 * @param {Any*} promise
19853 * @param {Function} callback to observe the resolution of the given
19854 * promise, takes no arguments.
19855 * @returns a promise for the resolution of the given promise when
19856 * ``fin`` is done.
19857 */
19858Q.fin = // XXX legacy
19859Q["finally"] = function (object, callback) {
19860 return Q(object)["finally"](callback);
19861};
19862
19863Promise.prototype.fin = // XXX legacy
19864Promise.prototype["finally"] = function (callback) {
19865 callback = Q(callback);
19866 return this.then(function (value) {
19867 return callback.fcall().then(function () {
19868 return value;
19869 });
19870 }, function (reason) {
19871 // TODO attempt to recycle the rejection with "this".
19872 return callback.fcall().then(function () {
19873 throw reason;
19874 });
19875 });
19876};
19877
19878/**
19879 * Terminates a chain of promises, forcing rejections to be
19880 * thrown as exceptions.
19881 * @param {Any*} promise at the end of a chain of promises
19882 * @returns nothing
19883 */
19884Q.done = function (object, fulfilled, rejected, progress) {
19885 return Q(object).done(fulfilled, rejected, progress);
19886};
19887
19888Promise.prototype.done = function (fulfilled, rejected, progress) {
19889 var onUnhandledError = function (error) {
19890 // forward to a future turn so that ``when``
19891 // does not catch it and turn it into a rejection.
19892 Q.nextTick(function () {
19893 makeStackTraceLong(error, promise);
19894 if (Q.onerror) {
19895 Q.onerror(error);
19896 } else {
19897 throw error;
19898 }
19899 });
19900 };
19901
19902 // Avoid unnecessary `nextTick`ing via an unnecessary `when`.
19903 var promise = fulfilled || rejected || progress ?
19904 this.then(fulfilled, rejected, progress) :
19905 this;
19906
19907 if (typeof process === "object" && process && process.domain) {
19908 onUnhandledError = process.domain.bind(onUnhandledError);
19909 }
19910
19911 promise.then(void 0, onUnhandledError);
19912};
19913
19914/**
19915 * Causes a promise to be rejected if it does not get fulfilled before
19916 * some milliseconds time out.
19917 * @param {Any*} promise
19918 * @param {Number} milliseconds timeout
19919 * @param {Any*} custom error message or Error object (optional)
19920 * @returns a promise for the resolution of the given promise if it is
19921 * fulfilled before the timeout, otherwise rejected.
19922 */
19923Q.timeout = function (object, ms, error) {
19924 return Q(object).timeout(ms, error);
19925};
19926
19927Promise.prototype.timeout = function (ms, error) {
19928 var deferred = defer();
19929 var timeoutId = setTimeout(function () {
19930 if (!error || "string" === typeof error) {
19931 error = new Error(error || "Timed out after " + ms + " ms");
19932 error.code = "ETIMEDOUT";
19933 }
19934 deferred.reject(error);
19935 }, ms);
19936
19937 this.then(function (value) {
19938 clearTimeout(timeoutId);
19939 deferred.resolve(value);
19940 }, function (exception) {
19941 clearTimeout(timeoutId);
19942 deferred.reject(exception);
19943 }, deferred.notify);
19944
19945 return deferred.promise;
19946};
19947
19948/**
19949 * Returns a promise for the given value (or promised value), some
19950 * milliseconds after it resolved. Passes rejections immediately.
19951 * @param {Any*} promise
19952 * @param {Number} milliseconds
19953 * @returns a promise for the resolution of the given promise after milliseconds
19954 * time has elapsed since the resolution of the given promise.
19955 * If the given promise rejects, that is passed immediately.
19956 */
19957Q.delay = function (object, timeout) {
19958 if (timeout === void 0) {
19959 timeout = object;
19960 object = void 0;
19961 }
19962 return Q(object).delay(timeout);
19963};
19964
19965Promise.prototype.delay = function (timeout) {
19966 return this.then(function (value) {
19967 var deferred = defer();
19968 setTimeout(function () {
19969 deferred.resolve(value);
19970 }, timeout);
19971 return deferred.promise;
19972 });
19973};
19974
19975/**
19976 * Passes a continuation to a Node function, which is called with the given
19977 * arguments provided as an array, and returns a promise.
19978 *
19979 * Q.nfapply(FS.readFile, [__filename])
19980 * .then(function (content) {
19981 * })
19982 *
19983 */
19984Q.nfapply = function (callback, args) {
19985 return Q(callback).nfapply(args);
19986};
19987
19988Promise.prototype.nfapply = function (args) {
19989 var deferred = defer();
19990 var nodeArgs = array_slice(args);
19991 nodeArgs.push(deferred.makeNodeResolver());
19992 this.fapply(nodeArgs).fail(deferred.reject);
19993 return deferred.promise;
19994};
19995
19996/**
19997 * Passes a continuation to a Node function, which is called with the given
19998 * arguments provided individually, and returns a promise.
19999 * @example
20000 * Q.nfcall(FS.readFile, __filename)
20001 * .then(function (content) {
20002 * })
20003 *
20004 */
20005Q.nfcall = function (callback /*...args*/) {
20006 var args = array_slice(arguments, 1);
20007 return Q(callback).nfapply(args);
20008};
20009
20010Promise.prototype.nfcall = function (/*...args*/) {
20011 var nodeArgs = array_slice(arguments);
20012 var deferred = defer();
20013 nodeArgs.push(deferred.makeNodeResolver());
20014 this.fapply(nodeArgs).fail(deferred.reject);
20015 return deferred.promise;
20016};
20017
20018/**
20019 * Wraps a NodeJS continuation passing function and returns an equivalent
20020 * version that returns a promise.
20021 * @example
20022 * Q.nfbind(FS.readFile, __filename)("utf-8")
20023 * .then(console.log)
20024 * .done()
20025 */
20026Q.nfbind =
20027Q.denodeify = function (callback /*...args*/) {
20028 var baseArgs = array_slice(arguments, 1);
20029 return function () {
20030 var nodeArgs = baseArgs.concat(array_slice(arguments));
20031 var deferred = defer();
20032 nodeArgs.push(deferred.makeNodeResolver());
20033 Q(callback).fapply(nodeArgs).fail(deferred.reject);
20034 return deferred.promise;
20035 };
20036};
20037
20038Promise.prototype.nfbind =
20039Promise.prototype.denodeify = function (/*...args*/) {
20040 var args = array_slice(arguments);
20041 args.unshift(this);
20042 return Q.denodeify.apply(void 0, args);
20043};
20044
20045Q.nbind = function (callback, thisp /*...args*/) {
20046 var baseArgs = array_slice(arguments, 2);
20047 return function () {
20048 var nodeArgs = baseArgs.concat(array_slice(arguments));
20049 var deferred = defer();
20050 nodeArgs.push(deferred.makeNodeResolver());
20051 function bound() {
20052 return callback.apply(thisp, arguments);
20053 }
20054 Q(bound).fapply(nodeArgs).fail(deferred.reject);
20055 return deferred.promise;
20056 };
20057};
20058
20059Promise.prototype.nbind = function (/*thisp, ...args*/) {
20060 var args = array_slice(arguments, 0);
20061 args.unshift(this);
20062 return Q.nbind.apply(void 0, args);
20063};
20064
20065/**
20066 * Calls a method of a Node-style object that accepts a Node-style
20067 * callback with a given array of arguments, plus a provided callback.
20068 * @param object an object that has the named method
20069 * @param {String} name name of the method of object
20070 * @param {Array} args arguments to pass to the method; the callback
20071 * will be provided by Q and appended to these arguments.
20072 * @returns a promise for the value or error
20073 */
20074Q.nmapply = // XXX As proposed by "Redsandro"
20075Q.npost = function (object, name, args) {
20076 return Q(object).npost(name, args);
20077};
20078
20079Promise.prototype.nmapply = // XXX As proposed by "Redsandro"
20080Promise.prototype.npost = function (name, args) {
20081 var nodeArgs = array_slice(args || []);
20082 var deferred = defer();
20083 nodeArgs.push(deferred.makeNodeResolver());
20084 this.dispatch("post", [name, nodeArgs]).fail(deferred.reject);
20085 return deferred.promise;
20086};
20087
20088/**
20089 * Calls a method of a Node-style object that accepts a Node-style
20090 * callback, forwarding the given variadic arguments, plus a provided
20091 * callback argument.
20092 * @param object an object that has the named method
20093 * @param {String} name name of the method of object
20094 * @param ...args arguments to pass to the method; the callback will
20095 * be provided by Q and appended to these arguments.
20096 * @returns a promise for the value or error
20097 */
20098Q.nsend = // XXX Based on Mark Miller's proposed "send"
20099Q.nmcall = // XXX Based on "Redsandro's" proposal
20100Q.ninvoke = function (object, name /*...args*/) {
20101 var nodeArgs = array_slice(arguments, 2);
20102 var deferred = defer();
20103 nodeArgs.push(deferred.makeNodeResolver());
20104 Q(object).dispatch("post", [name, nodeArgs]).fail(deferred.reject);
20105 return deferred.promise;
20106};
20107
20108Promise.prototype.nsend = // XXX Based on Mark Miller's proposed "send"
20109Promise.prototype.nmcall = // XXX Based on "Redsandro's" proposal
20110Promise.prototype.ninvoke = function (name /*...args*/) {
20111 var nodeArgs = array_slice(arguments, 1);
20112 var deferred = defer();
20113 nodeArgs.push(deferred.makeNodeResolver());
20114 this.dispatch("post", [name, nodeArgs]).fail(deferred.reject);
20115 return deferred.promise;
20116};
20117
20118/**
20119 * If a function would like to support both Node continuation-passing-style and
20120 * promise-returning-style, it can end its internal promise chain with
20121 * `nodeify(nodeback)`, forwarding the optional nodeback argument. If the user
20122 * elects to use a nodeback, the result will be sent there. If they do not
20123 * pass a nodeback, they will receive the result promise.
20124 * @param object a result (or a promise for a result)
20125 * @param {Function} nodeback a Node.js-style callback
20126 * @returns either the promise or nothing
20127 */
20128Q.nodeify = nodeify;
20129function nodeify(object, nodeback) {
20130 return Q(object).nodeify(nodeback);
20131}
20132
20133Promise.prototype.nodeify = function (nodeback) {
20134 if (nodeback) {
20135 this.then(function (value) {
20136 Q.nextTick(function () {
20137 nodeback(null, value);
20138 });
20139 }, function (error) {
20140 Q.nextTick(function () {
20141 nodeback(error);
20142 });
20143 });
20144 } else {
20145 return this;
20146 }
20147};
20148
20149Q.noConflict = function() {
20150 throw new Error("Q.noConflict only works when Q is used as a global");
20151};
20152
20153// All code before this point will be filtered from stack traces.
20154var qEndingLine = captureLine();
20155
20156return Q;
20157
20158});
20159
20160}).call(this,require('_process'))
Jian Li1c94b9d2017-02-08 15:47:21 +090020161
Jian Li8afbbee2016-07-27 19:16:51 +090020162},{"_process":12}],158:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020163/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020164 * Root reference for iframes.
20165 */
20166
Jian Li83d87a72016-04-20 15:38:24 -070020167var root;
20168if (typeof window !== 'undefined') { // Browser window
20169 root = window;
20170} else if (typeof self !== 'undefined') { // Web Worker
20171 root = self;
20172} else { // Other environments
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020173 console.warn("Using browser-only version of superagent in non-browser environment");
Jian Li83d87a72016-04-20 15:38:24 -070020174 root = this;
20175}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020176
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020177var Emitter = require('emitter');
20178var requestBase = require('./request-base');
20179var isObject = require('./is-object');
20180
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020181/**
20182 * Noop.
20183 */
20184
20185function noop(){};
20186
20187/**
Jian Li8afbbee2016-07-27 19:16:51 +090020188 * Expose `request`.
20189 */
20190
20191var request = module.exports = require('./request').bind(null, Request);
20192
20193/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020194 * Determine XHR.
20195 */
20196
20197request.getXHR = function () {
20198 if (root.XMLHttpRequest
20199 && (!root.location || 'file:' != root.location.protocol
20200 || !root.ActiveXObject)) {
20201 return new XMLHttpRequest;
20202 } else {
20203 try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {}
20204 try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {}
20205 try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {}
20206 try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {}
20207 }
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020208 throw Error("Browser-only verison of superagent could not find XHR");
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020209};
20210
20211/**
20212 * Removes leading and trailing whitespace, added to support IE.
20213 *
20214 * @param {String} s
20215 * @return {String}
20216 * @api private
20217 */
20218
20219var trim = ''.trim
20220 ? function(s) { return s.trim(); }
20221 : function(s) { return s.replace(/(^\s*|\s*$)/g, ''); };
20222
20223/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020224 * Serialize the given `obj`.
20225 *
20226 * @param {Object} obj
20227 * @return {String}
20228 * @api private
20229 */
20230
20231function serialize(obj) {
20232 if (!isObject(obj)) return obj;
20233 var pairs = [];
20234 for (var key in obj) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020235 pushEncodedKeyValuePair(pairs, key, obj[key]);
20236 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020237 return pairs.join('&');
20238}
20239
20240/**
Jian Li83d87a72016-04-20 15:38:24 -070020241 * Helps 'serialize' with serializing arrays.
20242 * Mutates the pairs array.
20243 *
20244 * @param {Array} pairs
20245 * @param {String} key
20246 * @param {Mixed} val
20247 */
20248
20249function pushEncodedKeyValuePair(pairs, key, val) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020250 if (val != null) {
20251 if (Array.isArray(val)) {
20252 val.forEach(function(v) {
20253 pushEncodedKeyValuePair(pairs, key, v);
20254 });
20255 } else if (isObject(val)) {
20256 for(var subkey in val) {
20257 pushEncodedKeyValuePair(pairs, key + '[' + subkey + ']', val[subkey]);
20258 }
20259 } else {
20260 pairs.push(encodeURIComponent(key)
20261 + '=' + encodeURIComponent(val));
20262 }
20263 } else if (val === null) {
20264 pairs.push(encodeURIComponent(key));
Jian Li83d87a72016-04-20 15:38:24 -070020265 }
Jian Li83d87a72016-04-20 15:38:24 -070020266}
20267
20268/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020269 * Expose serialization method.
20270 */
20271
20272 request.serializeObject = serialize;
20273
20274 /**
20275 * Parse the given x-www-form-urlencoded `str`.
20276 *
20277 * @param {String} str
20278 * @return {Object}
20279 * @api private
20280 */
20281
20282function parseString(str) {
20283 var obj = {};
20284 var pairs = str.split('&');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020285 var pair;
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020286 var pos;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020287
20288 for (var i = 0, len = pairs.length; i < len; ++i) {
20289 pair = pairs[i];
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020290 pos = pair.indexOf('=');
20291 if (pos == -1) {
20292 obj[decodeURIComponent(pair)] = '';
20293 } else {
20294 obj[decodeURIComponent(pair.slice(0, pos))] =
20295 decodeURIComponent(pair.slice(pos + 1));
20296 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020297 }
20298
20299 return obj;
20300}
20301
20302/**
20303 * Expose parser.
20304 */
20305
20306request.parseString = parseString;
20307
20308/**
20309 * Default MIME type map.
20310 *
20311 * superagent.types.xml = 'application/xml';
20312 *
20313 */
20314
20315request.types = {
20316 html: 'text/html',
20317 json: 'application/json',
20318 xml: 'application/xml',
20319 urlencoded: 'application/x-www-form-urlencoded',
20320 'form': 'application/x-www-form-urlencoded',
20321 'form-data': 'application/x-www-form-urlencoded'
20322};
20323
20324/**
20325 * Default serialization map.
20326 *
20327 * superagent.serialize['application/xml'] = function(obj){
20328 * return 'generated xml here';
20329 * };
20330 *
20331 */
20332
20333 request.serialize = {
20334 'application/x-www-form-urlencoded': serialize,
20335 'application/json': JSON.stringify
20336 };
20337
20338 /**
20339 * Default parsers.
20340 *
20341 * superagent.parse['application/xml'] = function(str){
20342 * return { object parsed from str };
20343 * };
20344 *
20345 */
20346
20347request.parse = {
20348 'application/x-www-form-urlencoded': parseString,
20349 'application/json': JSON.parse
20350};
20351
20352/**
20353 * Parse the given header `str` into
20354 * an object containing the mapped fields.
20355 *
20356 * @param {String} str
20357 * @return {Object}
20358 * @api private
20359 */
20360
20361function parseHeader(str) {
20362 var lines = str.split(/\r?\n/);
20363 var fields = {};
20364 var index;
20365 var line;
20366 var field;
20367 var val;
20368
20369 lines.pop(); // trailing CRLF
20370
20371 for (var i = 0, len = lines.length; i < len; ++i) {
20372 line = lines[i];
20373 index = line.indexOf(':');
20374 field = line.slice(0, index).toLowerCase();
20375 val = trim(line.slice(index + 1));
20376 fields[field] = val;
20377 }
20378
20379 return fields;
20380}
20381
20382/**
Jian Li8afbbee2016-07-27 19:16:51 +090020383 * Check if `mime` is json or has +json structured syntax suffix.
20384 *
20385 * @param {String} mime
20386 * @return {Boolean}
20387 * @api private
20388 */
20389
20390function isJSON(mime) {
20391 return /[\/+]json\b/.test(mime);
20392}
20393
20394/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020395 * Return the mime type for the given `str`.
20396 *
20397 * @param {String} str
20398 * @return {String}
20399 * @api private
20400 */
20401
20402function type(str){
20403 return str.split(/ *; */).shift();
20404};
20405
20406/**
20407 * Return header field parameters.
20408 *
20409 * @param {String} str
20410 * @return {Object}
20411 * @api private
20412 */
20413
20414function params(str){
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020415 return str.split(/ *; */).reduce(function(obj, str){
20416 var parts = str.split(/ *= */),
20417 key = parts.shift(),
20418 val = parts.shift();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020419
20420 if (key && val) obj[key] = val;
20421 return obj;
20422 }, {});
20423};
20424
20425/**
20426 * Initialize a new `Response` with the given `xhr`.
20427 *
20428 * - set flags (.ok, .error, etc)
20429 * - parse header
20430 *
20431 * Examples:
20432 *
20433 * Aliasing `superagent` as `request` is nice:
20434 *
20435 * request = superagent;
20436 *
20437 * We can use the promise-like API, or pass callbacks:
20438 *
20439 * request.get('/').end(function(res){});
20440 * request.get('/', function(res){});
20441 *
20442 * Sending data can be chained:
20443 *
20444 * request
20445 * .post('/user')
20446 * .send({ name: 'tj' })
20447 * .end(function(res){});
20448 *
20449 * Or passed to `.send()`:
20450 *
20451 * request
20452 * .post('/user')
20453 * .send({ name: 'tj' }, function(res){});
20454 *
20455 * Or passed to `.post()`:
20456 *
20457 * request
20458 * .post('/user', { name: 'tj' })
20459 * .end(function(res){});
20460 *
20461 * Or further reduced to a single call for simple cases:
20462 *
20463 * request
20464 * .post('/user', { name: 'tj' }, function(res){});
20465 *
20466 * @param {XMLHTTPRequest} xhr
20467 * @param {Object} options
20468 * @api private
20469 */
20470
20471function Response(req, options) {
20472 options = options || {};
20473 this.req = req;
20474 this.xhr = this.req.xhr;
20475 // responseText is accessible only if responseType is '' or 'text' and on older browsers
20476 this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined')
20477 ? this.xhr.responseText
20478 : null;
20479 this.statusText = this.req.xhr.statusText;
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020480 this._setStatusProperties(this.xhr.status);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020481 this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders());
20482 // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but
20483 // getResponseHeader still works. so we get content-type even if getting
20484 // other headers fails.
20485 this.header['content-type'] = this.xhr.getResponseHeader('content-type');
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020486 this._setHeaderProperties(this.header);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020487 this.body = this.req.method != 'HEAD'
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020488 ? this._parseBody(this.text ? this.text : this.xhr.response)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020489 : null;
20490}
20491
20492/**
20493 * Get case-insensitive `field` value.
20494 *
20495 * @param {String} field
20496 * @return {String}
20497 * @api public
20498 */
20499
20500Response.prototype.get = function(field){
20501 return this.header[field.toLowerCase()];
20502};
20503
20504/**
20505 * Set header related properties:
20506 *
20507 * - `.type` the content type without params
20508 *
20509 * A response of "Content-Type: text/plain; charset=utf-8"
20510 * will provide you with a `.type` of "text/plain".
20511 *
20512 * @param {Object} header
20513 * @api private
20514 */
20515
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020516Response.prototype._setHeaderProperties = function(header){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020517 // content-type
20518 var ct = this.header['content-type'] || '';
20519 this.type = type(ct);
20520
20521 // params
20522 var obj = params(ct);
20523 for (var key in obj) this[key] = obj[key];
20524};
20525
20526/**
20527 * Parse the given body `str`.
20528 *
20529 * Used for auto-parsing of bodies. Parsers
20530 * are defined on the `superagent.parse` object.
20531 *
20532 * @param {String} str
20533 * @return {Mixed}
20534 * @api private
20535 */
20536
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020537Response.prototype._parseBody = function(str){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020538 var parse = request.parse[this.type];
Jian Li8afbbee2016-07-27 19:16:51 +090020539 if (!parse && isJSON(this.type)) {
20540 parse = request.parse['application/json'];
20541 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020542 return parse && str && (str.length || str instanceof Object)
20543 ? parse(str)
20544 : null;
20545};
20546
20547/**
20548 * Set flags such as `.ok` based on `status`.
20549 *
20550 * For example a 2xx response will give you a `.ok` of __true__
20551 * whereas 5xx will be __false__ and `.error` will be __true__. The
20552 * `.clientError` and `.serverError` are also available to be more
20553 * specific, and `.statusType` is the class of error ranging from 1..5
20554 * sometimes useful for mapping respond colors etc.
20555 *
20556 * "sugar" properties are also defined for common cases. Currently providing:
20557 *
20558 * - .noContent
20559 * - .badRequest
20560 * - .unauthorized
20561 * - .notAcceptable
20562 * - .notFound
20563 *
20564 * @param {Number} status
20565 * @api private
20566 */
20567
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020568Response.prototype._setStatusProperties = function(status){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020569 // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request
20570 if (status === 1223) {
20571 status = 204;
20572 }
20573
20574 var type = status / 100 | 0;
20575
20576 // status / class
Jian Li83d87a72016-04-20 15:38:24 -070020577 this.status = this.statusCode = status;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020578 this.statusType = type;
20579
20580 // basics
20581 this.info = 1 == type;
20582 this.ok = 2 == type;
20583 this.clientError = 4 == type;
20584 this.serverError = 5 == type;
20585 this.error = (4 == type || 5 == type)
20586 ? this.toError()
20587 : false;
20588
20589 // sugar
20590 this.accepted = 202 == status;
20591 this.noContent = 204 == status;
20592 this.badRequest = 400 == status;
20593 this.unauthorized = 401 == status;
20594 this.notAcceptable = 406 == status;
20595 this.notFound = 404 == status;
20596 this.forbidden = 403 == status;
20597};
20598
20599/**
20600 * Return an `Error` representative of this response.
20601 *
20602 * @return {Error}
20603 * @api public
20604 */
20605
20606Response.prototype.toError = function(){
20607 var req = this.req;
20608 var method = req.method;
20609 var url = req.url;
20610
20611 var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')';
20612 var err = new Error(msg);
20613 err.status = this.status;
20614 err.method = method;
20615 err.url = url;
20616
20617 return err;
20618};
20619
20620/**
20621 * Expose `Response`.
20622 */
20623
20624request.Response = Response;
20625
20626/**
20627 * Initialize a new `Request` with the given `method` and `url`.
20628 *
20629 * @param {String} method
20630 * @param {String} url
20631 * @api public
20632 */
20633
20634function Request(method, url) {
20635 var self = this;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020636 this._query = this._query || [];
20637 this.method = method;
20638 this.url = url;
Jian Li8afbbee2016-07-27 19:16:51 +090020639 this.header = {}; // preserves header name case
20640 this._header = {}; // coerces header names to lowercase
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020641 this.on('end', function(){
20642 var err = null;
20643 var res = null;
20644
20645 try {
20646 res = new Response(self);
20647 } catch(e) {
20648 err = new Error('Parser is unable to parse the response');
20649 err.parse = true;
20650 err.original = e;
Jian Li8afbbee2016-07-27 19:16:51 +090020651 // issue #675: return the raw response if the response parsing fails
20652 err.rawResponse = self.xhr && self.xhr.responseText ? self.xhr.responseText : null;
20653 // issue #876: return the http status code if the response parsing fails
20654 err.statusCode = self.xhr && self.xhr.status ? self.xhr.status : null;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020655 return self.callback(err);
20656 }
20657
20658 self.emit('response', res);
20659
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020660 var new_err;
20661 try {
20662 if (res.status < 200 || res.status >= 300) {
20663 new_err = new Error(res.statusText || 'Unsuccessful HTTP response');
20664 new_err.original = err;
20665 new_err.response = res;
20666 new_err.status = res.status;
20667 }
20668 } catch(e) {
20669 new_err = e; // #985 touching res may cause INVALID_STATE_ERR on old Android
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020670 }
20671
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020672 // #1000 don't catch errors from the callback to avoid double calling it
20673 if (new_err) {
20674 self.callback(new_err, res);
20675 } else {
20676 self.callback(null, res);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020677 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020678 });
20679}
20680
20681/**
Jian Li8afbbee2016-07-27 19:16:51 +090020682 * Mixin `Emitter` and `requestBase`.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020683 */
20684
20685Emitter(Request.prototype);
Jian Li8afbbee2016-07-27 19:16:51 +090020686for (var key in requestBase) {
20687 Request.prototype[key] = requestBase[key];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020688}
20689
20690/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020691 * Set Content-Type to `type`, mapping values from `request.types`.
20692 *
20693 * Examples:
20694 *
20695 * superagent.types.xml = 'application/xml';
20696 *
20697 * request.post('/')
20698 * .type('xml')
20699 * .send(xmlstring)
20700 * .end(callback);
20701 *
20702 * request.post('/')
20703 * .type('application/xml')
20704 * .send(xmlstring)
20705 * .end(callback);
20706 *
20707 * @param {String} type
20708 * @return {Request} for chaining
20709 * @api public
20710 */
20711
20712Request.prototype.type = function(type){
20713 this.set('Content-Type', request.types[type] || type);
20714 return this;
20715};
20716
20717/**
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020718 * Set responseType to `val`. Presently valid responseTypes are 'blob' and
Jian Li8afbbee2016-07-27 19:16:51 +090020719 * 'arraybuffer'.
Jian Li83d87a72016-04-20 15:38:24 -070020720 *
Jian Li8afbbee2016-07-27 19:16:51 +090020721 * Examples:
Jian Li83d87a72016-04-20 15:38:24 -070020722 *
Jian Li8afbbee2016-07-27 19:16:51 +090020723 * req.get('/')
20724 * .responseType('blob')
20725 * .end(callback);
20726 *
20727 * @param {String} val
20728 * @return {Request} for chaining
Jian Li83d87a72016-04-20 15:38:24 -070020729 * @api public
20730 */
20731
Jian Li8afbbee2016-07-27 19:16:51 +090020732Request.prototype.responseType = function(val){
20733 this._responseType = val;
Jian Li83d87a72016-04-20 15:38:24 -070020734 return this;
20735};
20736
20737/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020738 * Set Accept to `type`, mapping values from `request.types`.
20739 *
20740 * Examples:
20741 *
20742 * superagent.types.json = 'application/json';
20743 *
20744 * request.get('/agent')
20745 * .accept('json')
20746 * .end(callback);
20747 *
20748 * request.get('/agent')
20749 * .accept('application/json')
20750 * .end(callback);
20751 *
20752 * @param {String} accept
20753 * @return {Request} for chaining
20754 * @api public
20755 */
20756
20757Request.prototype.accept = function(type){
20758 this.set('Accept', request.types[type] || type);
20759 return this;
20760};
20761
20762/**
20763 * Set Authorization field value with `user` and `pass`.
20764 *
20765 * @param {String} user
20766 * @param {String} pass
Jian Li8afbbee2016-07-27 19:16:51 +090020767 * @param {Object} options with 'type' property 'auto' or 'basic' (default 'basic')
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020768 * @return {Request} for chaining
20769 * @api public
20770 */
20771
Jian Li8afbbee2016-07-27 19:16:51 +090020772Request.prototype.auth = function(user, pass, options){
20773 if (!options) {
20774 options = {
20775 type: 'basic'
20776 }
20777 }
20778
20779 switch (options.type) {
20780 case 'basic':
20781 var str = btoa(user + ':' + pass);
20782 this.set('Authorization', 'Basic ' + str);
20783 break;
20784
20785 case 'auto':
20786 this.username = user;
20787 this.password = pass;
20788 break;
20789 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020790 return this;
20791};
20792
20793/**
20794* Add query-string `val`.
20795*
20796* Examples:
20797*
20798* request.get('/shoes')
20799* .query('size=10')
20800* .query({ color: 'blue' })
20801*
20802* @param {Object|String} val
20803* @return {Request} for chaining
20804* @api public
20805*/
20806
20807Request.prototype.query = function(val){
20808 if ('string' != typeof val) val = serialize(val);
20809 if (val) this._query.push(val);
20810 return this;
20811};
20812
20813/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020814 * Queue the given `file` as an attachment to the specified `field`,
20815 * with optional `filename`.
20816 *
20817 * ``` js
20818 * request.post('/upload')
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020819 * .attach('content', new Blob(['<a id="a"><b id="b">hey!</b></a>'], { type: "text/html"}))
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020820 * .end(callback);
20821 * ```
20822 *
20823 * @param {String} field
20824 * @param {Blob|File} file
20825 * @param {String} filename
20826 * @return {Request} for chaining
20827 * @api public
20828 */
20829
20830Request.prototype.attach = function(field, file, filename){
Jian Li8afbbee2016-07-27 19:16:51 +090020831 this._getFormData().append(field, file, filename || file.name);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020832 return this;
20833};
20834
Jian Li8afbbee2016-07-27 19:16:51 +090020835Request.prototype._getFormData = function(){
20836 if (!this._formData) {
20837 this._formData = new root.FormData();
20838 }
20839 return this._formData;
20840};
20841
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020842/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020843 * Invoke the callback with `err` and `res`
20844 * and handle arity check.
20845 *
20846 * @param {Error} err
20847 * @param {Response} res
20848 * @api private
20849 */
20850
20851Request.prototype.callback = function(err, res){
20852 var fn = this._callback;
20853 this.clearTimeout();
20854 fn(err, res);
20855};
20856
20857/**
20858 * Invoke callback with x-domain error.
20859 *
20860 * @api private
20861 */
20862
20863Request.prototype.crossDomainError = function(){
Jian Li8afbbee2016-07-27 19:16:51 +090020864 var err = new Error('Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020865 err.crossDomain = true;
Jian Li8afbbee2016-07-27 19:16:51 +090020866
20867 err.status = this.status;
20868 err.method = this.method;
20869 err.url = this.url;
20870
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020871 this.callback(err);
20872};
20873
20874/**
20875 * Invoke callback with timeout error.
20876 *
20877 * @api private
20878 */
20879
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020880Request.prototype._timeoutError = function(){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020881 var timeout = this._timeout;
20882 var err = new Error('timeout of ' + timeout + 'ms exceeded');
20883 err.timeout = timeout;
20884 this.callback(err);
20885};
20886
20887/**
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020888 * Compose querystring to append to req.url
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020889 *
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020890 * @api private
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020891 */
20892
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020893Request.prototype._appendQueryString = function(){
20894 var query = this._query.join('&');
20895 if (query) {
20896 this.url += ~this.url.indexOf('?')
20897 ? '&' + query
20898 : '?' + query;
20899 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020900};
20901
20902/**
20903 * Initiate request, invoking callback `fn(res)`
20904 * with an instanceof `Response`.
20905 *
20906 * @param {Function} fn
20907 * @return {Request} for chaining
20908 * @api public
20909 */
20910
20911Request.prototype.end = function(fn){
20912 var self = this;
20913 var xhr = this.xhr = request.getXHR();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020914 var timeout = this._timeout;
20915 var data = this._formData || this._data;
20916
20917 // store callback
20918 this._callback = fn || noop;
20919
20920 // state change
20921 xhr.onreadystatechange = function(){
20922 if (4 != xhr.readyState) return;
20923
20924 // In IE9, reads to any property (e.g. status) off of an aborted XHR will
20925 // result in the error "Could not complete the operation due to error c00c023f"
20926 var status;
20927 try { status = xhr.status } catch(e) { status = 0; }
20928
20929 if (0 == status) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020930 if (self.timedout) return self._timeoutError();
20931 if (self._aborted) return;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020932 return self.crossDomainError();
20933 }
20934 self.emit('end');
20935 };
20936
20937 // progress
20938 var handleProgress = function(e){
20939 if (e.total > 0) {
20940 e.percent = e.loaded / e.total * 100;
20941 }
Jian Li8afbbee2016-07-27 19:16:51 +090020942 e.direction = 'download';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020943 self.emit('progress', e);
20944 };
20945 if (this.hasListeners('progress')) {
20946 xhr.onprogress = handleProgress;
20947 }
20948 try {
20949 if (xhr.upload && this.hasListeners('progress')) {
20950 xhr.upload.onprogress = handleProgress;
20951 }
20952 } catch(e) {
20953 // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist.
20954 // Reported here:
20955 // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context
20956 }
20957
20958 // timeout
20959 if (timeout && !this._timer) {
20960 this._timer = setTimeout(function(){
20961 self.timedout = true;
20962 self.abort();
20963 }, timeout);
20964 }
20965
20966 // querystring
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020967 this._appendQueryString();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020968
20969 // initiate request
Jian Li8afbbee2016-07-27 19:16:51 +090020970 if (this.username && this.password) {
20971 xhr.open(this.method, this.url, true, this.username, this.password);
20972 } else {
20973 xhr.open(this.method, this.url, true);
20974 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020975
20976 // CORS
20977 if (this._withCredentials) xhr.withCredentials = true;
20978
20979 // body
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020980 if ('GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !this._isHost(data)) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020981 // serialize stuff
Jian Li8afbbee2016-07-27 19:16:51 +090020982 var contentType = this._header['content-type'];
Jian Li7f6d0e9e2016-09-27 02:04:49 +090020983 var serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : ''];
Jian Li8afbbee2016-07-27 19:16:51 +090020984 if (!serialize && isJSON(contentType)) serialize = request.serialize['application/json'];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020985 if (serialize) data = serialize(data);
20986 }
20987
20988 // set header fields
20989 for (var field in this.header) {
20990 if (null == this.header[field]) continue;
20991 xhr.setRequestHeader(field, this.header[field]);
20992 }
20993
Jian Li8afbbee2016-07-27 19:16:51 +090020994 if (this._responseType) {
20995 xhr.responseType = this._responseType;
20996 }
20997
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070020998 // send stuff
20999 this.emit('request', this);
Jian Li83d87a72016-04-20 15:38:24 -070021000
21001 // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing)
21002 // We need null here if data is undefined
21003 xhr.send(typeof data !== 'undefined' ? data : null);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021004 return this;
21005};
21006
Jian Li83d87a72016-04-20 15:38:24 -070021007
21008/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021009 * Expose `Request`.
21010 */
21011
21012request.Request = Request;
21013
21014/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021015 * GET `url` with optional callback `fn(res)`.
21016 *
21017 * @param {String} url
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021018 * @param {Mixed|Function} [data] or fn
21019 * @param {Function} [fn]
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021020 * @return {Request}
21021 * @api public
21022 */
21023
21024request.get = function(url, data, fn){
21025 var req = request('GET', url);
21026 if ('function' == typeof data) fn = data, data = null;
21027 if (data) req.query(data);
21028 if (fn) req.end(fn);
21029 return req;
21030};
21031
21032/**
21033 * HEAD `url` with optional callback `fn(res)`.
21034 *
21035 * @param {String} url
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021036 * @param {Mixed|Function} [data] or fn
21037 * @param {Function} [fn]
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021038 * @return {Request}
21039 * @api public
21040 */
21041
21042request.head = function(url, data, fn){
21043 var req = request('HEAD', url);
21044 if ('function' == typeof data) fn = data, data = null;
21045 if (data) req.send(data);
21046 if (fn) req.end(fn);
21047 return req;
21048};
21049
21050/**
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021051 * OPTIONS query to `url` with optional callback `fn(res)`.
21052 *
21053 * @param {String} url
21054 * @param {Mixed|Function} [data] or fn
21055 * @param {Function} [fn]
21056 * @return {Request}
21057 * @api public
21058 */
21059
21060request.options = function(url, data, fn){
21061 var req = request('OPTIONS', url);
21062 if ('function' == typeof data) fn = data, data = null;
21063 if (data) req.send(data);
21064 if (fn) req.end(fn);
21065 return req;
21066};
21067
21068/**
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021069 * DELETE `url` with optional callback `fn(res)`.
21070 *
21071 * @param {String} url
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021072 * @param {Function} [fn]
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021073 * @return {Request}
21074 * @api public
21075 */
21076
Jian Li83d87a72016-04-20 15:38:24 -070021077function del(url, fn){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021078 var req = request('DELETE', url);
21079 if (fn) req.end(fn);
21080 return req;
21081};
21082
Jian Li8afbbee2016-07-27 19:16:51 +090021083request['del'] = del;
21084request['delete'] = del;
Jian Li83d87a72016-04-20 15:38:24 -070021085
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021086/**
21087 * PATCH `url` with optional `data` and callback `fn(res)`.
21088 *
21089 * @param {String} url
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021090 * @param {Mixed} [data]
21091 * @param {Function} [fn]
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021092 * @return {Request}
21093 * @api public
21094 */
21095
21096request.patch = function(url, data, fn){
21097 var req = request('PATCH', url);
21098 if ('function' == typeof data) fn = data, data = null;
21099 if (data) req.send(data);
21100 if (fn) req.end(fn);
21101 return req;
21102};
21103
21104/**
21105 * POST `url` with optional `data` and callback `fn(res)`.
21106 *
21107 * @param {String} url
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021108 * @param {Mixed} [data]
21109 * @param {Function} [fn]
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021110 * @return {Request}
21111 * @api public
21112 */
21113
21114request.post = function(url, data, fn){
21115 var req = request('POST', url);
21116 if ('function' == typeof data) fn = data, data = null;
21117 if (data) req.send(data);
21118 if (fn) req.end(fn);
21119 return req;
21120};
21121
21122/**
21123 * PUT `url` with optional `data` and callback `fn(res)`.
21124 *
21125 * @param {String} url
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021126 * @param {Mixed|Function} [data] or fn
21127 * @param {Function} [fn]
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021128 * @return {Request}
21129 * @api public
21130 */
21131
21132request.put = function(url, data, fn){
21133 var req = request('PUT', url);
21134 if ('function' == typeof data) fn = data, data = null;
21135 if (data) req.send(data);
21136 if (fn) req.end(fn);
21137 return req;
21138};
21139
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021140},{"./is-object":159,"./request":161,"./request-base":160,"emitter":162}],159:[function(require,module,exports){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021141/**
Jian Li8afbbee2016-07-27 19:16:51 +090021142 * Check if `obj` is an object.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021143 *
21144 * @param {Object} obj
Jian Li8afbbee2016-07-27 19:16:51 +090021145 * @return {Boolean}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021146 * @api private
21147 */
21148
Jian Li8afbbee2016-07-27 19:16:51 +090021149function isObject(obj) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021150 return null !== obj && 'object' === typeof obj;
Jian Li8afbbee2016-07-27 19:16:51 +090021151}
21152
21153module.exports = isObject;
21154
21155},{}],160:[function(require,module,exports){
21156/**
21157 * Module of mixed-in functions shared between node and client code
21158 */
21159var isObject = require('./is-object');
21160
21161/**
21162 * Clear previous timeout.
21163 *
21164 * @return {Request} for chaining
21165 * @api public
21166 */
21167
21168exports.clearTimeout = function _clearTimeout(){
21169 this._timeout = 0;
21170 clearTimeout(this._timer);
21171 return this;
21172};
21173
21174/**
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021175 * Override default response body parser
Jian Li8afbbee2016-07-27 19:16:51 +090021176 *
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021177 * This function will be called to convert incoming data into request.body
Jian Li8afbbee2016-07-27 19:16:51 +090021178 *
21179 * @param {Function}
21180 * @api public
21181 */
21182
21183exports.parse = function parse(fn){
21184 this._parser = fn;
21185 return this;
21186};
21187
21188/**
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021189 * Override default request body serializer
21190 *
21191 * This function will be called to convert data set via .send or .attach into payload to send
21192 *
21193 * @param {Function}
21194 * @api public
21195 */
21196
21197exports.serialize = function serialize(fn){
21198 this._serializer = fn;
21199 return this;
21200};
21201
21202/**
Jian Li8afbbee2016-07-27 19:16:51 +090021203 * Set timeout to `ms`.
21204 *
21205 * @param {Number} ms
21206 * @return {Request} for chaining
21207 * @api public
21208 */
21209
21210exports.timeout = function timeout(ms){
21211 this._timeout = ms;
21212 return this;
21213};
21214
21215/**
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021216 * Promise support
Jian Li8afbbee2016-07-27 19:16:51 +090021217 *
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021218 * @param {Function} resolve
Jian Li8afbbee2016-07-27 19:16:51 +090021219 * @param {Function} reject
21220 * @return {Request}
21221 */
21222
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021223exports.then = function then(resolve, reject) {
21224 if (!this._fullfilledPromise) {
21225 var self = this;
21226 this._fullfilledPromise = new Promise(function(innerResolve, innerReject){
21227 self.end(function(err, res){
21228 if (err) innerReject(err); else innerResolve(res);
21229 });
21230 });
21231 }
21232 return this._fullfilledPromise.then(resolve, reject);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021233}
21234
21235/**
Jian Li8afbbee2016-07-27 19:16:51 +090021236 * Allow for extension
21237 */
21238
21239exports.use = function use(fn) {
21240 fn(this);
21241 return this;
21242}
21243
21244
21245/**
21246 * Get request header `field`.
21247 * Case-insensitive.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021248 *
Jian Li8afbbee2016-07-27 19:16:51 +090021249 * @param {String} field
21250 * @return {String}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021251 * @api public
21252 */
21253
Jian Li8afbbee2016-07-27 19:16:51 +090021254exports.get = function(field){
21255 return this._header[field.toLowerCase()];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021256};
21257
21258/**
Jian Li8afbbee2016-07-27 19:16:51 +090021259 * Get case-insensitive header `field` value.
21260 * This is a deprecated internal API. Use `.get(field)` instead.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021261 *
Jian Li8afbbee2016-07-27 19:16:51 +090021262 * (getHeader is no longer used internally by the superagent code base)
21263 *
21264 * @param {String} field
21265 * @return {String}
21266 * @api private
21267 * @deprecated
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021268 */
21269
Jian Li8afbbee2016-07-27 19:16:51 +090021270exports.getHeader = exports.get;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021271
21272/**
Jian Li8afbbee2016-07-27 19:16:51 +090021273 * Set header `field` to `val`, or multiple fields with one object.
21274 * Case-insensitive.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021275 *
Jian Li8afbbee2016-07-27 19:16:51 +090021276 * Examples:
21277 *
21278 * req.get('/')
21279 * .set('Accept', 'application/json')
21280 * .set('X-API-Key', 'foobar')
21281 * .end(callback);
21282 *
21283 * req.get('/')
21284 * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' })
21285 * .end(callback);
21286 *
21287 * @param {String|Object} field
21288 * @param {String} val
21289 * @return {Request} for chaining
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021290 * @api public
21291 */
21292
Jian Li8afbbee2016-07-27 19:16:51 +090021293exports.set = function(field, val){
21294 if (isObject(field)) {
21295 for (var key in field) {
21296 this.set(key, field[key]);
21297 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021298 return this;
21299 }
Jian Li8afbbee2016-07-27 19:16:51 +090021300 this._header[field.toLowerCase()] = val;
21301 this.header[field] = val;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021302 return this;
21303};
21304
21305/**
Jian Li8afbbee2016-07-27 19:16:51 +090021306 * Remove header `field`.
21307 * Case-insensitive.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021308 *
Jian Li8afbbee2016-07-27 19:16:51 +090021309 * Example:
21310 *
21311 * req.get('/')
21312 * .unset('User-Agent')
21313 * .end(callback);
21314 *
21315 * @param {String} field
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021316 */
Jian Li8afbbee2016-07-27 19:16:51 +090021317exports.unset = function(field){
21318 delete this._header[field.toLowerCase()];
21319 delete this.header[field];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021320 return this;
21321};
21322
21323/**
Jian Li8afbbee2016-07-27 19:16:51 +090021324 * Write the field `name` and `val` for "multipart/form-data"
21325 * request bodies.
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021326 *
Jian Li8afbbee2016-07-27 19:16:51 +090021327 * ``` js
21328 * request.post('/upload')
21329 * .field('foo', 'bar')
21330 * .end(callback);
21331 * ```
21332 *
21333 * @param {String} name
21334 * @param {String|Blob|File|Buffer|fs.ReadStream} val
21335 * @return {Request} for chaining
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021336 * @api public
21337 */
Jian Li8afbbee2016-07-27 19:16:51 +090021338exports.field = function(name, val) {
21339 this._getFormData().append(name, val);
21340 return this;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021341};
21342
Jian Li7f6d0e9e2016-09-27 02:04:49 +090021343/**
21344 * Abort the request, and clear potential timeout.
21345 *
21346 * @return {Request}
21347 * @api public
21348 */
21349exports.abort = function(){
21350 if (this._aborted) {
21351 return this;
21352 }
21353 this._aborted = true;
21354 this.xhr && this.xhr.abort(); // browser
21355 this.req && this.req.abort(); // node
21356 this.clearTimeout();
21357 this.emit('abort');
21358 return this;
21359};
21360
21361/**
21362 * Enable transmission of cookies with x-domain requests.
21363 *
21364 * Note that for this to work the origin must not be
21365 * using "Access-Control-Allow-Origin" with a wildcard,
21366 * and also must set "Access-Control-Allow-Credentials"
21367 * to "true".
21368 *
21369 * @api public
21370 */
21371
21372exports.withCredentials = function(){
21373 // This is browser-only functionality. Node side is no-op.
21374 this._withCredentials = true;
21375 return this;
21376};
21377
21378/**
21379 * Set the max redirects to `n`. Does noting in browser XHR implementation.
21380 *
21381 * @param {Number} n
21382 * @return {Request} for chaining
21383 * @api public
21384 */
21385
21386exports.redirects = function(n){
21387 this._maxRedirects = n;
21388 return this;
21389};
21390
21391/**
21392 * Convert to a plain javascript object (not JSON string) of scalar properties.
21393 * Note as this method is designed to return a useful non-this value,
21394 * it cannot be chained.
21395 *
21396 * @return {Object} describing method, url, and data of this request
21397 * @api public
21398 */
21399
21400exports.toJSON = function(){
21401 return {
21402 method: this.method,
21403 url: this.url,
21404 data: this._data,
21405 headers: this._header
21406 };
21407};
21408
21409/**
21410 * Check if `obj` is a host object,
21411 * we don't want to serialize these :)
21412 *
21413 * TODO: future proof, move to compoent land
21414 *
21415 * @param {Object} obj
21416 * @return {Boolean}
21417 * @api private
21418 */
21419
21420exports._isHost = function _isHost(obj) {
21421 var str = {}.toString.call(obj);
21422
21423 switch (str) {
21424 case '[object File]':
21425 case '[object Blob]':
21426 case '[object FormData]':
21427 return true;
21428 default:
21429 return false;
21430 }
21431}
21432
21433/**
21434 * Send `data` as the request body, defaulting the `.type()` to "json" when
21435 * an object is given.
21436 *
21437 * Examples:
21438 *
21439 * // manual json
21440 * request.post('/user')
21441 * .type('json')
21442 * .send('{"name":"tj"}')
21443 * .end(callback)
21444 *
21445 * // auto json
21446 * request.post('/user')
21447 * .send({ name: 'tj' })
21448 * .end(callback)
21449 *
21450 * // manual x-www-form-urlencoded
21451 * request.post('/user')
21452 * .type('form')
21453 * .send('name=tj')
21454 * .end(callback)
21455 *
21456 * // auto x-www-form-urlencoded
21457 * request.post('/user')
21458 * .type('form')
21459 * .send({ name: 'tj' })
21460 * .end(callback)
21461 *
21462 * // defaults to x-www-form-urlencoded
21463 * request.post('/user')
21464 * .send('name=tobi')
21465 * .send('species=ferret')
21466 * .end(callback)
21467 *
21468 * @param {String|Object} data
21469 * @return {Request} for chaining
21470 * @api public
21471 */
21472
21473exports.send = function(data){
21474 var obj = isObject(data);
21475 var type = this._header['content-type'];
21476
21477 // merge
21478 if (obj && isObject(this._data)) {
21479 for (var key in data) {
21480 this._data[key] = data[key];
21481 }
21482 } else if ('string' == typeof data) {
21483 // default to x-www-form-urlencoded
21484 if (!type) this.type('form');
21485 type = this._header['content-type'];
21486 if ('application/x-www-form-urlencoded' == type) {
21487 this._data = this._data
21488 ? this._data + '&' + data
21489 : data;
21490 } else {
21491 this._data = (this._data || '') + data;
21492 }
21493 } else {
21494 this._data = data;
21495 }
21496
21497 if (!obj || this._isHost(data)) return this;
21498
21499 // default to json
21500 if (!type) this.type('json');
21501 return this;
21502};
21503
Jian Li8afbbee2016-07-27 19:16:51 +090021504},{"./is-object":159}],161:[function(require,module,exports){
21505// The node and browser modules expose versions of this with the
21506// appropriate constructor function bound as first argument
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021507/**
Jian Li8afbbee2016-07-27 19:16:51 +090021508 * Issue a request:
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021509 *
Jian Li8afbbee2016-07-27 19:16:51 +090021510 * Examples:
21511 *
21512 * request('GET', '/users').end(callback)
21513 * request('/users').end(callback)
21514 * request('/users', callback)
21515 *
21516 * @param {String} method
21517 * @param {String|Function} url or callback
21518 * @return {Request}
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021519 * @api public
21520 */
21521
Jian Li8afbbee2016-07-27 19:16:51 +090021522function request(RequestConstructor, method, url) {
21523 // callback
21524 if ('function' == typeof url) {
21525 return new RequestConstructor('GET', method).end(url);
21526 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021527
Jian Li8afbbee2016-07-27 19:16:51 +090021528 // url first
21529 if (2 == arguments.length) {
21530 return new RequestConstructor('GET', method);
21531 }
21532
21533 return new RequestConstructor(method, url);
21534}
21535
21536module.exports = request;
21537
21538},{}],162:[function(require,module,exports){
21539
21540/**
21541 * Expose `Emitter`.
21542 */
21543
21544if (typeof module !== 'undefined') {
21545 module.exports = Emitter;
21546}
21547
21548/**
21549 * Initialize a new `Emitter`.
21550 *
21551 * @api public
21552 */
21553
21554function Emitter(obj) {
21555 if (obj) return mixin(obj);
21556};
21557
21558/**
21559 * Mixin the emitter properties.
21560 *
21561 * @param {Object} obj
21562 * @return {Object}
21563 * @api private
21564 */
21565
21566function mixin(obj) {
21567 for (var key in Emitter.prototype) {
21568 obj[key] = Emitter.prototype[key];
21569 }
21570 return obj;
21571}
21572
21573/**
21574 * Listen on the given `event` with `fn`.
21575 *
21576 * @param {String} event
21577 * @param {Function} fn
21578 * @return {Emitter}
21579 * @api public
21580 */
21581
21582Emitter.prototype.on =
21583Emitter.prototype.addEventListener = function(event, fn){
21584 this._callbacks = this._callbacks || {};
21585 (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
21586 .push(fn);
21587 return this;
21588};
21589
21590/**
21591 * Adds an `event` listener that will be invoked a single
21592 * time then automatically removed.
21593 *
21594 * @param {String} event
21595 * @param {Function} fn
21596 * @return {Emitter}
21597 * @api public
21598 */
21599
21600Emitter.prototype.once = function(event, fn){
21601 function on() {
21602 this.off(event, on);
21603 fn.apply(this, arguments);
21604 }
21605
21606 on.fn = fn;
21607 this.on(event, on);
21608 return this;
21609};
21610
21611/**
21612 * Remove the given callback for `event` or all
21613 * registered callbacks.
21614 *
21615 * @param {String} event
21616 * @param {Function} fn
21617 * @return {Emitter}
21618 * @api public
21619 */
21620
21621Emitter.prototype.off =
21622Emitter.prototype.removeListener =
21623Emitter.prototype.removeAllListeners =
21624Emitter.prototype.removeEventListener = function(event, fn){
21625 this._callbacks = this._callbacks || {};
21626
21627 // all
21628 if (0 == arguments.length) {
21629 this._callbacks = {};
21630 return this;
21631 }
21632
21633 // specific event
21634 var callbacks = this._callbacks['$' + event];
21635 if (!callbacks) return this;
21636
21637 // remove all handlers
21638 if (1 == arguments.length) {
21639 delete this._callbacks['$' + event];
21640 return this;
21641 }
21642
21643 // remove specific handler
21644 var cb;
21645 for (var i = 0; i < callbacks.length; i++) {
21646 cb = callbacks[i];
21647 if (cb === fn || cb.fn === fn) {
21648 callbacks.splice(i, 1);
21649 break;
21650 }
21651 }
21652 return this;
21653};
21654
21655/**
21656 * Emit `event` with the given args.
21657 *
21658 * @param {String} event
21659 * @param {Mixed} ...
21660 * @return {Emitter}
21661 */
21662
21663Emitter.prototype.emit = function(event){
21664 this._callbacks = this._callbacks || {};
21665 var args = [].slice.call(arguments, 1)
21666 , callbacks = this._callbacks['$' + event];
21667
21668 if (callbacks) {
21669 callbacks = callbacks.slice(0);
21670 for (var i = 0, len = callbacks.length; i < len; ++i) {
21671 callbacks[i].apply(this, args);
21672 }
21673 }
21674
21675 return this;
21676};
21677
21678/**
21679 * Return array of callbacks for `event`.
21680 *
21681 * @param {String} event
21682 * @return {Array}
21683 * @api public
21684 */
21685
21686Emitter.prototype.listeners = function(event){
21687 this._callbacks = this._callbacks || {};
21688 return this._callbacks['$' + event] || [];
21689};
21690
21691/**
21692 * Check if this emitter has `event` handlers.
21693 *
21694 * @param {String} event
21695 * @return {Boolean}
21696 * @api public
21697 */
21698
21699Emitter.prototype.hasListeners = function(event){
21700 return !! this.listeners(event).length;
21701};
21702
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021703},{}]},{},[1])(1)
21704});
Jian Li1c94b9d2017-02-08 15:47:21 +090021705
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021706
Jian Li8afbbee2016-07-27 19:16:51 +090021707 /*global JSONEditor*/
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021708'use strict';
21709
21710window.SwaggerUi = Backbone.Router.extend({
21711
21712 dom_id: 'swagger_ui',
21713
21714 // Attributes
21715 options: null,
21716 api: null,
21717 headerView: null,
21718 mainView: null,
21719
21720 // SwaggerUi accepts all the same options as SwaggerApi
21721 initialize: function(options) {
21722 options = options || {};
Jian Li8afbbee2016-07-27 19:16:51 +090021723
Jian Li83d87a72016-04-20 15:38:24 -070021724 if (options.defaultModelRendering !== 'model') {
21725 options.defaultModelRendering = 'schema';
21726 }
Jian Li8afbbee2016-07-27 19:16:51 +090021727
Jian Li83d87a72016-04-20 15:38:24 -070021728 if (!options.highlightSizeThreshold) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021729 options.highlightSizeThreshold = 100000;
21730 }
21731
21732 // Allow dom_id to be overridden
21733 if (options.dom_id) {
21734 this.dom_id = options.dom_id;
21735 delete options.dom_id;
21736 }
21737
21738 if (!options.supportedSubmitMethods){
21739 options.supportedSubmitMethods = [
21740 'get',
21741 'put',
21742 'post',
21743 'delete',
21744 'head',
21745 'options',
21746 'patch'
21747 ];
21748 }
21749
21750 if (typeof options.oauth2RedirectUrl === 'string') {
Jian Li8afbbee2016-07-27 19:16:51 +090021751 window.oAuthRedirectUrl = options.oauth2RedirectUrl;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021752 }
21753
21754 // Create an empty div which contains the dom_id
21755 if (! $('#' + this.dom_id).length){
21756 $('body').append('<div id="' + this.dom_id + '"></div>') ;
21757 }
21758
21759 this.options = options;
21760
21761 // set marked options
21762 marked.setOptions({gfm: true});
21763
21764 // Set the callbacks
21765 var that = this;
21766 this.options.success = function() { return that.render(); };
21767 this.options.progress = function(d) { return that.showMessage(d); };
21768 this.options.failure = function(d) { return that.onLoadFailure(d); };
21769
21770 // Create view to handle the header inputs
21771 this.headerView = new SwaggerUi.Views.HeaderView({el: $('#header')});
21772
21773 // Event handler for when the baseUrl/apiKey is entered by user
21774 this.headerView.on('update-swagger-ui', function(data) {
21775 return that.updateSwaggerUi(data);
21776 });
Jian Li83d87a72016-04-20 15:38:24 -070021777
21778 // JSon Editor custom theming
21779 JSONEditor.defaults.iconlibs.swagger = JSONEditor.AbstractIconLib.extend({
21780 mapping: {
21781 collapse: 'collapse',
21782 expand: 'expand'
21783 },
21784 icon_prefix: 'swagger-'
21785 });
21786
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021787 },
21788
21789 // Set an option after initializing
21790 setOption: function(option, value) {
21791 this.options[option] = value;
21792 },
21793
21794 // Get the value of a previously set option
21795 getOption: function(option) {
21796 return this.options[option];
21797 },
21798
21799 // Event handler for when url/key is received from user
21800 updateSwaggerUi: function(data){
21801 this.options.url = data.url;
21802 this.load();
21803 },
21804
21805 // Create an api and render
21806 load: function(){
21807 // Initialize the API object
21808 if (this.mainView) {
21809 this.mainView.clear();
21810 }
Jian Li8afbbee2016-07-27 19:16:51 +090021811
21812 if (this.authView) {
21813 this.authView.remove();
21814 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021815 var url = this.options.url;
21816 if (url && url.indexOf('http') !== 0) {
21817 url = this.buildUrl(window.location.href.toString(), url);
21818 }
21819 if(this.api) {
21820 this.options.authorizations = this.api.clientAuthorizations.authz;
21821 }
21822 this.options.url = url;
21823 this.headerView.update(url);
21824
21825 this.api = new SwaggerClient(this.options);
21826 },
21827
21828 // collapse all sections
21829 collapseAll: function(){
21830 Docs.collapseEndpointListForResource('');
21831 },
21832
21833 // list operations for all sections
21834 listAll: function(){
21835 Docs.collapseOperationsForResource('');
21836 },
21837
21838 // expand operations for all sections
21839 expandAll: function(){
21840 Docs.expandOperationsForResource('');
21841 },
21842
21843 // This is bound to success handler for SwaggerApi
21844 // so it gets called when SwaggerApi completes loading
21845 render: function(){
Jian Li8afbbee2016-07-27 19:16:51 +090021846 var authsModel;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021847 this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
21848 this.mainView = new SwaggerUi.Views.MainView({
21849 model: this.api,
21850 el: $('#' + this.dom_id),
21851 swaggerOptions: this.options,
21852 router: this
21853 }).render();
Jian Li8afbbee2016-07-27 19:16:51 +090021854 if (!_.isEmpty(this.api.securityDefinitions)){
21855 authsModel = _.map(this.api.securityDefinitions, function (auth, name) {
21856 var result = {};
21857 result[name] = auth;
21858 return result;
21859 });
21860 this.authView = new SwaggerUi.Views.AuthButtonView({
21861 data: SwaggerUi.utils.parseSecurityDefinitions(authsModel),
21862 router: this
21863 });
21864 $('#auth_container').append(this.authView.render().el);
21865 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021866 this.showMessage();
21867 switch (this.options.docExpansion) {
21868 case 'full':
21869 this.expandAll(); break;
21870 case 'list':
21871 this.listAll(); break;
21872 default:
21873 break;
21874 }
21875 this.renderGFM();
21876
21877 if (this.options.onComplete){
21878 this.options.onComplete(this.api, this);
21879 }
21880
21881 setTimeout(Docs.shebang.bind(this), 100);
21882 },
21883
21884 buildUrl: function(base, url){
21885 if (url.indexOf('/') === 0) {
21886 var parts = base.split('/');
21887 base = parts[0] + '//' + parts[2];
21888 return base + url;
21889 } else {
21890 var endOfPath = base.length;
21891
21892 if (base.indexOf('?') > -1){
21893 endOfPath = Math.min(endOfPath, base.indexOf('?'));
21894 }
21895
21896 if (base.indexOf('#') > -1){
21897 endOfPath = Math.min(endOfPath, base.indexOf('#'));
21898 }
21899
21900 base = base.substring(0, endOfPath);
21901
21902 if (base.indexOf('/', base.length - 1 ) !== -1){
21903 return base + url;
21904 }
21905
21906 return base + '/' + url;
21907 }
21908 },
21909
21910 // Shows message on topbar of the ui
21911 showMessage: function(data){
21912 if (data === undefined) {
21913 data = '';
21914 }
Jian Li83d87a72016-04-20 15:38:24 -070021915 var $msgbar = $('#message-bar');
21916 $msgbar.removeClass('message-fail');
21917 $msgbar.addClass('message-success');
21918 $msgbar.text(data);
21919 if(window.SwaggerTranslator) {
21920 window.SwaggerTranslator.translate($msgbar);
21921 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021922 },
21923
21924 // shows message in red
21925 onLoadFailure: function(data){
21926 if (data === undefined) {
21927 data = '';
21928 }
21929 $('#message-bar').removeClass('message-success');
21930 $('#message-bar').addClass('message-fail');
21931
21932 var val = $('#message-bar').text(data);
21933
21934 if (this.options.onFailure) {
21935 this.options.onFailure(data);
21936 }
21937
21938 return val;
21939 },
21940
21941 // Renders GFM for elements with 'markdown' class
21942 renderGFM: function(){
21943 $('.markdown').each(function(){
21944 $(this).html(marked($(this).html()));
21945 });
21946
21947 $('.propDesc', '.model-signature .description').each(function () {
21948 $(this).html(marked($(this).html())).addClass('markdown');
21949 });
21950 }
21951
21952});
21953
21954window.SwaggerUi.Views = {};
Jian Li8afbbee2016-07-27 19:16:51 +090021955window.SwaggerUi.Models = {};
21956window.SwaggerUi.Collections = {};
21957window.SwaggerUi.partials = {};
21958window.SwaggerUi.utils = {};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070021959
21960// don't break backward compatibility with previous versions and warn users to upgrade their code
21961(function(){
21962 window.authorizations = {
21963 add: function() {
21964 warn('Using window.authorizations is deprecated. Please use SwaggerUi.api.clientAuthorizations.add().');
21965
21966 if (typeof window.swaggerUi === 'undefined') {
21967 throw new TypeError('window.swaggerUi is not defined');
21968 }
21969
21970 if (window.swaggerUi instanceof SwaggerUi) {
21971 window.swaggerUi.api.clientAuthorizations.add.apply(window.swaggerUi.api.clientAuthorizations, arguments);
21972 }
21973 }
21974 };
21975
21976 window.ApiKeyAuthorization = function() {
21977 warn('window.ApiKeyAuthorization is deprecated. Please use SwaggerClient.ApiKeyAuthorization.');
21978 SwaggerClient.ApiKeyAuthorization.apply(window, arguments);
21979 };
21980
21981 window.PasswordAuthorization = function() {
21982 warn('window.PasswordAuthorization is deprecated. Please use SwaggerClient.PasswordAuthorization.');
21983 SwaggerClient.PasswordAuthorization.apply(window, arguments);
21984 };
21985
21986 function warn(message) {
21987 if ('console' in window && typeof window.console.warn === 'function') {
21988 console.warn(message);
21989 }
21990 }
21991})();
21992
21993
21994// UMD
21995(function (root, factory) {
21996 if (typeof define === 'function' && define.amd) {
21997 // AMD. Register as an anonymous module.
21998 define(['b'], function (b) {
21999 return (root.SwaggerUi = factory(b));
22000 });
22001 } else if (typeof exports === 'object') {
22002 // Node. Does not work with strict CommonJS, but
Jian Li83d87a72016-04-20 15:38:24 -070022003 // only CommonJS-like environments that support module.exports,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022004 // like Node.
22005 module.exports = factory(require('b'));
22006 } else {
22007 // Browser globals
22008 root.SwaggerUi = factory(root.b);
22009 }
22010}(this, function () {
22011 return SwaggerUi;
22012}));
22013
22014'use strict';
22015
Jian Li8afbbee2016-07-27 19:16:51 +090022016window.SwaggerUi.utils = {
Jian Li1c94b9d2017-02-08 15:47:21 +090022017 parseSecurityDefinitions: function (security, securityDefinitions) {
22018 var auths = Object.assign({}, securityDefinitions);
Jian Li8afbbee2016-07-27 19:16:51 +090022019 var oauth2Arr = [];
22020 var authsArr = [];
22021 var scopes = [];
22022 var utils = window.SwaggerUi.utils;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022023
Jian Li8afbbee2016-07-27 19:16:51 +090022024 if (!Array.isArray(security)) { return null; }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022025
Jian Li8afbbee2016-07-27 19:16:51 +090022026 security.forEach(function (item) {
22027 var singleSecurity = {};
22028 var singleOauth2Security = {};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022029
Jian Li8afbbee2016-07-27 19:16:51 +090022030 for (var key in item) {
22031 if (Array.isArray(item[key])) {
22032 if (!auths[key]) { continue; }
22033 auths[key] = auths[key] || {};
22034 if (auths[key].type === 'oauth2') {
22035 singleOauth2Security[key] = Object.assign({}, auths[key]);
22036 singleOauth2Security[key].scopes = Object.assign({}, auths[key].scopes);
22037 for (var i in singleOauth2Security[key].scopes) {
22038 if (item[key].indexOf(i) < 0) {
22039 delete singleOauth2Security[key].scopes[i];
22040 }
22041 }
22042 singleOauth2Security[key].scopes = utils.parseOauth2Scopes(singleOauth2Security[key].scopes);
22043 scopes = _.merge(scopes, singleOauth2Security[key].scopes);
22044 } else {
22045 singleSecurity[key] = Object.assign({}, auths[key]);
22046 }
22047 } else {
22048 if (item[key].type === 'oauth2') {
22049 singleOauth2Security[key] = Object.assign({}, item[key]);
22050 singleOauth2Security[key].scopes = utils.parseOauth2Scopes(singleOauth2Security[key].scopes);
22051 scopes = _.merge(scopes, singleOauth2Security[key].scopes);
22052 } else {
22053 singleSecurity[key] = item[key];
22054 }
22055 }
22056 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022057
Jian Li8afbbee2016-07-27 19:16:51 +090022058 if (!_.isEmpty(singleSecurity)) {
22059 authsArr.push(singleSecurity);
22060 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022061
Jian Li8afbbee2016-07-27 19:16:51 +090022062 if (!_.isEmpty(singleOauth2Security)){
22063 oauth2Arr.push(singleOauth2Security);
22064 }
22065 });
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022066
Jian Li8afbbee2016-07-27 19:16:51 +090022067 return {
22068 auths : authsArr,
22069 oauth2: oauth2Arr,
22070 scopes: scopes
22071 };
22072 },
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022073
Jian Li8afbbee2016-07-27 19:16:51 +090022074 parseOauth2Scopes: function (data) {
22075 var scopes = Object.assign({}, data);
22076 var result = [];
22077 var key;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022078
Jian Li8afbbee2016-07-27 19:16:51 +090022079 for (key in scopes) {
22080 result.push({scope: key, description: scopes[key]});
22081 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022082
Jian Li8afbbee2016-07-27 19:16:51 +090022083 return result;
Jian Li7f6d0e9e2016-09-27 02:04:49 +090022084 },
22085
22086 sanitize: function(html) {
22087 // Strip the script tags from the html and inline evenhandlers
22088 html = html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
22089 html = html.replace(/(on\w+="[^"]*")*(on\w+='[^']*')*(on\w+=\w*\(\w*\))*/gi, '');
22090
22091 return html;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022092 }
Jian Li8afbbee2016-07-27 19:16:51 +090022093};
22094'use strict';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022095
Jian Li8afbbee2016-07-27 19:16:51 +090022096SwaggerUi.Models.ApiKeyAuthModel = Backbone.Model.extend({
22097 defaults: {
22098 'in': '',
22099 name: '',
22100 title: '',
22101 value: ''
22102 },
22103
22104 initialize: function () {
22105 this.on('change', this.validate);
22106 },
22107
22108 validate: function () {
22109 var valid = !!this.get('value');
22110
22111 this.set('valid', valid);
22112
22113 return valid;
22114 }
22115});
22116'use strict';
22117
22118SwaggerUi.Views.ApiKeyAuthView = Backbone.View.extend({ // TODO: append this to global SwaggerUi
22119
22120 events: {
22121 'change .input_apiKey_entry': 'apiKeyChange'
22122 },
22123
22124 selectors: {
22125 apikeyInput: '.input_apiKey_entry'
22126 },
22127
22128 template: Handlebars.templates.apikey_auth,
22129
22130 initialize: function(opts) {
22131 this.options = opts || {};
22132 this.router = this.options.router;
22133 },
22134
22135 render: function (){
22136 this.$el.html(this.template(this.model.toJSON()));
22137
22138 return this;
22139 },
22140
22141 apiKeyChange: function (e) {
22142 var val = $(e.target).val();
22143 if (val) {
22144 this.$(this.selectors.apikeyInput).removeClass('error');
22145 }
22146
22147 this.model.set('value', val);
22148 },
22149
22150 isValid: function () {
22151 return this.model.validate();
22152 },
22153
22154 highlightInvalid: function () {
22155 if (!this.isValid()) {
22156 this.$(this.selectors.apikeyInput).addClass('error');
22157 }
22158 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022159
22160});
22161'use strict';
22162
Jian Li8afbbee2016-07-27 19:16:51 +090022163SwaggerUi.Views.AuthButtonView = Backbone.View.extend({
22164 events: {
22165 'click .authorize__btn': 'authorizeBtnClick'
22166 },
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022167
Jian Li8afbbee2016-07-27 19:16:51 +090022168 tpls: {
22169 popup: Handlebars.templates.popup,
22170 authBtn: Handlebars.templates.auth_button,
22171 authBtnOperation: Handlebars.templates.auth_button_operation
22172 },
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022173
Jian Li8afbbee2016-07-27 19:16:51 +090022174 initialize: function(opts) {
22175 this.options = opts || {};
22176 this.options.data = this.options.data || {};
22177 this.isOperation = this.options.isOperation;
22178 this.model = this.model || {};
22179 this.router = this.options.router;
22180 this.auths = this.options.data.oauth2.concat(this.options.data.auths);
22181 },
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022182
Jian Li8afbbee2016-07-27 19:16:51 +090022183 render: function () {
22184 var tplName = this.isOperation ? 'authBtnOperation' : 'authBtn';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022185
Jian Li8afbbee2016-07-27 19:16:51 +090022186 this.$authEl = this.renderAuths(this.auths);
22187 this.$el.html(this.tpls[tplName](this.model));
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022188
Jian Li8afbbee2016-07-27 19:16:51 +090022189 return this;
22190 },
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022191
Jian Li8afbbee2016-07-27 19:16:51 +090022192 authorizeBtnClick: function (e) {
22193 var authsModel;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022194
Jian Li8afbbee2016-07-27 19:16:51 +090022195 e.preventDefault();
22196
22197 authsModel = {
22198 title: 'Available authorizations',
22199 content: this.$authEl
22200 };
22201
22202 // The content of the popup is removed and all events unbound after clicking the 'Cancel' button of the popup.
22203 // We'll have to re-render the contents before creating a new popup view.
22204 this.render();
22205
22206 this.popup = new SwaggerUi.Views.PopupView({model: authsModel});
22207 this.popup.render();
22208 },
22209
22210 renderAuths: function (auths) {
22211 var $el = $('<div>');
22212 var isLogout = false;
22213
22214 auths.forEach(function (auth) {
22215 var authView = new SwaggerUi.Views.AuthView({data: auth, router: this.router});
22216 var authEl = authView.render().el;
22217 $el.append(authEl);
22218 if (authView.isLogout) {
22219 isLogout = true;
22220 }
22221 }, this);
22222
22223 this.model.isLogout = isLogout;
22224
22225 return $el;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022226 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022227
22228});
Jian Li8afbbee2016-07-27 19:16:51 +090022229
22230'use strict';
22231
22232SwaggerUi.Collections.AuthsCollection = Backbone.Collection.extend({
22233 constructor: function() {
22234 var args = Array.prototype.slice.call(arguments);
22235
22236 args[0] = this.parse(args[0]);
22237
22238 Backbone.Collection.apply(this, args);
22239 },
22240
22241 add: function (model) {
22242 var args = Array.prototype.slice.call(arguments);
22243
22244 if (Array.isArray(model)) {
22245 args[0] = _.map(model, function(val) {
22246 return this.handleOne(val);
22247 }, this);
22248 } else {
22249 args[0] = this.handleOne(model);
22250 }
22251
22252 Backbone.Collection.prototype.add.apply(this, args);
22253 },
22254
22255 handleOne: function (model) {
22256 var result = model;
22257
22258 if (! (model instanceof Backbone.Model) ) {
22259 switch (model.type) {
22260 case 'oauth2':
22261 result = new SwaggerUi.Models.Oauth2Model(model);
22262 break;
22263 case 'basic':
22264 result = new SwaggerUi.Models.BasicAuthModel(model);
22265 break;
22266 case 'apiKey':
22267 result = new SwaggerUi.Models.ApiKeyAuthModel(model);
22268 break;
22269 default:
22270 result = new Backbone.Model(model);
22271 }
22272 }
22273
22274 return result;
22275 },
22276
22277 isValid: function () {
22278 var valid = true;
22279
22280 this.models.forEach(function(model) {
22281 if (!model.validate()) {
22282 valid = false;
22283 }
22284 });
22285
22286 return valid;
22287 },
22288
22289 isAuthorized: function () {
22290 return this.length === this.where({ isLogout: true }).length;
22291 },
22292
22293 isPartiallyAuthorized: function () {
22294 return this.where({ isLogout: true }).length > 0;
22295 },
22296
22297 parse: function (data) {
Jian Li1c94b9d2017-02-08 15:47:21 +090022298 var authz = {};
22299
22300 if(typeof window.swaggerUi !== 'undefined') {
22301 authz = Object.assign({}, window.swaggerUi.api.clientAuthorizations.authz);
22302 }
Jian Li8afbbee2016-07-27 19:16:51 +090022303
22304 return _.map(data, function (auth, name) {
22305 var isBasic = authz[name] && auth.type === 'basic' && authz[name].username && authz[name].password;
22306
22307 _.extend(auth, {
22308 title: name
22309 });
22310
22311 if (authz[name] || isBasic) {
22312 _.extend(auth, {
22313 isLogout: true,
22314 value: isBasic ? undefined : authz[name].value,
22315 username: isBasic ? authz[name].username : undefined,
22316 password: isBasic ? authz[name].password : undefined,
22317 valid: true
22318 });
22319 }
22320
22321 return auth;
22322 });
22323 }
22324});
22325'use strict';
22326
22327SwaggerUi.Views.AuthsCollectionView = Backbone.View.extend({
22328
22329 initialize: function(opts) {
22330 this.options = opts || {};
22331 this.options.data = this.options.data || {};
22332 this.router = this.options.router;
22333
22334 this.collection = new SwaggerUi.Collections.AuthsCollection(opts.data);
22335
22336 this.$innerEl = $('<div>');
22337 this.authViews = [];
22338 },
22339
22340 render: function () {
22341 this.collection.each(function (auth) {
22342 this.renderOneAuth(auth);
22343 }, this);
22344
22345 this.$el.html(this.$innerEl.html() ? this.$innerEl : '');
22346
22347 return this;
22348 },
22349
22350 renderOneAuth: function (authModel) {
22351 var authViewEl, authView, authViewName;
22352 var type = authModel.get('type');
22353
22354 if (type === 'apiKey') {
22355 authViewName = 'ApiKeyAuthView';
22356 } else if (type === 'basic' && this.$innerEl.find('.basic_auth_container').length === 0) {
22357 authViewName = 'BasicAuthView';
22358 } else if (type === 'oauth2') {
22359 authViewName = 'Oauth2View';
22360 }
22361
22362 if (authViewName) {
22363 authView = new SwaggerUi.Views[authViewName]({model: authModel, router: this.router});
22364 authViewEl = authView.render().el;
22365 this.authViews.push(authView);
22366 }
22367
22368 this.$innerEl.append(authViewEl);
22369 },
22370
22371 highlightInvalid: function () {
22372 this.authViews.forEach(function (view) {
22373 view.highlightInvalid();
22374 }, this);
22375 }
22376
22377});
22378
22379'use strict';
22380
22381/* global redirect_uri:true */
22382/* global clientId */
22383/* global scopeSeparator */
22384/* global additionalQueryStringParams */
22385/* global clientSecret */
22386/* global onOAuthComplete */
22387/* global realm */
22388/*jshint unused:false*/
22389
22390SwaggerUi.Views.AuthView = Backbone.View.extend({
22391 events: {
22392 'click .auth_submit__button': 'authorizeClick',
22393 'click .auth_logout__button': 'logoutClick'
22394 },
22395
22396 tpls: {
22397 main: Handlebars.templates.auth_view
22398 },
22399
22400 selectors: {
22401 innerEl: '.auth_inner',
22402 authBtn: '.auth_submit__button'
22403 },
22404
22405 initialize: function(opts) {
22406 this.options = opts || {};
22407 opts.data = opts.data || {};
22408 this.router = this.options.router;
22409
22410 this.authsCollectionView = new SwaggerUi.Views.AuthsCollectionView({data: opts.data});
22411
22412 this.$el.html(this.tpls.main({
22413 isLogout: this.authsCollectionView.collection.isAuthorized(),
22414 isAuthorized: this.authsCollectionView.collection.isPartiallyAuthorized()
22415 }));
22416 this.$innerEl = this.$(this.selectors.innerEl);
22417 this.isLogout = this.authsCollectionView.collection.isPartiallyAuthorized();
22418 },
22419
22420 render: function () {
22421 this.$innerEl.html(this.authsCollectionView.render().el);
22422
22423 return this;
22424 },
22425
22426 authorizeClick: function (e) {
22427 e.preventDefault();
22428 e.stopPropagation();
22429
22430 if (this.authsCollectionView.collection.isValid()) {
22431 this.authorize();
22432 } else {
22433 this.authsCollectionView.highlightInvalid();
22434 }
22435 },
22436
22437 authorize: function () {
22438 this.authsCollectionView.collection.forEach(function (auth) {
22439 var keyAuth, basicAuth;
22440 var type = auth.get('type');
22441
22442 if (type === 'apiKey') {
22443 keyAuth = new SwaggerClient.ApiKeyAuthorization(
22444 auth.get('name'),
22445 auth.get('value'),
22446 auth.get('in')
22447 );
22448
22449 this.router.api.clientAuthorizations.add(auth.get('title'), keyAuth);
22450 } else if (type === 'basic') {
22451 basicAuth = new SwaggerClient.PasswordAuthorization(auth.get('username'), auth.get('password'));
22452 this.router.api.clientAuthorizations.add(auth.get('title'), basicAuth);
22453 } else if (type === 'oauth2') {
22454 this.handleOauth2Login(auth);
22455 }
22456 }, this);
22457
22458 this.router.load();
22459 },
22460
22461 logoutClick: function (e) {
22462 e.preventDefault();
22463
22464 this.authsCollectionView.collection.forEach(function (auth) {
22465 window.swaggerUi.api.clientAuthorizations.remove(auth.get('title'));
22466 });
22467
22468 this.router.load();
22469 },
22470
22471 // taken from lib/swagger-oauth.js
22472 handleOauth2Login: function (auth) {
22473 var host = window.location;
22474 var pathname = location.pathname.substring(0, location.pathname.lastIndexOf('/'));
22475 var defaultRedirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
22476 var redirectUrl = window.oAuthRedirectUrl || defaultRedirectUrl;
22477 var url = null;
22478 var scopes = _.map(auth.get('scopes'), function (scope) {
Jian Li1c94b9d2017-02-08 15:47:21 +090022479 if(scope.checked) {
22480 return scope.scope;
22481 }
Jian Li8afbbee2016-07-27 19:16:51 +090022482 });
Jian Li1c94b9d2017-02-08 15:47:21 +090022483 var container = window.swaggerUiAuth || (window.swaggerUiAuth = {});
Jian Li8afbbee2016-07-27 19:16:51 +090022484 var state, dets, ep;
Jian Li1c94b9d2017-02-08 15:47:21 +090022485 container.OAuthSchemeKey = auth.get('title');
Jian Li8afbbee2016-07-27 19:16:51 +090022486
22487 window.enabledScopes = scopes;
22488 var flow = auth.get('flow');
22489
Jian Li1c94b9d2017-02-08 15:47:21 +090022490 /**
22491 * Returns the name of the access token parameter returned by the server.
22492 *
22493 * @param dets
22494 * The authorisation scheme configuration.
22495 * @return the name of the access token parameter
22496 */
22497 function getTokenName(dets) {
22498 return dets.vendorExtensions['x-tokenName'] || dets.tokenName;
22499 }
22500
Jian Li8afbbee2016-07-27 19:16:51 +090022501 if(auth.get('type') === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) {
22502 dets = auth.attributes;
22503 url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code');
Jian Li1c94b9d2017-02-08 15:47:21 +090022504 container.tokenName = getTokenName(dets) || 'access_token';
22505 container.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null);
22506 state = container.OAuthSchemeKey;
Jian Li8afbbee2016-07-27 19:16:51 +090022507 }
22508 else if(auth.get('type') === 'oauth2' && flow && (flow === 'application')) {
22509 dets = auth.attributes;
Jian Li1c94b9d2017-02-08 15:47:21 +090022510 container.tokenName = getTokenName(dets) || 'access_token';
22511 this.clientCredentialsFlow(scopes, dets, container.OAuthSchemeKey);
22512 return;
22513 }
22514 else if(auth.get('type') === 'oauth2' && flow && (flow === 'password')) {
22515 dets = auth.attributes;
22516 container.tokenName = getTokenName(dets) || 'access_token';
22517 this.passwordFlow(scopes, dets, container.OAuthSchemeKey);
Jian Li8afbbee2016-07-27 19:16:51 +090022518 return;
22519 }
22520 else if(auth.get('grantTypes')) {
22521 // 1.2 support
22522 var o = auth.get('grantTypes');
22523 for(var t in o) {
22524 if(o.hasOwnProperty(t) && t === 'implicit') {
22525 dets = o[t];
22526 ep = dets.loginEndpoint.url;
22527 url = dets.loginEndpoint.url + '?response_type=token';
Jian Li1c94b9d2017-02-08 15:47:21 +090022528 container.tokenName = getTokenName(dets);
Jian Li8afbbee2016-07-27 19:16:51 +090022529 }
22530 else if (o.hasOwnProperty(t) && t === 'accessCode') {
22531 dets = o[t];
22532 ep = dets.tokenRequestEndpoint.url;
22533 url = dets.tokenRequestEndpoint.url + '?response_type=code';
Jian Li1c94b9d2017-02-08 15:47:21 +090022534 container.tokenName = getTokenName(dets);
Jian Li8afbbee2016-07-27 19:16:51 +090022535 }
22536 }
22537 }
22538
22539 redirect_uri = redirectUrl;
22540
22541 url += '&redirect_uri=' + encodeURIComponent(redirectUrl);
22542 url += '&realm=' + encodeURIComponent(realm);
22543 url += '&client_id=' + encodeURIComponent(clientId);
22544 url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator));
22545 url += '&state=' + encodeURIComponent(state);
22546 for (var key in additionalQueryStringParams) {
22547 url += '&' + key + '=' + encodeURIComponent(additionalQueryStringParams[key]);
22548 }
22549
22550 window.open(url);
22551 },
22552
22553 // taken from lib/swagger-oauth.js
Jian Li1c94b9d2017-02-08 15:47:21 +090022554 clientCredentialsFlow: function (scopes, oauth, OAuthSchemeKey) {
22555 this.accessTokenRequest(scopes, oauth, OAuthSchemeKey, 'client_credentials');
22556 },
22557
22558 passwordFlow: function (scopes, oauth, OAuthSchemeKey) {
22559 this.accessTokenRequest(scopes, oauth, OAuthSchemeKey, 'password', {
22560 'username': oauth.username,
22561 'password': oauth.password
22562 });
22563 },
22564
22565 accessTokenRequest: function (scopes, oauth, OAuthSchemeKey, grantType, params) {
22566 params = $.extend({}, {
Jian Li8afbbee2016-07-27 19:16:51 +090022567 'scope': scopes.join(' '),
Jian Li1c94b9d2017-02-08 15:47:21 +090022568 'grant_type': grantType
22569 }, params);
22570
22571 var headers= {};
22572
22573 switch (oauth.clientAuthenticationType) {
22574 case 'basic':
22575 headers.Authorization = 'Basic ' + btoa(oauth.clientId + ':' + oauth.clientSecret);
22576 break;
22577 case 'request-body':
22578 params.client_id = oauth.clientId;
22579 params.client_secret = oauth.clientSecret;
22580 break;
22581 }
22582
Jian Li8afbbee2016-07-27 19:16:51 +090022583 $.ajax({
Jian Li1c94b9d2017-02-08 15:47:21 +090022584 url : oauth.tokenUrl,
Jian Li8afbbee2016-07-27 19:16:51 +090022585 type: 'POST',
22586 data: params,
Jian Li1c94b9d2017-02-08 15:47:21 +090022587 headers: headers,
Jian Li8afbbee2016-07-27 19:16:51 +090022588 success: function (data)
22589 {
22590 onOAuthComplete(data, OAuthSchemeKey);
22591 },
22592 error: function ()
22593 {
22594 onOAuthComplete('');
22595 }
22596 });
22597 }
Jian Li8afbbee2016-07-27 19:16:51 +090022598});
22599
22600'use strict';
22601
22602SwaggerUi.Models.BasicAuthModel = Backbone.Model.extend({
22603 defaults: {
22604 username: '',
22605 password: '',
22606 title: 'basic'
22607 },
22608
22609 initialize: function () {
22610 this.on('change', this.validate);
22611 },
22612
22613 validate: function () {
22614 var valid = !!this.get('password') && !!this.get('username');
22615
22616 this.set('valid', valid);
22617
22618 return valid;
22619 }
22620});
22621'use strict';
22622
22623SwaggerUi.Views.BasicAuthView = Backbone.View.extend({
22624
22625 initialize: function (opts) {
22626 this.options = opts || {};
22627 this.router = this.options.router;
22628 },
22629
22630 events: {
22631 'change .auth_input': 'inputChange'
22632 },
22633
22634 selectors: {
22635 usernameInput: '.basic_auth__username',
22636 passwordInput: '.basic_auth__password'
22637 },
22638
22639 cls: {
22640 error: 'error'
22641 },
22642
22643 template: Handlebars.templates.basic_auth,
22644
22645 render: function(){
22646 $(this.el).html(this.template(this.model.toJSON()));
22647
22648 return this;
22649 },
22650
22651 inputChange: function (e) {
22652 var $el = $(e.target);
22653 var val = $el.val();
22654 var attr = $el.prop('name');
22655
22656 if (val) {
22657 $el.removeClass(this.cls.error);
22658 }
22659
22660 this.model.set(attr, val);
22661 },
22662
22663 isValid: function () {
22664 return this.model.validate();
22665 },
22666
22667 highlightInvalid: function () {
22668 if (!this.model.get('username')) {
22669 this.$(this.selectors.usernameInput).addClass(this.cls.error);
22670 }
22671 }
22672});
22673
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022674'use strict';
22675
22676SwaggerUi.Views.ContentTypeView = Backbone.View.extend({
22677 initialize: function() {},
22678
22679 render: function(){
22680 this.model.contentTypeId = 'ct' + Math.random();
22681 $(this.el).html(Handlebars.templates.content_type(this.model));
22682 return this;
22683 }
22684});
22685'use strict';
22686
22687SwaggerUi.Views.HeaderView = Backbone.View.extend({
22688 events: {
22689 'click #show-pet-store-icon' : 'showPetStore',
22690 'click #explore' : 'showCustom',
Jian Li7f6d0e9e2016-09-27 02:04:49 +090022691 'submit #api_selector' : 'showCustom',
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022692 'keyup #input_baseUrl' : 'showCustomOnKeyup',
22693 'keyup #input_apiKey' : 'showCustomOnKeyup'
22694 },
22695
22696 initialize: function(){},
22697
22698 showPetStore: function(){
22699 this.trigger('update-swagger-ui', {
22700 url:'http://petstore.swagger.io/v2/swagger.json'
22701 });
22702 },
22703
22704 showCustomOnKeyup: function(e){
22705 if (e.keyCode === 13) {
22706 this.showCustom();
22707 }
22708 },
22709
22710 showCustom: function(e){
22711 if (e) {
22712 e.preventDefault();
22713 }
22714
22715 this.trigger('update-swagger-ui', {
Jian Li8afbbee2016-07-27 19:16:51 +090022716 url: $('#input_baseUrl').val()
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022717 });
22718 },
22719
22720 update: function(url, apiKey, trigger){
22721 if (trigger === undefined) {
22722 trigger = false;
22723 }
22724
22725 $('#input_baseUrl').val(url);
22726
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022727 if (trigger) {
22728 this.trigger('update-swagger-ui', {url:url});
22729 }
22730 }
22731});
22732
22733'use strict';
22734
22735SwaggerUi.Views.MainView = Backbone.View.extend({
22736 apisSorter : {
22737 alpha : function(a,b){ return a.name.localeCompare(b.name); }
22738 },
22739 operationsSorters : {
22740 alpha : function(a,b){ return a.path.localeCompare(b.path); },
22741 method : function(a,b){ return a.method.localeCompare(b.method); }
22742 },
22743 initialize: function(opts){
22744 var sorterOption, sorterFn, key, value;
22745 opts = opts || {};
22746
22747 this.router = opts.router;
22748
22749 // Sort APIs
22750 if (opts.swaggerOptions.apisSorter) {
22751 sorterOption = opts.swaggerOptions.apisSorter;
22752 if (_.isFunction(sorterOption)) {
22753 sorterFn = sorterOption;
22754 } else {
22755 sorterFn = this.apisSorter[sorterOption];
22756 }
22757 if (_.isFunction(sorterFn)) {
22758 this.model.apisArray.sort(sorterFn);
22759 }
22760 }
22761 // Sort operations of each API
22762 if (opts.swaggerOptions.operationsSorter) {
22763 sorterOption = opts.swaggerOptions.operationsSorter;
22764 if (_.isFunction(sorterOption)) {
22765 sorterFn = sorterOption;
22766 } else {
22767 sorterFn = this.operationsSorters[sorterOption];
22768 }
22769 if (_.isFunction(sorterFn)) {
22770 for (key in this.model.apisArray) {
22771 this.model.apisArray[key].operationsArray.sort(sorterFn);
22772 }
22773 }
22774 }
22775
22776 // set up the UI for input
22777 this.model.auths = [];
22778
22779 for (key in this.model.securityDefinitions) {
22780 value = this.model.securityDefinitions[key];
22781
22782 this.model.auths.push({
22783 name: key,
22784 type: value.type,
22785 value: value
22786 });
22787 }
22788
22789 if ('validatorUrl' in opts.swaggerOptions) {
22790 // Validator URL specified explicitly
22791 this.model.validatorUrl = opts.swaggerOptions.validatorUrl;
Jian Li8afbbee2016-07-27 19:16:51 +090022792 } else if (this.model.url.indexOf('localhost') > 0 || this.model.url.indexOf('127.0.0.1') > 0) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022793 // Localhost override
22794 this.model.validatorUrl = null;
22795 } else {
Jian Li7f6d0e9e2016-09-27 02:04:49 +090022796 this.model.validatorUrl = '//online.swagger.io/validator';
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022797 }
Jian Li83d87a72016-04-20 15:38:24 -070022798
22799 // JSonEditor requires type='object' to be present on defined types, we add it if it's missing
22800 // is there any valid case were it should not be added ?
22801 var def;
22802 for(def in this.model.definitions){
22803 if (!this.model.definitions[def].type){
22804 this.model.definitions[def].type = 'object';
22805 }
22806 }
22807
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022808 },
22809
Jian Li8afbbee2016-07-27 19:16:51 +090022810 render: function () {
22811 $(this.el).html(Handlebars.templates.main(this.model));
22812 this.info = this.$('.info')[0];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022813
Jian Li8afbbee2016-07-27 19:16:51 +090022814 if (this.info) {
22815 this.info.addEventListener('click', this.onLinkClick, true);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022816 }
22817
Jian Li8afbbee2016-07-27 19:16:51 +090022818 this.model.securityDefinitions = this.model.securityDefinitions || {};
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022819
22820 // Render each resource
22821
22822 var resources = {};
22823 var counter = 0;
22824 for (var i = 0; i < this.model.apisArray.length; i++) {
22825 var resource = this.model.apisArray[i];
22826 var id = resource.name;
22827 while (typeof resources[id] !== 'undefined') {
22828 id = id + '_' + counter;
22829 counter += 1;
22830 }
Jian Li7f6d0e9e2016-09-27 02:04:49 +090022831 resource.id = sanitizeHtml(id);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022832 resources[id] = resource;
22833 this.addResource(resource, this.model.auths);
22834 }
22835
22836 $('.propWrap').hover(function onHover(){
22837 $('.optionsWrapper', $(this)).show();
22838 }, function offhover(){
22839 $('.optionsWrapper', $(this)).hide();
22840 });
22841 return this;
22842 },
22843
22844 addResource: function(resource, auths){
22845 // Render a resource and add it to resources li
Jian Li1c94b9d2017-02-08 15:47:21 +090022846 resource.id = resource.id.replace(/[^a-zA-Z\d]/g, function(str) { return str.charCodeAt(0); });
Jian Li83d87a72016-04-20 15:38:24 -070022847
22848 // Make all definitions available at the root of the resource so that they can
22849 // be loaded by the JSonEditor
22850 resource.definitions = this.model.definitions;
22851
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022852 var resourceView = new SwaggerUi.Views.ResourceView({
22853 model: resource,
22854 router: this.router,
22855 tagName: 'li',
22856 id: 'resource_' + resource.id,
22857 className: 'resource',
22858 auths: auths,
22859 swaggerOptions: this.options.swaggerOptions
22860 });
22861 $('#resources', this.el).append(resourceView.render().el);
22862 },
22863
22864 clear: function(){
22865 $(this.el).html('');
Jian Li8afbbee2016-07-27 19:16:51 +090022866 },
22867
22868 onLinkClick: function (e) {
22869 var el = e.target;
22870
22871 if (el.tagName === 'A' && el.href && !el.target) {
22872 e.preventDefault();
22873 window.open(el.href, '_blank');
22874 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070022875 }
22876});
22877
22878'use strict';
22879
Jian Li8afbbee2016-07-27 19:16:51 +090022880SwaggerUi.Models.Oauth2Model = Backbone.Model.extend({
22881 defaults: {
Jian Li1c94b9d2017-02-08 15:47:21 +090022882 scopes: {},
22883 isPasswordFlow: false,
22884 clientAuthenticationType: 'none'
Jian Li8afbbee2016-07-27 19:16:51 +090022885 },
22886
22887 initialize: function () {
Jian Li1c94b9d2017-02-08 15:47:21 +090022888 if(this.attributes && this.attributes.scopes) {
22889 var attributes = _.cloneDeep(this.attributes);
22890 var i, scopes = [];
22891 for(i in attributes.scopes) {
22892 var scope = attributes.scopes[i];
22893 if(typeof scope.description === 'string') {
22894 scopes[scope] = attributes.scopes[i];
22895 scopes.push(attributes.scopes[i]);
22896 }
22897 }
22898 attributes.scopes = scopes;
22899 this.attributes = attributes;
22900 }
22901
22902 if (this.attributes && this.attributes.flow) {
22903 var flow = this.attributes.flow;
22904 this.set('isPasswordFlow', flow === 'password');
22905 this.set('requireClientAuthentication', flow === 'application');
22906 this.set('clientAuthentication', flow === 'password' || flow === 'application');
22907 }
Jian Li8afbbee2016-07-27 19:16:51 +090022908 this.on('change', this.validate);
22909 },
22910
22911 setScopes: function (name, val) {
22912 var auth = _.extend({}, this.attributes);
22913 var index = _.findIndex(auth.scopes, function(o) {
22914 return o.scope === name;
22915 });
22916 auth.scopes[index].checked = val;
22917
22918 this.set(auth);
22919 this.validate();
22920 },
22921
22922 validate: function () {
22923 var valid = false;
Jian Li1c94b9d2017-02-08 15:47:21 +090022924 if (this.get('isPasswordFlow') &&
22925 (!this.get('username'))) {
22926 return false;
22927 }
22928
22929 if (this.get('clientAuthenticationType') in ['basic', 'request-body'] &&
22930 (!this.get('clientId'))) {
22931 return false;
22932 }
22933
Jian Li8afbbee2016-07-27 19:16:51 +090022934 var scp = this.get('scopes');
22935 var idx = _.findIndex(scp, function (o) {
22936 return o.checked === true;
22937 });
22938
22939 if(scp.length > 0 && idx >= 0) {
22940 valid = true;
22941 }
22942
22943 if(scp.length === 0) {
22944 valid = true;
22945 }
22946
22947 this.set('valid', valid);
22948
22949 return valid;
22950 }
22951});
22952
22953'use strict';
22954
22955SwaggerUi.Views.Oauth2View = Backbone.View.extend({
22956 events: {
Jian Li1c94b9d2017-02-08 15:47:21 +090022957 'change .oauth-scope': 'scopeChange',
22958 'change .oauth-username': 'setUsername',
22959 'change .oauth-password': 'setPassword',
22960 'change .oauth-client-authentication-type': 'setClientAuthenticationType',
22961 'change .oauth-client-id': 'setClientId',
22962 'change .oauth-client-secret': 'setClientSecret'
Jian Li8afbbee2016-07-27 19:16:51 +090022963 },
22964
22965 template: Handlebars.templates.oauth2,
22966
Jian Li1c94b9d2017-02-08 15:47:21 +090022967 cls: {
22968 error: 'error'
22969 },
22970
Jian Li8afbbee2016-07-27 19:16:51 +090022971 render: function () {
22972 this.$el.html(this.template(this.model.toJSON()));
22973
22974 return this;
22975 },
22976
22977 scopeChange: function (e) {
22978 var val = $(e.target).prop('checked');
22979 var scope = $(e.target).data('scope');
22980
22981 this.model.setScopes(scope, val);
Jian Li1c94b9d2017-02-08 15:47:21 +090022982 },
22983
22984 setUsername: function (e) {
22985 var val= $(e.target).val();
22986 this.model.set('username', val);
22987 if (val) {
22988 $(e.target).removeClass(this.cls.error);
22989 }
22990 },
22991
22992 setPassword: function (e) {
22993 this.model.set('password', $(e.target).val());
22994 },
22995
22996 setClientAuthenticationType: function (e) {
22997 var type = $(e.target).val();
22998 var $el = this.$el;
22999 this.model.set('clientAuthenticationType', type);
23000
23001 switch(type) {
23002 case 'none':
23003 $el.find('.oauth-client-authentication').hide();
23004 break;
23005 case 'basic':
23006 case 'request-body':
23007 $el.find('.oauth-client-id').removeClass(this.cls.error);
23008 $el.find('.oauth-client-authentication').show();
23009 break;
23010 }
23011 },
23012
23013 setClientId: function (e) {
23014 var val = $(e.target).val();
23015 this.model.set('clientId', val);
23016 if (val) {
23017 $(e.target).removeClass(this.cls.error);
23018 }
23019 },
23020
23021 setClientSecret: function (e) {
23022 this.model.set('clientSecret', $(e.target).val());
23023 $(e.target).removeClass('error');
23024 },
23025
23026 highlightInvalid: function () {
23027 if (!this.model.get('username')) {
23028 this.$el.find('.oauth-username').addClass(this.cls.error);
23029 }
23030
23031 if (!this.model.get('clientId')) {
23032 this.$el.find('.oauth-client-id').addClass(this.cls.error);
23033 }
Jian Li8afbbee2016-07-27 19:16:51 +090023034 }
23035});
23036'use strict';
23037
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023038SwaggerUi.Views.OperationView = Backbone.View.extend({
23039 invocationUrl: null,
23040
23041 events: {
23042 'submit .sandbox' : 'submitOperation',
23043 'click .submit' : 'submitOperation',
23044 'click .response_hider' : 'hideResponse',
23045 'click .toggleOperation' : 'toggleOperationContent',
23046 'mouseenter .api-ic' : 'mouseEnter',
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023047 'dblclick .curl' : 'selectText',
Jian Li8afbbee2016-07-27 19:16:51 +090023048 'change [name=responseContentType]' : 'showSnippet'
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023049 },
23050
23051 initialize: function(opts) {
23052 opts = opts || {};
23053 this.router = opts.router;
23054 this.auths = opts.auths;
23055 this.parentId = this.model.parentId;
23056 this.nickname = this.model.nickname;
23057 this.model.encodedParentId = encodeURIComponent(this.parentId);
Jian Li8afbbee2016-07-27 19:16:51 +090023058
Jian Li83d87a72016-04-20 15:38:24 -070023059 if (opts.swaggerOptions) {
23060 this.model.defaultRendering = opts.swaggerOptions.defaultModelRendering;
Jian Li8afbbee2016-07-27 19:16:51 +090023061
Jian Li83d87a72016-04-20 15:38:24 -070023062 if (opts.swaggerOptions.showRequestHeaders) {
23063 this.model.showRequestHeaders = true;
23064 }
Jian Li1c94b9d2017-02-08 15:47:21 +090023065
23066 if (opts.swaggerOptions.showOperationIds) {
23067 this.model.showOperationIds = true;
23068 }
Jian Li83d87a72016-04-20 15:38:24 -070023069 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023070 return this;
23071 },
23072
23073 selectText: function(event) {
Jian Li8afbbee2016-07-27 19:16:51 +090023074 var doc = document,
23075 text = event.target.firstChild,
23076 range,
23077 selection;
23078 if (doc.body.createTextRange) {
23079 range = document.body.createTextRange();
23080 range.moveToElementText(text);
23081 range.select();
23082 } else if (window.getSelection) {
23083 selection = window.getSelection();
23084 range = document.createRange();
23085 range.selectNodeContents(text);
23086 selection.removeAllRanges();
23087 selection.addRange(range);
23088 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023089 },
23090
23091 mouseEnter: function(e) {
23092 var elem = $(this.el).find('.content');
23093 var x = e.pageX;
23094 var y = e.pageY;
23095 var scX = $(window).scrollLeft();
23096 var scY = $(window).scrollTop();
23097 var scMaxX = scX + $(window).width();
23098 var scMaxY = scY + $(window).height();
23099 var wd = elem.width();
23100 var hgh = elem.height();
23101
23102 if (x + wd > scMaxX) {
23103 x = scMaxX - wd;
23104 }
23105
23106 if (x < scX) {
23107 x = scX;
23108 }
23109
23110 if (y + hgh > scMaxY) {
23111 y = scMaxY - hgh;
23112 }
23113
23114 if (y < scY) {
23115 y = scY;
23116 }
23117
23118 var pos = {};
23119 pos.top = y;
23120 pos.left = x;
23121 elem.css(pos);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023122 },
23123
23124 // Note: copied from CoffeeScript compiled file
Jian Li1c94b9d2017-02-08 15:47:21 +090023125 // TODO: refactor
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023126 render: function() {
Jian Li8afbbee2016-07-27 19:16:51 +090023127 var a, auth, auths, code, contentTypeModel, isMethodSubmissionSupported, k, key, l, len, len1, len2, len3, len4, m, modelAuths, n, o, p, param, q, ref, ref1, ref2, ref3, ref4, ref5, responseContentTypeView, responseSignatureView, schema, schemaObj, scopeIndex, signatureModel, statusCode, successResponse, type, v, value, produces, isXML, isJSON;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023128 isMethodSubmissionSupported = jQuery.inArray(this.model.method, this.model.supportedSubmitMethods()) >= 0;
23129 if (!isMethodSubmissionSupported) {
23130 this.model.isReadOnly = true;
23131 }
23132 this.model.description = this.model.description || this.model.notes;
23133 this.model.oauth = null;
23134 modelAuths = this.model.authorizations || this.model.security;
23135 if (modelAuths) {
23136 if (Array.isArray(modelAuths)) {
23137 for (l = 0, len = modelAuths.length; l < len; l++) {
23138 auths = modelAuths[l];
23139 for (key in auths) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023140 for (a in this.auths) {
23141 auth = this.auths[a];
Jian Li83d87a72016-04-20 15:38:24 -070023142 if (key === auth.name) {
23143 if (auth.type === 'oauth2') {
23144 this.model.oauth = {};
23145 this.model.oauth.scopes = [];
23146 ref1 = auth.value.scopes;
23147 for (k in ref1) {
23148 v = ref1[k];
23149 scopeIndex = auths[key].indexOf(k);
23150 if (scopeIndex >= 0) {
23151 o = {
23152 scope: k,
23153 description: v
23154 };
23155 this.model.oauth.scopes.push(o);
23156 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023157 }
23158 }
23159 }
23160 }
23161 }
23162 }
23163 } else {
23164 for (k in modelAuths) {
23165 v = modelAuths[k];
23166 if (k === 'oauth2') {
23167 if (this.model.oauth === null) {
23168 this.model.oauth = {};
23169 }
23170 if (this.model.oauth.scopes === void 0) {
23171 this.model.oauth.scopes = [];
23172 }
23173 for (m = 0, len1 = v.length; m < len1; m++) {
23174 o = v[m];
23175 this.model.oauth.scopes.push(o);
23176 }
23177 }
23178 }
23179 }
23180 }
23181 if (typeof this.model.responses !== 'undefined') {
23182 this.model.responseMessages = [];
23183 ref2 = this.model.responses;
23184 for (code in ref2) {
23185 value = ref2[code];
23186 schema = null;
23187 schemaObj = this.model.responses[code].schema;
23188 if (schemaObj && schemaObj.$ref) {
23189 schema = schemaObj.$ref;
Jian Li83d87a72016-04-20 15:38:24 -070023190 if (schema.indexOf('#/definitions/') !== -1) {
23191 schema = schema.replace(/^.*#\/definitions\//, '');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023192 }
23193 }
23194 this.model.responseMessages.push({
23195 code: code,
23196 message: value.description,
Jian Li83d87a72016-04-20 15:38:24 -070023197 responseModel: schema,
Jian Li8afbbee2016-07-27 19:16:51 +090023198 headers: value.headers,
23199 schema: schemaObj
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023200 });
23201 }
23202 }
23203 if (typeof this.model.responseMessages === 'undefined') {
23204 this.model.responseMessages = [];
23205 }
23206 signatureModel = null;
Jian Li8afbbee2016-07-27 19:16:51 +090023207 produces = this.model.produces;
23208 isXML = this.contains(produces, 'xml');
23209 isJSON = isXML ? this.contains(produces, 'json') : true;
23210
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023211 if (this.model.successResponse) {
23212 successResponse = this.model.successResponse;
23213 for (key in successResponse) {
23214 value = successResponse[key];
23215 this.model.successCode = key;
23216 if (typeof value === 'object' && typeof value.createJSONSample === 'function') {
Jian Li83d87a72016-04-20 15:38:24 -070023217 this.model.successDescription = value.description;
23218 this.model.headers = this.parseResponseHeaders(value.headers);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023219 signatureModel = {
Jian Li8afbbee2016-07-27 19:16:51 +090023220 sampleJSON: isJSON ? JSON.stringify(SwaggerUi.partials.signature.createJSONSample(value), void 0, 2) : false,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023221 isParam: false,
Jian Li8afbbee2016-07-27 19:16:51 +090023222 sampleXML: isXML ? SwaggerUi.partials.signature.createXMLSample(value.name, value.definition, value.models) : false,
23223 signature: SwaggerUi.partials.signature.getModelSignature(value.name, value.definition, value.models, value.modelPropertyMacro)
23224 };
23225 } else {
23226 signatureModel = {
23227 signature: SwaggerUi.partials.signature.getPrimitiveSignature(value)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023228 };
23229 }
23230 }
23231 } else if (this.model.responseClassSignature && this.model.responseClassSignature !== 'string') {
23232 signatureModel = {
23233 sampleJSON: this.model.responseSampleJSON,
23234 isParam: false,
23235 signature: this.model.responseClassSignature
23236 };
23237 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023238 $(this.el).html(Handlebars.templates.operation(this.model));
23239 if (signatureModel) {
Jian Li83d87a72016-04-20 15:38:24 -070023240 signatureModel.defaultRendering = this.model.defaultRendering;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023241 responseSignatureView = new SwaggerUi.Views.SignatureView({
23242 model: signatureModel,
23243 router: this.router,
23244 tagName: 'div'
23245 });
23246 $('.model-signature', $(this.el)).append(responseSignatureView.render().el);
23247 } else {
23248 this.model.responseClassSignature = 'string';
23249 $('.model-signature', $(this.el)).html(this.model.type);
23250 }
23251 contentTypeModel = {
23252 isParam: false
23253 };
23254 contentTypeModel.consumes = this.model.consumes;
23255 contentTypeModel.produces = this.model.produces;
23256 ref3 = this.model.parameters;
23257 for (n = 0, len2 = ref3.length; n < len2; n++) {
23258 param = ref3[n];
23259 type = param.type || param.dataType || '';
23260 if (typeof type === 'undefined') {
23261 schema = param.schema;
23262 if (schema && schema.$ref) {
23263 ref = schema.$ref;
23264 if (ref.indexOf('#/definitions/') === 0) {
23265 type = ref.substring('#/definitions/'.length);
23266 } else {
23267 type = ref;
23268 }
23269 }
23270 }
23271 if (type && type.toLowerCase() === 'file') {
23272 if (!contentTypeModel.consumes) {
23273 contentTypeModel.consumes = 'multipart/form-data';
23274 }
23275 }
23276 param.type = type;
23277 }
23278 responseContentTypeView = new SwaggerUi.Views.ResponseContentTypeView({
23279 model: contentTypeModel,
23280 router: this.router
23281 });
23282 $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
23283 ref4 = this.model.parameters;
23284 for (p = 0, len3 = ref4.length; p < len3; p++) {
23285 param = ref4[p];
23286 this.addParameter(param, contentTypeModel.consumes);
23287 }
23288 ref5 = this.model.responseMessages;
23289 for (q = 0, len4 = ref5.length; q < len4; q++) {
23290 statusCode = ref5[q];
Jian Li8afbbee2016-07-27 19:16:51 +090023291 statusCode.isXML = isXML;
23292 statusCode.isJSON = isJSON;
23293 if (!_.isUndefined(statusCode.headers)) {
23294 statusCode.headers = this.parseHeadersType(statusCode.headers);
23295 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023296 this.addStatusCode(statusCode);
23297 }
Jian Li8afbbee2016-07-27 19:16:51 +090023298
23299 if (Array.isArray(this.model.security)) {
Jian Li1c94b9d2017-02-08 15:47:21 +090023300 var authsModel = SwaggerUi.utils.parseSecurityDefinitions(this.model.security, this.model.parent.securityDefinitions);
Jian Li8afbbee2016-07-27 19:16:51 +090023301
Jian Li1c94b9d2017-02-08 15:47:21 +090023302 authsModel.isLogout = !_.isEmpty(this.model.clientAuthorizations.authz);
Jian Li8afbbee2016-07-27 19:16:51 +090023303 this.authView = new SwaggerUi.Views.AuthButtonView({
23304 data: authsModel,
23305 router: this.router,
23306 isOperation: true,
23307 model: {
23308 scopes: authsModel.scopes
23309 }
23310 });
23311 this.$('.authorize-wrapper').append(this.authView.render().el);
23312 }
23313
23314 this.showSnippet();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023315 return this;
23316 },
23317
Jian Li8afbbee2016-07-27 19:16:51 +090023318 parseHeadersType: function (headers) {
23319 var map = {
23320 'string': {
23321 'date-time': 'dateTime',
23322 'date' : 'date'
23323 }
23324 };
23325
23326 _.forEach(headers, function (header) {
23327 var value;
23328 header = header || {};
23329 value = map[header.type] && map[header.type][header.format];
23330 if (!_.isUndefined(value)) {
23331 header.type = value;
23332 }
23333 });
23334
23335 return headers;
23336 },
23337
23338 contains: function (produces, type) {
23339 return produces.filter(function (val) {
23340 if (val.indexOf(type) > -1) {
23341 return true;
23342 }
23343 }).length;
23344 },
23345
Jian Li83d87a72016-04-20 15:38:24 -070023346 parseResponseHeaders: function (data) {
23347 var HEADERS_SEPARATOR = '; ';
23348 var headers = _.clone(data);
23349
23350 _.forEach(headers, function (header) {
23351 var other = [];
23352 _.forEach(header, function (value, key) {
23353 var properties = ['type', 'description'];
23354 if (properties.indexOf(key.toLowerCase()) === -1) {
23355 other.push(key + ': ' + value);
23356 }
23357 });
23358
23359 other.join(HEADERS_SEPARATOR);
23360 header.other = other;
23361 });
23362
23363 return headers;
23364 },
23365
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023366 addParameter: function(param, consumes) {
23367 // Render a parameter
23368 param.consumes = consumes;
Jian Li83d87a72016-04-20 15:38:24 -070023369 param.defaultRendering = this.model.defaultRendering;
23370
23371 // Copy this param JSON spec so that it will be available for JsonEditor
23372 if(param.schema){
23373 $.extend(true, param.schema, this.model.definitions[param.type]);
23374 param.schema.definitions = this.model.definitions;
23375 // This is required for JsonEditor to display the root properly
23376 if(!param.schema.type){
23377 param.schema.type = 'object';
Jian Li8afbbee2016-07-27 19:16:51 +090023378 }
Jian Li83d87a72016-04-20 15:38:24 -070023379 // This is the title that will be used by JsonEditor for the root
23380 // Since we already display the parameter's name in the Parameter column
23381 // We set this to space, we can't set it to null or space otherwise JsonEditor
23382 // will replace it with the text "root" which won't look good on screen
23383 if(!param.schema.title){
23384 param.schema.title = ' ';
23385 }
Jian Li8afbbee2016-07-27 19:16:51 +090023386 }
Jian Li83d87a72016-04-20 15:38:24 -070023387
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023388 var paramView = new SwaggerUi.Views.ParameterView({
23389 model: param,
23390 tagName: 'tr',
Jian Li83d87a72016-04-20 15:38:24 -070023391 readOnly: this.model.isReadOnly,
23392 swaggerOptions: this.options.swaggerOptions
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023393 });
23394 $('.operation-params', $(this.el)).append(paramView.render().el);
23395 },
23396
23397 addStatusCode: function(statusCode) {
23398 // Render status codes
Jian Li83d87a72016-04-20 15:38:24 -070023399 statusCode.defaultRendering = this.model.defaultRendering;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023400 var statusCodeView = new SwaggerUi.Views.StatusCodeView({
23401 model: statusCode,
23402 tagName: 'tr',
23403 router: this.router
23404 });
23405 $('.operation-status', $(this.el)).append(statusCodeView.render().el);
23406 },
23407
23408 // Note: copied from CoffeeScript compiled file
23409 // TODO: redactor
23410 submitOperation: function(e) {
23411 var error_free, form, isFileUpload, map, opts;
23412 if (e !== null) {
23413 e.preventDefault();
23414 }
23415 form = $('.sandbox', $(this.el));
23416 error_free = true;
23417 form.find('input.required').each(function() {
23418 $(this).removeClass('error');
23419 if (jQuery.trim($(this).val()) === '') {
23420 $(this).addClass('error');
23421 $(this).wiggle({
23422 callback: (function(_this) {
23423 return function() {
23424 $(_this).focus();
23425 };
23426 })(this)
23427 });
23428 error_free = false;
23429 }
23430 });
Jian Li83d87a72016-04-20 15:38:24 -070023431 form.find('textarea.required:visible').each(function() {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023432 $(this).removeClass('error');
23433 if (jQuery.trim($(this).val()) === '') {
23434 $(this).addClass('error');
23435 $(this).wiggle({
23436 callback: (function(_this) {
23437 return function() {
23438 return $(_this).focus();
23439 };
23440 })(this)
23441 });
23442 error_free = false;
23443 }
23444 });
23445 form.find('select.required').each(function() {
23446 $(this).removeClass('error');
23447 if (this.selectedIndex === -1) {
23448 $(this).addClass('error');
23449 $(this).wiggle({
23450 callback: (function(_this) {
23451 return function() {
23452 $(_this).focus();
23453 };
23454 })(this)
23455 });
23456 error_free = false;
23457 }
23458 });
23459 if (error_free) {
23460 map = this.getInputMap(form);
23461 isFileUpload = this.isFileUpload(form);
23462 opts = {
23463 parent: this
23464 };
23465 if (this.options.swaggerOptions) {
23466 for(var key in this.options.swaggerOptions) {
23467 opts[key] = this.options.swaggerOptions[key];
23468 }
23469 }
Jian Li83d87a72016-04-20 15:38:24 -070023470
23471 var pi;
23472 for(pi = 0; pi < this.model.parameters.length; pi++){
23473 var p = this.model.parameters[pi];
23474 if( p.jsonEditor && p.jsonEditor.isEnabled()){
23475 var json = p.jsonEditor.getValue();
23476 map[p.name] = JSON.stringify(json);
23477 }
23478 }
23479
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023480 opts.responseContentType = $('div select[name=responseContentType]', $(this.el)).val();
23481 opts.requestContentType = $('div select[name=parameterContentType]', $(this.el)).val();
23482 $('.response_throbber', $(this.el)).show();
23483 if (isFileUpload) {
23484 $('.request_url', $(this.el)).html('<pre></pre>');
23485 $('.request_url pre', $(this.el)).text(this.invocationUrl);
23486
23487 opts.useJQuery = true;
23488 map.parameterContentType = 'multipart/form-data';
Jian Li83d87a72016-04-20 15:38:24 -070023489 this.map = map;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023490 return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this);
23491 } else {
23492 this.map = map;
23493 return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this);
23494 }
23495 }
23496 },
23497
23498 getInputMap: function (form) {
23499 var map, ref1, l, len, o, ref2, m, len1, val, ref3, n, len2;
23500 map = {};
23501 ref1 = form.find('input');
23502 for (l = 0, len = ref1.length; l < len; l++) {
23503 o = ref1[l];
23504 if ((o.value !== null) && jQuery.trim(o.value).length > 0) {
23505 map[o.name] = o.value;
23506 }
23507 if (o.type === 'file') {
23508 map[o.name] = o.files[0];
23509 }
23510 }
23511 ref2 = form.find('textarea');
23512 for (m = 0, len1 = ref2.length; m < len1; m++) {
23513 o = ref2[m];
23514 val = this.getTextAreaValue(o);
23515 if ((val !== null) && jQuery.trim(val).length > 0) {
23516 map[o.name] = val;
23517 }
23518 }
23519 ref3 = form.find('select');
23520 for (n = 0, len2 = ref3.length; n < len2; n++) {
23521 o = ref3[n];
23522 val = this.getSelectedValue(o);
23523 if ((val !== null) && jQuery.trim(val).length > 0) {
23524 map[o.name] = val;
23525 }
23526 }
23527 return map;
23528 },
23529
23530 isFileUpload: function (form) {
23531 var ref1, l, len, o;
23532 var isFileUpload = false;
23533 ref1 = form.find('input');
23534 for (l = 0, len = ref1.length; l < len; l++) {
23535 o = ref1[l];
23536 if (o.type === 'file') {
23537 isFileUpload = true;
23538 }
23539 }
23540 return isFileUpload;
23541 },
23542
23543 success: function(response, parent) {
23544 parent.showCompleteStatus(response);
23545 },
23546
23547 // wraps a jquery response as a shred response
23548 wrap: function(data) {
Jian Li8afbbee2016-07-27 19:16:51 +090023549 var h, headerArray, headers, i, l, len, o;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023550 headers = {};
23551 headerArray = data.getAllResponseHeaders().split('\r');
23552 for (l = 0, len = headerArray.length; l < len; l++) {
23553 i = headerArray[l];
23554 h = i.match(/^([^:]*?):(.*)$/);
23555 if (!h) {
23556 h = [];
23557 }
23558 h.shift();
23559 if (h[0] !== void 0 && h[1] !== void 0) {
23560 headers[h[0].trim()] = h[1].trim();
23561 }
23562 }
23563 o = {};
23564 o.content = {};
23565 o.content.data = data.responseText;
23566 o.headers = headers;
23567 o.request = {};
23568 o.request.url = this.invocationUrl;
23569 o.status = data.status;
23570 return o;
23571 },
23572
23573 getSelectedValue: function(select) {
23574 if (!select.multiple) {
23575 return select.value;
23576 } else {
23577 var options = [];
23578 for (var l = 0, len = select.options.length; l < len; l++) {
23579 var opt = select.options[l];
23580 if (opt.selected) {
23581 options.push(opt.value);
23582 }
23583 }
23584 if (options.length > 0) {
23585 return options;
23586 } else {
23587 return null;
23588 }
23589 }
23590 },
23591
23592 // handler for hide response link
23593 hideResponse: function(e) {
23594 if (e) { e.preventDefault(); }
23595 $('.response', $(this.el)).slideUp();
23596 $('.response_hider', $(this.el)).fadeOut();
23597 },
23598
23599 // Show response from server
23600 showResponse: function(response) {
23601 var prettyJson = JSON.stringify(response, null, '\t').replace(/\n/g, '<br>');
23602 $('.response_body', $(this.el)).html(_.escape(prettyJson));
23603 },
23604
23605 // Show error from server
23606 showErrorStatus: function(data, parent) {
23607 parent.showStatus(data);
23608 },
23609
23610 // show the status codes
23611 showCompleteStatus: function(data, parent){
23612 parent.showStatus(data);
23613 },
23614
23615 // Adapted from http://stackoverflow.com/a/2893259/454004
23616 // Note: directly ported from CoffeeScript
23617 // TODO: Cleanup CoffeeScript artifacts
23618 formatXml: function(xml) {
23619 var contexp, fn, formatted, indent, l, lastType, len, lines, ln, pad, reg, transitions, wsexp;
23620 reg = /(>)(<)(\/*)/g;
23621 wsexp = /[ ]*(.*)[ ]+\n/g;
23622 contexp = /(<.+>)(.+\n)/g;
Jian Li8afbbee2016-07-27 19:16:51 +090023623 xml = xml.replace(/\r\n/g, '\n').replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023624 pad = 0;
23625 formatted = '';
23626 lines = xml.split('\n');
23627 indent = 0;
23628 lastType = 'other';
23629 transitions = {
23630 'single->single': 0,
23631 'single->closing': -1,
23632 'single->opening': 0,
23633 'single->other': 0,
23634 'closing->single': 0,
23635 'closing->closing': -1,
23636 'closing->opening': 0,
23637 'closing->other': 0,
23638 'opening->single': 1,
23639 'opening->closing': 0,
23640 'opening->opening': 1,
23641 'opening->other': 1,
23642 'other->single': 0,
23643 'other->closing': -1,
23644 'other->opening': 0,
23645 'other->other': 0
23646 };
23647 fn = function(ln) {
23648 var fromTo, j, key, padding, type, types, value;
23649 types = {
23650 single: Boolean(ln.match(/<.+\/>/)),
23651 closing: Boolean(ln.match(/<\/.+>/)),
23652 opening: Boolean(ln.match(/<[^!?].*>/))
23653 };
23654 type = ((function() {
23655 var results;
23656 results = [];
23657 for (key in types) {
23658 value = types[key];
23659 if (value) {
23660 results.push(key);
23661 }
23662 }
23663 return results;
23664 })())[0];
23665 type = type === void 0 ? 'other' : type;
23666 fromTo = lastType + '->' + type;
23667 lastType = type;
23668 padding = '';
23669 indent += transitions[fromTo];
23670 padding = ((function() {
23671 var m, ref1, results;
23672 results = [];
23673 for (j = m = 0, ref1 = indent; 0 <= ref1 ? m < ref1 : m > ref1; j = 0 <= ref1 ? ++m : --m) {
23674 results.push(' ');
23675 }
23676 return results;
23677 })()).join('');
23678 if (fromTo === 'opening->closing') {
23679 formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
23680 } else {
23681 formatted += padding + ln + '\n';
23682 }
23683 };
23684 for (l = 0, len = lines.length; l < len; l++) {
23685 ln = lines[l];
23686 fn(ln);
23687 }
23688 return formatted;
23689 },
23690
23691 // puts the response data in UI
23692 showStatus: function(response) {
23693 var url, content;
23694 if (response.content === undefined) {
23695 content = response.data;
23696 url = response.url;
23697 } else {
23698 content = response.content.data;
23699 url = response.request.url;
23700 }
23701 var headers = response.headers;
Jian Li7f6d0e9e2016-09-27 02:04:49 +090023702 if(typeof content === 'string') {
23703 content = jQuery.trim(content);
23704 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023705
23706 // if server is nice, and sends content-type back, we can use it
23707 var contentType = null;
23708 if (headers) {
23709 contentType = headers['Content-Type'] || headers['content-type'];
23710 if (contentType) {
23711 contentType = contentType.split(';')[0].trim();
23712 }
23713 }
Jian Li1c94b9d2017-02-08 15:47:21 +090023714
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023715 $('.response_body', $(this.el)).removeClass('json');
23716 $('.response_body', $(this.el)).removeClass('xml');
23717
23718 var supportsAudioPlayback = function(contentType){
23719 var audioElement = document.createElement('audio');
23720 return !!(audioElement.canPlayType && audioElement.canPlayType(contentType).replace(/no/, ''));
23721 };
23722
23723 var pre;
23724 var code;
Jian Li1c94b9d2017-02-08 15:47:21 +090023725 var skipHighlight = false;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023726 if (!content) {
23727 code = $('<code />').text('no content');
23728 pre = $('<pre class="json" />').append(code);
23729
Jian Li8afbbee2016-07-27 19:16:51 +090023730 // JSON
Jian Li1c94b9d2017-02-08 15:47:21 +090023731 } else if (
23732 contentType === 'application/octet-stream' ||
23733 headers['Content-Disposition'] && (/attachment/).test(headers['Content-Disposition']) ||
Jian Li7f6d0e9e2016-09-27 02:04:49 +090023734 headers['content-disposition'] && (/attachment/).test(headers['content-disposition']) ||
23735 headers['Content-Description'] && (/File Transfer/).test(headers['Content-Description']) ||
23736 headers['content-description'] && (/File Transfer/).test(headers['content-description'])) {
23737
23738 if ('Blob' in window) {
23739 var type = contentType || 'text/html';
Jian Li7f6d0e9e2016-09-27 02:04:49 +090023740 var a = document.createElement('a');
Jian Li1c94b9d2017-02-08 15:47:21 +090023741 var href;
23742
23743 if({}.toString.apply(content) === '[object Blob]') {
23744 href = window.URL.createObjectURL(content);
23745 }
23746 else {
23747 var binaryData = [];
23748 binaryData.push(content);
23749 href = window.URL.createObjectURL(new Blob(binaryData, {type: type}));
23750 }
Jian Li7f6d0e9e2016-09-27 02:04:49 +090023751 var fileName = response.url.substr(response.url.lastIndexOf('/') + 1);
23752 var download = [type, fileName, href].join(':');
23753
23754 // Use filename from response header
23755 var disposition = headers['content-disposition'] || headers['Content-Disposition'];
23756 if(typeof disposition !== 'undefined') {
23757 var responseFilename = /filename=([^;]*);?/.exec(disposition);
23758 if(responseFilename !== null && responseFilename.length > 1) {
23759 download = responseFilename[1];
Jian Li1c94b9d2017-02-08 15:47:21 +090023760 fileName = download;
Jian Li7f6d0e9e2016-09-27 02:04:49 +090023761 }
23762 }
23763
23764 a.setAttribute('href', href);
23765 a.setAttribute('download', download);
23766 a.innerText = 'Download ' + fileName;
23767
23768 pre = $('<div/>').append(a);
Jian Li1c94b9d2017-02-08 15:47:21 +090023769 skipHighlight = true;
Jian Li7f6d0e9e2016-09-27 02:04:49 +090023770 } else {
23771 pre = $('<pre class="json" />').append('Download headers detected but your browser does not support downloading binary via XHR (Blob).');
23772 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023773 } else if (contentType === 'application/json' || /\+json$/.test(contentType)) {
23774 var json = null;
23775 try {
23776 json = JSON.stringify(JSON.parse(content), null, ' ');
23777 } catch (_error) {
23778 json = 'can\'t parse JSON. Raw result:\n\n' + content;
23779 }
23780 code = $('<code />').text(json);
23781 pre = $('<pre class="json" />').append(code);
23782
Jian Li8afbbee2016-07-27 19:16:51 +090023783 // XML
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023784 } else if (contentType === 'application/xml' || /\+xml$/.test(contentType)) {
23785 code = $('<code />').text(this.formatXml(content));
23786 pre = $('<pre class="xml" />').append(code);
23787
Jian Li8afbbee2016-07-27 19:16:51 +090023788 // HTML
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023789 } else if (contentType === 'text/html') {
23790 code = $('<code />').html(_.escape(content));
23791 pre = $('<pre class="xml" />').append(code);
23792
Jian Li8afbbee2016-07-27 19:16:51 +090023793 // Plain Text
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023794 } else if (/text\/plain/.test(contentType)) {
23795 code = $('<code />').text(content);
23796 pre = $('<pre class="plain" />').append(code);
23797
Jian Li8afbbee2016-07-27 19:16:51 +090023798 // Image
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023799 } else if (/^image\//.test(contentType)) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +090023800 var urlCreator = window.URL || window.webkitURL;
23801 var imageUrl = urlCreator.createObjectURL(content);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023802
Jian Li7f6d0e9e2016-09-27 02:04:49 +090023803 pre = $('<img>').attr( 'src', imageUrl);
Jian Li8afbbee2016-07-27 19:16:51 +090023804 // Audio
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023805 } else if (/^audio\//.test(contentType) && supportsAudioPlayback(contentType)) {
23806 pre = $('<audio controls>').append($('<source>').attr('src', url).attr('type', contentType));
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023807 } else if(headers.location || headers.Location) {
Jian Li7f6d0e9e2016-09-27 02:04:49 +090023808 // Location header based redirect download
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023809 window.location = response.url;
23810
Jian Li8afbbee2016-07-27 19:16:51 +090023811 // Anything else (CORS)
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023812 } else {
23813 code = $('<code />').text(content);
23814 pre = $('<pre class="json" />').append(code);
23815 }
23816 var response_body = pre;
23817 $('.request_url', $(this.el)).html('<pre></pre>');
23818 $('.request_url pre', $(this.el)).text(url);
23819 $('.response_code', $(this.el)).html('<pre>' + response.status + '</pre>');
23820 $('.response_body', $(this.el)).html(response_body);
23821 $('.response_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(response.headers, null, ' ')).replace(/\n/g, '<br>') + '</pre>');
23822 $('.response', $(this.el)).slideDown();
23823 $('.response_hider', $(this.el)).show();
23824 $('.response_throbber', $(this.el)).hide();
23825
23826
Jian Li83d87a72016-04-20 15:38:24 -070023827 // adds curl output
23828 var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType});
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023829 curlCommand = curlCommand.replace('!', '&#33;');
Jian Li8afbbee2016-07-27 19:16:51 +090023830 $( 'div.curl', $(this.el)).html('<pre>' + _.escape(curlCommand) + '</pre>');
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023831
23832 // only highlight the response if response is less than threshold, default state is highlight response
23833 var opts = this.options.swaggerOptions;
23834
23835 if (opts.showRequestHeaders) {
23836 var form = $('.sandbox', $(this.el)),
Jian Li8afbbee2016-07-27 19:16:51 +090023837 map = this.getInputMap(form),
23838 requestHeaders = this.model.getHeaderParams(map);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023839 delete requestHeaders['Content-Type'];
23840 $('.request_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(requestHeaders, null, ' ')).replace(/\n/g, '<br>') + '</pre>');
23841 }
23842
Jian Li1c94b9d2017-02-08 15:47:21 +090023843 // Call user-defined hook
23844 if (opts.responseHooks && opts.responseHooks[this.nickname]) {
23845 opts.responseHooks[this.nickname](response, this);
23846 }
23847
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023848 var response_body_el = $('.response_body', $(this.el))[0];
23849 // only highlight the response if response is less than threshold, default state is highlight response
Jian Li1c94b9d2017-02-08 15:47:21 +090023850 if (opts.highlightSizeThreshold && typeof response.data !== 'undefined' && response.data.length > opts.highlightSizeThreshold || skipHighlight) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023851 return response_body_el;
23852 } else {
23853 return hljs.highlightBlock(response_body_el);
23854 }
23855 },
23856
23857 toggleOperationContent: function (event) {
23858 var elem = $('#' + Docs.escapeResourceName(this.parentId + '_' + this.nickname + '_content'));
23859 if (elem.is(':visible')){
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023860 $.bbq.pushState('#/', 2);
Jian Li83d87a72016-04-20 15:38:24 -070023861 event.preventDefault();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023862 Docs.collapseOperation(elem);
23863 } else {
23864 Docs.expandOperation(elem);
23865 }
23866 },
23867
23868 getTextAreaValue: function(textArea) {
23869 var param, parsed, result, i;
23870 if (textArea.value === null || jQuery.trim(textArea.value).length === 0) {
23871 return null;
23872 }
23873 param = this.getParamByName(textArea.name);
23874 if (param && param.type && param.type.toLowerCase() === 'array') {
23875 parsed = textArea.value.split('\n');
23876 result = [];
23877 for (i = 0; i < parsed.length; i++) {
23878 if (parsed[i] !== null && jQuery.trim(parsed[i]).length > 0) {
23879 result.push(parsed[i]);
23880 }
23881 }
23882 return result.length > 0 ? result : null;
23883 } else {
23884 return textArea.value;
23885 }
23886 },
23887
Jian Li8afbbee2016-07-27 19:16:51 +090023888 showSnippet: function () {
23889 var contentTypeEl = this.$('[name=responseContentType]');
23890 var xmlSnippetEl = this.$('.operation-status .snippet_xml, .response-class .snippet_xml');
23891 var jsonSnippetEl = this.$('.operation-status .snippet_json, .response-class .snippet_json');
23892 var contentType;
23893
23894 if (!contentTypeEl.length) { return; }
23895 contentType = contentTypeEl.val();
23896
23897 if (contentType.indexOf('xml') > -1) {
23898 xmlSnippetEl.show();
23899 jsonSnippetEl.hide();
23900 } else {
23901 jsonSnippetEl.show();
23902 xmlSnippetEl.hide();
23903 }
23904 },
23905
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023906 getParamByName: function(name) {
23907 var i;
23908 if (this.model.parameters) {
23909 for(i = 0; i < this.model.parameters.length; i++) {
23910 if (this.model.parameters[i].name === name) {
23911 return this.model.parameters[i];
23912 }
23913 }
23914 }
23915 return null;
23916 }
23917
23918});
23919
23920'use strict';
23921
23922SwaggerUi.Views.ParameterContentTypeView = Backbone.View.extend({
23923 initialize: function () {},
23924
23925 render: function(){
23926 this.model.parameterContentTypeId = 'pct' + Math.random();
23927 $(this.el).html(Handlebars.templates.parameter_content_type(this.model));
23928 return this;
23929 }
23930
23931});
23932'use strict';
23933
23934SwaggerUi.Views.ParameterView = Backbone.View.extend({
Jian Li8afbbee2016-07-27 19:16:51 +090023935 events: {
23936 'change [name=parameterContentType]' : 'toggleParameterSnippet'
23937 },
23938
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023939 initialize: function(){
23940 Handlebars.registerHelper('isArray', function(param, opts) {
Jian Li8afbbee2016-07-27 19:16:51 +090023941 var paramType = param.type && param.type.toLowerCase();
23942 if (paramType === 'array' || param.allowMultiple) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023943 return opts.fn(this);
23944 } else {
23945 return opts.inverse(this);
23946 }
23947 });
23948 },
23949
23950 render: function() {
23951 var type = this.model.type || this.model.dataType;
Jian Li8afbbee2016-07-27 19:16:51 +090023952 var modelType = this.model.modelSignature.type;
23953 var modelDefinitions = this.model.modelSignature.definitions;
23954 var schema = this.model.schema || {};
23955 var consumes = this.model.consumes || [];
23956 var sampleJSON, signatureView;
23957
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023958 if (typeof type === 'undefined') {
Jian Li8afbbee2016-07-27 19:16:51 +090023959 if (schema.$ref) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023960 var ref = schema.$ref;
23961 if (ref.indexOf('#/definitions/') === 0) {
23962 type = ref.substring('#/definitions/'.length);
23963 } else {
23964 type = ref;
23965 }
23966 }
23967 }
23968
23969 this.model.type = type;
23970 this.model.paramType = this.model.in || this.model.paramType;
23971 this.model.isBody = this.model.paramType === 'body' || this.model.in === 'body';
23972 this.model.isFile = type && type.toLowerCase() === 'file';
23973
23974 // Allow for default === false
23975 if(typeof this.model.default === 'undefined') {
23976 this.model.default = this.model.defaultValue;
23977 }
23978
23979 this.model.hasDefault = (typeof this.model.default !== 'undefined');
23980 this.model.valueId = 'm' + this.model.name + Math.random();
23981
23982 if (this.model.allowableValues) {
23983 this.model.isList = true;
23984 }
23985
Jian Li8afbbee2016-07-27 19:16:51 +090023986 var isXML = this.contains(consumes, 'xml');
23987 var isJSON = isXML ? this.contains(consumes, 'json') : true;
23988 sampleJSON = SwaggerUi.partials.signature.createParameterJSONSample(modelType, modelDefinitions);
23989
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023990 var template = this.template();
23991 $(this.el).html(template(this.model));
23992
23993 var signatureModel = {
Jian Li8afbbee2016-07-27 19:16:51 +090023994 sampleJSON: isJSON ? sampleJSON : false,
23995 sampleXML: sampleJSON && isXML ? SwaggerUi.partials.signature.createXMLSample('', schema, modelDefinitions, true) : false,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023996 isParam: true,
Jian Li8afbbee2016-07-27 19:16:51 +090023997 signature: SwaggerUi.partials.signature.getParameterModelSignature(modelType, modelDefinitions),
Jian Li83d87a72016-04-20 15:38:24 -070023998 defaultRendering: this.model.defaultRendering
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070023999 };
24000
Jian Li8afbbee2016-07-27 19:16:51 +090024001 if (sampleJSON) {
24002 signatureView = new SwaggerUi.Views.SignatureView({model: signatureModel, tagName: 'div'});
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070024003 $('.model-signature', $(this.el)).append(signatureView.render().el);
24004 }
24005 else {
24006 $('.model-signature', $(this.el)).html(this.model.signature);
24007 }
24008
24009 var isParam = false;
24010
Jian Li83d87a72016-04-20 15:38:24 -070024011 if( this.options.swaggerOptions.jsonEditor && this.model.isBody && this.model.schema){
24012 var $self = $(this.el);
Jian Li8afbbee2016-07-27 19:16:51 +090024013 this.model.jsonEditor =
Jian Li83d87a72016-04-20 15:38:24 -070024014 /* global JSONEditor */
24015 new JSONEditor($('.editor_holder', $self)[0],
Jian Li8afbbee2016-07-27 19:16:51 +090024016 {schema: this.model.schema, startval : this.model.default,
24017 ajax:true,
24018 disable_properties:true,
Jian Li83d87a72016-04-20 15:38:24 -070024019 disable_edit_json:true,
24020 iconlib: 'swagger' });
24021 // This is so that the signature can send back the sample to the json editor
24022 // TODO: SignatureView should expose an event "onSampleClicked" instead
24023 signatureModel.jsonEditor = this.model.jsonEditor;
24024 $('.body-textarea', $self).hide();
24025 $('.editor_holder', $self).show();
24026 $('.parameter-content-type', $self)
24027 .change(function(e){
24028 if(e.target.value === 'application/xml'){
24029 $('.body-textarea', $self).show();
24030 $('.editor_holder', $self).hide();
24031 this.model.jsonEditor.disable();
24032 }
24033 else {
24034 $('.body-textarea', $self).hide();
24035 $('.editor_holder', $self).show();
24036 this.model.jsonEditor.enable();
24037 }
24038 });
24039 }
24040
24041
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070024042 if (this.model.isBody) {
24043 isParam = true;
24044 }
24045
24046 var contentTypeModel = {
24047 isParam: isParam
24048 };
24049
24050 contentTypeModel.consumes = this.model.consumes;
24051
24052 if (isParam) {
24053 var parameterContentTypeView = new SwaggerUi.Views.ParameterContentTypeView({model: contentTypeModel});
24054 $('.parameter-content-type', $(this.el)).append(parameterContentTypeView.render().el);
Jian Li8afbbee2016-07-27 19:16:51 +090024055 this.toggleParameterSnippet();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070024056 }
24057
24058 else {
24059 var responseContentTypeView = new SwaggerUi.Views.ResponseContentTypeView({model: contentTypeModel});
24060 $('.response-content-type', $(this.el)).append(responseContentTypeView.render().el);
Jian Li8afbbee2016-07-27 19:16:51 +090024061 this.toggleResponseSnippet();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070024062 }
24063
24064 return this;
24065 },
24066
Jian Li8afbbee2016-07-27 19:16:51 +090024067 contains: function (consumes, type) {
24068 return consumes.filter(function (val) {
24069 if (val.indexOf(type) > -1) {
24070 return true;
24071 }
24072 }).length;
24073 },
24074
24075 toggleParameterSnippet: function () {
24076 var contentType = this.$('[name=parameterContentType]').val();
24077
24078 this.toggleSnippet(contentType);
24079 },
24080
24081 toggleResponseSnippet: function () {
24082 var contentEl = this.$('[name=responseContentType]');
24083
24084 if (!contentEl.length) { return; }
24085
24086 this.toggleSnippet(contentEl.val());
24087 },
24088
24089 toggleSnippet: function (type) {
24090 type = type || '';
24091 if (type.indexOf('xml') > -1) {
24092 this.$('.snippet_xml').show();
24093 this.$('.snippet_json').hide();
24094 } else {
24095 this.$('.snippet_json').show();
24096 this.$('.snippet_xml').hide();
24097 }
24098 },
24099
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070024100 // Return an appropriate template based on if the parameter is a list, readonly, required
24101 template: function(){
24102 if (this.model.isList) {
24103 return Handlebars.templates.param_list;
24104 } else {
24105 if (this.options.readOnly) {
24106 if (this.model.required) {
24107 return Handlebars.templates.param_readonly_required;
24108 } else {
24109 return Handlebars.templates.param_readonly;
24110 }
24111 } else {
24112 if (this.model.required) {
24113 return Handlebars.templates.param_required;
24114 } else {
24115 return Handlebars.templates.param;
24116 }
24117 }
24118 }
24119 }
24120});
24121
24122'use strict';
24123
Jian Li8afbbee2016-07-27 19:16:51 +090024124/* jshint -W122 */
24125SwaggerUi.partials.signature = (function () {
24126 // copy-pasted from swagger-js
24127 var resolveSchema = function (schema) {
24128 if (_.isPlainObject(schema.schema)) {
24129 schema = resolveSchema(schema.schema);
24130 }
24131
24132 return schema;
24133 };
24134
24135 // copy-pasted from swagger-js
24136 var simpleRef = function (name) {
24137 if (typeof name === 'undefined') {
24138 return null;
24139 }
24140
24141 if (name.indexOf('#/definitions/') === 0) {
24142 return name.substring('#/definitions/'.length);
24143 } else {
24144 return name;
24145 }
24146 };
24147
24148 // copy-pasted from swagger-js
24149 var getInlineModel = function(inlineStr) {
24150 if(/^Inline Model \d+$/.test(inlineStr) && this.inlineModels) {
24151 var id = parseInt(inlineStr.substr('Inline Model'.length).trim(),10); //
24152 var model = this.inlineModels[id];
24153 return model;
24154 }
24155 // I'm returning null here, should I rather throw an error?
24156 return null;
24157 };
24158
24159 // copy-pasted from swagger-js
24160 var formatXml = function(xml) {
24161 var contexp, fn, formatted, indent, l, lastType, len, lines, ln, pad, reg, transitions, wsexp;
24162 reg = /(>)(<)(\/*)/g;
24163 wsexp = /[ ]*(.*)[ ]+\n/g;
24164 contexp = /(<.+>)(.+\n)/g;
24165 xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
24166 pad = 0;
24167 formatted = '';
24168 lines = xml.split('\n');
24169 indent = 0;
24170 lastType = 'other';
24171 transitions = {
24172 'single->single': 0,
24173 'single->closing': -1,
24174 'single->opening': 0,
24175 'single->other': 0,
24176 'closing->single': 0,
24177 'closing->closing': -1,
24178 'closing->opening': 0,
24179 'closing->other': 0,
24180 'opening->single': 1,
24181 'opening->closing': 0,
24182 'opening->opening': 1,
24183 'opening->other': 1,
24184 'other->single': 0,
24185 'other->closing': -1,
24186 'other->opening': 0,
24187 'other->other': 0
24188 };
24189 fn = function(ln) {
24190 var fromTo, j, key, padding, type, types, value;
24191 types = {
24192 single: Boolean(ln.match(/<.+\/>/)),
24193 closing: Boolean(ln.match(/<\/.+>/)),
24194 opening: Boolean(ln.match(/<[^!?].*>/))
24195 };
24196 type = ((function() {
24197 var results;
24198 results = [];
24199 for (key in types) {
24200 value = types[key];
24201 if (value) {
24202 results.push(key);
24203 }
24204 }
24205 return results;
24206 })())[0];
24207 type = type === void 0 ? 'other' : type;
24208 fromTo = lastType + '->' + type;
24209 lastType = type;
24210 padding = '';
24211 indent += transitions[fromTo];
24212 padding = ((function() {
24213 var m, ref1, results;
24214 results = [];
24215 for (j = m = 0, ref1 = indent; 0 <= ref1 ? m < ref1 : m > ref1; j = 0 <= ref1 ? ++m : --m) {
24216 results.push(' ');
24217 }
24218 return results;
24219 })()).join('');
24220 if (fromTo === 'opening->closing') {
24221 formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
24222 } else {
24223 formatted += padding + ln + '\n';
24224 }
24225 };
24226 for (l = 0, len = lines.length; l < len; l++) {
24227 ln = lines[l];
24228 fn(ln);
24229 }
24230 return formatted;
24231 };
24232
24233 // copy-pasted from swagger-js
24234 var getModelSignature = function (name, schema, models, modelPropertyMacro) {
24235 var strongOpen = '<span class="strong">';
24236 var strongClose = '</span>';
24237
24238 var optionHtml = function (label, value) {
24239 return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
24240 };
24241
24242
24243 // Allow for ignoring the 'name' argument.... shifting the rest
24244 if(_.isObject(arguments[0])) {
24245 name = void 0;
24246 schema = arguments[0];
24247 models = arguments[1];
24248 modelPropertyMacro = arguments[2];
24249 }
24250
24251 models = models || {};
24252
24253 // Resolve the schema (Handle nested schemas)
24254 schema = resolveSchema(schema);
24255
24256 // Return for empty object
24257 if(_.isEmpty(schema)) {
24258 return strongOpen + 'Empty' + strongClose;
24259 }
24260
24261 // Dereference $ref from 'models'
24262 if(typeof schema.$ref === 'string') {
24263 name = simpleRef(schema.$ref);
24264 schema = models[name];
24265 if(typeof schema === 'undefined')
24266 {
24267 return strongOpen + name + ' is not defined!' + strongClose;
24268 }
24269 }
24270
24271 if(typeof name !== 'string') {
24272 name = schema.title || 'Inline Model';
24273 }
24274
24275 // If we are a Model object... adjust accordingly
24276 if(schema.definition) {
24277 schema = schema.definition;
24278 }
24279
24280 if(typeof modelPropertyMacro !== 'function') {
24281 modelPropertyMacro = function(prop){
24282 return (prop || {}).default;
24283 };
24284 }
24285
24286 var references = {};
24287 var seenModels = [];
24288 var inlineModels = 0;
24289
24290 // Generate current HTML
24291 var html = processModel(schema, name);
24292
24293 // Generate references HTML
24294 while (_.keys(references).length > 0) {
24295 /* jshint ignore:start */
24296 _.forEach(references, function (schema, name) {
24297 var seenModel = _.indexOf(seenModels, name) > -1;
24298
24299 delete references[name];
24300
24301 if (!seenModel) {
24302 seenModels.push(name);
24303
24304 html += '<br />' + processModel(schema, name);
24305 }
24306 });
24307 /* jshint ignore:end */
24308 }
24309
24310 return html;
24311
24312
24313 function addReference(schema, name, skipRef) {
24314 var modelName = name;
24315 var model;
24316
24317 if (schema.$ref) {
24318 modelName = schema.title || simpleRef(schema.$ref);
24319 model = models[simpleRef(schema.$ref)];
24320 } else if (_.isUndefined(name)) {
24321 modelName = schema.title || 'Inline Model ' + (++inlineModels);
24322 model = {definition: schema};
24323 }
24324
24325 if (skipRef !== true) {
24326 references[modelName] = _.isUndefined(model) ? {} : model.definition;
24327 }
24328
24329 return modelName;
24330 }
24331
24332 function primitiveToHTML(schema) {
24333 var html = '<span class="propType">';
24334 var type = schema.type || 'object';
24335
24336 if (schema.$ref) {
24337 html += addReference(schema, simpleRef(schema.$ref));
24338 } else if (type === 'object') {
24339 if (!_.isUndefined(schema.properties)) {
24340 html += addReference(schema);
24341 } else {
24342 html += 'object';
24343 }
24344 } else if (type === 'array') {
24345 html += 'Array[';
24346
24347 if (_.isArray(schema.items)) {
24348 html += _.map(schema.items, addReference).join(',');
24349 } else if (_.isPlainObject(schema.items)) {
24350 if (_.isUndefined(schema.items.$ref)) {
24351 if (!_.isUndefined(schema.items.type) && _.indexOf(['array', 'object'], schema.items.type) === -1) {
24352 html += schema.items.type;
24353 } else {
24354 html += addReference(schema.items);
24355 }
24356 } else {
24357 html += addReference(schema.items, simpleRef(schema.items.$ref));
24358 }
24359 } else {
24360 console.log('Array type\'s \'items\' schema is not an array or an object, cannot process');
24361 html += 'object';
24362 }
24363
24364 html += ']';
24365 } else {
24366 html += schema.type;
24367 }
24368
24369 html += '</span>';
24370
24371 return html;
24372 }
24373
24374 function primitiveToOptionsHTML(schema, html) {
24375 var options = '';
24376 var type = schema.type || 'object';
24377 var isArray = type === 'array';
24378
24379 if (!_.isUndefined(schema.description)) {
24380 html += ': ' + '<span class="propDesc">' + schema.description + '</span>';
24381 }
24382
24383 if (schema.enum) {
24384 html += ' = <span class="propVals">[\'' + schema.enum.join('\', \'') + '\']</span>';
24385 }
24386
24387 if (isArray) {
24388 if (_.isPlainObject(schema.items) && !_.isUndefined(schema.items.type)) {
24389 type = schema.items.type;
24390 } else {
24391 type = 'object';
24392 }
24393 }
24394
24395 if (!_.isUndefined(schema.default)) {
24396 options += optionHtml('Default', schema.default);
24397 }
24398
24399 switch (type) {
24400 case 'string':
24401 if (schema.minLength) {
24402 options += optionHtml('Min. Length', schema.minLength);
24403 }
24404
24405 if (schema.maxLength) {
24406 options += optionHtml('Max. Length', schema.maxLength);
24407 }
24408
24409 if (schema.pattern) {
24410 options += optionHtml('Reg. Exp.', schema.pattern);
24411 }
24412 break;
24413 case 'integer':
24414 case 'number':
24415 if (schema.minimum) {
24416 options += optionHtml('Min. Value', schema.minimum);
24417 }
24418
24419 if (schema.exclusiveMinimum) {
24420 options += optionHtml('Exclusive Min.', 'true');
24421 }
24422
24423 if (schema.maximum) {
24424 options += optionHtml('Max. Value', schema.maximum);
24425 }
24426
24427 if (schema.exclusiveMaximum) {
24428 options += optionHtml('Exclusive Max.', 'true');
24429 }
24430
24431 if (schema.multipleOf) {
24432 options += optionHtml('Multiple Of', schema.multipleOf);
24433 }
24434
24435 break;
24436 }
24437
24438 if (isArray) {
24439 if (schema.minItems) {
24440 options += optionHtml('Min. Items', schema.minItems);
24441 }
24442
24443 if (schema.maxItems) {
24444 options += optionHtml('Max. Items', schema.maxItems);
24445 }
24446
24447 if (schema.uniqueItems) {
24448 options += optionHtml('Unique Items', 'true');
24449 }
24450
24451 if (schema.collectionFormat) {
24452 options += optionHtml('Coll. Format', schema.collectionFormat);
24453 }
24454 }
24455
24456 if (_.isUndefined(schema.items)) {
24457 if (_.isArray(schema.enum)) {
24458 var enumString;
24459
24460 if (type === 'number' || type === 'integer') {
24461 enumString = schema.enum.join(', ');
24462 } else {
24463 enumString = '"' + schema.enum.join('", "') + '"';
24464 }
24465
24466 options += optionHtml('Enum', enumString);
24467 }
24468 }
24469
24470 if (options.length > 0) {
24471 html = '<span class="propWrap">' + html + '<table class="optionsWrapper"><tr><th colspan="2">' + type + '</th></tr>' + options + '</table></span>';
24472 }
24473
24474 return html;
24475 }
24476
24477 function processModel(schema, name) {
24478 var type = schema.type || 'object';
24479 var isArray = schema.type === 'array';
24480 var html = strongOpen + name + ' ' + (isArray ? '[' : '{') + strongClose;
24481 var contents;
24482
24483 if (name) {
24484 seenModels.push(name);
24485 }
24486
24487 if (isArray) {
24488 if (_.isArray(schema.items)) {
24489 html += '<div>' + _.map(schema.items, function (item) {
24490 var type = item.type || 'object';
24491
24492 if (_.isUndefined(item.$ref)) {
24493 if (_.indexOf(['array', 'object'], type) > -1) {
24494 if (type === 'object' && _.isUndefined(item.properties)) {
24495 return 'object';
24496 } else {
24497 return addReference(item);
24498 }
24499 } else {
24500 return primitiveToOptionsHTML(item, type);
24501 }
24502 } else {
24503 return addReference(item, simpleRef(item.$ref));
24504 }
24505 }).join(',</div><div>');
24506 } else if (_.isPlainObject(schema.items)) {
24507 if (_.isUndefined(schema.items.$ref)) {
24508 if (_.indexOf(['array', 'object'], schema.items.type || 'object') > -1) {
24509 if ((_.isUndefined(schema.items.type) || schema.items.type === 'object') && _.isUndefined(schema.items.properties)) {
24510 html += '<div>object</div>';
24511 } else {
24512 html += '<div>' + addReference(schema.items) + '</div>';
24513 }
24514 } else {
24515 html += '<div>' + primitiveToOptionsHTML(schema.items, schema.items.type) + '</div>';
24516 }
24517 } else {
24518 html += '<div>' + addReference(schema.items, simpleRef(schema.items.$ref)) + '</div>';
24519 }
24520 } else {
24521 console.log('Array type\'s \'items\' property is not an array or an object, cannot process');
24522 html += '<div>object</div>';
24523 }
24524 } else {
24525 if (schema.$ref) {
24526 html += '<div>' + addReference(schema, name) + '</div>';
24527 } else if (type === 'object') {
24528 if (_.isPlainObject(schema.properties)) {
24529 contents = _.map(schema.properties, function (property, name) {
24530 var propertyIsRequired = (_.indexOf(schema.required, name) >= 0);
24531 var cProperty = _.cloneDeep(property);
24532
24533 var requiredClass = propertyIsRequired ? 'required' : '';
24534 var html = '<span class="propName ' + requiredClass + '">' + name + '</span> (';
24535 var model;
24536
24537 // Allow macro to set the default value
24538 cProperty.default = modelPropertyMacro(cProperty);
24539
24540 // Resolve the schema (Handle nested schemas)
24541 cProperty = resolveSchema(cProperty);
24542
24543 // We need to handle property references to primitives (Issue 339)
24544 if (!_.isUndefined(cProperty.$ref)) {
24545 model = models[simpleRef(cProperty.$ref)];
24546
24547 if (!_.isUndefined(model) && _.indexOf([undefined, 'array', 'object'], model.definition.type) === -1) {
24548 // Use referenced schema
24549 cProperty = resolveSchema(model.definition);
24550 }
24551 }
24552
24553 html += primitiveToHTML(cProperty);
24554
24555 if(!propertyIsRequired) {
24556 html += ', <span class="propOptKey">optional</span>';
24557 }
24558
24559 if(property.readOnly) {
24560 html += ', <span class="propReadOnly">read only</span>';
24561 }
24562
24563 html += ')';
24564
24565 return '<div' + (property.readOnly ? ' class="readOnly"' : '') + '>' + primitiveToOptionsHTML(cProperty, html);
24566 }).join(',</div>');
24567 }
24568
24569 if (contents) {
24570 html += contents + '</div>';
24571 }
24572 } else {
24573 html += '<div>' + primitiveToOptionsHTML(schema, type) + '</div>';
24574 }
24575 }
24576
24577 return html + strongOpen + (isArray ? ']' : '}') + strongClose;
24578 }
24579
24580 };
24581
24582 // copy-pasted from swagger-js
24583 var schemaToJSON = function (schema, models, modelsToIgnore, modelPropertyMacro) {
24584 // Resolve the schema (Handle nested schemas)
24585 schema = resolveSchema(schema);
24586
24587 if(typeof modelPropertyMacro !== 'function') {
24588 modelPropertyMacro = function(prop){
24589 return (prop || {}).default;
24590 };
24591 }
24592
24593 modelsToIgnore= modelsToIgnore || {};
24594
24595 var type = schema.type || 'object';
24596 var format = schema.format;
24597 var model;
24598 var output;
24599
24600 if (!_.isUndefined(schema.example)) {
24601 output = schema.example;
24602 } else if (_.isUndefined(schema.items) && _.isArray(schema.enum)) {
24603 output = schema.enum[0];
24604 }
24605
24606 if (_.isUndefined(output)) {
24607 if (schema.$ref) {
24608 model = models[simpleRef(schema.$ref)];
24609
24610 if (!_.isUndefined(model)) {
24611 if (_.isUndefined(modelsToIgnore[model.name])) {
24612 modelsToIgnore[model.name] = model;
24613 output = schemaToJSON(model.definition, models, modelsToIgnore, modelPropertyMacro);
24614 delete modelsToIgnore[model.name];
24615 } else {
24616 if (model.type === 'array') {
24617 output = [];
24618 } else {
24619 output = {};
24620 }
24621 }
24622 }
24623 } else if (!_.isUndefined(schema.default)) {
24624 output = schema.default;
24625 } else if (type === 'string') {
24626 if (format === 'date-time') {
24627 output = new Date().toISOString();
24628 } else if (format === 'date') {
24629 output = new Date().toISOString().split('T')[0];
24630 } else {
24631 output = 'string';
24632 }
24633 } else if (type === 'integer') {
24634 output = 0;
24635 } else if (type === 'number') {
24636 output = 0.0;
24637 } else if (type === 'boolean') {
24638 output = true;
24639 } else if (type === 'object') {
24640 output = {};
24641
24642 _.forEach(schema.properties, function (property, name) {
24643 var cProperty = _.cloneDeep(property);
24644
24645 // Allow macro to set the default value
24646 cProperty.default = modelPropertyMacro(property);
24647
24648 output[name] = schemaToJSON(cProperty, models, modelsToIgnore, modelPropertyMacro);
24649 });
24650 } else if (type === 'array') {
24651 output = [];
24652
24653 if (_.isArray(schema.items)) {
24654 _.forEach(schema.items, function (item) {
24655 output.push(schemaToJSON(item, models, modelsToIgnore, modelPropertyMacro));
24656 });
24657 } else if (_.isPlainObject(schema.items)) {
24658 output.push(schemaToJSON(schema.items, models, modelsToIgnore, modelPropertyMacro));
24659 } else if (_.isUndefined(schema.items)) {
24660 output.push({});
24661 } else {
24662 console.log('Array type\'s \'items\' property is not an array or an object, cannot process');
24663 }
24664 }
24665 }
24666
24667 return output;
24668 };
24669
24670 // copy-pasted from swagger-js
24671 var createJSONSample = function (value, modelsToIgnore) {
24672 modelsToIgnore = modelsToIgnore || {};
24673
24674 modelsToIgnore[value.name] = value;
24675
24676 // Response support
Jian Li1c94b9d2017-02-08 15:47:21 +090024677 if (value.examples && _.isPlainObject(value.examples)) {
24678 value = _.cloneDeep(value);
24679 var keys = Object.keys(value.examples);
Jian Li8afbbee2016-07-27 19:16:51 +090024680
Jian Li1c94b9d2017-02-08 15:47:21 +090024681 _.forEach(keys, function(key) {
24682 if(key.indexOf('application/json') === 0) {
24683 var example = value.examples[key];
24684 if (_.isString(example)) {
24685 example = jsyaml.safeLoad(example);
24686 }
24687 value.definition.example = example;
24688 return schemaToJSON(value.definition, example, modelsToIgnore, value.modelPropertyMacro);
24689 }
24690 });
24691 }
24692
24693 if (value.examples) {
24694 value = _.cloneDeep(value);
24695 var example = value.examples;
24696 if (_.isString(example)) {
24697 example = jsyaml.safeLoad(example);
Jian Li8afbbee2016-07-27 19:16:51 +090024698 }
Jian Li1c94b9d2017-02-08 15:47:21 +090024699 value.definition.example = example;
24700 return schemaToJSON(value.definition, example, modelsToIgnore, value.modelPropertyMacro);
Jian Li8afbbee2016-07-27 19:16:51 +090024701 }
24702
24703 return schemaToJSON(value.definition, value.models, modelsToIgnore, value.modelPropertyMacro);
24704 };
24705
24706 // copy-pasted from swagger-js
24707 var getParameterModelSignature = function (type, definitions) {
24708 var isPrimitive, listType;
24709
24710 if (type instanceof Array) {
24711 listType = true;
24712 type = type[0];
24713 }
24714
24715 // Convert undefined to string of 'undefined'
24716 if (typeof type === 'undefined') {
24717 type = 'undefined';
24718 isPrimitive = true;
24719
24720 } else if (definitions[type]){
24721 // a model def exists?
24722 type = definitions[type]; /* Model */
24723 isPrimitive = false;
24724
24725 } else if (getInlineModel(type)) {
24726 type = getInlineModel(type); /* Model */
24727 isPrimitive = false;
24728
24729 } else {
24730 // We default to primitive
24731 isPrimitive = true;
24732 }
24733
24734 if (isPrimitive) {
24735 if (listType) {
24736 return 'Array[' + type + ']';
24737 } else {
24738 return type.toString();
24739 }
24740 } else {
24741 if (listType) {
24742 return 'Array[' + getModelSignature(type.name, type.definition, type.models, type.modelPropertyMacro) + ']';
24743 } else {
24744 return getModelSignature(type.name, type.definition, type.models, type.modelPropertyMacro);
24745 }
24746 }
24747 };
24748
24749 // copy-pasted from swagger-js
24750 var createParameterJSONSample = function (type, models) {
24751 var listType, sampleJson, innerType;
24752 models = models || {};
24753
24754 listType = (type instanceof Array);
24755 innerType = listType ? type[0] : type;
24756
24757 if(models[innerType]) {
24758 sampleJson = createJSONSample(models[innerType]);
24759 } else if (getInlineModel(innerType)){
24760 sampleJson = createJSONSample(getInlineModel(innerType)); // may return null, if type isn't correct
24761 }
24762
24763
24764 if (sampleJson) {
24765 sampleJson = listType ? [sampleJson] : sampleJson;
24766
24767 if (typeof sampleJson === 'string') {
24768 return sampleJson;
24769 } else if (_.isObject(sampleJson)) {
24770 var t = sampleJson;
24771
24772 if (sampleJson instanceof Array && sampleJson.length > 0) {
24773 t = sampleJson[0];
24774 }
24775
24776 if (t.nodeName && typeof t === 'Node') {
24777 var xmlString = new XMLSerializer().serializeToString(t);
24778
24779 return formatXml(xmlString);
24780 } else {
24781 return JSON.stringify(sampleJson, null, 2);
24782 }
24783 } else {
24784 return sampleJson;
24785 }
24786 }
24787 };
24788
24789 var wrapTag = function (name, value, attrs) {
24790 var str, attributes;
24791
24792 attrs = attrs || [];
24793
24794 attributes = attrs.map(function (attr) {
24795 return ' ' + attr.name + '="' + attr.value + '"';
24796 }).join('');
24797
24798 if (!name) {
24799 return getErrorMessage('Node name is not provided');
24800 }
24801
24802 str = [
24803 '<', name,
24804 attributes,
24805 '>',
24806 value,
24807 '</', name, '>'
24808 ];
24809
24810 return str.join('');
24811 };
24812
Jian Li1c94b9d2017-02-08 15:47:21 +090024813 // Commenting this funtion as the names are now determined beforehand and the prefix part is exposed as a separate function | https://github.com/swagger-api/swagger-ui/issues/2577
24814 /** var getName = function (name, xml) {
Jian Li8afbbee2016-07-27 19:16:51 +090024815 var result = name || '';
24816
24817 xml = xml || {};
24818
24819 if (xml.name) {
24820 result = xml.name;
24821 }
24822
24823 if (xml.prefix) {
24824 result = xml.prefix + ':' + result;
24825 }
24826
24827 return result;
24828 };
Jian Li1c94b9d2017-02-08 15:47:21 +090024829 */
24830
24831 var getPrefix = function (name, xml) {
24832 var result = name || '';
24833
24834 xml = xml || {};
24835
24836 if (xml.prefix) {
24837 result = xml.prefix + ':' + result;
24838 }
24839
24840 return result;
24841 };
Jian Li8afbbee2016-07-27 19:16:51 +090024842
24843 var getNamespace = function (xml) {
24844 var namespace = '';
24845 var name = 'xmlns';
24846
24847 xml = xml || {};
24848
24849 if (xml.namespace) {
24850 namespace = xml.namespace;
24851 } else {
24852 return namespace;
24853 }
24854
24855 if (xml.prefix) {
24856 name += ':' + xml.prefix;
24857 }
24858
24859 return {
24860 name: name,
24861 value: namespace
24862 };
24863 };
24864
24865 var createArrayXML = function (descriptor) {
24866 var name = descriptor.name;
24867 var config = descriptor.config;
24868 var definition = descriptor.definition;
24869 var models = descriptor.models;
24870 var value;
24871 var items = definition.items;
24872 var xml = definition.xml || {};
24873 var namespace = getNamespace(xml);
24874 var attributes = [];
24875
24876 if (!items) { return getErrorMessage(); }
Jian Li1c94b9d2017-02-08 15:47:21 +090024877 var key = name;
24878 // If there is a name specified for the array elements, use that for the array elements name | https://github.com/swagger-api/swagger-ui/issues/2577
24879 if(items.xml && items.xml.name) {
24880 key = items.xml.name;
24881 }
24882 value = createSchemaXML(key, items, models, config);
Jian Li8afbbee2016-07-27 19:16:51 +090024883 if (namespace) {
24884 attributes.push(namespace);
24885 }
24886
24887 if (xml.wrapped) {
24888 value = wrapTag(name, value, attributes);
24889 }
24890
24891 return value;
24892 };
24893
24894 var getPrimitiveSignature = function (schema) {
24895 var type, items;
24896
24897 schema = schema || {};
24898 items = schema.items || {};
24899 type = schema.type || '';
24900
24901 switch (type) {
24902 case 'object': return 'Object is not a primitive';
24903 case 'array' : return 'Array[' + (items.format || items.type) + ']';
24904 default: return schema.format || type;
24905 }
24906 };
24907
24908 var createPrimitiveXML = function (descriptor) {
24909 var name = descriptor.name;
24910 var definition = descriptor.definition;
24911 var primitivesMap = {
24912 'string': {
24913 'date': new Date(1).toISOString().split('T')[0],
24914 'date-time' : new Date(1).toISOString(),
24915 'default': 'string'
24916 },
24917 'integer': {
24918 'default': 1
24919 },
24920 'number': {
24921 'default': 1.1
24922 },
24923 'boolean': {
24924 'default': true
24925 }
24926 };
24927 var type = definition.type;
24928 var format = definition.format;
24929 var xml = definition.xml || {};
24930 var namespace = getNamespace(xml);
24931 var attributes = [];
24932 var value;
24933
24934 if (_.keys(primitivesMap).indexOf(type) < 0) { return getErrorMessage(); }
24935
24936 if (_.isArray(definition.enum)){
24937 value = definition.enum[0];
24938 } else {
24939 value = definition.example || primitivesMap[type][format] || primitivesMap[type].default;
24940 }
24941
24942 if (xml.attribute) {
24943 return {name: name, value: value};
24944 }
24945
24946 if (namespace) {
24947 attributes.push(namespace);
24948 }
24949
24950 return wrapTag(name, value, attributes);
24951 };
24952
24953 function createObjectXML (descriptor) {
24954 var name = descriptor.name;
24955 var definition = descriptor.definition;
24956 var config = descriptor.config;
24957 var models = descriptor.models;
24958 var isParam = descriptor.config.isParam;
24959 var serializedProperties;
24960 var attrs = [];
24961 var properties = definition.properties;
24962 var additionalProperties = definition.additionalProperties;
24963 var xml = definition.xml;
24964 var namespace = getNamespace(xml);
24965
24966 if (namespace) {
24967 attrs.push(namespace);
Jian Li1c94b9d2017-02-08 15:47:21 +090024968 }
Jian Li8afbbee2016-07-27 19:16:51 +090024969
24970 if (!properties && !additionalProperties) { return getErrorMessage(); }
24971
24972 properties = properties || {};
24973
24974 serializedProperties = _.map(properties, function (prop, key) {
24975 var xml, result;
24976
24977 if (isParam && prop.readOnly) {
24978 return '';
24979 }
24980
24981 xml = prop.xml || {};
24982 result = createSchemaXML(key, prop, models, config);
24983
24984 if (xml.attribute) {
24985 attrs.push(result);
24986 return '';
24987 }
24988
24989 return result;
24990 }).join('');
24991
24992 if (additionalProperties) {
24993 serializedProperties += '<!-- additional elements allowed -->';
24994 }
24995
24996 return wrapTag(name, serializedProperties, attrs);
24997 }
24998
24999 function getInfiniteLoopMessage (name, loopTo) {
25000 return wrapTag(name, '<!-- Infinite loop $ref:' + loopTo + ' -->');
25001 }
25002
25003 function getErrorMessage (details) {
25004 details = details ? ': ' + details : '';
25005 return '<!-- invalid XML' + details + ' -->';
25006 }
25007
25008 function createSchemaXML (name, definition, models, config) {
25009 var $ref = _.isObject(definition) ? definition.$ref : null;
25010 var output, index;
25011 config = config || {};
25012 config.modelsToIgnore = config.modelsToIgnore || [];
Jian Li1c94b9d2017-02-08 15:47:21 +090025013
Jian Li8afbbee2016-07-27 19:16:51 +090025014 var descriptor = _.isString($ref) ? getDescriptorByRef($ref, name, models, config)
25015 : getDescriptor(name, definition, models, config);
Jian Li1c94b9d2017-02-08 15:47:21 +090025016
Jian Li8afbbee2016-07-27 19:16:51 +090025017 if (!descriptor) {
25018 return getErrorMessage();
25019 }
25020
25021 switch (descriptor.type) {
25022 case 'array':
25023 output = createArrayXML(descriptor); break;
25024 case 'object':
25025 output = createObjectXML(descriptor); break;
25026 case 'loop':
25027 output = getInfiniteLoopMessage(descriptor.name, descriptor.config.loopTo); break;
25028 default:
25029 output = createPrimitiveXML(descriptor);
25030 }
25031
25032 if ($ref && descriptor.type !== 'loop') {
25033 index = config.modelsToIgnore.indexOf($ref);
25034 if (index > -1) {
25035 config.modelsToIgnore.splice(index, 1);
25036 }
25037 }
25038
25039 return output;
25040 }
25041
25042 function Descriptor (name, type, definition, models, config) {
25043 if (arguments.length < 4) {
25044 throw new Error();
25045 }
Jian Li8afbbee2016-07-27 19:16:51 +090025046 this.config = config || {};
25047 this.config.modelsToIgnore = this.config.modelsToIgnore || [];
Jian Li1c94b9d2017-02-08 15:47:21 +090025048 // name is already set by getDescriptorByRef or getDescriptor function depending on the type. Only prefix, if present is needed to be set here | https://github.com/swagger-api/swagger-ui/issues/2577
25049 this.name = getPrefix(name, definition.xml);
Jian Li8afbbee2016-07-27 19:16:51 +090025050 this.definition = definition;
25051 this.models = models;
25052 this.type = type;
25053 }
25054
25055 function getDescriptorByRef($ref, name, models, config) {
25056 var modelType = simpleRef($ref);
25057 var model = models[modelType] || {};
25058 var type = model.definition && model.definition.type ? model.definition.type : 'object';
Jian Li1c94b9d2017-02-08 15:47:21 +090025059 // If model definition xml name is present, then that will be preferred over model name. This is the case of preferring XmlElement name over XmlRootElement name if XmlElement name is provided | https://github.com/swagger-api/swagger-ui/issues/2577
25060 if(model.definition && model.definition.xml && model.definition.xml.name) {
25061 name = name || model.definition.xml.name || model.name;
25062 }
25063 // else only model name will be considered for determination | https://github.com/swagger-api/swagger-ui/issues/2577
25064 else {
25065 name = name || model.name;
25066 }
25067
Jian Li8afbbee2016-07-27 19:16:51 +090025068 if (config.modelsToIgnore.indexOf($ref) > -1) {
25069 type = 'loop';
25070 config.loopTo = modelType;
25071 } else {
25072 config.modelsToIgnore.push($ref);
25073 }
25074
25075 if (!model.definition) {
25076 return null;
25077 }
Jian Li1c94b9d2017-02-08 15:47:21 +090025078 return new Descriptor(name, type, model.definition, models, config);
Jian Li8afbbee2016-07-27 19:16:51 +090025079 }
25080
25081 function getDescriptor (name, definition, models, config){
25082 var type = definition.type || 'object';
Jian Li1c94b9d2017-02-08 15:47:21 +090025083 // If definition xml name is present, then that will be preferred over name | https://github.com/swagger-api/swagger-ui/issues/2577
25084 if(definition.xml && definition.xml.name) {
25085 name = definition.xml.name || name;
25086 }
Jian Li8afbbee2016-07-27 19:16:51 +090025087 if (!definition) {
25088 return null;
25089 }
25090
25091 return new Descriptor(name, type, definition, models, config);
25092 }
25093
25094 function createXMLSample (name, definition, models, isParam) {
25095 var prolog = '<?xml version="1.0"?>';
25096
25097 return formatXml(prolog + createSchemaXML(name, definition, models, { isParam: isParam } ));
25098 }
25099
25100 return {
25101 getModelSignature: getModelSignature,
25102 createJSONSample: createJSONSample,
25103 getParameterModelSignature: getParameterModelSignature,
25104 createParameterJSONSample: createParameterJSONSample,
25105 createSchemaXML: createSchemaXML,
25106 createXMLSample: createXMLSample,
25107 getPrimitiveSignature: getPrimitiveSignature
25108 };
25109
25110})();
25111
25112'use strict';
25113
25114SwaggerUi.Views.PopupView = Backbone.View.extend({
25115 events: {
25116 'click .api-popup-cancel': 'cancelClick'
25117 },
25118
25119 template: Handlebars.templates.popup,
25120 className: 'api-popup-dialog',
25121
25122 selectors: {
25123 content: '.api-popup-content',
25124 main : '#swagger-ui-container'
25125 },
25126
25127 initialize: function(){
25128 this.$el.html(this.template(this.model));
25129 },
25130
25131 render: function () {
25132 this.$(this.selectors.content).append(this.model.content);
25133 $(this.selectors.main).first().append(this.el);
25134 this.showPopup();
25135
25136 return this;
25137 },
25138
25139 showPopup: function () {
25140 this.$el.show();
25141 },
25142
25143 cancelClick: function () {
25144 this.remove();
25145 }
25146
25147});
25148
25149'use strict';
25150
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025151SwaggerUi.Views.ResourceView = Backbone.View.extend({
25152 initialize: function(opts) {
25153 opts = opts || {};
25154 this.router = opts.router;
25155 this.auths = opts.auths;
25156 if ('' === this.model.description) {
25157 this.model.description = null;
25158 }
25159 if (this.model.description) {
25160 this.model.summary = this.model.description;
25161 }
Jian Li7f6d0e9e2016-09-27 02:04:49 +090025162 this.number = 0;
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025163 },
25164
25165 render: function(){
25166 var methods = {};
25167
25168
25169 $(this.el).html(Handlebars.templates.resource(this.model));
25170
25171 // Render each operation
25172 for (var i = 0; i < this.model.operationsArray.length; i++) {
25173 var operation = this.model.operationsArray[i];
25174 var counter = 0;
25175 var id = operation.nickname;
25176
25177 while (typeof methods[id] !== 'undefined') {
25178 id = id + '_' + counter;
25179 counter += 1;
25180 }
25181
25182 methods[id] = operation;
25183
25184 operation.nickname = id;
25185 operation.parentId = this.model.id;
Jian Li83d87a72016-04-20 15:38:24 -070025186 operation.definitions = this.model.definitions; // make Json Schema available for JSonEditor in this operation
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025187 this.addOperation(operation);
25188 }
25189
25190 $('.toggleEndpointList', this.el).click(this.callDocs.bind(this, 'toggleEndpointListForResource'));
25191 $('.collapseResource', this.el).click(this.callDocs.bind(this, 'collapseOperationsForResource'));
25192 $('.expandResource', this.el).click(this.callDocs.bind(this, 'expandOperationsForResource'));
25193
25194 return this;
25195 },
25196
25197 addOperation: function(operation) {
25198
25199 operation.number = this.number;
25200
25201 // Render an operation and add it to operations li
25202 var operationView = new SwaggerUi.Views.OperationView({
25203 model: operation,
25204 router: this.router,
25205 tagName: 'li',
25206 className: 'endpoint',
25207 swaggerOptions: this.options.swaggerOptions,
25208 auths: this.auths
25209 });
25210
25211 $('.endpoints', $(this.el)).append(operationView.render().el);
25212
25213 this.number++;
25214
25215 },
25216 // Generic Event handler (`Docs` is global)
25217
25218
25219 callDocs: function(fnName, e) {
25220 e.preventDefault();
25221 Docs[fnName](e.currentTarget.getAttribute('data-id'));
25222 }
25223});
Jian Li7f6d0e9e2016-09-27 02:04:49 +090025224
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025225'use strict';
25226
25227SwaggerUi.Views.ResponseContentTypeView = Backbone.View.extend({
25228 initialize: function(){},
25229
25230 render: function(){
25231 this.model.responseContentTypeId = 'rct' + Math.random();
25232 $(this.el).html(Handlebars.templates.response_content_type(this.model));
25233 return this;
25234 }
25235});
25236'use strict';
25237
25238SwaggerUi.Views.SignatureView = Backbone.View.extend({
25239 events: {
25240 'click a.description-link' : 'switchToDescription',
25241 'click a.snippet-link' : 'switchToSnippet',
Jian Li8afbbee2016-07-27 19:16:51 +090025242 'mousedown .snippet_json' : 'jsonSnippetMouseDown',
25243 'mousedown .snippet_xml' : 'xmlSnippetMouseDown'
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025244 },
25245
25246 initialize: function () {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025247 },
25248
25249 render: function(){
25250
25251 $(this.el).html(Handlebars.templates.signature(this.model));
25252
Jian Li83d87a72016-04-20 15:38:24 -070025253 if (this.model.defaultRendering === 'model') {
25254 this.switchToDescription();
25255 } else {
25256 this.switchToSnippet();
25257 }
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025258
25259 return this;
25260 },
25261
25262 // handler for show signature
25263 switchToDescription: function(e){
25264 if (e) { e.preventDefault(); }
25265
25266 $('.snippet', $(this.el)).hide();
25267 $('.description', $(this.el)).show();
25268 $('.description-link', $(this.el)).addClass('selected');
25269 $('.snippet-link', $(this.el)).removeClass('selected');
25270 },
25271
25272 // handler for show sample
25273 switchToSnippet: function(e){
25274 if (e) { e.preventDefault(); }
25275
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025276 $('.snippet', $(this.el)).show();
Jian Li8afbbee2016-07-27 19:16:51 +090025277 $('.description', $(this.el)).hide();
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025278 $('.snippet-link', $(this.el)).addClass('selected');
25279 $('.description-link', $(this.el)).removeClass('selected');
25280 },
25281
25282 // handler for snippet to text area
Jian Li8afbbee2016-07-27 19:16:51 +090025283 snippetToTextArea: function(val) {
25284 var textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode));
25285
25286 // Fix for bug in IE 10/11 which causes placeholder text to be copied to "value"
25287 if ($.trim(textArea.val()) === '' || textArea.prop('placeholder') === textArea.val()) {
25288 textArea.val(val);
25289 // TODO move this code outside of the view and expose an event instead
25290 if( this.model.jsonEditor && this.model.jsonEditor.isEnabled()){
25291 this.model.jsonEditor.setValue(JSON.parse(this.model.sampleJSON));
25292 }
25293 }
25294 },
25295
25296 jsonSnippetMouseDown: function (e) {
25297 if (this.model.isParam) {
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025298 if (e) { e.preventDefault(); }
25299
Jian Li8afbbee2016-07-27 19:16:51 +090025300 this.snippetToTextArea(this.model.sampleJSON);
25301 }
25302 },
Jian Li83d87a72016-04-20 15:38:24 -070025303
Jian Li8afbbee2016-07-27 19:16:51 +090025304 xmlSnippetMouseDown: function (e) {
25305 if (this.model.isParam) {
25306 if (e) { e.preventDefault(); }
25307
25308 this.snippetToTextArea(this.model.sampleXML);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025309 }
25310 }
25311});
25312'use strict';
25313
25314SwaggerUi.Views.StatusCodeView = Backbone.View.extend({
25315 initialize: function (opts) {
25316 this.options = opts || {};
25317 this.router = this.options.router;
25318 },
25319
25320 render: function(){
Jian Li8afbbee2016-07-27 19:16:51 +090025321 var responseModel, responseModelView;
25322 var value = this.router.api.models[this.model.responseModel];
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025323 $(this.el).html(Handlebars.templates.status_code(this.model));
25324
25325 if (this.router.api.models.hasOwnProperty(this.model.responseModel)) {
Jian Li8afbbee2016-07-27 19:16:51 +090025326 responseModel = {
25327 sampleJSON: JSON.stringify(SwaggerUi.partials.signature.createJSONSample(value), void 0, 2),
25328 sampleXML: this.model.isXML ? SwaggerUi.partials.signature.createXMLSample('', this.model.schema, this.router.api.models) : false,
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025329 isParam: false,
Jian Li8afbbee2016-07-27 19:16:51 +090025330 signature: SwaggerUi.partials.signature.getModelSignature(this.model.responseModel, value, this.router.api.models),
Jian Li83d87a72016-04-20 15:38:24 -070025331 defaultRendering: this.model.defaultRendering
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025332 };
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025333 } else {
Jian Li8afbbee2016-07-27 19:16:51 +090025334 responseModel = {
25335 signature: SwaggerUi.partials.signature.getPrimitiveSignature(this.model.schema)
25336 };
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025337 }
Jian Li8afbbee2016-07-27 19:16:51 +090025338
25339 responseModelView = new SwaggerUi.Views.SignatureView({model: responseModel, tagName: 'div'});
25340 $('.model-signature', this.$el).append(responseModelView.render().el);
Thomas Vachuska0fa2aa12015-08-18 12:53:04 -070025341 return this;
25342 }
Jian Li1c94b9d2017-02-08 15:47:21 +090025343});}).call(this);
25344//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlbXBsYXRlcy5qcyIsImRvYy5qcyIsImVzNS1zaGltLmpzIiwiaGVscGVycy9oYW5kbGViYXJzLmpzIiwic2FuaXRpemUtaHRtbC5taW4uanMiLCJub2RlX21vZHVsZXMvYnJvd3NlcmlmeS9ub2R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pzY3M6aWdub3JlIGRpc2FsbG93VW51c2VkVmFyaWFibGVzXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIG9iai54ID09PSBvYmo7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHsgLyogdGhpcyBpcyBFUzMgKi9cbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH0oKSk7XG4gICAgdmFyIGRlZmluZVByb3BlcnRpZXMgPSAoZnVuY3Rpb24gKGhhcykge1xuICAgICAgICAvLyBEZWZpbmUgY29uZmlndXJhYmxlLCB3cml0YWJsZSwgYW5kIG5vbi1lbnVtZXJhYmxlIHByb3BzXG4gICAgICAgIC8vIGlmIHRoZXkgZG9uJ3QgZXhpc3QuXG4gICAgICAgIHZhciBkZWZpbmVQcm9wZXJ0eTtcbiAgICAgICAgaWYgKHN1cHBvcnRzRGVzY3JpcHRvcnMpIHtcbiAgICAgICAgICAgIGRlZmluZVByb3BlcnR5ID0gZnVuY3Rpb24gKG9iamVjdCwgbmFtZSwgbWV0aG9kLCBmb3JjZUFzc2lnbikge1xuICAgICAgICAgICAgICAgIGlmICghZm9yY2VBc3NpZ24gJiYgKG5hbWUgaW4gb2JqZWN0KSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICRPYmplY3QuZGVmaW5lUHJvcGVydHkob2JqZWN0LCBuYW1lLCB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIHdyaXRhYmxlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogbWV0aG9kXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZGVmaW5lUHJvcGVydHkgPSBmdW5jdGlvbiAob2JqZWN0LCBuYW1lLCBtZXRob2QsIGZvcmNlQXNzaWduKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFmb3JjZUFzc2lnbiAmJiAobmFtZSBpbiBvYmplY3QpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgb2JqZWN0W25hbWVdID0gbWV0aG9kO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gZGVmaW5lUHJvcGVydGllcyhvYmplY3QsIG1hcCwgZm9yY2VBc3NpZ24pIHtcbiAgICAgICAgICAgIGZvciAodmFyIG5hbWUgaW4gbWFwKSB7XG4gICAgICAgICAgICAgICAgaWYgKGhhcy5jYWxsKG1hcCwgbmFtZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVmaW5lUHJvcGVydHkob2JqZWN0LCBuYW1lLCBtYXBbbmFtZV0sIGZvcmNlQXNzaWduKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgfShPYmplY3RQcm90b3R5cGUuaGFzT3duUHJvcGVydHkpKTtcblxuICAgIC8vXG4gICAgLy8gVXRpbFxuICAgIC8vID09PT09PVxuICAgIC8vXG5cbiAgICAvKiByZXBsYWNlYWJsZSB3aXRoIGh0dHBzOi8vbnBtanMuY29tL3BhY2thZ2UvZXMtYWJzdHJhY3QgL2hlbHBlcnMvaXNQcmltaXRpdmUgKi9cbiAgICB2YXIgaXNQcmltaXRpdmUgPSBmdW5jdGlvbiBpc1ByaW1pdGl2ZShpbnB1dCkge1xuICAgICAgICB2YXIgdHlwZSA9IHR5cGVvZiBpbnB1dDtcbiAgICAgICAgcmV0dXJuIGlucHV0ID09PSBudWxsIHx8ICh0eXBlICE9PSAnb2JqZWN0JyAmJiB0eXBlICE9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Gl2ZShpbnB1dCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YWx1ZU9mID0gaW5wdXQudmFsdWVPZjtcbiAgICAgICAgICAgIGlmIChpc0NhbGxhYmxlKHZhbHVlT2YpKSB7XG4gICAgICAgICAgICAgICAgdmFsID0gdmFsdWVPZi5jYWxsKGlucHV0KTtcbiAgICAgICAgICAgICAgICBpZiAoaXNQcmltaXRpdmUodmFsKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRvU3RyID0gaW5wdXQudG9TdHJpbmc7XG4gICAgICAgICAgICBpZiAoaXNDYWxsYWJsZSh0b1N0cikpIHtcbiAgICAgICAgICAgICAgICB2YWwgPSB0b1N0ci5jYWxsKGlucHV0KTtcbiAgICAgICAgICAgICAgICBpZiAoaXNQcmltaXRpdmUodmFsKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoKTtcbiAgICAgICAgfSxcblxuICAgICAgICAvLyBFUzUgOS45XG4gICAgICAgIC8vIGh0dHA6Ly9lczUuZ2l0aHViLmNvbS8jeDkuOVxuICAgICAgICAvKiByZXBsYWNlYWJsZSB3aXRoIGh0dHBzOi8vbnBtanMuY29tL3BhY2thZ2UvZXMtYWJzdHJhY3QgRVM1LlRvT2JqZWN0ICovXG4gICAgICAgIFRvT2JqZWN0OiBmdW5jdGlvbiAobykge1xuICAgICAgICAgICAgaWYgKG8gPT0gbnVsbCkgeyAvLyB0aGlzIG1hdGNoZXMgYm90aCBudWxsIGFuZCB1bmRlZmluZWRcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFwiY2FuJ3QgY29udmVydCB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yAgIDE1LjMuNC41LjMuXG4gICAgICAgICAgICB2YXIgYm91bmQ7XG4gICAgICAgICAgICB2YXIgYmluZGVyID0gZnVuY3Rpb24gKCkge1xuXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMgaW5zdGFuY2VvZiBib3VuZCkge1xuICAgICAgICAgICAgICAgICAgICAvLyAxNS4zLjQuNS4yIFtbQ29uc3RydWN0XV1cbiAgICAgICAgICAgICAgICAgICAgLy8gV2hlbiB0aGUgW1tDb25zdHJ1Y3RdXSBpbnRlcm5hbCBtZXRob2Qgb2YgYSBmdW5jdGlvbiBvYmplY3QsXG4gICAgICAgICAgICAgICAgICAgIC8vIEYgdGhhdCB3YXMgY3JlYXRlZCB1c2luZyB0aGUgYmluZCBmdW5jdGlvbiBpcyBjYWxsZWQgd2l0aCBhXG4gICAgICAgICAgICAgICAgICAgIC8vIGxpc3Qgb2YgYXJndW1lbnRzIEV4dHJhQXJncywgdGhlIGZvbGxvd2luZyBzdGVwcyBhcmUgdGFrZW46XG4gICAgICAgICAgICAgICAgICAgIC8vIDEuIExldCB0YXJnZXQgYmUgdGhlIHZhbHVlIG9mIEYncyBbW1RhcmdldEZ1bmN0aW9uXV1cbiAgICAgICAgICAgICAgICAgICAgLy8gICBpbnRlcm5hbCBwcm9wZXJ0eS5cbiAgICAgICAgICAgICAgICAgICAgLy8gMi4gSWYgdGFyZ2V0IGhhcyBubyBbW0NvbnN0cnVjdF1dIGludGVybmFsIG1ldGhvZCwgYVxuICAgICAgICAgICAgICAgICAgICAvLyAgIFR5cGVFcnJvciBleGNlcHRpb24gaXMgdGhyb3duLlxuICAgICAgICAgICAgICAgICAgICAvLyAzLiBMZXQgYm91bmRBcmdzIGJlIHRoZSB2YWx1ZSBvZiBGJ3MgW1tCb3VuZEFyZ3NdXSBpbnRlcm5hbFxuICAgICAgICAgICAgICAgICAgICAvLyAgIHByb3BlcnR5LlxuICAgICAgICAgICAgICAgICAgICAvLyA0LiBMZXQgYXJncyBiZSBhIG5ldyBsaXN0IGNvbnRhaW5pbmcgdGhlIHNhbWUgdmFsdWVzIGFzIHRoZVxuICAgICAgICAgICAgICAgICAgICAvLyAgIGxpc3QgYm91bmRBcmdzIGluIHRoZSBzYW1lIG9yZGVyIGZvbGxvd2VkIGJ5IHRoZSBzYW1lXG4gICAgICAgICAgICAgICAgICAgIC8vICAgdmFsdWVzIGFzIHRoZSBsaXN0IEV4dHJhQXJncyBpbiB0aGUgc2FtZSBvcmRlci5cbiAgICAgICAgICAgICAgICAgICAgLy8gNS4gUmV0dXJuIHRoZSByZXN1bHQgb2YgY2FsbGluZyB0aGUgW1tDb25zdHJ1Y3RdXSBpbnRlcm5hbFxuICAgICAgICAgICAgICAgICAgICAvLyAgIG1ldGhvZCBvZiB0YXJnZXQgcHJvdmlkaW5nIGFyZ3MgYXMgdGhlIGFyZ3VtZW50cy5cblxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzdWx0ID0gYXBwbHkuY2FsbChcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnJheV9jb25jYXQuY2FsbChhcmdzLCBhcnJheV9zbGljZS5jYWxsKGFyZ3VtZW50cykpXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkT2JqZWN0KHJlc3VsdCkgPT09IHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcztcblxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIDE1LjMuNC41LjEgW1tDYWxsXV1cbiAgICAgICAgICAgICAgICAgICAgLy8gV2hlbiB0aGUgW1tDYWxsXV0gaW50ZXJuYWwgbWV0aG9kIG9mIGEgZnVuY3Rpb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Ly8gNS4gUmV0dXJuIHRoZSByZXN1bHQgb2YgY2FsbGluZyB0aGUgW1tDYWxsXV0gaW50ZXJuYWwgbWV0aG9kXG4gICAgICAgICAgICAgICAgICAgIC8vICAgb2YgdGFyZ2V0IHByb3ZpZGluZyBib3VuZFRoaXMgYXMgdGhlIHRoaXMgdmFsdWUgYW5kXG4gICAgICAgICAgICAgICAgICAgIC8vICAgcHJvdmlkaW5nIGFyZ3MgYXMgdGhlIGFyZ3VtZW50cy5cblxuICAgICAgICAgICAgICAgICAgICAvLyBlcXVpdjogdGFyZ2V0LmNhbGwodGhpcywgLi4uYm91bmRBcmdzLCAuLi5hcmdzKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXBwbHkuY2FsbChcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoYXQsXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnJheV9jb25jYXQuY2FsbChhcmdzLCBhcnJheV9zbGljZS5jYWxsKGFyZ3VtZW50cykpXG4gICAgICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIC8vIDE1LiBJZiB0aGUgW1tDbGFzc11dIGludGVybmFsIHByb3BlcnR5IG9mIFRhcmdldCBpcyBcIkZ1bmN0aW9uXCIsIHRoZW5cbiAgICAgICAgICAgIC8vICAgICBhLiBMZXQgTCBiZSB0aGUgbGVuZ3RoIHByb3BlcnR5IG9mIFRhcmdldCBtaW51cyB0aGUgbGVuZ3RoIG9mIEEuXG4gICAgICAgICAgICAvLyAgICAgYi4gU2V0IHRoZSBsZW5ndGggb3duIHByb3BlcnR5IG9mIEYgdG8gZWl0aGVyIDAgb3IgTCwgd2hpY2hldmVyIGlzXG4gICAgICAgICAgICAvLyAgICAgICBsYXJnZXIuXG4gICAgICAgICAgICAvLyAxNi4gRWxzZSBzZXQgdGhlIGxlbmd0aCBvd24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ICAgICB2YXIgcHJvcGVybHlCb3hlc05vblN0cmljdCA9IHRydWU7XG4gICAgICAgIHZhciBwcm9wZXJseUJveGVzU3RyaWN0ID0gdHJ1ZTtcbiAgICAgICAgdmFyIHRocmV3RXhjZXB0aW9uID0gZmFsc2U7XG4gICAgICAgIGlmIChtZXRob2QpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgbWV0aG9kLmNhbGwoJ2ZvbycsIGZ1bmN0aW9uIChfLCBfXywgY29udGV4dCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvbnRleHQgIT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJseUJveGVzTm9uU3RyaWN0ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIG1ldGhvZC5jYWxsKFsxXSwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAndXNlIHN0cmljdCc7XG5cbiAgICAgICAgICAgICAgICAgICAgcHJvcGVybHlCb3hlc1N0cmljdCA9IHR5cGVvZiB0aGlzID09PSAnc3RyaW5nJztcbiAgICAgICAgICAgICAgICB9LCAneCcpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIHRocmV3RXhjZXB0aW9uID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gISFtZXRob2QgJiYgIXRocmV3RXhjZXB0aW9uICYmIHByb3Blcmx5Qm94ZXNOb25TdHJpY3QgJiYgcHJvcGVybHlCb3hlc1N0cmljdDtcbiAgICB9O1xuXG4gICAgZGVmaW5lUHJvcGVydGllcyhBcnJheVByb3RvdHlwZSwge1xuICAgICAgICBmb3JFYWNoOiBmdW5jdGlvbiBmb3JFYWNoKGNhbGxiYWNrZm4vKiwgdGhpc0FyZyovKSB7XG4gICAgICAgICAgICB2YXIgb2JqZWN0ID0gRVMuVG9PYmplY3QodGhpcyk7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHNwbGl0U3RyaW5nICYmIGlzU3RyaW5nKHRoaXMpID8gc3RyU3BsaXQodGhpcywgJycpIDogb2JqZWN0O1xuICAgICAgICAgICAgdmFyIGkgPSAtMTtcbiAgICAgICAgICAgIHZhciBsZW5ndGggPSBFUy5Ub1VpbnQzMihzZWxmLmxlbmd0aCk7XG4gICAgICAgICAgICB2YXIgVDtcbiAgICAgICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgIFQgPSBhcmd1bWVudHNbMV07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIElmIG5vIGNhbGxiYWNrIGZ1bmN0aW9uIG9yIGlmIGNhbGxiYWNrIGlzIG5vdCBhIGNhbGxhYmxlIGZ1bmN0aW9uXG4gICAgICAgICAgICBpZiAoIWlzQ2FsbGFibGUoY2FsbGJhY2tmbikpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdBcnJheS5wcm90b3R5cGUuZm9yRWFjaCBjYWxsYmFjayBtdXN0IGJlIGEgZnVuY3Rpb24nKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgd2hpbGUgKCsraSA8IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGlmIChpIGluIHNlbGYpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gSW52b2tlIHRoZSBjYWxsYmFjayBmdW5jdGlvbiB3aXRoIGNhbGwsIHBhc3NpbmcgYXJndW1lbnRzOlxuICAgICAgICAgICAgICAgICAgICAvLyBjb250ZXh0LCBwcm9wZXJ0eSB2YWx1ZSwgcHJvcGVydHkga2V5LCB0aGlzQXJnIG9iamVjdFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIFQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFja2ZuKHNlbGZbaV0sIGksIG9iamVjdCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFja2ZuLmNhbGwoVCwgc2VsZltpXSwgaSwgb2JqZWN0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sICFwcm9wZXJseUJveGVzQ29udGV4dChBcnJheVByb3RvdHlwZS5mb3JFYWNoKSk7XG5cbiAgICAvLyBFUzUgMTUuNC40LjE5XG4gICAgLy8gaHR0cDovL2VzNS5naXRodWIuY29tLyN4MTUuNC40LjE5XG4gICAgLy8gaHR0cHM6Ly9kZXZlbG9wZXIubW96aWxsYS5vcmcvZW4vQ29yZV9KYXZhU2NyaXB0XzEuNV9SZWZlcmVuY2UvT2JqZWN0cy9BcnJheS9tYXBcbiAgICBkZWZpbmVQcm9wZXJ0aWVzKEFycmF5UHJvdG90eXBlLCB7XG4gICAgICAgIG1hcDogZnVuY3Rpb24gbWFwKGNhbGxiYWNrZm4vKiwgdGhpc0FyZyovKSB7XG4gICAgICAgICAgICB2YXIgb2JqZWN0ID0gRVMuVG9PYmplY3QodGhpcyk7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHNwbGl0U3RyaW5nICYmIGlzU3RyaW5nKHRoaXMpID8gc3RyU3BsaXQodGhpcywgJycpIDogb2JqZWN0O1xuICAgICAgICAgICAgdmFyIGxlbmd0aCA9IEVTLlRvVWludDMyKHNlbGYubGVuZ3RoKTtcbiAgICAgICAgICAgIHZhciByZXN1bHQgPSAkQXJyYXkobGVuZ3RoKTtcbiAgICAgICAgICAgIHZhciBUO1xuICAgICAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICAgICAgVCA9IGFyZ3VtZW50c1sxXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gSWYgbm8gY2FsbGJhY2sgZnVuY3Rpb24gb3IgaWYgY2FsbGJhY2sgaXMgbm90IGEgY2FsbGFibGUgZnVuY3Rpb25cbiAgICAgICAgICAgIGlmICghaXNDYWxsYWJsZShjYWxsYmFja2ZuKSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ0FycmF5LnByb3RvdHlwZS5tYXAgY2FsbGJhY2sgbXVzdCBiZSBhIGZ1bmN0aW9uJyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaSBpbiBzZWxmKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgVCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdFtpXSA9IGNhbGxiYWNrZm4oc2VsZltpXSwgaSwgb2JqZWN0KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdFtpXSA9IGNhbGxiYWNrZm4uY2FsbChULCBzZWxmW2ldLCBpLCBvYmplY3QpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfVxuICAgIH0sICFwcm9wZXJseUJveGVzQ29udGV4dChBcnJheVByb3RvdHlwZS5tYXApKTtcblxuICAgIC8vIEVTNSAxNS40LjQuMjBcbiAgICAvLyBodHRwOi8vZXM1LmdpdGh1Yi5jb20vI3gxNS40LjQuMjBcbiAgICAvLyBodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZy9lbi9Db3JlX0phdmFTY3JpcHRfMS41X1JlZmVyZW5jZS9PYmplY3RzL0FycmF5L2ZpbHRlclxuICAgIGRlZmluZVByb3BlcnRpZXMoQXJyYXlQcm90b3R5cGUsIHtcbiAgICAgICAgZmlsdGVyOiBmdW5jdGlvbiBmaWx0ZXIoY2FsbGJhY2tmbi8qLCB0aGlzQXJnKi8pIHtcbiAgICAgICAgICAgIHZhciBvYmplY3QgPSBFUy5Ub09iamVjdCh0aGlzKTtcbiAgICAgICAgICAgIHZhciBzZWxmID0gc3BsaXRTdHJpbmcgJiYgaXNTdHJpbmcodGhpcykgPyBzdHJTcGxpdCh0aGlzLCAnJykgOiBvYmplY3Q7XG4gICAgICAgICAgICB2YXIgbGVuZ3RoID0gRVMuVG9VaW50MzIoc2VsZi5sZW5ndGgpO1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IFtdO1xuICAgICAgICAgICAgdmFyIHZhbHVlO1xuICAgICAgICAgICAgdmFyIFQ7XG4gICAgICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgICAgICBUID0gYXJndW1lbnRzWzFdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBJZiBubyBjYWxsYmFjayBmdW5jdGlvbiBvciBpZiBjYWxsYmFjayBpcyBub3QgYSBjYWxsYWJsZSBmdW5jdGlvblxuICAgICAgICAgICAgaWYgKCFpc0NhbGxhYmxlKGNhbGxiYWNrZm4pKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignQXJyYXkucHJvdG90eXBlLmZpbHRlciBjYWxsYmFjayBtdXN0IGJlIGEgZnVuY3Rpb24nKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChpIGluIHNlbGYpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBzZWxmW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIFQgPT09ICd1bmRlZmluZWQnID8g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qZWN0KHRoaXMpO1xuICAgICAgICAgICAgdmFyIHNlbGYgPSBzcGxpdFN0cmluZyAmJiBpc1N0cmluZyh0aGlzKSA/IHN0clNwbGl0KHRoaXMsICcnKSA6IG9iamVjdDtcbiAgICAgICAgICAgIHZhciBsZW5ndGggPSBFUy5Ub1VpbnQzMihzZWxmLmxlbmd0aCk7XG4gICAgICAgICAgICB2YXIgVDtcbiAgICAgICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgIFQgPSBhcmd1bWVudHNbMV07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIElmIG5vIGNhbGxiYWNrIGZ1bmN0aW9uIG9yIGlmIGNhbGxiYWNrIGlzIG5vdCBhIGNhbGxhYmxlIGZ1bmN0aW9uXG4gICAgICAgICAgICBpZiAoIWlzQ2FsbGFibGUoY2FsbGJhY2tmbikpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdBcnJheS5wcm90b3R5cGUuc29tZSBjYWxsYmFjayBtdXN0IGJlIGEgZnVuY3Rpb24nKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChpIGluIHNlbGYgJiYgKHR5cGVvZiBUID09PSAndW5kZWZpbmVkJyA/IGNhbGxiYWNrZm4oc2VsZltpXSwgaSwgb2JqZWN0KSA6IGNhbGxiYWNrZm4uY2FsbChULCBzZWxmW2ldLCBpLCBvYmplY3QpKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9LCAhcHJvcGVybHlCb3hlc0NvbnRleHQoQXJyYXlQcm90b3R5cGUuc29tZSkpO1xuXG4gICAgLy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XBlRXJyb3IoJ0FycmF5LnByb3RvdHlwZS5yZWR1Y2UgY2FsbGJhY2sgbXVzdCBiZSBhIGZ1bmN0aW9uJyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIG5vIHZhbHVlIHRvIHJldHVybiBpZiBubyBpbml0aWFsIHZhbHVlIGFuZCBhbiBlbXB0eSBhcnJheVxuICAgICAgICAgICAgaWYgKGxlbmd0aCA9PT0gMCAmJiBhcmd1bWVudHMubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcigncmVkdWNlIG9mIGVtcHR5IGFycmF5IHdpdGggbm8gaW5pdGlhbCB2YWx1ZScpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgaSA9IDA7XG4gICAgICAgICAgICB2YXIgcmVzdWx0O1xuICAgICAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPj0gMikge1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGFyZ3VtZW50c1sxXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaSBpbiBzZWxmKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBzZWxmW2krK107XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIGFycmF5IGNvbnRhaW5zIG5vIHZhbHVlcywgbm8gaW5pdGlhbCB2YWx1ZSB0byByZXR1cm5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCsraSA+PSBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ3JlZHVjZSBvZiBlbXB0eSBhcnJheSB3aXRoIG5vIGluaXRpYWwgdmFsdWUnKTtcbiAgICAgICAgICAgICAgIC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gICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpIGluIHNlbGYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IHNlbGZbaS0tXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgYXJyYXkgY29udGFpbnMgbm8gdmFsdWVzLCBubyBpbml0aWFsIHZhbHVlIHRvIHJldHVyblxuICAgICAgICAgICAgICAgICAgICBpZiAoLS1pIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcigncmVkdWNlUmlnaHQgb2YgZW1wdHkgYXJyYXkgd2l0aCBubyBpbml0aWFsIHZhbHVlJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IHdoaWxlICh0cnVlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGkgPCAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIGlmIChpIGluIHNlbGYpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gY2FsbGJhY2tmbihyZXN1bHQsIHNlbGZbaV0sIGksIG9iamVjdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSB3aGlsZSAoaS0tKTtcblxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfVxuICAgIH0sICFyZWR1Y2VSaWdodENvZXJjZXNUb09iamVjdCk7XG5cbiAgICAvLyBFUzUgMTUuNC40LjE0XG4gICAgLy8gaHR0cDovL2VzNS5naXRodWIuY29tLyN4MTUuNC40LjE0XG4gICAgLy8gaHR0cHM6Ly9kZXZlbG9wZXIubW96aWxsYS5vcmcvZW4vSmF2YVNjcmlwdC9SZWZlcmVuY2UvR2xvYmFsX09iamVjdHMvQXJyYXkvaW5kZXhPZlxuICAgIHZhciBoYXNGaXJlZm94MkluZGV4T2ZCdWcgPSBBcnJheVByb3RvdHlwZS5pbmRleE9mICYmIFswLCAxXS5pbmRleE9mKDEsIDIpICE9PSAtMTtcbiAgICBkZWZpbmVQcm9wZXJ0aWVzKEFycmF5UHJvdG90eXBlLCB7XG4gICAgICAgIGluZGV4T2Y6IGZ1bmN0aW9uIGluZGV4T2Yoc2VhcmNoRWxlbWVudC8qLCBmcm9tSW5kZXggKi8pIHtcbiAgICAgICAgICAgIHZhciBzZWxmID0gc3BsaXRTdHJpbmcgJiYgaXNTdHJpbmcodGhpcykgPyBzdHJTcGxpdCh0aGlzLCAnJykgOiBFUy5Ub09iamVjdCh0aGlzKTtcbiAgICAgICAgICAgIHZhciBsZW5ndGggPSBFUy5Ub1VpbnQzMihzZWxmLmxlbmd0aCk7XG5cbiAgICAgICAgICAgIGlmIChsZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBpID0gMDtcbiAgICAgICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgIGkgPSBFUy5Ub0ludGVnZXIoYXJndW1lbnRzWzFdKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gaGFuZGxlIG5lZ2F0aXZlIGluZGljZXNcbiAgICAgICAgICAgIGkgPSBpID49IDAgPyBpIDogbWF4KDAsIGxlbmd0aCArIGkpO1xuICAgICAgICAgICAgZm9yICg7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChpIGluIHNlbGYgJiYgc2VsZltpXSA9PT0gc2VhcmNoRWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gIC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JuIGFycmF5X3NwbGljZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSwgIXNwbGljZU5vb3BSZXR1cm5zRW1wdHlBcnJheSk7XG5cbiAgICB2YXIgc3BsaWNlV29ya3NXaXRoRW1wdHlPYmplY3QgPSAoZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgb2JqID0ge307XG4gICAgICAgIEFycmF5UHJvdG90eXBlLnNwbGljZS5jYWxsKG9iaiwgMCwgMCwgMSk7XG4gICAgICAgIHJldHVybiBvYmoubGVuZ3RoID09PSAxO1xuICAgIH0oKSk7XG4gICAgZGVmaW5lUHJvcGVydGllcyhBcnJheVByb3RvdHlwZSwge1xuICAgICAgICBzcGxpY2U6IGZ1bmN0aW9uIHNwbGljZShzdGFydCwgZGVsZXRlQ291bnQpIHtcbiAgICAgICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGFyZ3MgPSBhcmd1bWVudHM7XG4gICAgICAgICAgICB0aGlzLmxlbmd0aCA9IG1heChFUy5Ub0ludGVnZXIodGhpcy5sZW5ndGgpLCAwKTtcbiAgICAgICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID4gMCAmJiB0eXBlb2YgZGVsZXRlQ291bnQgIT09ICdudW1iZXInKSB7XG4gICAgICAgICAgICAgICAgYXJncyA9IGFycmF5U2xpY2UoYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICBpZiAoYXJncy5sZW5ndGggPCAyKSB7XG4gICAgICAgICAgICAgICAgICAgIHB1c2hDYWxsKGFyZ3MsIHRoaXMubGVuZ3RoIC0gc3RhcnQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGFyZ3NbMV0gPSBFUy5Ub0ludGVnZXIoZGVsZXRlQ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nJlYWtzIG9uIHRoaXMsIG5vIGlkZWEgd2h5LlxuICAgICAgICB2YXIgbiA9IDI1NjtcbiAgICAgICAgdmFyIGFyciA9IFtdO1xuICAgICAgICBhcnJbbl0gPSAnYSc7XG4gICAgICAgIGFyci5zcGxpY2UobiArIDEsIDAsICdiJyk7XG4gICAgICAgIHJldHVybiBhcnJbbl0gPT09ICdhJztcbiAgICB9KCkpO1xuICAgIGRlZmluZVByb3BlcnRpZXMoQXJyYXlQcm90b3R5cGUsIHtcbiAgICAgICAgc3BsaWNlOiBmdW5jdGlvbiBzcGxpY2Uoc3RhcnQsIGRlbGV0ZUNvdW50KSB7XG4gICAgICAgICAgICB2YXIgTyA9IEVTLlRvT2JqZWN0KHRoaXMpO1xuICAgICAgICAgICAgdmFyIEEgPSBbXTtcbiAgICAgICAgICAgIHZhciBsZW4gPSBFUy5Ub1VpbnQzMihPLmxlbmd0aCk7XG4gICAgICAgICAgICB2YXIgcmVsYXRpdmVTdGFydCA9IEVTLlRvSW50ZWdlcihzdGFydCk7XG4gICAgICAgICAgICB2YXIgYWN0dWFsU3RhcnQgPSByZWxhdGl2ZVN0YXJ0IDwgMCA/IG1heCgobGVuICsgcmVsYXRpdmVTdGFydCksIDApIDogbWluKHJlbGF0aXZlU3RhcnQsIGxlbik7XG4gICAgICAgICAgICB2YXIgYWN0dWFsRGVsZXRlQ291bnQgPSBtaW4obWF4KEVTLlRvSW50ZWdlcihkZWxldGVDb3VudCksIDApLCBsZW4gLSBhY3R1YWxTdGFydCk7XG5cbiAgICAgICAgICAgIHZhciBrID0gMDtcbiAgICAgICAgICAgIHZhciBmcm9tO1xuICAgICAgICAgICAgd2hpbGUgKGsgPCBhY3R1YWxEZWxldGVDb3VudCkge1xuICAgICAgICAgICAgICAgIGZyb20gPSAkU3RyaW5nKGFjdHVhbFN0YXJ0ICsgayk7XG4gICAgICAgICAgICAgICAgaWYgKG93bnMoTywgZnJvbSkpIHtcbiAgICAgICAgICAgICAgICAgICAgQVtrXSA9IE9bZnJvbV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGsgKz0gMTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIGl0ZW1zID0gYXJyYXlTbGljZShhcmd1bWVudHMsIDIpO1xuICAgICAgICAgICAgdmFyIGl0ZW1Db3VudCA9IGl0ZW1zLmxlbmd0aDtcbiAgICAgICAgICAgIHZhciB0bztcbiAgICAgICAgICAgIGlmIChpdGVtQ291bnQgPCBhY3R1YWxEZWxldGVDb3VudCkge1xuICAgICAgICAgICAgICAgIGsgPSBhY3R1YWxTdGFydDtcbiAgICAgICAgICAgICAgICB2YXIgbWF4SyA9IGxlbiAtIGFjdHVhbERlbGV0ZUNvdW50O1xuICAgICAgICAgICAgICAgIHdoaWxlIChrIDwgbWF4Sykge1xuICAgICAgICAgICAgICAgICAgICBmcm9tID0gJFN0cmluZyhrICsgYWN0dWFsRGVsZXRlQ291bnQpO1xuICAgICAgICAgICAgICAgICAgICB0byA9ICRTdHJpbmcoayArIGl0ZW1Db3VudCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvd25zKE8sIGZyb20pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBPW3RvXSA9IE9bZnJvbV07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgT1t0b107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgayArPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBrID0gbGVuO1xuICAgICAgICAgICAgICAgIHZhciBtaW5LID0gbGVuIC0gYWN0dWFsRGVsZXRlQ291bnQgKyBpdGVtQ291bnQ7XG4gICAgICAgICAgICAgICAgd2hpbGUgKGsgPiBtaW5LKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBPW2sgLSAxXTtcbiAgICAgICAgICAgICAgICAgICAgayAtPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXRlbUNvdW50ID4gYWN0dWFsRGVsZXRlQ291bnQpIHtcbiAgICAgICAgICAgICAgICBrID0gbGVuIC0gYWN0dWFsRGVsZXRlQ291bnQ7XG4gICAgICAgICAgICAgICAgd2hpbGUgKGsgPiBhY3R1YWxTdGFydCkge1xuICAgICAgICAgICAgICAgICAgICBmcm9tID0gJFN0cmluZyhrICsgYWN0dWFsRGVsZXRlQ291bnQgLSAxKTtcbiAgICAgICAgICAgICAgICAgICAgdG8gPSAkU3RyaW5nKGsgKyBpdGVtQ291bnQgLSAxKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG93bnMoTywgZnJvbSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIE9bdG9dID0gT1tmcm9tXTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBPW3RvXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBrIC09IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgayA9IGFjdHVhbFN0YXJ0O1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBpdGVtcy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgICAgIE9ba10gPSBpdGVtc1tpXTtcbiAgICAgICAgICAgICAgICBrICs9IDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBPLmxlbmd0aCA9IGxlbiAtIGFjdHVhbERlbGV0ZUNvdW50ICsgaXRlbUNvdW50O1xuXG4gICAgICAgICAgICByZXR1cm4gQTtcbiAgICAgICAgfVxuICAgIH0sICFzcGxpY2VXb3Jrc1dpdGhMYXJnZVNwYXJzZUFycmF5cyB8fCAhc3BsaWNlV29ya3NXaXRoU21hbGxTcGFyc2VBcnJheXMpO1xuXG4gICAgdmFyIG9yaWd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AgICByZXR1cm4gb3JpZ2luYWxKb2luLmNhbGwodGhpcywgc2VwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwgaGFzSm9pblVuZGVmaW5lZEJ1Zyk7XG4gICAgfVxuXG4gICAgdmFyIHB1c2hTaGltID0gZnVuY3Rpb24gcHVzaChpdGVtKSB7XG4gICAgICAgIHZhciBPID0gRVMuVG9PYmplY3QodGhpcyk7XG4gICAgICAgIHZhciBuID0gRVMuVG9VaW50MzIoTy5sZW5ndGgpO1xuICAgICAgICB2YXIgaSA9IDA7XG4gICAgICAgIHdoaWxlIChpIDwgYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgT1tuICsgaV0gPSBhcmd1bWVudHNbaV07XG4gICAgICAgICAgICBpICs9IDE7XG4gICAgICAgIH1cbiAgICAgICAgTy5sZW5ndGggPSBuICsgaTtcbiAgICAgICAgcmV0dXJuIG4gKyBpO1xuICAgIH07XG5cbiAgICB2YXIgcHVzaElzTm90R2VuZXJpYyA9IChmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBvYmogPSB7fTtcbiAgICAgICAgdmFyIHJlc3VsdCA9IEFycmF5LnByb3RvdHlwZS5wdXNoLmNhbGwob2JqLCB1bmRlZmluZWQpO1xuICAgICAgICByZXR1cm4gcmVzdWx0ICE9PSAxIHx8IG9iai5sZW5ndGggIT09IDEgfHwgdHlwZW9mIG9ialswXSAhPT0gJ3VuZGVmaW5lZCcgfHwgIW93bnMob2JqLCAwKTtcbiAgICB9KCkpO1xuICAgIGRlZmluZVByb3BlcnRpZXMoQXJyYXlQcm90b3R5cGUsIHtcbiAgICAgICAgcHVzaDogZnVuY3Rpb24gcHVzaChpdGVtKSB7XG4gICAgICAgICAgICBpZiAoaXNBcnJheSh0aGlzKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBhcnJheV9wdXNoLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1c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Y2tsaXN0ZWRLZXlzID0ge1xuICAgICAgICAkd2luZG93OiB0cnVlLFxuICAgICAgICAkY29uc29sZTogdHJ1ZSxcbiAgICAgICAgJHBhcmVudDogdHJ1ZSxcbiAgICAgICAgJHNlbGY6IHRydWUsXG4gICAgICAgICRmcmFtZTogdHJ1ZSxcbiAgICAgICAgJGZyYW1lczogdHJ1ZSxcbiAgICAgICAgJGZyYW1lRWxlbWVudDogdHJ1ZSxcbiAgICAgICAgJHdlYmtpdEluZGV4ZWREQjogdHJ1ZSxcbiAgICAgICAgJHdlYmtpdFN0b3JhZ2VJbmZvOiB0cnVlLFxuICAgICAgICAkZXh0ZXJuYWw6IHRydWVcbiAgICB9O1xuICAgIHZhciBoYXNBdXRvbWF0aW9uRXF1YWxpdHlCdWcgPSAoZnVuY3Rpb24gKCkge1xuICAgICAgICAvKiBnbG9iYWxzIHdpbmRvdyAqL1xuICAgICAgICBpZiAodHlwZW9mIHdpbmRvdyA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKHZhciBrIGluIHdpbmRvdykge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBpZiAoIWJsYWNrbGlzdGVkS2V5c1snJCcgKyBrXSAmJiBvd25zKHdpbmRvdywgaykgJiYgd2luZG93W2tdICE9PSBudWxsICYmIHR5cGVvZiB3aW5kb3dba10gPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgICAgIGVxdWFsc0NvbnN0cnVjdG9yUHJvdG90eXBlKHdpbmRvd1trXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9KCkpO1xuICAgIHZhciBlcXVhbHNDb25zdHJ1Y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jdC5rZXlzIGNhbGxlZCBvbiBhIG5vbi1vYmplY3QnKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHRoZUtleXMgPSBbXTtcbiAgICAgICAgICAgIHZhciBza2lwUHJvdG8gPSBoYXNQcm90b0VudW1CdWcgJiYgaXNGbjtcbiAgICAgICAgICAgIGlmICgoaXNTdHIgJiYgaGFzU3RyaW5nRW51bUJ1ZykgfHwgaXNBcmdzKSB7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvYmplY3QubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICAgICAgcHVzaENhbGwodGhlS2V5cywgJFN0cmluZyhpKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIWlzQXJncykge1xuICAgICAgICAgICAgICAgIGZvciAodmFyIG5hbWUgaW4gb2JqZWN0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghKHNraXBQcm90byAmJiBuYW1lID09PSAncHJvdG90eXBlJykgJiYgb3ducyhvYmplY3QsIG5hbWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwdXNoQ2FsbCh0aGVLZXlzLCAkU3RyaW5nKG5hbWUpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGhhc0RvbnRFbnVtQnVnKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNraXBDb25zdHJ1Y3RvciA9IGVxdWFsc0NvbnN0cnVjdG9yUHJvdG90eXBlSWZOb3RCdWdneShvYmplY3QpO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgZG9udEVudW1zTGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRvbnRFbnVtID0gZG9udEVudW1zW2pdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIShza2lwQ29uc3RydWN0b3IgJiYgZG9udEVudW0gPT09ICdjb25zdHJ1Y3RvcicpICYmIG93bnMob2JqZWN0LCBkb250RW51bSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1c2hDYWxsKHRoZUtleXMsIGRvbnRFbnVtKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGVLZXlzO1xuICAgICAgICB9XG4gICAgfSk7XG5cbiAgICB2YXIga2V5c1dvcmtzV2l0aEFyZ3VtZW50cyA9ICRPYmplY3Qua2V5cyAmJiAoZnVuY3Rpb24gKCkge1xuICAgICAgICAvLyBTYWZhcmkgNS4wIGJ1Z1xuICAgICAgICByZXR1cm4gJE9iamVjdC5rZXlzKGFyZ3VtZW50cykubGVuZ3RoID09PSAyO1xuICAgIH0oMSwgMikpO1xuICAgIHZhciBrZXlzSGFzQXJndW1lbnRzTGVuZ3RoQnVnID0gJE9iamVjdC5rZXlzICYmIChmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBhcmdLZXlzID0gJE9iamVjdC5rZXlzKGFyZ3VtZW50cyk7XG4gICAgICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoICE9PSAxIHx8IGFyZ0tleXMubGVuZ3RoICE9PSAxIHx8IGFyZ0tleXNbMF0gIT09IDE7XG4gICAgfSgxKSk7XG4gICAgdmFyIG9yaWdpbmFsS2V5cyA9ICRPYmplY3Qua2V5cztcbiAgICBkZWZpbmVQcm9wZXJ0aWVzKCRPYmplY3QsIHtcbiAgICAgICAga2V5czogZnVuY3Rpb24ga2V5cyhvYmplY3QpIHtcbiAgICAgICAgICAgIGlmIChpc0FyZ3VtZW50cyhvYmplY3QpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9yaWdpbmFsS2V5cyhhcnJheVNsaWNlKG9iamVjdCkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgIC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1cbiAgICAgICAgICAgIHZhciB5ZWFyID0gb3JpZ2luYWxHZXRGdWxsWWVhcih0aGlzKTtcbiAgICAgICAgICAgIGlmICh5ZWFyIDwgMCAmJiBvcmlnaW5hbEdldE1vbnRoKHRoaXMpID4gMTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4geWVhciArIDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4geWVhcjtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0TW9udGg6IGZ1bmN0aW9uIGdldE1vbnRoKCkge1xuICAgICAgICAgICAgaWYgKCF0aGlzIHx8ICEodGhpcyBpbnN0YW5jZW9mIERhdGUpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcigndGhpcyBpcyBub3QgYSBEYXRlIG9iamVjdC4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciB5ZWFyID0gb3JpZ2luYWxHZXRGdWxsWWVhcih0aGlzKTtcbiAgICAgICAgICAgIHZhciBtb250aCA9IG9yaWdpbmFsR2V0TW9udGgodGhpcyk7XG4gICAgICAgICAgICBpZiAoeWVhciA8IDAgJiYgbW9udGggPiAxMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIG1vbnRoO1xuICAgICAgICB9LFxuICAgICAgICBnZXREYXRlOiBmdW5jdGlvbiBnZXREYXRlKCkge1xuICAgICAgICAgICAgaWYgKCF0aGlzIHx8ICEodGhpcyBpbnN0YW5jZW9mIERhdGUpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcigndGhpcyBpcyBub3QgYSBEYXRlIG9iamVjdC4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciB5ZWFyID0gb3JpZ2luYWxHZXRGdWxsWWVhcih0aGlzKTtcbiAgICAgICAgICAgIHZhciBtb250aCA9IG9yaWdpbmFsR2V0TW9udGgodGhpcyk7XG4gICAgICAgICAgICB2YXIgZGF0ZSA9IG9yaWdpbmFsR2V0RGF0ZSh0aGlzKTtcbiAgICAgICAgICAgIGlmICh5ZWFyIDwgMCAmJiBtb250aCA+IDExKSB7XG4gICAgICAgICAgICAgICAgaWYgKG1vbnRoID09PSAxMikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF0ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGRheXMgPSBkYXlzSW5Nb250aCgwLCB5ZWFyICsgMSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChkYXlzIC0gZGF0ZSkgKyAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGRhdGU7XG4gICAgICAgIH0sXG4gICAgICAgIGdldFVUQ0Z1bGxZZWFyOiBmdW5jdGlvbiBnZXRVVENGdWxsWWVhcigpIHtcbiAgICAgICAgICAgIGlmICghdGhpcyB8fCAhKHRoaXMgaW5zdGFuY2VvZiBEYXRlKSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ3RoaXMgaXMgbm90IGEgRGF0ZSBvYmplY3QuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgeWVhciA9IG9yaWdpbmFsR2V0VVRDRnVsbFllYXIodGhpcyk7XG4gICAgICAgICAgICBpZiAoeWVhciA8IDAgJiYgb3JpZ2luYWxHZXRVVENNb250aCh0aGlzKSA+IDExKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHllYXIgKyAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHllYXI7XG4gICAgICAgIH0sXG4gICAgICAgIGdldFVUQ01vbnRoOiBmdW5jdGlvbiBnZXRVVENNb250aCgpIHtcbiAgICAgICAgICAgIGlmICghdGhpcyB8fCAhKHRoaXMgaW5zdGFuY2VvZiBEYXRlKSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ3RoaXMgaXMgbm90IGEgRGF0ZSBvYmplY3QuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgeWVhciA9IG9yaWdpbmFsR2V0VVRDRnVsbFllYXIodGhpcyk7XG4gICAgICAgICAgICB2YXIgbW9udGggPSBvcmlnaW5hbEdldFVUQ01vbnRoKHRoaXMpO1xuICAgICAgICAgICAgaWYgKHllYXIgPCAwICYmIG1vbnRoID4gMTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBtb250aDtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0VVRDRGF0ZTogZnVuY3Rpb24gZ2V0VVRDRGF0ZSgpIHtcbiAgICAgICAgICAgIGlmICghdGhpcyB8fCAhKHRoaXMgaW5zdGFuY2VvZiBEYXRlKSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ3RoaXMgaXMgbm90IGEgRGF0ZSBvYmplY3QuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgeWVhciA9IG9yaWdpbmFsR2V0VVRDRnVsbFllYXIodGhpcyk7XG4gICAgICAgICAgICB2YXIgbW9udGggPSBvcmlnaW5hbEdldFVUQ01vbnRoKHRoaXMpO1xuICAgICAgICAgICAgdmFyIGRhdGUgPSBvcmlnaW5hbEdldFVUQ0RhdGUodGhpcyk7XG4gICAgICAgICAgICBpZiAoeWVhciA8IDAgJiYgbW9udGggPiAxMSkge1xuICAgICAgICAgICAgICAgIGlmIChtb250aCA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRhdGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBkYXlzID0gZGF5c0luTW9udGgoMCwgeWVhciArIDEpO1xuICAgICAgICAgICAgICAgIHJldHVybiAoZGF5cyAtIGRhdGUpICsgMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBkYXRlO1xuICAgICAgICB9XG4gICAgfSwgaGFzTmVnYXRpdmVNb250aFllYXJCdWcpO1xuXG4gICAgZGVmaW5lUHJvcGVydGllcyhEYXRlLnByb3RvdHlwZSwge1xuICAgICAgICB0b1VUQ1N0cmluZzogZnVuY3Rpb24gdG9VVENTdHJpbmcoKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMgfHwgISh0aGlzIGluc3RhbmNlb2YgRGF0ZSkpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCd0aGlzIGlzIG5vdCBhIERhdGUgb2JqZWN0LicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGRheSA9IG9yaWdpbmFsR2V0VVRDRGF5KHRoaXMpO1xuICAgICAgICAgICAgdmFyIGRhdGUgPSBvcmlnaW5hbEdldFVUQ0RhdGUodGhpcyk7XG4gICAgICAgICAgICB2YXIgbW9udGggPSBvcmlnaW5hbEdldFVUQ01vbnRoKHRoaXMpO1xuICAgICAgICAgICAgdmFyIHllYXIgPSBvcmlnaW5hbEdldFVUQ0Z1bGxZZWFyKHRoaXMpO1xuICAgICAgICAgICAgdmFyIGhvdXIgPSBvcmlnaW5hbEdldFVUQ0hvdXJzKHRoaXMpO1xuICAgICAgICAgICAgdmFyIG1pbnV0ZSA9IG9yaWdpbmFsR2V0VVRDTWludXRlcyh0aGlzKTtcbiAgICAgICAgICAgIHZhciBzZWNvbmQgPSBvcmlnaW5hbEdldFVUQ1NlY29uZHModGhpcyk7XG4gICAgICAgICAgICByZXR1cm4gZGF5TmFtZVtkYXldICsgJywgJyArXG4gICAgICAgICAgICAgICAgKGRhdGUgPCAxMCA/ICcwJyArIGRhdGUgOiBkYXRlKSArICcgJyArXG4gICAgICAgICAgICAgICAgbW9udGhOYW1lW21vbnRoXSArICcgJyArXG4gICAgICAgICAgICAgICAgeWVhciArICcgJyArXG4gICAgICAgICAgICAgICAgKGhvdXIgPCAxMCA/ICcwJyArIGhvdXIgOiBob3VyKSArICc6JyArXG4gICAgICAgICAgICAgICAgKG1pbnV0ZSA8IDEwID8gJzAnICsgbWludXRlIDogbWludXRlKSArICc6JyArXG4gICAgICAgICAgICAgICAgKHNlY29uZCA8IDEwID8gJzAnICsgc2Vjb25kIDogc2Vjb25kKSArICcgR01UJztcbiAgICAgICAgfVxuICAgIH0sIGhhc05lZ2F0aXZlTW9udGhZZWFyQnVnIHx8IGhhc1RvVVRDU3RyaW5nRm9ybWF0QnVnKTtcblxuICAgIC8vIE9wZXJhIDEyIGhhcyBgLGBcbiAgICBkZWZpbmVQcm9wZXJ0aWVzKERhdGUucHJvdG90eXBlLCB7XG4gICAgICAgIHRvRGF0ZVN0cmluZzogZnVuY3Rpb24gdG9EYXRlU3RyaW5nKCkge1xuICAgICAgICAgICAgaWYgKCF0aGlzIHx8ICEodGhpcyBpbnN0YW5jZW9mIERhdGUpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcigndGhpcyBpcyBub3QgYSBEYXRlIG9iamVjdC4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBkYXkgPSB0aGlzLmdldERheSgpO1xuICAgICAgICAgICAgdmFyIGRhdGUgPSB0aGlzLmdldERhdGUoKTtcbiAgICAgICAgICAgIHZhciBtb250aCA9IHRoaXMuZ2V0TW9udGgoKTtcbiAgICAgICAgICAgIHZhciB5ZWFyID0gdGhpcy5nZXRGdWxsWWVhcigpO1xuICAgICAgICAgICAgcmV0dXJuIGRheU5hbWVbZGF5XSArICcgJyArXG4gICAgICAgICAgICAgICAgbW9udGhOYW1lW21vbnRoXSArICcgJyArXG4gICAgICAgICAgICAgICAgKGRhdGUgPCAxMCA/ICcwJyArIGRhdGUgOiBkYXRlKSArICcgJyArXG4gICAgICAgICAgICAgICAgeWVhcjtcbiAgICAgICAgfVxuICAgIH0sIGhhc05lZ2F0aXZlTW9udGhZZWFyQnVnI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mc2V0ID0gTWF0aC5mbG9vcihNYXRoLmFicyh0aW1lem9uZU9mZnNldCkgJSA2MCk7XG4gICAgICAgICAgICByZXR1cm4gZGF5TmFtZVtkYXldICsgJyAnICtcbiAgICAgICAgICAgICAgICBtb250aE5hbWVbbW9udGhdICsgJyAnICtcbiAgICAgICAgICAgICAgICAoZGF0ZSA8IDEwID8gJzAnICsgZGF0ZSA6IGRhdGUpICsgJyAnICtcbiAgICAgICAgICAgICAgICB5ZWFyICsgJyAnICtcbiAgICAgICAgICAgICAgICAoaG91ciA8IDEwID8gJzAnICsgaG91ciA6IGhvdXIpICsgJzonICtcbiAgICAgICAgICAgICAgICAobWludXRlIDwgMTAgPyAnMCcgKyBtaW51dGUgOiBtaW51dGUpICsgJzonICtcbiAgICAgICAgICAgICAgICAoc2Vjb25kIDwgMTAgPyAnMCcgKyBzZWNvbmQgOiBzZWNvbmQpICsgJyBHTVQnICtcbiAgICAgICAgICAgICAgICAodGltZXpvbmVPZmZzZXQgPiAwID8gJy0nIDogJysnKSArXG4gICAgICAgICAgICAgICAgKGhvdXJzT2Zmc2V0IDwgMTAgPyAnMCcgKyBob3Vyc09mZnNldCA6IGhvdXJzT2Zmc2V0KSArXG4gICAgICAgICAgICAgICAgKG1pbnV0ZXNPZmZzZXQgPCAxMCA/ICcwJyArIG1pbnV0ZXNPZmZzZXQgOiBtaW51dGVzT2Zmc2V0KTtcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHN1cHBvcnRzRGVzY3JpcHRvcnMpIHtcbiAgICAgICAgICAgICRPYmplY3QuZGVmaW5lUHJvcGVydHkoRGF0ZS5wcm90b3R5cGUsICd0b1N0cmluZycsIHtcbiAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgICAgICAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgICAgICAgICAgICAgd3JpdGFibGU6IHRydWVcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICA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JsZSBuby1pbXBsaWNpdC1nbG9iYWxzICovXG4gICAgICAgIERhdGUgPSAoZnVuY3Rpb24gKE5hdGl2ZURhdGUpIHtcbiAgICAgICAgLyogZXNsaW50LWVuYWJsZSBuby1pbXBsaWNpdC1nbG9iYWxzICovXG4gICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tdW5kZWYgKi9cbiAgICAgICAgICAgIC8vIERhdGUubGVuZ3RoID09PSA3XG4gICAgICAgICAgICB2YXIgRGF0ZVNoaW0gPSBmdW5jdGlvbiBEYXRlKFksIE0sIEQsIGgsIG0sIHMsIG1zKSB7XG4gICAgICAgICAgICAgICAgdmFyIGxlbmd0aCA9IGFyZ3VtZW50cy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgdmFyIGRhdGU7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMgaW5zdGFuY2VvZiBOYXRpdmVEYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzZWNvbmRzID0gcztcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1pbGxpcyA9IG1zO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaGFzU2FmYXJpU2lnbmVkSW50QnVnICYmIGxlbmd0aCA+PSA3ICYmIG1zID4gbWF4U2FmZVVuc2lnbmVkMzJCaXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdvcmsgYXJvdW5kIGEgU2FmYXJpIDgvOSBidWcgd2hlcmUgaXQgdHJlYXRzIHRoZSBzZWNvbmRzIGFzIHNpZ25lZFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1zVG9TaGlmdCA9IE1hdGguZmxvb3IobXMgLyBtYXhTYWZlVW5zaWduZWQzMkJpdCkgKiBtYXhTYWZlVW5zaWduZWQzMkJpdDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzVG9TaGlmdCA9IE1hdGguZmxvb3IobXNUb1NoaWZ0IC8gMWUzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlY29uZHMgKz0gc1RvU2hpZnQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBtaWxsaXMgLT0gc1RvU2hpZnQgKiAxZTM7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZGF0ZSA9IGxlbmd0aCA9PT0gMSAmJiAkU3RyaW5nKFkpID09PSBZID8gLy8gaXNTdHJpbmcoWSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGV4cGxpY2l0bHkgcGFzcyBpdCB0aHJvdWdoIHBhcnNlOlxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3IE5hdGl2ZURhdGUoRGF0ZVNoaW0ucGFyc2UoWSkpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGhhdmUgdG8gbWFudWFsbHkgbWFrZSBjYWxscyBkZXBlbmRpbmcgb24gYXJndW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxlbmd0aCBoZXJlXG4gICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggPj0gNyA/IG5ldyBOYXRpdmVEYXRlKFksIE0sIEQsIGgsIG0sIHNlY29uZHMsIG1pbGxpcykgOlxuICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID49IDYgPyBuZXcgTmF0aXZlRGF0ZShZLCBNLCBELCBoLCBtLCBzZWNvbmRzKSA6XG4gICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggPj0gNSA/IG5ldyBOYXRpdmVEYXRlKFksIE0sIEQsIGgsIG0pIDpcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA+PSA0ID8gbmV3IE5hdGl2ZURhdGUoWSwgTSwgRCwgaCkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID49IDMgPyBuZXcgTmF0aXZlRGF0ZShZLCBNLCBEKSA6XG4gICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggPj0gMiA/IG5ldyBOYXRpdmVEYXRlKFksIE0pIDpcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA+PSAxID8gbmV3IE5hdGl2ZURhdGUoWSBpbnN0YW5jZW9mIE5hdGl2ZURhdGUgPyArWSA6IFkpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IE5hdGl2ZURhdGUoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBkYXRlID0gTmF0aXZlRGF0ZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIWlzUHJpbWl0aXZlKGRhdGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFByZXZlbnQgbWl4dXBzIHdpdGggdW5maXhlZCBEYXRlIG9iamVjdFxuICAgICAgICAgICAgICAgICAgICBkZWZpbmVQcm9wZXJ0aWVzKGRhdGUsIHsgY29uc3RydWN0b3I6IERhdGVTaGltIH0sIHRydWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZGF0ZTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIC8vIDE1LjkuMS4xNSBEYXRlIFRpbWUgU3RyaW5nIEZvcm1hdC5cbiAgICAgICAgICAgIHZhciBpc29EYXRlRXhwcmVzc2lvbiA9IG5ldyBSZWdFeHAoJ14nICtcbiAgICAgICAgICAgICAgICAnKFxcXFxkezR9fFsrLV1cXFxcZHs2fSknICsgLy8gZm91ci1kaWdpdCB5ZWFyIGNhcHR1cmUgb3Igc2lnbiArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyA2LWRpZ2l0IGV4dGVuZGVkIHllYXJcbiAgICAgICAgICAgICAgICAnKD86LShcXFxcZHsyfSknICsgLy8gb3B0aW9uYWwgbW9udGggY2FwdHVyZVxuICAgICAgICAgICAgICAgICcoPzotKFxcXFxkezJ9KScgKyAvLyBvcHRpb25hbCBkYXkgY2FwdHVyZVxuICAgICAgICAgICAgICAgICcoPzonICsgLy8gY2FwdHVyZSBob3VyczptaW51dGVzOnNlY29uZHMubWlsbGlzZWNvbmRzXG4gICAgICAgICAgICAgICAgICAgICdUKFxcXFxkezJ9KScgKyAvLyBob3VycyBjYXB0dXJlXG4gICAgICAgICAgICAgICAgICAgICc6KFxcXFxkezJ9KScgKyAvLyBtaW51dGVzIGNhcHR1cmVcbiAgICAgICAgICAgICAgICAgICAgJyg/OicgKyAvLyBvcHRpb25hbCA6c2Vjb25kcy5taWxsaXNlY29uZHNcbiAgICAgICAgICAgICAgICAgICAgICAgICc6KFxcXFxkezJ9KScgKyAvLyBzZWNvbmRzIGNhcHR1cmVcbiAgICAgICAgICAgICAgICAgICAgICAgICcoPzooXFxcXC5cXFxcZHsxLH0pKT8nICsgLy8gbWlsbGlzZWNvbmRzIGNhcHR1cmVcbiAgICAgICAgICAgICAgICAgICAgJyk/JyArXG4gICAgICAgICAgICAgICAgJygnICsgLy8gY2FwdHVyZSBVVEMgb2Zmc2V0IGNvbXBvbmVudFxuICAgICAgICAgICAgICAgICAgICAnWnwnICsgLy8gVVRDIGNhcHR1cmVcbiAgICAgICAgICAgICAgICAgICAgJyg/OicgKyAvLyBvZmZzZXQgc3BlY2lmaWVyICsvLWhvdXJzOm1pbnV0ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICcoWy0rXSknICsgLy8gc2lnbiBjYXB0dXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnKFxcXFxkezJ9KScgKyAvLyBob3VycyBvZmZzZXQgY2FwdHVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJzooXFxcXGR7Mn0pJyArIC8vIG1pbnV0ZXMgb2Zmc2V0IGNhcHR1cmVcbiAgICAgICAgICAgICAgICAgICAgJyknICtcbiAgICAgICAgICAgICAgICAnKT8pPyk/KT8nICtcbiAgICAgICAgICAgICckJyk7XG5cbiAgICAgICAgICAgIHZhciBtb250aHMgPSBbMCwgMzEsIDU5LCA5MCwgMTIwLCAxNTEsIDE4MSwgMjEyLCAyNDMsIDI3MywgMzA0LCAzMzQsIDM2NV07XG5cbiAgICAgICAgICAgIHZhciBkYXlGcm9tTW9udGggPSBmdW5jdGlvbiBkYXlGcm9tTW9udGgoeWVhciwgbW9udGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgdCA9IG1vbnRoID4gMSA/IDEgOiAwO1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgIG1vbnRoc1ttb250aF0gK1xuICAgICAgICAgICAgICAgICAgICBNYXRoLmZsb29yKCh5ZWFyIC0gMTk2OSArIHQpIC8gNCkgLVxuICAgICAgICAgICAgICAgICAgICBNYXRoLmZsb29yKCh5ZWFyIC0gMTkwMSArIHQpIC8gMTAwKSArXG4gICAgICAgICAgICAgICAgICAgIE1hdGguZmxvb3IoKHllYXIgLSAxNjAxICsgdCkgLyA0MDApICtcbiAgICAgICAgICAgICAgICAgICAgMzY1ICogKHllYXIgLSAxOTcwKVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICB2YXIgdG9VVEMgPSBmdW5jdGlvbiB0b1VUQyh0KSB7XG4gICAgICAgICAgICAgICAgdmFyIHMgPSAwO1xuICAgICAgICAgICAgICAgIHZhciBtcyA9IHQ7XG4gICAgICAgICAgICAgICAgaWYgKGhhc1NhZmFyaVNpZ25lZEludEJ1ZyAmJiBtcyA+IG1heFNhZmVVbnNpZ25lZDMyQml0KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHdvcmsgYXJvdW5kIGEgU2FmYXJpIDgvOSBidWcgd2hlcmUgaXQgdHJlYXRzIHRoZSBzZWNvbmRzIGFzIHNpZ25lZFxuICAgICAgICAgICAgICAgICAgICB2YXIgbXNUb1NoaWZ0ID0gTWF0aC5mbG9vcihtcyAvIG1heFNhZmVVbnNpZ25lZDMyQml0KSAqIG1heFNhZmVVbnNpZ25lZDMyQml0O1xuICAgICAgICAgICAgICAgICAgICB2YXIgc1RvU2hpZnQgPSBNYXRoLmZsb29yKG1zVG9TaGlmdCAvIDFlMyk7XG4gICAgICAgICAgICAgICAgICAgIHMgKz0gc1RvU2hpZnQ7XG4gICAgICAgICAgICAgICAgICAgIG1zIC09IHNUb1NoaWZ0ICogMWUzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gJE51bWJlcihuZXcgTmF0aXZlRGF0ZSgxOTcwLCAwLCAxLCAwLCAwLCBzLCBtcykpO1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgLy8gQ29weSBhbnkgY3VzdG9tIG1ldGhvZHMgYSAzcmQgcGFydHkgbGlicmFyeSBtYXkgaGF2ZSBhZGRlZFxuICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIE5hdGl2ZURhdGUpIHtcbiAgICAgICAgICAgICAgICBpZiAob3ducyhOYXRpdmVEYXRlLCBrZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgIERhdGVTaGltW2tleV0gPSBOYXRpdmVEYXRlW2tleV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBDb3B5IFwibmF0aXZlXCIgbWV0aG9kcyBleHBsaWNpdGx5OyB0aGV5IG1heSBiZSBub24tZW51bWVyYWJsZVxuICAgICAgICAgICAgZGVmaW5lUHJvcGVydGllcyhEYXRlU2hpbSwge1xuICAgICAgICAgICAgICAgIG5vdzogTmF0aXZlRGF0ZS5ub3csXG4gICAgICAgICAgICAgICAgVVRDOiBOYXRpdmVEYXRlLlVUQ1xuICAgICAgICAgICAgfSwgdHJ1ZSk7XG4gICAgICAgICAgICBEYXRlU2hpbS5wcm90b3R5cGUgPSBOYXRpdmVEYXRlLnByb3RvdHlwZTtcbiAgICAgICAgICAgIGRlZmluZVByb3BlcnRpZXMoRGF0ZVNoaW0ucHJvdG90eXBlLCB7XG4gICAgICAgICAgICAgICAgY29uc3RydWN0b3I6IERhdGVTaGltXG4gICAgICAgICAgICB9LCB0cnVlKTtcblxuICAgICAgICAgICAgLy8gVXBncmFkZSBEYXRlLnBhcnNlIHRvIGhhbmRsZSBzaW1wbGlmaWVkIElTTyA4NjAxIHN0cmluZ3NcbiAgICAgICAgICAgIHZhciBwYXJzZVNoaW0gPSBmdW5jdGlvbiBwYXJzZShzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICB2YXIgbWF0Y2ggPSBpc29EYXRlRXhwcmVzc2lvbi5leGVjKHN0cmluZyk7XG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHBhcnNlIG1vbnRocywgZGF5cywgaG91cnMsIG1pbnV0ZXMsIHNlY29uZHMsIGFuZCBtaWxsaXNlY29uZHNcbiAgICAgICAgICAgICAgICAgICAgLy8gcHJvdmlkZSBkZWZhdWx0IHZhbHVlcyBpZiBuZWNlc3NhcnlcbiAgICAgICAgICAgICAgICAgICAgLy8gcGFyc2UgdGhlIFVUQyBvZmZzZXQgY29tcG9uZW50XG4gICAgICAgICAgICAgICAgICAgIHZhciB5ZWFyID0gJE51bWJlcihtYXRjaFsxXSksXG4gICAgICAgICAgICAgICAgICAgICAgICBtb250aCA9ICROdW1iZXIobWF0Y2hbMl0gfHwgMSkgLSAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF5ID0gJE51bWJlcihtYXRjaFszXSB8fCAxKSAtIDEsXG4gICAgICAgICAgICAgICAgICAgICAgICBob3VyID0gJE51bWJlcihtYXRjaFs0XSB8fCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbnV0ZSA9ICROdW1iZXIobWF0Y2hbNV0gfHwgMCksXG4gICAgICAgICAgICAgICAgICAgICAgICBzZWNvbmQgPSAkTnVtYmVyKG1hdGNoWzZdIHx8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWlsbGlzZWNvbmQgPSBNYXRoLmZsb29yKCROdW1iZXIobWF0Y2hbN10gfHwgMCkgKiAxMDAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdoZW4gdGltZSB6b25lIGlzIG1pc3NlZCwgbG9jYWwgb2Zmc2V0IHNob3VsZCBiZSB1c2VkXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAoRVMgNS4xIGJ1ZylcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNlZSBodHRwczovL2J1Z3MuZWNtYXNjcmlwdC5vcmcvc2hvd19idWcuY2dpP2lkPTExMlxuICAgICAgICAgICAgICAgICAgICAgICAgaXNMb2NhbFRpbWUgPSBCb29sZWFuKG1hdGNoWzRdICYmICFtYXRjaFs4XSksXG4gICAgICAgICAgICAgICAgICAgICAgICBzaWduT2Zmc2V0ID0gbWF0Y2hbOV0gPT09ICctJyA/IDEgOiAtMSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhvdXJPZmZzZXQgPSAkTnVtYmVyKG1hdGNoWzEwXSB8fCAwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pbnV0ZU9mZnNldCA9ICROdW1iZXIobWF0Y2hbMTFdIHx8IDApLFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICB2YXIgaGFzTWludXRlc09yU2Vjb25kc09yTWlsbGlzZWNvbmRzID0gbWludXRlID4gMCB8fCBzZWNvbmQgPiAwIHx8IG1pbGxpc2Vjb25kID4gMDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgaG91ciA8IChoYXNNaW51dGVzT3JTZWNvbmRzT3JNaWxsaXNlY29uZHMgPyAyNCA6IDI1KSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgbWludXRlIDwgNjAgJiYgc2Vjb25kIDwgNjAgJiYgbWlsbGlzZWNvbmQgPCAxMDAwICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBtb250aCA+IC0xICYmIG1vbnRoIDwgMTIgJiYgaG91ck9mZnNldCA8IDI0ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBtaW51dGVPZmZzZXQgPCA2MCAmJiAvLyBkZXRlY3QgaW52YWxpZCBvZmZzZXRzXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXkgPiAtMSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgZGF5IDwgKGRheUZyb21Nb250aCh5ZWFyLCBtb250aCArIDEpIC0gZGF5RnJvbU1vbnRoKHllYXIsIG1vbnRoKSlcbiAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRheUZyb21Nb250aCh5ZWFyLCBtb250aCkgKyBkYXkpICogMjQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhvdXIgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhvdXJPZmZzZXQgKiBzaWduT2Zmc2V0XG4gICAgICAgICAgICAgICAgICAgICAgICApICogNjA7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHJlc3VsdCArIG1pbnV0ZSArIG1pbnV0ZU9mZnNldCAqIHNpZ25PZmZzZXQpICogNjAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlY29uZFxuICAgICAgICAgICAgICAgICAgICAgICAgKSAqIDEwMDAgKyBtaWxsaXNlY29uZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0xvY2FsVGltZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IHRvVVRDKHJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoLTguNjRlMTUgPD0gcmVzdWx0ICYmIHJlc3VsdCA8PSA4LjY0ZTE1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gTmFOO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gTmF0aXZlRGF0ZS5wYXJzZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGRlZmluZVByb3BlcnRpZXMoRGF0ZVNoaW0sIHsgcGFyc2U6IHBhcnNlU2hpbSB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIERhdGVTaGltO1xuICAgICAgICB9KERhdGUpKTtcbiAgICAgICAgLyogZ2xvYmFsIERhdGU6IGZhbHNlICovXG4gICAgfVxuXG4gICAgLy8gRVM1IDE1LjkuNC40XG4gICAgLy8gaHR0cDovL2VzNS5naXRodWIuY29tLyN4MTUuOS40LjRcbiAgICBpZiAoIURhdGUubm93KSB7XG4gICAgICAgIERhdGUubm93ID0gZnVuY3Rpb24gbm93KCkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIC8vXG4gICAgLy8gTnVtYmVyXG4gICAgLy8gPT09PT09XG4gICAgLy9cblxuICAgIC8vIEVTNS4xIDE1LjcuNC41XG4gICAgLy8gaHR0cDovL2VzNS5naXRodWIuY29tLyN4MTUuNy40LjVcbiAgICB2YXIgaGFzVG9GaXhlZEJ1Z3MgPSBOdW1iZXJQcm90b3R5cGUudG9GaXhlZCAmJiAoXG4gICAgICAoMC4wMDAwOCkudG9GaXhlZCgzKSAhPT0gJzAuMDAwJyB8fFxuICAgICAgKDAuOSkudG9GaXhlZCgwKSAhPT0gJzEnIHx8XG4gICAgICAoMS4yNTUpLnRvRml4ZWQoMikgIT09ICcxLjI1JyB8fFxuICAgICAgKDEwMDAwMDAwMDAwMDAwMDAxMjgpLnRvRml4ZWQoMCkgIT09ICcxMDAwMDAwMDAwMDAwMDAwMTI4J1xuICAgICk7XG5cbiAgICB2YXIgdG9GaXhlZEhlbHBlcnMgPSB7XG4gICAgICAgIGJhc2U6IDFlNyxcbiAgICAgICAgc2l6ZTogNixcbiAgICAgICAgZGF0YTogWzAsIDAsIDAsIDAsIDAsIDBdLFxuICAgICAgICBtdWx0aXBseTogZnVuY3Rpb24gbXVsdGlwbHkobiwgYykge1xuICAgICAgICAgICAgdmFyIGkgPSAtMTtcbiAgICAgICAgICAgIHZhciBjMiA9IGM7XG4gICAgICAgICAgICB3aGlsZSAoKytpIDwgdG9GaXhlZEhlbHBlcnMuc2l6ZSkge1xuICAgICAgICAgICAgICAgIGMyICs9IG4gKiB0b0ZpeGVkSGVscGVycy5kYXRhW2ldO1xuICAgICAgICAgICAgICAgIHRvRml4ZWRIZWxwZXJzLmRhdGFbaV0gPSBjMiAlIHRvRml4ZWRIZWxwZXJzLmJhc2U7XG4gICAgICAgICAgICAgICAgYzIgPSBNYXRoLmZsb29yKGMyIC8gdG9GaXhlZEhlbHBlcnMuYmFzZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGRpdmlkZTogZnVuY3Rpb24gZGl2aWRlKG4pIHtcbiAgICAgICAgICAgIHZhciBpID0gdG9GaXhlZEhlbHBlcnMuc2l6ZTtcbiAgICAgICAgICAgIHZhciBjID0gMDtcbiAgICAgICAgICAgIHdoaWxlICgtLWkgPj0gMCkge1xuICAgICAgICAgICAgICAgIGMgKz0gdG9GaXhlZEhlbHBlcnMuZGF0YVtpXTtcbiAgICAgICAgICAgICAgICB0b0ZpeGVkSGVscGVycy5kYXRhW2ldID0gTWF0aC5mbG9vcihjIC8gbik7XG4gICAgICAgICAgICAgICAgYyA9IChjICUgbikgKiB0b0ZpeGVkSGVscGVycy5iYXNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBudW1Ub1N0cmluZzogZnVuY3Rpb24gbnVtVG9TdHJpbmcoKSB7XG4gICAgICAgICAgICB2YXIgaSA9IHRvRml4ZWRIZWxwZXJzLnNpemU7XG4gICAgICAgICAgICB2YXIgcyA9ICcnO1xuICAgICAgICAgICAgd2hpbGUgKC0taSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgaWYgKHMgIT09ICcnIHx8IGkgPT09IDAgfHwgdG9GaXhlZEhlbHBlcnMuZGF0YVtpXSAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdCA9ICRTdHJpbmcodG9GaXhlZEhlbHBlcnMuZGF0YVtpXSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzID09PSAnJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcyA9IHQ7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzICs9IHN0clNsaWNlKCcwMDAwMDAwJywgMCwgNyAtIHQubGVuZ3RoKSArIHQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcztcbiAgICAgICAgfSxcbiAgICAgICAgcG93OiBmdW5jdGlvbiBwb3coeCwgbiwgYWNjKSB7XG4gICAgICAgICAgICByZXR1cm4gKG4gPT09IDAgPyBhY2MgOiAobiAlIDIgPT09IDEgPyBwb3coeCwgbiAtIDEsIGFjYyAqIHgpIDogcG93KHggKiB4LCBuIC8gMiwgYWNjKSkpO1xuICAgICAgICB9LFxuICAgICAgICBsb2c6IGZ1bmN0aW9uIGxvZyh4KSB7XG4gICAgICAgICAgICB2YXIgbiA9IDA7XG4gICAgICAgICAgICB2YXIgeDIgPSB4O1xuICAgICAgICAgICAgd2hpbGUgKHgyID49IDQwOTYpIHtcbiAgICAgICAgICAgICAgICBuICs9IDEyO1xuICAgICAgICAgICAgICAgIHgyIC89IDQwOTY7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB3aGlsZSAoeDIgPj0gMikge1xuICAgICAgICAgICAgICAgIG4gKz0gMTtcbiAgICAgICAgICAgICAgICB4MiAvPSAyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIG47XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIHRvRml4ZWRTaGltID0gZnVuY3Rpb24gdG9GaXhlZChmcmFjdGlvbkRpZ2l0cykge1xuICAgICAgICB2YXIgZiwgeCwgcywgbSwgZSwgeiwgaiwgaztcblxuICAgICAgICAvLyBUZXN0IGZvciBOYU4gYW5kIHJvdW5kIGZyYWN0aW9uRGlnaXRzIGRvd25cbiAgICAgICAgZiA9ICROdW1iZXIoZnJhY3Rpb25EaWdpdHMpO1xuICAgICAgICBmID0gaXNBY3R1YWxOYU4oZikgPyAwIDogTWF0aC5mbG9vcihmKTtcblxuICAgICAgICBpZiAoZiA8IDAgfHwgZiA+IDIwKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgUmFuZ2VFcnJvcignTnVtYmVyLnRvRml4ZWQgY2FsbGVkIHdpdGggaW52YWxpZCBudW1iZXIgb2YgZGVjaW1hbHMnKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHggPSAkTnVtYmVyKHRoaXMpO1xuXG4gICAgICAgIGlmIChpc0FjdHVhbE5hTih4KSkge1xuICAgICAgICAgICAgcmV0dXJuICdOYU4nO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSWYgaXQgaXMgdG9vIGJpZyBvciBzbWFsbCwgcmV0dXJuIHRoZSBzdHJpbmcgdmFsdWUgb2YgdGhlIG51bWJlclxuICAgICAgICBpZiAoeCA8PSAtMWUyMSB8fCB4ID49IDFlMjEpIHtcbiAgICAgICAgICAgIHJldHVybiAkU3RyaW5nKHgpO1xuICAgICAgICB9XG5cbiAgICAgICAgcyA9ICcnO1xuXG4gICAgICAgIGlmICh4IDwgMCkge1xuICAgICAgICAgICAgcyA9ICctJztcbiAgICAgICAgICAgIHggPSAteDtcbiAgICAgICAgfVxuXG4gICAgICAgIG0gPSAnMCc7XG5cbiAgICAgICAgaWYgKHggPiAxZS0yMSkge1xuICAgICAgICAgICAgLy8gMWUtMjEgPCB4IDwgMWUyMVxuICAgICAgICAgICAgLy8gLTcwIDwgbG9nMih4KSA8IDcwXG4gICAgICAgICAgICBlID0gdG9GaXhlZEhlbHBlcnMubG9nKHggKiB0b0ZpeGVkSGVscGVycy5wb3coMiwgNjksIDEpKSAtIDY5O1xuICAgICAgICAgICAgeiA9IChlIDwgMCA/IHggKiB0b0ZpeGVkSGVscGVycy5wb3coMiwgLWUsIDEpIDogeCAvIHRvRml4ZWRIZWxwZXJzLnBvdygyLCBlLCAxKSk7XG4gICAgICAgICAgICB6ICo9IDB4MTAwMDAwMDAwMDAwMDA7IC8vIE1hdGgucG93KDIsIDUyKTtcbiAgICAgICAgICAgIGUgPSA1MiAtIGU7XG5cbiAgICAgICAgICAgIC8vIC0xOCA8IGUgPCAxMjJcbiAgICAgICAgICAgIC8vIHggPSB6IC8gMiBeIGVcbiAgICAgICAgICAgIGlmIChlID4gMCkge1xuICAgICAgICAgICAgICAgIHRvRml4ZWRIZWxwZXJzLm11bHRpcGx5KDAsIHopO1xuICAgICAgICAgICAgICAgIGogPSBmO1xuXG4gICAgICAgICAgICAgICAgd2hpbGUgKGogPj0gNykge1xuICAgICAgICAgICAgICAgICAgICB0b0ZpeGVkSGVscGVycy5tdWx0aXBseSgxZTcsIDApO1xuICAgICAgICAgICAgICAgICAgICBqIC09IDc7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdG9GaXhlZEhlbHBlcnMubXVsdGlwbHkodG9GaXhlZEhlbHBlcnMucG93KDEwLCBqLCAxKSwgMCk7XG4gICAgICAgICAgICAgICAgaiA9IGUgLSAxO1xuXG4gICAgICAgICAgICAgICAgd2hpbGUgKGogPj0gMjMpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9GaXhlZEhlbHBlcnMuZGl2aWRlKDEgPDwgMjMpO1xuICAgICAgICAgICAgICAgICAgICBqIC09IDIzO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRvRml4ZWRIZWxwZXJzLmRpdmlkZSgxIDw8IGopO1xuICAgICAgICAgICAgICAgIHRvRml4ZWRIZWxwZXJzLm11bHRpcGx5KDEsIDEpO1xuICAgICAgICAgICAgICAgIHRvRml4ZWRIZWxwZXJzLmRpdmlkZSgyKTtcbiAgICAgICAgICAgICAgICBtID0gdG9GaXhlZEhlbHBlcnMubnVtVG9TdHJpbmcoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdG9GaXhlZEhlbHBlcnMubXVsdGlwbHkoMCwgeik7XG4gICAgICAgICAgICAgICAgdG9GaXhlZEhlbHBlcnMubXVsdGlwbHkoMSA8PCAoLWUpLCAwKTtcbiAgICAgICAgICAgICAgICBtID0gdG9GaXhlZEhlbHBlcnMubnVtVG9TdHJpbmcoKSArIHN0clNsaWNlKCcwLjAwMDAwMDAwMDAwMDAwMDAwMDAwJywgMiwgMiArIGYpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGYgPiAwKSB7XG4gICAgICAgICAgICBrID0gbS5sZW5ndGg7XG5cbiAgICAgICAgICAgIGlmIChrIDw9IGYpIHtcbiAgICAgICAgICAgICAgICBtID0gcyArIHN0clNsaWNlKCcwLjAwMDAwMDAwMDAwMDAwMDAwMDAnLCAwLCBmIC0gayArIDIpICsgbTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbSA9IHMgKyBzdHJTbGljZShtLCAwLCBrIC0gZikgKyAnLicgKyBzdHJTbGljZShtLCBrIC0gZik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtID0gcyArIG07XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbTtcbiAgICB9O1xuICAgIGRlZmluZVByb3BlcnRpZXMoTnV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0KC8ocykqLylbMV0gPT09ICd0JyB8fFxuICAgICAgICAndGVzdCcuc3BsaXQoLyg/OikvLCAtMSkubGVuZ3RoICE9PSA0IHx8XG4gICAgICAgICcnLnNwbGl0KC8uPy8pLmxlbmd0aCB8fFxuICAgICAgICAnLicuc3BsaXQoLygpKCkvKS5sZW5ndGggPiAxXG4gICAgKSB7XG4gICAgICAgIChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgY29tcGxpYW50RXhlY05wY2cgPSB0eXBlb2YgKC8oKT8/LykuZXhlYygnJylbMV0gPT09ICd1bmRlZmluZWQnOyAvLyBOUENHOiBub25wYXJ0aWNpcGF0aW5nIGNhcHR1cmluZyBncm91cFxuICAgICAgICAgICAgdmFyIG1heFNhZmUzMkJpdEludCA9IE1hdGgucG93KDIsIDMyKSAtIDE7XG5cbiAgICAgICAgICAgIFN0cmluZ1Byb3RvdHlwZS5zcGxpdCA9IGZ1bmN0aW9uIChzZXBhcmF0b3IsIGxpbWl0KSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cmluZyA9IFN0cmluZyh0aGlzKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHNlcGFyYXRvciA9PT0gJ3VuZGVmaW5lZCcgJiYgbGltaXQgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIElmIGBzZXBhcmF0b3JgIGlzIG5vdCBhIHJlZ2V4LCB1c2UgbmF0aXZlIHNwbGl0XG4gICAgICAgICAgICAgICAgaWYgKCFpc1JlZ2V4KHNlcGFyYXRvcikpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0clNwbGl0KHRoaXMsIHNlcGFyYXRvciwgbGltaXQpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBvdXRwdXQgPSBbXTtcbiAgICAgICAgICAgICAgICB2YXIgZmxhZ3MgPSAoc2VwYXJhdG9yLmlnbm9yZUNhc2UgPyAnaScgOiAnJykgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzZXBhcmF0b3IubXVsdGlsaW5lID8gJ20nIDogJycpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2VwYXJhdG9yLnVuaWNvZGUgPyAndScgOiAnJykgKyAvLyBpbiBFUzZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2VwYXJhdG9yLnN0aWNreSA/ICd5JyA6ICcnKSwgLy8gRmlyZWZveCAzKyBhbmQgRVM2XG4gICAgICAgICAgICAgICAgICAgIGxhc3RMYXN0SW5kZXggPSAwLFxuICAgICAgICAgICAgICAgICAgICAvLyBNYWtlIGBnbG9iYWxgIGFuZCBhdm9pZCBgbGFzdEluZGV4YCBpc3N1ZXMgYnkgd29ya2luZyB3aXRoIGEgY29weVxuICAgICAgICAgICAgICAgICAgICBzZXBhcmF0b3IyLCBtYXRjaCwgbGFzdEluZGV4LCBsYXN0TGVuZ3RoO1xuICAgICAgICAgICAgICAgIHZhciBzZXBhcmF0b3JDb3B5ID0gbmV3IFJlZ0V4cChzZXBhcmF0b3Iuc291cmNlLCBmbGFncyArICdnJyk7XG4gICAgICAgICAgICAgICAgaWYgKCFjb21wbGlhbnRFeGVjTnBjZykge1xuICAgICAgICAgICAgICAgICAgICAvLyBEb2Vzbid0IG5lZWQgZmxhZ3MgZ3ksIGJ1dCB0aGV5IGRvbid0IGh1cnRcbiAgICAgICAgICAgICAgICAgICAgc2VwYXJhdG9yMiA9IG5ldyBSZWdFeHAoJ14nICsgc2VwYXJhdG9yQ29weS5zb3VyY2UgKyAnJCg/IVxcXFxzKScsIGZsYWdzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLyogVmFsdWVzIGZvciBgbGltaXRgLCBwZXIgdGhlIHNwZWM6XG4gICAgICAgICAgICAgICAgICogSWYgdW5kZWZpbmVkOiA0Mjk0OTY3Mjk1IC8vIG1heFNhZmUzMkJpdEludFxuICAgICAgICAgICAgICAgICAqIElmIDAsIEluZmluaXR5LCBvciBOYU46IDBcbiAgICAgICAgICAgICAgICAgKiBJZiBwb3NpdGl2ZSBudW1iZXI6IGxpbWl0ID0gTWF0aC5mbG9vcihsaW1pdCk7IGlmIChsaW1pdCA+IDQyOTQ5NjcyOTUpIGxpbWl0IC09IDQyOTQ5NjcyOTY7XG4gICAgICAgICAgICAgICAgICogSWYgbmVnYXRpdmUgbnVtYmVyOiA0Mjk0OTY3Mjk2IC0gTWF0aC5mbG9vcihNYXRoLmFicyhsaW1pdCkpXG4gICAgICAgICAgICAgICAgICogSWYgb3RoZXI6IFR5cGUtY29udmVydCwgdGhlbiB1c2UgdGhlIGFib3ZlIHJ1bGVzXG4gICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgdmFyIHNwbGl0TGltaXQgPSB0eXBlb2YgbGltaXQgPT09ICd1bmRlZmluZWQnID8gbWF4U2FmZTMyQml0SW50IDogRVMuVG9VaW50MzIobGltaXQpO1xuICAgICAgICAgICAgICAgIG1hdGNoID0gc2VwYXJhdG9yQ29weS5leGVjKHN0cmluZyk7XG4gICAgICAgICAgICAgICAgd2hpbGUgKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGBzZXBhcmF0b3JDb3B5Lmxhc3RJbmRleGAgaXMgbm90IHJlbGlhYmxlIGNyb3NzLWJyb3dzZXJcbiAgICAgICAgICAgICAgICAgICAgbGFzdEluZGV4ID0gbWF0Y2guaW5kZXggKyBtYXRjaFswXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIGlmIChsYXN0SW5kZXggPiBsYXN0TGFzdEluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwdXNoQ2FsbChvdXRwdXQsIHN0clNsaWNlKHN0cmluZywgbGFzdExhc3RJbmRleCwgbWF0Y2guaW5kZXgpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZpeCBicm93c2VycyB3aG9zZSBgZXhlY2AgbWV0aG9kcyBkb24ndCBjb25zaXN0ZW50bHkgcmV0dXJuIGB1bmRlZmluZWRgIGZvclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9ucGFydGljaXBhdGluZyBjYXB0dXJpbmcgZ3JvdXBzXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbXBsaWFudEV4ZWNOcGNnICYmIG1hdGNoLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBlc2xpbnQtZGlzYWJsZSBuby1sb29wLWZ1bmMgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXRjaFswXS5yZXBsYWNlKHNlcGFyYXRvcjIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDE7IGkgPCBhcmd1bWVudHMubGVuZ3RoIC0gMjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGFyZ3VtZW50c1tpXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXRjaFtpXSA9IHZvaWQgMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgbm8tbG9vcC1mdW5jICovXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2gubGVuZ3RoID4gMSAmJiBtYXRjaC5pbmRleCA8IHN0cmluZy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnJheV9wdXNoLmFwcGx5KG91dHB1dCwgYXJyYXlTbGljZShtYXRjaCwgMSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgbGFzdExlbmd0aCA9IG1hdGNoWzBdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RMYXN0SW5kZXggPSBsYXN0SW5kZXg7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3V0cHV0Lmxlbmd0aCA+PSBzcGxpdExpbWl0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHNlcGFyYXRvckNvcHkubGFzdEluZGV4ID09PSBtYXRjaC5pbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VwYXJhdG9yQ29weS5sYXN0SW5kZXgrKzsgLy8gQXZvaWQgYW4gaW5maW5pdGUgbG9vcFxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG1hdGNoID0gc2VwYXJhdG9yQ29weS5leGVjKHN0cmluZyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChsYXN0TGFzdEluZGV4ID09PSBzdHJpbmcubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChsYXN0TGVuZ3RoIHx8ICFzZXBhcmF0b3JDb3B5LnRlc3QoJycpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwdXNoQ2FsbChvdXRwdXQsICcnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHB1c2hDYWxsKG91dHB1dCwgc3RyU2xpY2Uoc3RyaW5nLCBsYXN0TGFzdEluZGV4KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBv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hcmNoU3RyKTtcbiAgICAgICAgICAgICAgICBpZiAoaW5kZXggIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBrICsgaW5kZXg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICB9XG4gICAgfSwgaGFzTGFzdEluZGV4QnVnKTtcblxuICAgIHZhciBvcmlnaW5hbExhc3RJbmRleE9mID0gU3RyaW5nUHJvdG90eXBlLmxhc3RJbmRleE9mO1xuICAgIGRlZmluZVByb3BlcnRpZXMoU3RyaW5nUHJvdG90eXBlLCB7XG4gICAgICAgIGxhc3RJbmRleE9mOiBmdW5jdGlvbiBsYXN0SW5kZXhPZihzZWFyY2hTdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBvcmlnaW5hbExhc3RJbmRleE9mLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIH1cbiAgICB9LCBTdHJpbmdQcm90b3R5cGUubGFzdEluZGV4T2YubGVuZ3RoICE9PSAxKTtcblxuICAgIC8vIEVTLTUgMTUuMS4yLjJcbiAgICAvKiBlc2xpbnQtZGlzYWJsZSByYWRpeCAqL1xuICAgIGlmIChwYXJzZUludCh3cyArICcwOCcpICE9PSA4IHx8IHBhcnNlSW50KHdzICsgJzB4MTYnKSAhPT0gMjIpIHtcbiAgICAvKiBlc2xpbnQtZW5hYmxlIHJhZGl4ICovXG4gICAgICAgIC8qIGdsb2JhbCBwYXJzZUludDogdHJ1ZSAqL1xuICAgICAgICBwYXJzZUludCA9IChmdW5jdGlvbiAob3JpZ1BhcnNlSW50KSB7XG4gICAgICAgICAgICB2YXIgaGV4UmVnZXggPSAvXltcXC0rXT8wW3hYXS87XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gcGFyc2VJbnQoc3RyLCByYWRpeCkge1xuICAgICAgICAgICAgICAgIHZhciBzdHJpbmcgPSB0cmltKFN0cmluZyhzdH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gdGhpcyA9PT0gJ3VuZGVmaW5lZCcgfHwgdGhpcyA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJjYW4ndCBjb252ZXJ0IFwiICsgdGhpcyArICcgdG8gb2JqZWN0Jyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgbmFtZSA9IHRoaXMubmFtZTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbmFtZSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBuYW1lID0gJ0Vycm9yJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIG5hbWUgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgbmFtZSA9ICRTdHJpbmcobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgbXNnID0gdGhpcy5tZXNzYWdlO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtc2cgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgbXNnID0gJyc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBtc2cgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgbXNnID0gJFN0cmluZyhtc2cpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFuYW1lKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1zZztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghbXNnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5hbWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbmFtZSArICc6ICcgKyBtc2c7XG4gICAgICAgIH07XG4gICAgICAgIC8vIGNhbid0IHVzZSBkZWZpbmVQcm9wZXJ0aWVzIGhlcmUgYmVjYXVzZSBvZiB0b1N0cmluZyBlbnVtZXJhdGlvbiBpc3N1ZSBpbiBJRSA8PSA4XG4gICAgICAgIEVycm9yLnByb3RvdHlwZS50b1N0cmluZyA9IGVycm9yVG9TdHJpbmdTaGltO1xuICAgIH1cblxuICAgIGlmIChzdXBwb3J0c0Rlc2NyaXB0b3JzKSB7XG4gICAgICAgIHZhciBlbnN1cmVOb25FbnVtZXJhYmxlID0gZnVuY3Rpb24gKG9iaiwgcHJvcCkge1xuICAgICAgICAgICAgaWYgKGlzRW51bShvYmosIHByb3ApKSB7XG4gICAgICAgICAgICAgICAgdmFyIGRlc2MgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKG9iaiwgcHJvcCk7XG4gICAgICAgICAgICAgICAgaWYgKGRlc2MuY29uZmlndXJhYmxlKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlc2MuZW51bWVyYWJsZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkob2JqLCBwcm9wLCBkZXNjKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIGVuc3VyZU5vbkVudW1lcmFibGUoRXJyb3IucHJvdG90eXBlLCAnbWVzc2FnZScpO1xuICAgICAgICBpZiAoRXJyb3IucHJvdG90eXBlLm1lc3NhZ2UgIT09ICcnKSB7XG4gICAgICAgICAgICBFcnJvci5wcm90b3R5cGUubWVzc2FnZSA9ICcnO1xuICAgICAgICB9XG4gICAgICAgIGVuc3VyZU5vbkVudW1lcmFibGUoRXJyb3IucHJvdG90eXBlLCAnbmFtZScpO1xuICAgIH1cblxuICAgIGlmIChTdHJpbmcoL2EvbWlnKSAhPT0gJy9hL2dpbScpIHtcbiAgICAgICAgdmFyIHJlZ2V4VG9TdHJpbmcgPSBmdW5jdGlvbiB0b1N0cmluZygpIHtcbiAgICAgICAgICAgIHZhciBzdHIgPSAnLycgKyB0aGlzLnNvdXJjZSArICcvJztcbiAgICAgICAgICAgIGlmICh0aGlzLmdsb2JhbCkge1xuICAgICAgICAgICAgICAgIHN0ciArPSAnZyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGhpcy5pZ25vcmVDYXNlKSB7XG4gICAgICAgICAgICAgICAgc3RyICs9ICdpJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLm11bHRpbGluZSkge1xuICAgICAgICAgICAgICAgIHN0ciArPSAnbSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gc3RyO1xuICAgICAgICB9O1xuICAgICAgICAvLyBjYW4ndCB1c2UgZGVmaW5lUHJvcGVydGllcyBoZXJlIGJlY2F1c2Ugb2YgdG9TdHJpbmcgZW51bWVyYXRpb24gaXNzdWUgaW4gSUUgPD0gOFxuICAgICAgICBSZWdFeHAucHJvdG90eXBlLnRvU3RyaW5nID0gcmVnZXhUb1N0cmluZztcbiAgICB9XG59KSk7XG4iLCIndXNlIHN0cmljdCc7XG4vKmpzbGludCBlcWVxOiB0cnVlKi9cblxuSGFuZGxlYmFycy5yZWdpc3RlckhlbHBlcignc2FuaXRpemUnLCBmdW5jdGlvbiAodGV4dCkge1xuICAgIHZhciByZXN1bHQ7XG5cbiAgICBpZiAodGV4dCA9PT0gdW5kZWZpbmVkKSB7IHJldHVybiAnJzsgfVxuXG4gICAgcmVzdWx0ID0gc2FuaXRpemVIdG1sKHRleHQsIHtcbiAgICAgICAgYWxsb3dlZFRhZ3M6IFsgJ2RpdicsICdzcGFuJywgJ2InLCAnaScsICdlbScsICdzdHJvbmcnLCAnYScsICdicicsICd0YWJsZScsICd0Ym9keScsICd0cicsICd0aCcsICd0ZCcgXSxcbiAgICAgICAgYWxsb3dlZEF0dHJpYnV0ZXM6IHtcbiAgICAgICAgICAgICdkaXYnOiBbICdjbGFzcycgXSxcbiAgICAgICAgICAgICdzcGFuJzogWyAnY2xhc3MnIF0sXG4gICAgICAgICAgICAndGFibGUnOiBbICdjbGFzcycgXSxcbiAgICAgICAgICAgICd0ZCc6IFs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ICAgICAgICBjYXNlICc9PSc6XG4gICAgICAgICAgICByZXR1cm4gKHYxID09IHYyKSA/IG9wdGlvbnMuZm4odGhpcykgOiBvcHRpb25zLmludmVyc2UodGhpcyk7XG4gICAgICAgIGNhc2UgJz09PSc6XG4gICAgICAgICAgICByZXR1cm4gKHYxID09PSB2MikgPyBvcHRpb25zLmZuKHRoaXMpIDogb3B0aW9ucy5pbnZlcnNlKHRoaXMpO1xuICAgICAgICBjYXNlICc8JzpcbiAgICAgICAgICAgIHJldHVybiAodjEgPCB2MikgPyBvcHRpb25zLmZuKHRoaXMpIDogb3B0aW9ucy5pbnZlcnNlKHRoaXMpO1xuICAgICAgICBjYXNlICc8PSc6XG4gICAgICAgICAgICByZXR1cm4gKHYxIDw9IHYyKSA/IG9wdGlvbnMuZm4odGhpcykgOiBvcHRpb25zLmludmVyc2UodGhpcyk7XG4gICAgICAgIGNhc2UgJz4nOlxuICAgICAgICAgICAgcmV0dXJuICh2MSA+IHYyKSA/IG9wdGlvbnMuZm4odGhpcykgOiBvcHRpb25zLmludmVyc2UodGhpcyk7XG4gICAgICAgIGNhc2UgJz49JzpcbiAgICAgICAgICAgIHJldHVybiAodjEgPj0gdjIpID8gb3B0aW9ucy5mbih0aGlzKSA6IG9wdGlvbnMuaW52ZXJzZSh0aGlzKTtcbiAgICAgICAgY2FzZSAnJiYnOlxuICAgICAgICAgICAgcmV0dXJuICh2MSAmJiB2MikgPyBvcHRpb25zLmZuKHRoaXMpIDogb3B0aW9ucy5pbnZlcnNlKHRoaXMpO1xuICAgICAgICBjYXNlICd8fCc6XG4gICAgICAgICAgICByZXR1cm4gKHYxIHx8IHYyKSA/IG9wdGlvbnMuZm4odGhpcykgOiBvcHRpb25zLmludmVyc2UodGhpcyk7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICByZXR1cm4gb3B0aW9ucy5pbnZlcnNlKHRoaXMpO1xuICAgIH1cbn0pO1xuXG5IYW5kbGViYXJzLnJlZ2lzdGVySGV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3VyaXR5RGVmaW5pdGlvbi52ZW5kb3JFeHRlbnNpb25zID0ge307XG4gICAgICBmb3IodmFyIGV4dCBpbiBzZWN1cml0eURlZmluaXRpb24pIHtcbiAgICAgICAgaGVscGVycy5leHRyYWN0RXh0ZW5zaW9ucyhleHQsIHNlY3VyaXR5RGVmaW5pdGlvbik7XG4gICAgICAgIGlmIChleHQgPT09ICdzY29wZXMnKSB7XG4gICAgICAgICAgdmFyIHNjb3BlcyA9IHNlY3VyaXR5RGVmaW5pdGlvbltleHRdO1xuICAgICAgICAgIGlmKHR5cGVvZiBzY29wZXMgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICBzY29wZXMudmVuZG9yRXh0ZW5zaW9ucyA9IHt9O1xuICAgICAgICAgICAgZm9yICh2YXIgcyBpbiBzY29wZXMpIHtcbiAgICAgICAgICAgICAgaGVscGVycy5leHRyYWN0RXh0ZW5zaW9ucyhzLCBzY29wZXMpO1xuICAgICAgICAgICAgICBpZihzLmluZGV4T2YoJ3gtJykgPT09IDApIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgc2NvcGVzW3NdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgaWYgKEFycmF5LmlzQXJyYXkocmVzcG9uc2UudGFncykpIHtcbiAgICBkZWZpbmVkVGFncyA9IHt9O1xuXG4gICAgZm9yIChrID0gMDsgayA8IHJlc3BvbnNlLnRhZ3MubGVuZ3RoOyBrKyspIHtcbiAgICAgIHZhciB0ID0gXy5jbG9uZURlZXAocmVzcG9uc2UudGFnc1trXSk7XG4gICAgICBkZWZpbmVkVGFnc1t0Lm5hbWVdID0gdDtcbiAgICAgIGZvcihpIGluIHQpIHtcbiAgICAgICAgaWYoaSA9PT0gJ2V4dGVybmFsRG9jcycgJiYgdHlwZW9mIHRbaV0gPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgZm9yKHZhci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mJpbmQoc2VsZi5oZWxwLCBvcGVyYXRpb25Hcm91cCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBiaW5kIHRvIHRoZSBhcGlzIG9iamVjdFxuICAgICAgICBzZWxmLmFwaXNbYXBpUHJvcGVydHldW29wZXJhdGlvbklkXSA9IG9wZXJhdGlvbkdyb3VwW29wZXJhdGlvbklkXSA9IF8uYmluZChvcGVyYXRpb25PYmplY3QuZXhlY3V0ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25PYmplY3QpO1xuICAgICAgICBzZWxmLmFwaXNbYXBpUHJvcGVydHldW29wZXJhdGlvbklkXS5oZWxwID0gb3BlcmF0aW9uR3JvdXBbb3BlcmF0aW9uSWRdLmhlbHAgPSBfLmJpbmQob3BlcmF0aW9uT2JqZWN0LmhlbHAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRpb25PYmplY3QpO1xuICAgICAgICBzZWxmLmFwaXNbYXBpUHJvcGVydHldW29wZXJhdGlvbklkXS5hc0N1cmwgPSBvcGVyYXRpb25Hcm91cFtvcGVyYXRpb25JZF0uYXNDdXJsID0gXy5iaW5kKG9wZXJhdGlvbk9iamVjdC5hc0N1cmwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uT2JqZWN0KTtcblxuICAgICAgICBvcGVyYXRpb25Hcm91cC5hcGlzW29wZXJhdGlvbklkXSA9IG9wZXJhdGlvbkdyb3VwLm9wZXJhdGlvbnNbb3BlcmF0aW9uSWRdID0gb3BlcmF0aW9uT2JqZWN0O1xuXG4gICAgICAgIC8vI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AgIHIud2l0aENyZWRlbnRpYWxzKCk7XG4gIH1cblxuICB2YXIgYWNjZXB0ID0gb2JqLmhlYWRlcnMuQWNjZXB0O1xuXG4gIGlmKHRoaXMuYmluYXJ5UmVxdWVzdChhY2NlcHQpKSB7XG4gICAgci5vbigncmVxdWVzdCcsIGZ1bmN0aW9uICgpIHtcbiAgICAgIGlmKHRoaXMueGhyKSB7XG4gICAgICAgIHRoaXMueGhyLnJlc3BvbnNlVHlwZSA9ICdibG9iJztcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxuXG4gIGlmKG9iai5ib2R5KSB7XG4gICAgaWYoXy5pc09iamVjdChvYmouYm9keSkpIHtcbiAgICAgIHZhciBjb250ZW50VHlwZSA9IG9iai5oZWFkZXJzWydDb250ZW50LVR5cGUnXSB8fCAnJztcbiAgICAgIGlmIChjb250ZW50VHlwZS5pbmRleE9mKCdtdWx0aXBhcnQvZm9ybS1kYXRhJykgPT09IDApIHtcbiAgICAgICAgZGVsZXRlIGhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddO1xuICAgICAgICBpZih7fS50b1N0cmluZy5hcHBseShvYmouYm9keSkgPT09ICdbb2JqZWN0IEZvcm1EYXRhXScpIHtcbiAgICAgICAgICByLnNlbmQob2JqLmJvZHkpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIHZhciBrZXluYW1lLCB2YWx1ZSwgdjtcbiAgICAgICAgICBmb3IgKGtleW5hbWUgaW4gb2JqLmJvZHkpIHtcbiAgICAgICAgICAgIHZhbHVlID0gb2JqLmJvZHlba2V5bmFtZV07XG4gICAgICAgICAgICBpZihBcnJheS5pc0FycmF5KHZhbHVlKSkge1xuICAgICAgICAgICAgICBmb3IodiBpbiB2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHIuZmllbGQoa2V5bmFtZSwgdik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgIC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gICAgICAgICAgIGNvdW50ZXIgPSAwO1xuICAgICAgICAgICAgICAgIHdoaWxlICghZG9uZSkge1xuICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzcGVjLmRlZmluaXRpb25zW25hbWVdID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBkb25lID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBuYW1lID0gbW9kZWxOYW1lICsgJ18nICsgY291bnRlcjtcbiAgICAgICAgICAgICAgICAgIGNvdW50ZXIrKztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3BlYy5kZWZpbml0aW9uc1tuYW1lXSA9IHthbGxPZjogcGFyYW1ldGVyLnNjaGVtYS5hbGxPZn07XG4gICAgICAgICAgICAgICAgZGVsZXRlIHBhcmFtZXRlci5zY2hlbWEuYWxsT2Y7XG4gICAgICAgICAgICAgICAgcGFyYW1ldGVyLnNjaGVtYS4kcmVmID0gJyMvZGVmaW5pdGlvbnMvJyArIG5hbWU7XG4gICAgICAgICAgICAgICAgdGhpcy5wcm9jZXNzQWxsT2Yocm9vdCwgbmFtZSwgc3BlYy5kZWZpbml0aW9uc1tuYW1lXSwgcmVzb2x1dGlvblRhYmxlLCB1bnJlc29sdmVkUmVmcywgc3BlYyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZXNvbHZlVG8ocm9vdCwgcGFyYW1ldGVyLnNjaGVtYSwgcmVzb2x1dGlvblRhYmxlLCBsb2NhdGlvbik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBhcmFtZXRlci4kcmVmKSB7XG4gICAgICAgICAgICAgIC8vIHBhcmFtZXRlciByZWZlcmVuY2VcbiAgICAgICAgICAgICAgdGhpcy5yZXNvbHZlSW5saW5lKHJvb3QsIHNwZWMsIHBhcmFtZXRlciwgcmVzb2x1dGlvblRhYmxlLCB1bnJlc29sdmVkUmVmcywgcGFyYW1ldGVyLiRyZWYpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGZvciAocmVzcG9uc2VDb2RlIGluIG9wZXJhdGlvbi5yZXNwb25zZXMpIHtcbiAgICAgICAgICAgIHZhciByZXNwb25zZSA9IG9wZXJhdGlvbi5yZXNwb25zZXNbcmVzcG9uc2VDb2RlXTtcbiAgICAgICAgICAgIGxvY2F0aW9uID0gJy9wYXRocycgKyBuYW1lICsgJy8nICsgbWV0aG9kICsgJy9yZXNwb25zZXMvJyArIHJlc3BvbnNlQ29kZTtcblxuICAgICAgICAgICAgaWYgKF8uaXNPYmplY3QocmVzcG9uc2UpKSB7XG4gICAgICAgICAgICAgIGlmIChyZXNwb25zZS4kcmVmKSB7XG4gICAgICAgICAgICAgICAgLy8gcmVzcG9uc2UgcmVmZXJlbmNlXG4gICAgICAgICAgICAgICAgdGhpcy5yZXNvbHZlSW5saW5lKHJvb3QsIHNwZWMsIHJlc3BvbnNlLCByZXNvbHV0aW9uVGFibGUsIHVucmVzb2x2ZWRSZWZzLCBsb2NhdGlvbik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnNjaGVtYSkge1xuICAgICAgICAgICAgICAgIHZhciByZXNwb25zZU9iaiA9IHJlc3BvbnNlO1xuICAgICAgICAgICAgICAgIGlmIChfLmlzQXJyYXkocmVzcG9uc2VPYmouc2NoZW1hLmFsbE9mKSkge1xuICAgICAgICAgICAgICAgICAgLy8gbW92ZSB0byBhIGRlZmluaXRpb25cbiAgICAgICAgICAgICAgICAgIG1vZGVsTmFtZSA9ICdpbmxpbmVfbW9kZWwnO1xuICAgICAgICAgICAgICAgICAgbmFtZSA9IG1vZGVsTmFtZTtcbiAgICAgICAgICAgICAgICAgIGRvbmUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGNvdW50ZXIgPSAwO1xuICAgICAgICAgICAgICAgICAgd2hpbGUgKCFkb25lKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc3BlYy5kZWZpbml0aW9uc1tuYW1lXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICBkb25lID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuYW1lID0gbW9kZWxOYW1lICsgJ18nICsgY291bnRlcjtcbiAgICAgICAgICAgICAgICAgICAgY291bnRlcisrO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgc3BlYy5kZWZpbml0aW9uc1tuYW1lXSA9IHthbGxPZjogcmVzcG9uc2VPYmouc2NoZW1hLmFsbE9mfTtcbiAgICAgICAgICAgICAgICAgIGRlbGV0ZSByZXNwb25zZU9iai5zY2hlbWEuYWxsT2Y7XG4gICAgICAgICAgICAgICAgICBkZWxldGUgcmVzcG9uc2VPYmouc2NoZW1hLnR5cGU7XG4gICAgICAgICAgICAgICAgICByZXNwb25zZU9iai5zY2hlbWEuJHJlZiA9ICcjL2RlZmluaXRpb25zLycgKyBuYW1lO1xuICAgICAgICAgICAgICAgICAgdGhpcy5wcm9jZXNzQWxsT2Yocm9vdCwgbmFtZSwgc3BlYy5kZWZpbml0aW9uc1tuYW1lXSwgcmVzb2x1dGlvblRhYmxlLCB1bnJlc29sdmVkUmVmcywgc3BlYyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKCdhcnJheScgPT09IHJlc3BvbnNlT2JqLnNjaGVtYS50eXBlKSB7XG4gICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VPYmouc2NoZW1hLml0ZW1zICYmIHJlc3BvbnNlT2JqLnNjaGVtYS5pdGVtcy4kcmVmKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHJlc3BvbnNlIHJlZmVyZW5jZVxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlc29sdmVJbmxpbmUocm9vdCwgc3BlYywgcmVzcG9uc2VPYmouc2NoZW1hLml0ZW1zLCByZXNvbHV0aW9uVGFibGUsIHVucmVzb2x2ZWRSZWZzLCBsb2NhdGlvbik7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgdGhpcy5yZXNvbHZlVG8ocm9vdCwgcmVzcG9uc2Uuc2NoZW1hLCByZXNvbHV0aW9uVGFibGUsIGxvY2F0aW9uKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIC8vIGNsZWFyIHRoZW0gb3V0IHRvIGF2b2lkIG11bHRpcGxlIHJlc29sdXRpb25zXG4gICAgICBwYXRoLnBhcmFtZXRlcnMgPSBbXTtcbiAgICB9XG4gIH1cblxuICB2YXIgZXhwZWN0ZWRDYWxscyA9IDAsIHRvUmVzb2x2ZSA9IFtdO1xuICAvLyBpZiB0aGUgcm9vdCBpcyBzYW1lIGFzIG9ialtpXS5yb290IHdlIGNhbiByZXNvbHZlIGxvY2FsbHlcbiAgdmFyIGFsbCA9IHJlc29sdXRpb25UYWJsZTtcblxuICB2YXIgcGFydHM7XG4gIGZvcihpID0gMDsgaSA8IGFsbC5sZW5ndGg7IGkrKykge1xuICAgIHZhciBhID0gYWxsW2ldO1xuICAgIGlmKHJvb3QgPT09IGEucm9vdCkge1xuICAgICAgaWYoYS5yZXNvbHZlQXMgPT09ICdyZWYnKSB7XG4gICAgICAgIC8vIHJlc29sdmUgYW55IHBhdGggd2Fsa2luZ1xuICAgICAgICB2YXIgam9pbmVkID0gKChhLnJvb3QgfHwgJycpICsgJy8nICsgYS5rZXkpLnNwbGl0KCcvJyk7XG4gICAgICAgIHZhciBub3JtYWxpemVkID0gW107XG4gICAgICAgIHZhciB1cmwgPSAnJztcbiAgICAgICAgdmFyIGs7XG5cbiAgICAgICAgaWYoYS5rZXkuaW5kZXhPZignLi4vJykgPj0gMCkge1xuICAgICAgICAgIGZvcih2YXIgaiA9IDA7IGogPCBqb2luZWQubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgIGlmKGpvaW5lZFtqXSA9PT0gJy4uJykge1xuICAgICAgICAgICAgICBub3JtYWxpemVkID0gbm9ybWFsaXplZC5zbGljZSgwLCBub3JtYWxpemVkLmxlbmd0aC0xKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBub3JtYWxpemVkLnB1c2goam9pbmVkW2pdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZm9yKGsgPSAwOyBrIDwgbm9ybWFsaXplZC5sZW5ndGg7IGsgKyspIHtcbiAgICAgICAgICAgIGlmKGsgPiAwKSB7XG4gICAgICAgICAgICAgIHVybCArPSAnLyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB1cmwgKz0gbm9ybWFsaXplZFtrXTtcbiAgICAgICAgICB9XG4gICAgICAgICAgLy8gd2Ugbm93IGhhdmUgdG8gcmVtb3RlIHJlc29sdmUgdGhpcyBiZWNhdXNlIHRoZSBwYXRoIGhhcyBjaGFuZ2VkXG4gICAgICAgICAgYS5yb290ID0gdXJsO1xuICAgICAgICAgIHRvUmVzb2x2ZS5wdXNoKGEpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIHBhcnRzID0gYS5rZXkuc3BsaXQoJyMnKTtcbiAgICAgICAgICBpZihwYXJ0cy5sZW5ndGggPT09IDIpIHtcbiAgICAgICAgICAgIGlmKHBhcnRzWzBdLmluZGV4T2YoJ2h0dHA6JykgPT09IDAgfHwgcGFydHNbMF0uaW5kZXhPZignaHR0cHM6JykgPT09IDApIHtcbiAgICAgICAgICAgICAgYS5yb290ID0gcGFydHNbMF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsb2NhdGlvbiA9IHBhcnRzWzFdLnNwbGl0KCcvJyk7XG4gICAgICAgICAgICB2YXIgcjtcbiAgICAgICAgICAgIHZhciBzID0gc3BlYztcbiAgICAgICAgICAgIGZvcihrID0gMDsgayA8IGxvY2F0aW9uLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgIHZhciBwYXJ0ID0gbG9jYXRpb25ba107XG4gICAgICAgICAgICAgIGlmKHBhcnQgIT09ICcnKSB7XG4gICAgICAgICAgICAgICAgcyA9IHNbcGFydF07XG4gICAgICAgICAgICAgICAgaWYodHlwZW9mIHMgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICByID0gcztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICByID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYociA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAvLyBtdXN0IHJlc29sdmUgdGhpcyB0b29cbiAgICAgICAgICAgICAgdG9SZXNvbHZlLnB1c2goYSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgaWYgKGEucmVzb2x2ZUFzID09PSAnaW5saW5lJykge1xuICAgICAgICAgIGlmKGEua2V5ICYmIGEua2V5LmluZGV4T2YoJyMnKSA9PT0gLTEgJiYgYS5rZXkuY2hhckF0KDApICE9PSAnLycpIHtcbiAgICAgICAgICAgIC8vIGhhbmRsZSByZWxhdGl2ZSBzY2hlbWFcbiAgICAgICAgICAgIHBhcn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goc3BlYywgcm9vdCwgcmVzb2x1dGlvblRhYmxlLCByZXNvbHZlZFJlZnMsIHVucmVzb2x2ZWRSZWZzLCBjYWxsYmFjaywgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGVsc2UgaWYoc2VsZi5mYWlsZWRVcmxzLmluZGV4T2YoaXRlbS5yb290KSA9PT0gLTEpIHtcbiAgICAgICAgdmFyIG9iaiA9IHtcbiAgICAgICAgICB1c2VKUXVlcnk6IGZhbHNlLCAgLy8gVE9ET1xuICAgICAgICAgIHVybDogaXRlbS5yb290LFxuICAgICAgICAgIG1ldGhvZDogJ2dldCcsXG4gICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgYWNjZXB0OiBzZWxmLnNjb3BlLnN3YWdnZXJSZXF1ZXN0SGVhZGVycyB8fCAnYXBwbGljYXRpb24vanNvbidcbiAgICAgICAgICB9LFxuICAgICAgICAgIG9uOiB7XG4gICAgICAgICAgICBlcnJvcjogZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgIHByb2Nlc3NlZENhbGxzICs9IDE7XG4gICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdmYWlsZWQgdXJsOiAnICsgb2JqLnVybCk7XG4gICAgICAgICAgICAgIHNlbGYuZmFpbGVkVXJscy5wdXNoKG9iai51cmwpO1xuICAgICAgICAgICAgICBpZiAobG9jaykge1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBsb2NrW2l0ZW0ucm9vdF07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgdW5yZXNvbHZlZFJlZnNbaXRlbS5rZXldID0ge1xuICAgICAgICAgICAgICAgIHJvb3Q6IGl0ZW0ucm9vdCxcbiAgICAgICAgICAgICAgICBsb2NhdGlvbjogaXRlbS5sb2NhdGlvblxuICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgIGlmIChwcm9jZXNzZWRDYWxscyA9PT0gZXhwZWN0ZWRDYWxscykge1xuICAgICAgICAgICAgICAgIHNlbGYuZmluaXNoKHNwZWMsIF9yb290LCByZXNvbHV0aW9uVGFibGUsIHJlc29sdmVkUmVmcywgdW5yZXNvbHZlZFJlZnMsIGNhbGxiYWNrKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgIC8vIGpzaGludCBpZ25vcmU6bGluZVxuICAgICAgICAgICAgcmVzcG9uc2U6IGZ1bmN0aW9uIChyZXNwb25zZSkge1xuICAgICAgICAgICAgICB2YXIgc3dhZ2dlciA9IHJlc3BvbnNlLm9iajtcbiAgICAgICAgICAgICAgaWYgKGxvY2spIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgbG9ja1tpdGVtLnJvb3RdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChzZWxmLnJlc29sdmVyQ2FjaGUpIHtcbiAgICAgICAgICAgICAgICBzZWxmLnJlc29sdmVyQ2FjaGVbaXRlbS5yb290XSA9IHN3YWdnZXI7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgc2VsZi5yZXNvbHZlSXRlbShzd2FnZ2VyLCBpdGVtLnJvb3QsIHJlc29sdXRpb25UYWJsZSwgcmVzb2x2ZWRSZWZzLCB1bnJlc29sdmVkUmVmcywgaXRlbSk7XG4gICAgICAgICAgICAgIHByb2Nlc3NlZENhbGxzICs9IDE7XG5cbiAgICAgICAgICAgICAgaWYgKHByb2Nlc3NlZENhbGxzID09PSBleHBlY3RlZENhbGxzKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5maW5pc2goc3BlYywgX3Jvb3QsIHJlc29sdXRpb25UYWJsZSwgcmVzb2x2ZWRSZWZzLCB1bnJlc29sdmVkUmVmcywgY2FsbGJhY2spO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSAvLyBqc2hpbnQgaWdub3JlOmxpbmVcbiAgICAgICAgfTtcblxuICAgICAgICAvLyBhcHBseSB0aW1lb3V0IG9ubHkgd2hlbiBzcGVjaWZpZWRcbiAgICAgICAgaWYgKHNjb3BlICYmIHNjb3BlLmZldGNoU3BlY1RpbWVvdXQpIHtcbiAgICAgICAgICBvYmoudGltZW91dCA9IHNjb3BlLmZldGNoU3BlY1RpbWVvdXQ7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc2NvcGUgJiYgc2NvcGUuY2xpZW50QXV0aG9yaXphdGlvbnMpIHtcbiAgICAgICAgICBzY29wZS5jbGllbnRBdXRob3JpemF0aW9ucy5hcHBseShvYmopO1xuICAgICAgICB9XG5cbiAgICAgICAgKGZ1bmN0aW9uIHdhaXRGb3JVbmxvY2soKSB7XG4gICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGlmIChsb2NrW29iai51cmxdKSB7XG4gICAgICAgICAgICAgIHdhaXRGb3JVbmxvY2soKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgY2FjaGVkID0gc2VsZi5yZXNvbHZlckNhY2hlW29iai51cmxdO1xuICAgICAgICAgICAgICBpZiAoXy5pc09iamVjdChjYWNoZWQpKSB7XG4gICAgICAgICAgICAgICAgb2JqLm9uLnJlc3BvbnNlKHtvYmo6IGNhY2hlZH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGxvY2tbb2JqLnVybF0gPSB0cnVlO1xuICAgICAgICAgICAgICAgIG5ldyBTd2FnZ2VySHR0cCgpLmV4ZWN1dGUob2JqLCBvcHRzKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sIDApO1xuICAgICAgICB9KSgpO1xuICAgICAgfVxuXG4gICAgICBlbHNlIHtcbiAgICAgICAgcHJvY2Vzc2VkQ2FsbHMgKz0gMTtcbiAgICAgICAgdW5yZXNvbHZlZFJlZnNbaXRlbS5rZXldID0ge1xuICAgICAgICAgIHJvb3Q6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kZWQganVzdCBhICdzcGVjJywgbm90IGEgJ3VybCcgP1xuXG4gIGlmIChyZWYpIHtcbiAgICBpZihyZWYuaW5kZXhPZignLi4vJykgPT09IDApIHtcbiAgICAgIC8vIHJlc2V0IHJvb3RcbiAgICAgIHAgPSByZWYuc3BsaXQoJy4uLycpO1xuICAgICAgcDIgPSByb290LnNwbGl0KCcvJyk7XG4gICAgICByZWYgPSAnJztcbiAgICAgIGZvcihpID0gMDsgaSA8IHAubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgaWYocFtpXSA9PT0gJycpIHtcbiAgICAgICAgICBwMiA9IHAyLnNsaWNlKDAsIHAyLmxlbmd0aC0xKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICByZWYgKz0gcFtpXTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcm9vdCA9ICcnO1xuICAgICAgZm9yKGkgPSAwOyBpIDwgcDIubGVuZ3RoIC0gMTsgaSsrKSB7XG4gICAgICAgIGlmKGkgPiAwKSB7IHJvb3QgKz0gJy8nOyB9XG4gICAgICAgIHJvb3QgKz0gcDJbaV07XG4gICAgICB9XG4gICAgICByb290VHJpbW1lZCA9IHRydWU7XG4gICAgfVxuICAgIGlmKHJlZi5pbmRleE9mKCcjJykgPj0gMCkge1xuICAgICAgaWYocmVmLmluZGV4T2YoJy8nKSA9PT0gMCkge1xuICAgICAgICBycyA9IHJlZi5zcGxpdCgnIycpO1xuICAgICAgICBwICA9IHJvb3Quc3BsaXQoJy8vJyk7XG4gICAgICAgIHAyID0gcFsxXS5zcGxpdCgnLycpO1xuICAgICAgICByb290ID0gcFswXSArICcvLycgKyBwMlswXSArIHJzWzBdO1xuICAgICAgICBsb2NhdGlvbiA9IHJzWzFdO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIHJzID0gcmVmLnNwbGl0KCcjJyk7XG4gICAgICAgIGlmKHJzWzBdICE9PSAnJykge1xuICAgICAgICAgIHAyID0gcm9vdC5zcGxpdCgnLycpO1xuICAgICAgICAgIHAyID0gcDIuc2xpY2UoMCwgcDIubGVuZ3RoIC0gMSk7XG4gICAgICAgICAgaWYoIXJvb3RUcmltbWVkKSB7XG4gICAgICAgICAgICByb290ID0gJyc7XG4gICAgICAgICAgICBmb3IgKHZhciBrID0gMDsgayA8IHAyLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgIGlmKGsgPiAwKSB7IHJvb3QgKz0gJy8nOyB9XG4gICAgICAgICAgICAgIHJvb3QgKz0gcDJba107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHJvb3QgKz0gJy8nICsgcmVmLnNwbGl0KCcjJylbMF07XG4gICAgICAgIH1cbiAgICAgICAgbG9jYXRpb24gPSByc1sxXTtcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKHJlZi5pbmRleE9mKCdodHRwOicpID09PSAwIHx8IHJlZi5pbmRleE9mKCdodHRwczonKSA9PT0gMCkge1xuICAgICAgaWYocmVmLmluZGV4T2YoJyMnKSA+PSAwKSB7XG4gICAgICAgIHJvb3QgPSByZWYuc3BsaXQoJyMnKVswXTtcbiAgICAgICAgbG9jYXRpb24gPSByZWYuc3BsaXQoJyMnKVsxXTtcbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICByb290ID0gcmVmO1xuICAgICAgICBsb2NhdGlvbiA9ICcnO1xuICAgICAgfVxuICAgICAgcmVzb2x1dGlvblRhYmxlLnB1c2goe29iajogcHJvcGVydHksIHJlc29sdmVBczogJ2lubGluZScsIHJvb3Q6IHJvb3QsIGtleToga2V5LCBsb2NhdGlvbjogbG9jYXRpb259KTtcbiAgICB9IGVsc2UgaWYgKHJlZi5pbmRleE9mKCcjJykgPT09IDApIHtcbiAgICAgIGxvY2F0aW9uID0gcmVmLnNwbGl0KCcjJylbMV07XG4gICAgICByZXNvbHV0aW9uVGFibGUucHVzaCh7b2JqOiBwcm9wZXJ0eSwgcmVzb2x2ZUFzOiA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Byb290O1xuICBpZiAoKHR5cGVvZiByZWYgIT09ICd1bmRlZmluZWQnKSAmJiAocmVmICE9PSBudWxsKSkge1xuICAgIGlmKHJlZi5pbmRleE9mKCcjJykgPj0gMCkge1xuICAgICAgdmFyIHBhcnRzID0gcmVmLnNwbGl0KCcjJyk7XG5cbiAgICAgIC8vICMvZGVmaW5pdGlvbnMvZm9vXG4gICAgICAvLyBmb28uanNvbiMvYmFyXG4gICAgICBpZihwYXJ0c1swXSAmJiByZWYuaW5kZXhPZignLycpID09PSAwKSB7XG5cbiAgICAgIH1cbiAgICAgIGVsc2UgaWYocGFydHNbMF0gJiYgKHBhcnRzWzBdLmluZGV4T2YoJ2h0dHA6JykgPT09IDAgfHwgcGFydHNbMF0uaW5kZXhPZignaHR0cHM6JykgPT09IDApKSB7XG4gICAgICAgIGxyb290ID0gcGFydHNbMF07XG4gICAgICAgIHJlZiA9IHBhcnRzWzFdO1xuICAgICAgfVxuICAgICAgZWxzZSBpZihwYXJ0c1swXSAmJiBwYXJ0c1swXS5sZW5ndGggPiAwKSB7XG4gICAgICAgIC8vIHJlbGF0aXZlIGZpbGVcbiAgICAgICAgc3AgPSByb290LnNwbGl0KCcvJyk7XG4gICAgICAgIGxyb290ID0gJyc7XG4gICAgICAgIGZvcihpID0gMDsgaSA8IHNwLmxlbmd0aCAtIDE7IGkrKykge1xuICAgICAgICAgIGxyb290ICs9IHNwW2ldICsgJy8nO1xuICAgICAgICB9XG4gICAgICAgIGxyb290ICs9IHBhcnRzWzBdO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG5cbiAgICAgIH1cblxuICAgICAgbG9jYXRpb24gPSBwYXJ0c1sxXTtcbiAgICB9XG4gICAgZWxzZSBpZiAocmVmLmluZGV4T2YoJ2h0dHA6JykgPT09IDAgfHwgcmVmLmluZGV4T2YoJ2h0dHBzOicpID09PSAwKSB7XG4gICAgICBscm9vdCA9IHJlZjtcbiAgICAgIGxvY2F0aW9uID0gJyc7XG4gICAgfVxuICAgIG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IGluIG91dHB1dFtwYXJ0XSkge1xuICAgICAgICAgICAgICAgICAgb3V0cHV0W3BhcnRdW25hbWVdWyd4LXJlc29sdmVkLWZyb20nXSA9IHNvdXJjZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBpZihwYXJ0ID09PSAncHJvcGVydGllcycpIHtcbiAgICAgICAgICAgICAgICB2YXIgcHJvcGVydGllcyA9IGNvbXBvbmVudFtwYXJ0XTtcbiAgICAgICAgICAgICAgICBmb3IobmFtZSBpbiBwcm9wZXJ0aWVzKSB7XG4gICAgICAgICAgICAgICAgICBvdXRwdXQucHJvcGVydGllc1tuYW1lXSA9IF8uY2xvbmVEZWVwKHByb3BlcnRpZXNbbmFtZV0pO1xuICAgICAgICAgICAgICAgICAgdmFyIHJlc29sdmVkRnJvbSA9IHByb3BlcnRpZXNbbmFtZV1bJ3gtcmVzb2x2ZWQtZnJvbSddO1xuICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiByZXNvbHZlZEZyb20gPT09ICd1bmRlZmluZWQnIHx8IHJlc29sdmVkRnJvbSA9PT0gJ3NlbGYnKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmVkRnJvbSA9IHNvdXJjZTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIG91dHB1dC5wcm9wZXJ0aWVzW25hbWVdWyd4LXJlc29sdmVkLWZyb20nXSA9IHJlc29sdmVkRnJvbTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSBpZihwYXJ0ID09PSAncmVxdWlyZWQnKSB7XG4gICAgICAgICAgICAgICAgLy8gbWVyZ2UgJiBkZWR1cCB0aGUgcmVxdWlyZWQgYXJyYXlcbiAgICAgICAgICAgICAgICB2YXIgYSA9IG91dHB1dC5yZXF1aXJlZC5jb25jYXQoY29tcG9uZW50W3BhcnRdKTtcbiAgICAgICAgICAgICAgICBmb3IodmFyIGsgPSAwOyBrIDwgYS5sZW5ndGg7ICsraykge1xuICAgICAgICAgICAgICAgICAgZm9yKHZhciBqID0gayArIDE7IGogPCBhLmxlbmd0aDsgKytqKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmKGFba10gPT09IGFbal0pIHsgYS5zcGxpY2Uoai0tLCAxKTsgfVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBvdXRwdXQucmVxdWlyZWQgPSBhO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2UgaWYocGFydCA9PT0gJ3gtcmVzb2x2ZWQtZnJvbScpIHtcbiAgICAgICAgICAgICAgICBvdXRwdXRbJ3gtcmVzb2x2ZWQtZnJvbSddLnB1c2goc291cmNlKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBUT0RPOiBuZWVkIHRvIG1lcmdlIHRoaXMgcHJvcGVydHlcbiAgICAgICAgICAgICAgICAvLyBjb25zb2xlLmxvZygnd2hhdCB0byBkbyB3aXRoICcgKyBwYXJ0KVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIG9ialtrZXldID0gb3V0cHV0O1xuICAgICAgfVxuICAgIH1cbiAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIEhlbHBlcnMgPSByZXF1aXJlKCcuL2hlbHBlcnMnKTtcblxudmFyIF8gPSB7XG4gIGlzUGxhaW5PYmplY3Q6IHJlcXVpcmUoJ2xvZGFzaC1jb21wYXQvbGFuZy9pc1BsYWluT2JqZWN0JyksXG4gIGlzVW5kZWZpbmVkOiByZXF1aXJlKCdsb2Rhc2gtY29tcGF0L2xhbmcvaXNVbmRlZmluZWQnKSxcbiAgaXNBcnJheTog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Elzc3VlIDMzOSlcbiAgICAgICAgICAgIGlmICghXy5pc1VuZGVmaW5lZChjUHJvcGVydHkuJHJlZikpIHtcbiAgICAgICAgICAgICAgbW9kZWwgPSBtb2RlbHNbSGVscGVycy5zaW1wbGVSZWYoY1Byb3BlcnR5LiRyZWYpXTtcblxuICAgICAgICAgICAgICBpZiAoIV8uaXNVbmRlZmluZWQobW9kZWwpICYmIF8uaW5kZXhPZihbdW5kZWZpbmVkLCAnYXJyYXknLCAnb2JqZWN0J10sIG1vZGVsLmRlZmluaXRpb24udHlwZSkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgLy8gVXNlIHJlZmVyZW5jZWQgc2NoZW1hXG4gICAgICAgICAgICAgICAgY1Byb3BlcnR5ID0gSGVscGVycy5yZXNvbHZlU2NoZW1hKG1vZGVsLmRlZmluaXRpb24pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGh0bWwgKz0gcHJpbWl0aXZlVG9IVE1MKGNQcm9wZXJ0eSk7XG5cbiAgICAgICAgICAgIGlmKCFwcm9wZXJ0eUlzUmVxdWlyZWQpIHtcbiAgICAgICAgICAgICAgaHRtbCArPSAnLCA8c3BhbiBjbGFzcz1cInByb3BPcHRLZXlcIj5vcHRpb25hbDwvc3Bhbj4nO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZihwcm9wZXJ0eS5yZWFkT25seSkge1xuICAgICAgICAgICAgICAgIGh0bWwgKz0gJywgPHNwYW4gY2xhc3M9XCJwcm9wUmVhZE9ubHlcIj5yZWFkIG9ubHk8L3NwYW4+JztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaHRtbCArPSAnKSc7XG5cbiAgICAgICAgICAgIGlmICghXy5pc1VuZGVmaW5lZChwcm9wRGVzY3JpcHRpb24pKSB7XG4gICAgICAgICAgICAgIGh0bWwgKz0gJzogJyArICc8c3BhbiBjbGFzcz1cInByb3BEZXNjXCI+JyArIHByb3BEZXN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GlzdGluZ0F1dGhvcml6YXRpb25zICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgdmFyIHNjb3Blc09iamVjdDtcbiAgICAgIGZvcih2YXIga2V5IGluIGV4aXN0aW5nQXV0aG9yaXphdGlvbnMpIHtcbiAgICAgICAgb3BlcmF0aW9uLnNlY3VyaXR5ID0gb3BlcmF0aW9uLnNlY3VyaXR5IHx8IFtdO1xuICAgICAgICB2YXIgc2NvcGVzID0gZXhpc3RpbmdBdXRob3JpemF0aW9uc1trZXldO1xuICAgICAgICBpZihzY29wZXMpIHtcbiAgICAgICAgICB2YXIgc2VjdXJpdHlTY29wZXMgPSBbXTtcbiAgICAgICAgICBmb3IodmFyIGogaW4gc2NvcGVzKSB7XG4gICAgICAgICAgICBzZWN1cml0eVNjb3Blcy5wdXNoKHNjb3Blc1tqXS5zY29wZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNjb3Blc09iamVjdCA9IHt9O1xuICAgICAgICAgIHNjb3Blc09iamVjdFtrZXldID0gc2VjdXJpdHlTY29wZXM7XG4gICAgICAgICAgb3BlcmF0aW9uLnNlY3VyaXR5LnB1c2goc2NvcGVzT2JqZWN0KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBzY29wZXNPYmplY3QgPSB7fTtcbiAgICAgICAgICBzY29wZXNPYmplY3Rba2V5XSA9IFtdO1xuICAgICAgICAgIG9wZXJhdGlvbi5zZWN1cml0eS5wdXNoKHNjb3Blc09iamVjdCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZihleGlzdGluZ09wZXJhdGlvbi5jb25zdW1lcykge1xuICAgICAgb3BlcmF0aW9uLmNvbnN1bWVzID0gZXhpc3RpbmdPcGVyYXRpb24uY29uc3VtZXM7XG4gICAgfVxuICAgIGVsc2UgaWYoc3dhZ2dlci5jb25zdW1lcykge1xuICAgICAgb3BlcmF0aW9uLmNvbnN1bWVzID0gc3dhZ2dlci5jb25zdW1l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udChrZXkpICsgJz0nICsgbWFzayhlbmNvZGVVUklDb21wb25lbnQodmFsdWUpLCBwYXNzd29yZCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBib2R5ID0gZW5jb2RlZDtcbiAgfSBlbHNlIGlmIChpc011bHRpUGFydCkge1xuICAgIHZhciBib2R5UGFyYW07XG4gICAgaWYgKHR5cGVvZiBGb3JtRGF0YSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgYm9keVBhcmFtID0gbmV3IEZvcm1EYXRhKCk7XG5cbiAgICAgIGJvZHlQYXJhbS50eXBlID0gJ2Zvcm1EYXRhJztcblxuICAgICAgZm9yIChrZXkgaW4gZm9ybVBhcmFtcykge1xuICAgICAgICBwYXJhbSA9IGZvcm1QYXJhbXNba2V5XS5wYXJhbTtcbiAgICAgICAgdmFsdWUgPSBhcmdzW2tleV07XG5cbiAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICBpZih7fS50b1N0cmluZy5hcHBseSh2YWx1ZSkgPT09ICdbb2JqZWN0IEZpbGVdJykge1xuICAgICAgICAgICAgYm9keVBhcmFtLmFwcGVuZChrZXksIHZhbHVlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSBpZiAodmFsdWUudHlwZSA9PT0gJ2ZpbGUnICYmIHZhbHVlLnZhbHVlKSB7XG4gICAgICAgICAgICBib2R5UGFyYW0uYXBwZW5kKGtleSwgdmFsdWUudmFsdWUpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSh2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgaWYocGFyYW0uY29sbGVjdGlvbkZvcm1hdCA9PT0gJ211bHRpJykge1xuICAgICAgICAgICAgICAgIGJvZHlQYXJhbS5kZWxldGUoa2V5KTtcbiAgICAgICAgICAgICAgICBmb3IodmFyIHYgaW4gdmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgIGJvZHlQYXJhbS5hcHBlbmQoa2V5LCB2YWx1ZVt2XSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHlQYXJhbS5hcHBlbmQoa2V5LCB0aGlzLmVuY29kZVF1ZXJ5Q29sbGVjdGlvbihwYXJhbS5jb2xsZWN0aW9uRm9ybWF0LCBrZXksIHZhbHVlKS5zcGxpdCgnPScpLnNsaWNlKDEpLmpvaW4oJz0nKSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBib2R5UGFyYW0uYXBwZW5kKGtleSwgdmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgYm9keSA9IGJvZHlQYXJhbTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICBib2R5UGFyYW0gPSB7fTtcbiAgICAgIGZvciAoa2V5IGluIGZvcm1QYXJhbXMpIHtcbiAgICAgICAgdmFsdWUgPSBhcmdzW2tleV07XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KHZhbHVlKSkge1xuICAgICAgICAgIHZhciBkZWxpbWV0ZXI7XG4gICAgICAgICAgdmFyIGZvcm1hdCA9IHBhcmFtLmNvbGxlY3Rpb25Gb3JtYXQgfHwgJ211bHRpJztcbiAgICAgICAgICBpZihmb3JtYXQgPT09ICdzc3YnKSB7XG4gICAgICAgICAgICBkZWxpbWV0ZXIgPSAnICc7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2UgaWYoZm9ybWF0ID09PSAncGlwZXMnKSB7XG4gICAgICAgICAgICBkZWxpbWV0ZXIgPSAnfCc7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2UgaWYoZm9ybWF0ID09PSAndHN2Jykge1xuICAgICAgICAgICAgZGVsaW1ldGVyID0gJ1xcdCc7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2UgaWYoZm9ybWF0ID09PSAnbXVsdGknKSB7XG4gICAgICAgICAgICBib2R5UGFyYW1ba2V5XSA9IHZhbHVlO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZGVsaW1ldGVyID0gJywnO1xuICAgICAgICAgIH1cbiAgICAgICAgICB2YXIgZGF0YTtcbiAgICAgICAgICB2YWx1ZS5mb3JFYWNoKGZ1bmN0aW9uKHYpIHtcbiAgICAgICAgICAgIGlmKGRhdGEpIHtcbiAgICAgICAgICAgICAgZGF0YSArPSBkZWxpbWV0ZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgZGF0YSA9ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGF0YSArPSB2O1xuICAgICAgICAgIH0pO1xuICAgICAgICAgIGJvZHlQYXJhbVtrZXldID0gZGF0YTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBib2R5UGFyYW1ba2V5XSA9IHZhbHVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBib2R5ID0gYm9keVBhcmFtO1xuICAgIH1cbiAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdtdWx0aXBhcnQvZm9ybS1kYXRhJztcbiAgfVxuXG4gIHJldHVybiBib2R5O1xufTtcblxuLyoqXG4gKiBnZXRzIHNhbXBsZSByZXNwb25zZSBmb3IgYSBzaW5nbGUgb3BlcmF0aW9uXG4gKiovXG5PcGVyYXRpb24ucHJvdG90eXBlLmdldE1vZGVsU2FtcGxlSlNPTiA9IGZ1bmN0aW9uICh0eXBlLCBtb2RlbHMpIHtcbiAgdmFyIGxpc3RUeXBlLCBzYW1wbGVKc29uLCBpbm5lclR5cGU7XG4gIG1vZGVscyA9IG1vZGV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Jykge1xuICAgICAgICAgICAgICAgIGlmKHBhcmFtVmFsdWUubmFtZSkge1xuICAgICAgICAgICAgICAgICAgYm9keSArPSAnLUYgJyArIHBhcmFtZXRlci5uYW1lICsgJz1AXCInICsgcGFyYW1WYWx1ZS5uYW1lICsgJ1wiICc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHBhcmFtVmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICBpZihwYXJhbWV0ZXIuY29sbGVjdGlvbkZvcm1hdCA9PT0gJ211bHRpJykge1xuICAgICAgICAgICAgICAgICAgICBmb3IodmFyIHYgaW4gcGFyYW1WYWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgIGJvZHkgKz0gJy1GICcgKyB0aGlzLmVuY29kZVF1ZXJ5S2V5KHBhcmFtZXRlci5uYW1lKSArICc9JyArIG1hc2socGFyYW1WYWx1ZVt2XSwgcGFyYW1ldGVyLmZvcm1hdCkgKyAnICc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBib2R5ICs9ICctRiAnICsgdGhpcy5lbmNvZGVRdWVyeUNvbGxlY3Rpb24ocGFyYW1ldGVyLmNvbGxlY3Rpb25Gb3JtYXQsIHBhcmFtZXRlci5uYW1lLCBtYXNrKHBhcmFtVmFsdWUsIHBhcmFtZXRlci5mb3JtYXQpKSArICcgJztcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgYm9keSArPSAnLUYgJyArIHRoaXMuZW5jb2RlUXVlcnlLZXkocGFyYW1ldGVyLm5hbWUpICsgJz0nICsgbWFzayhwYXJhbVZhbHVlLCBwYXJhbWV0ZXIuZm9ybWF0KSArICcgJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmKCFib2R5KSB7XG4gICAgICAgIGJvZHkgPSBKU09OLnN0cmluZ2lmeShvYmouYm9keSk7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGJvZHkgPSBvYmouYm9keTtcbiAgICB9XG4gICAgLy8gZXNjYXBlIEAgPT4gJTQwLCAnID0+ICUyN1xuICAgIGJvZHkgPSBib2R5LnJlcGxhY2UoL1xcJy9nLCAnJTI3JykucmVwbGFjZSgvXFxuL2csICcgXFxcXCBcXG4gJyk7XG5cbiAgICBpZighaXNGb3JtRGF0YSkge1xuICAgICAgLy8gZXNjYXBlICYgPT4gJTI2XG4gICAgICBib2R5ID0gYm9keS5yZXBsYWNlKC8mL2csICclMjYnKTtcbiAgICB9XG4gICAgaWYoaXNNdWx0aXBhcnQpIHtcbiAgICAgIHJlc3VsdHMucHVzaChib2R5KTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICByZXN1bHRzLnB1c2goJy1kIFxcJycgKyBib2R5LnJlcGxhY2UoL0AvZywgJyU0MCcpICsgJ1xcJycpO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiAnY3VybCAnICsgKHJlc3VsdHMuam9pbignICcpKSArICcgXFwnJyArIG9iai51cmwgKyAnXFwnJztcbn07XG5cbk9wZXJhdGlvbi5wcm90b3R5cGUuZW5jb2RlUGF0aENvbGxlY3Rpb24gPSBmdW5jdGlvbiAodHlwZSwgbmFtZSwgdmFsdWUsIG1hc2tQYXNzd29yZHMpIHtcbiAgdmFyIGVuY29kZWQgPSAnJztcbiAgdmFyIGk7XG4gIHZhciBzZXBhcmF0b3IgPSAnJztcblxuICBpZiAodHlwZSA9PT0gJ3NzdicpIHtcbiAgICBzZXBhcmF0b3IgPSAnJTIwJztcbiAgfSBlbHNlIGlmICh0eXBlID09P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ICAgICAgICAgICB0aGlzLnBhcnNlKGNvb2tpZXN0ciwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3IENvb2tpZShjb29raWVzdHIsIHJlcXVlc3RfZG9tYWluLCByZXF1ZXN0X3BhdGgpO1xuICAgIH1cbiAgICBleHBvcnRzLkNvb2tpZSA9IENvb2tpZTtcblxuICAgIENvb2tpZS5wcm90b3R5cGUudG9TdHJpbmcgPSBmdW5jdGlvbiB0b1N0cmluZygpIHtcbiAgICAgICAgdmFyIHN0ciA9IFt0aGlzLm5hbWUgKyBcIj1cIiArIHRoaXMudmFsdWVdO1xuICAgICAgICBpZiAodGhpcy5leHBpcmF0aW9uX2RhdGUgIT09IEluZmluaXR5KSB7XG4gICAgICAgICAgICBzdHIucHVzaChcImV4cGlyZXM9XCIgKyAobmV3IERhdGUodGhpcy5leHBpcmF0aW9uX2RhdGUpKS50b0dNVFN0cmluZygpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5kb21haW4pIHtcbiAgICAgICAgICAgIHN0ci5wdXNoKFwiZG9tYWluPVwiICsgdGhpcy5kb21haW4pO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLnBhdGgpIHtcbiAgICAgICAgICAgIHN0ci5wdXNoKFwicGF0aD1cIiArIHRoaXMucGF0aCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMuc2VjdXJlKSB7XG4gICAgICAgICAgICBzdHIucHVzaChcInNlY3VyZVwiKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5ub3NjcmlwdCkge1xuICAgICAgICAgICAgc3RyLnB1c2goXCJodHRwb25seVwiKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3RyLmpvaW4oXCI7IFwiKTtcbiAgICB9O1xuXG4gICAgQ29va2llLnByb3Rv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1xuICAgICAgICAgICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgICAgICAgY2FzZSBcImh0dHBvbmx5XCI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubm9zY3JpcHQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFwiZXhwaXJlc1wiOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLmV4cGlyYXRpb25fZGF0ZSA9IHZhbHVlID9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBOdW1iZXIoRGF0ZS5wYXJzZSh2YWx1ZSkpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbmZpbml0eTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBcInBhdGhcIjpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRoID0gdmFsdWUgP1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLnRyaW0oKSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJcIjtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5leHBsaWNpdF9wYXRoID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBcImRvbWFpblwiOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRvbWFpbiA9IHZhbHVlID9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS50cmltKCkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiXCI7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZXhwbGljaXRfZG9tYWluID0gISF0aGlzLmRvbWFpbjtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBcInNlY3VyZVwiOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNlY3VyZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCF0aGlzLmV4cGxpY2l0X3BhdGgpIHtcbiAgICAgICAgICAgICAgIHRoaXMucGF0aCA9IHJlcXVlc3RfcGF0aCB8fCBcIi9cIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghdGhpcy5leHBsaWNpdF9kb21haW4pIHtcbiAgICAgICAgICAgICAgIHRoaXMuZG9tYWluID0gcmVxdWVzdF9kb21haW47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXcgQ29va2llKCkucGFyc2Uoc3RyLCByZXF1ZXN0X2RvbWFpbiwgcmVxdWVzdF9wYXRoKTtcbiAgICB9O1xuXG4gICAgQ29va2llLnByb3RvdHlwZS5tYXRjaGVzID0gZnVuY3Rpb24gbWF0Y2hlcyhhY2Nlc3NfaW5mbykge1xuICAgICAgICBpZiAodGhpcy5ub3NjcmlwdCAmJiBhY2Nlc3NfaW5mby5zY3JpcHQgfHxcbiAgICAgICAgICAgICAgICB0aGlzLnNlY3VyZSAmJiAhYWNjZXNzX2luZm8uc2VjdXJlIHx8XG4gICAgICAgICAgICAgICAgIXRoaXMuY29sbGlkZXNXaXRoKGFjY2Vzc19pbmZvKSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH07XG5cbiAgICBDb29raWUucHJvdG90eXBlLmNvbGxpZGVzV2l0aCA9IGZ1bmN0aW9uIGNvbGxpZGVzV2l0aChhY2Nlc3NfaW5mbykge1xuICAgICAgICBpZiAoKHRoaXMucGF0aCAmJiAhYWNjZXNzX2luZm8ucGF0aCkgfHwgKHRoaXMuZG9tYWluICYmICFhY2Nlc3NfaW5mby5kb21haW4pKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMucGF0aCAmJiBhY2Nlc3NfaW5mby5wYXRoLmluZGV4T2YodGhpcy5wYXRoKSAhPT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLmV4cGxpY2l0X3BhdGggJiYgYWNjZXNzX2luZm8ucGF0aC5pbmRleE9mKCB0aGlzLnBhdGggKSAhPT0gMCkge1xuICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGFjY2Vzc19kb21haW4gPSBhY2Nlc3NfaW5mby5kb21haW4gJiYgYWNjZXNzX2luZm8uZG9tYWluLnJlcGxhY2UoL15bXFwuXS8sJycpO1xuICAgICAgICB2YXIgY29va2llX2RvbWFpbiA9IHRoaXMuZG9tYWluICYmIHRoaXMuZG9tYWluLnJlcGxhY2UoL15bXFwuXS8sJycpO1xuICAgICAgICBpZiAoY29va2llX2RvbWFpbiA9PT0gYWNjZXNzX2RvbWFpbikge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvb2tpZV9kb21haW4pIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5leHBsaWNpdF9kb21haW4pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7IC8vIHdlIGFscmVhZHkgY2hlY2tlZCBpZiB0aGUgZG9tYWlucyB3ZXJlIGV4YWN0bHkgdGhlIHNhbWVcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciB3aWxkY2FyZCA9IGFjY2Vzc19kb21haW4uaW5kZXhPZihjb29raWVfZG9tYWluKTtcbiAgICAgICAgICAgIGlmICh3aWxkY2FyZCA9PT0gLTEgfHwgd2lsZGNhcmQgIT09IGFjY2Vzc19kb21haW4ubGVuZ3RoIC0gY29va2llX2RvbWFpbi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gQ29va2llSmFyKCkge1xuICAgICAgICB2YXIgY29va2llcywgY29va2llc19saXN0LCBjb2xsaWRhYmxlX2Nvb2tpZTtcbiAgICAgICAgaWYgKHRoaXMgaW5zdGFuY2VvZiBDb29raWVKYXIpIHtcbiAgICAgICAgICAgIGNvb2tpZXMgPSBPYmplY3QuY3JlYXRlKG51bGwpOyAvL25hbWU6IFtDb29raWVdXG5cbiAgICAgICAgICAgIHRoaXMuc2V0Q29va2llID0gZnVuY3Rpb24gc2V0Q29va2llKGNvb2tpZSwgcmVxdWVzdF9kb21haW4sIHJlcXVlc3RfcGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciByZW1vdmUsIGk7XG4gICAgICAgICAgICAgICAgY29va2llID0gbmV3IENvb2tpZShjb29raWUsIHJlcXVlc3RfZG9tYWluLCByZXF1ZXN0X3BhdGgpO1xuICAgICAgICAgICAgICAgIC8vRGVsZXRlIHRoZSBjb29raWUgaWYgdGhlIHNldCBpcyBwYXN0IHRoZSBjdXJyZW50IHRpbWVcbiAgICAgICAgICAgICAgICByZW1vdmUgPSBjb29raWUuZXhwaXJhdGlvbl9kYXRlIDw9IERhdGUubm93KCk7XG4gICAgICAgICAgICAgICAgaWYgKGNvb2tpZXNbY29va2llLm5hbWVdICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29va2llc19saXN0ID0gY29va2llc1tjb29raWUubmFtZV07XG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb29raWVzX2xpc3QubGVuZ3RoOyBpICs9IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbGxpZGFibGVfY29va2llID0gY29va2llc19saXN0W2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbGxpZGFibGVfY29va2llLmNvbGxpZGVzV2l0aChjb29raWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlbW92ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29raWVzX2xpc3Quc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29va2llc19saXN0Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvb2tpZXNbY29va2llLm5hbWVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2llc19saXN0W2ldID0gY29va2llO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb29raWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlbW92ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvb2tpZXNfbGlzdC5wdXNoKGNvb2tpZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjb29raWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChyZW1vdmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb29raWVzW2Nvb2tpZS5uYW1lXSA9IFtjb29raWVdO1xuICAgICAgICAgICAgICAgIHJldHVybiBjb29raWVzW2Nvb2tpZS5uYW1lXTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICAvL3JldHVybnMgYSBjb29raWVcbiAgICAgICAgICAgIHRoaXMuZ2V0Q29va2llID0gZnVuY3Rpb24gZ2V0Q29va2llKGNvb2tpZV9uYW1lLCBhY2Nlc3NfaW5mbykge1xuICAgICAgICAgICAgICAgIHZhciBjb29raWUsIGk7XG4gICAgICAgICAgICAgICAgY29va2llc19saXN0ID0gY29va2llc1tjb29raWVfbmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKCFjb29raWVzX2xpc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29va2llc19saXN0Lmxlbmd0aDsgaSArPSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvb2tpZSA9IGNvb2tpZXNfbGlzdFtpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZS5leHBpcmF0aW9uX2RhdGUgPD0gRGF0ZS5ub3coKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZXNfbGlzdC5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29va2llc1tjb29raWUubmFtZV07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChjb29raWUubWF0Y2hlcyhhY2Nlc3NfaW5mbykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb29raWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgLy9yZXR1cm5zIGEgbGlzdCBvZiBjb29raWVzXG4gICAgICAgICAgICB0aGlzLmdldENvb2tpZXMgPSBmdW5jdGlvbiBnZXRDb29raWVzKGFjY2Vzc19pbmZvKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1hdGNoZXMgPSBbXSwgY29va2llX25hbWUsIGNvb2tpZTtcbiAgICAgICAgICAgICAgICBmb3IgKGNvb2tpZV9uYW1lIGluIGNvb2tpZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgY29va2llID0gdGhpcy5nZXRDb29raWUoY29va2llX25hbWUsIGFjY2Vzc19pbmZvKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hlcy5wdXNoKGNvb2tpZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbWF0Y2hlcy50b1N0cmluZyA9IGZ1bmN0aW9uIHRvU3RyaW5nKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2hlcy5qb2luKFwiOlwiKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIG1hdGNoZXMudG9WYWx1ZVN0cmluZyA9IGZ1bmN0aW9uIHRvVmFsdWVTdHJpbmcoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaGVzLm1hcChmdW5jdGlvbiAoYykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGMudG9WYWx1ZVN0cmluZygpO1xuICAgICAgICAgICAgICAgICAgICB9KS5qb2luKCc7Jyk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2hlcztcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXcgQ29va2llSmFyKCk7XG4gICAgfVxuICAgIGV4cG9ydHMuQ29va2llSmFyID0gQ29va2llSmFyO1xuXG4gICA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9zY2hlbWEvZGVmYXVsdF9zYWZlJyk7XG5cbnZhciBfdG9TdHJpbmcgICAgICAgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO1xudmFyIF9oYXNPd25Qcm9wZXJ0eSA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBDSEFSX1RBQiAgICAgICAgICAgICAgICAgID0gMHgwOTsgLyogVGFiICovXG52YXIgQ0hBUl9MSU5FX0ZFRUQgICAgICAgICAgICA9IDB4MEE7IC8qIExGICovXG52YXIgQ0hBUl9TUEFDRSAgICAgICAgICAgICAgICA9IDB4MjA7IC8qIFNwYWNlICovXG52YXIgQ0hBUl9FWENMQU1BVElPTiAgICAgICAgICA9IDB4MjE7IC8qICEgKi9cbnZhciBDSEFSX0RPVUJMRV9RVU9URSAgICAgICAgID0gMHgyMjsgLyogXCIgKi9cbnZhciBDSEFSX1NIQVJQICAgICAgICAgICAgICAgID0gMHgyMzsgLyogIyAqL1xudmFyIENIQVJfUEVSQ0VOVCAgICAgICAgICAgICAgPSAweDI1OyAvKiAlICovXG52YXIgQ0hBUl9BTVBFUlNBTkQgICAgICAgICAgICA9IDB4MjY7IC8qICYgKi9cbnZhciBDSEFSX1NJTkdMRV9RVU9URSAgICAgICAgID0gMHgyNzsgLyogJyAqL1xudmFyIENIQVJfQVNURVJJU0sgICAgICAgICAgICAgPSAweDJBOyAvKiAqICovXG52YXIgQ0hBUl9DT01NQSAgICAgICAgICAgICAgICA9IDB4MkM7IC8qICwgKi9cbnZhciBDSEFSX01JTlVTICAgICAgICAgICAgICAgID0gMHgyRDsgLyogLSAqL1xudmFyIENIQVJfQ09MT04gICAgICAgICAgICAgICAgPSAweDNBOyAvKiA6ICovXG52YXIgQ0hBUl9HUkVBVEVSX1RIQU4gICAgICAgICA9IDB4M0U7IC8qID4gKi9cbnZhciBDSEFSX1FVRVNUSU9OICAgICAgICAgICAgID0gMHgzRjsgLyogPyAqL1xudmFyIENIQVJfQ09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IGMgLSAweDMwO1xuICB9XG5cbiAgcmV0dXJuIC0xO1xufVxuXG5mdW5jdGlvbiBzaW1wbGVFc2NhcGVTZXF1ZW5jZShjKSB7XG4gIHJldHVybiAoYyA9PT0gMHgzMC8qIDAgKi8pID8gJ1xceDAwJyA6XG4gICAgICAgIChjID09PSAweDYxLyogYSAqLykgPyAnXFx4MDcnIDpcbiAgICAgICAgKGMgPT09IDB4NjIvKiBiICovKSA/ICdcXHgwOCcgOlxuICAgICAgICAoYyA9PT0gMHg3NC8qIHQgKi8pID8gJ1xceDA5JyA6XG4gICAgICAgIChjID09PSAweDA5LyogVGFiICovKSA/ICdcXHgwOScgOlxuICAgICAgICAoYyA9PT0gMHg2RS8qIG4gKi8pID8gJ1xceDBBJyA6XG4gICAgICAgIChjID09PSAweDc2LyogdiAqLykgPyAnXFx4MEInIDpcbiAgICAgICAgKGMgPT09IDB4NjYvKiBmICovKSA/ICdcXHgwQycgOlxuICAgICAgICAoYyA9PT0gMHg3Mi8qIHIgKi8pID8gJ1xceDBEJyA6XG4gICAgICAgIChjID09PSAweDY1LyogZSAqLykgPyAnXFx4MUInIDpcbiAgICAgICAgKGMgPT09IDB4MjAvKiBTcGFjZSAqLykgPyAnICcgOlxuICAgICAgICAoYyA9PT0gMHgyMi8qIFwiICovKSA/ICdcXHgyMicgOlxuICAgICAgICAoYyA9PT0gMHgyRi8qIC8gKi8pID8gJy8nIDpcbiAgICAgICAgKGMgPT09IDB4NUMvKiBcXCAqLykgPyAnXFx4NUMnIDpcbiAgICAgICAgKGMgPT09IDB4NEUvKiBOICovKSA/ICdcXHg4NScgOlxuICAgICAgICAoYyA9PT0gMHg1Ri8qIF8gKi8pID8gJ1xceEEwJyA6XG4gICAgICAgIChjID09PSAweDRDLyogTCAqLykgPyAnXFx1MjAyOCcgOlxuICAgICAgICAoYyA9PT0gMHg1MC8qIFAgKi8pID8gJ1xcdTIwMjknIDogJyc7XG59XG5cbmZ1bmN0aW9uIGNoYXJGcm9tQ29kZ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XX0lORElDQVRPUihjaCkgfHxcbiAgICAgIGNoID09PSAweDIzLyogIyAqLyAgICB8fFxuICAgICAgY2ggPT09IDB4MjYvKiAmICovICAgIHx8XG4gICAgICBjaCA9PT0gMHgyQS8qICogKi8gICAgfHxcbiAgICAgIGNoID09PSAweDIxLyogISAqLyAgICB8fFxuICAgICAgY2ggPT09IDB4N0MvKiB8ICovICAgIHx8XG4gICAgICBjaCA9PT0gMHgzRS8qID4gKi8gICAgfHxcbiAgICAgIGNoID09PSAweDI3LyogJyAqLyAgICB8fFxuICAgICAgY2ggPT09IDB4MjIvKiBcIiAqLyAgICB8fFxuICAgICAgY2ggPT09IDB4MjUvKiAlICovICAgIHx8XG4gICAgICBjaCA9PT0gMHg0MC8qIEAgKi8gICAgfHxcbiAgICAgIGNoID09PSAweDYwLyogYCAqLykge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIGlmIChjaCA9PT0gMHgzRi8qID8gKi8gfHwgY2ggPT09IDB4MkQvKiAtICovKSB7XG4gICAgZm9sbG93aW5nID0gc3RhdGUuaW5wdXQuY2hhckNvZGVBdChzdGF0ZS5wb3NpdGlvbiArIDEpO1xuXG4gICAgaWYgKGlzX1dTX09SX0VPTChmb2xsb3dpbmcpIHx8XG4gICAgICAgIHdpdGhpbkZsb3dDb2xsZWN0aW9uICYmIGlzX0ZMT1dfSU5ESUNBVE9SKGZvbGxvd2luZykpIHtcbiAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG4gIH1cblxuICBzdGF0ZS5raW5kID0gJ3NjYWxhcic7XG4gIHN0YXRlLnJlc3VsdCA9ICcnO1xuICBjYXB0dXJlU3RhcnQgPSBjYXB0dXJlRW5kID0gc3RhdGUucG9zaXRpb247XG4gIGhhc1BlbmRpbmdDb250ZW50ID0gZmFsc2U7XG5cbiAgd2hpbGUgKGNoICE9PSAwKSB7XG4gICAgaWYgKGNoID09PSAweDNBLyogOiAqLykge1xuICAgICAgZm9sbG93aW5nID0gc3RhdGU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4gIGlmIChjaCA9PT0gJy0nIHx8IGNoID09PSAnKycpIHtcbiAgICBjaCA9IGRhdGFbKytpbmRleF07XG4gIH1cblxuICBpZiAoY2ggPT09ICcwJykge1xuICAgIC8vIDBcbiAgICBpZiAoaW5kZXggKyAxID09PSBtYXgpIHJldHVybiB0cnVlO1xuICAgIGNoID0gZGF0YVsrK2luZGV4XTtcblxuICAgIC8vIGJhc2UgMiwgYmFzZSA4LCBiYXNlIDE2XG5cbiAgICBpZiAoY2ggPT09ICdiJykge1xuICAgICAgLy8gYmFzZSAyXG4gICAgICBpbmRleCsrO1xuXG4gICAgICBmb3IgKDsgaW5kZXggPCBtYXg7IGluZGV4KyspIHtcbiAgICAgICAgY2ggPSBkYXRhW2luZGV4XTtcbiAgICAgICAgaWYgKGNoID09PSAnXycpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoY2ggIT09ICcwJyAmJiBjaCAhPT0gJzEnKSByZXR1cm4gZmFsc2U7XG4gICAgICAgIGhhc0RpZ2l0cyA9IHRydWU7XG4gICAgICB9XG4gICAgICByZXR1cm4gaGFzRGlnaXRzO1xuICAgIH1cblxuXG4gICAgaWYgKGNoID09PSAneCcpIHtcbiAgICAgIC8vIGJhc2UgMTZcbiAgICAgIGluZGV4Kys7XG5cbiAgICAgIGZvciAoOyBpbmRleCA8IG1heDsgaW5kZXgrKykge1xuICAgICAgICBjaCA9IGRhdGFbaW5kZXhdO1xuICAgICAgICBpZiAoY2ggPT09ICdfJykgY29udGludWU7XG4gICAgICAgIGlmICghaXNIZXhDb2RlKGRhdGEuY2hhckNvZGVBdChpbmRleCkpKSByZXR1cm4gZmFsc2U7XG4gICAgICAgIGhhc0RpZ2l0cyA9IHRydWU7XG4gICAgICB9XG4gICAgICByZXR1cm4gaGFzRGlnaXRzO1xuICAgIH1cblxuICAgIC8vIGJhc2UgOFxuICAgIGZvciAoOyBpbmRleCA8IG1heDsgaW5kZXgrKykge1xuICAgICAgY2ggPSBkYXRhW2luZGV4XTtcbiA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iJ3VzZSBzdHJpY3QnO1xuXG52YXIgVHlwZSA9IHJlcXVpcmUoJy4uL3R5cGUnKTtcblxudmFyIFlBTUxfREFURV9SRUdFWFAgPSBuZXcgUmVnRXhwKFxuICAnXihbMC05XVswLTldWzAtOV1bMC05XSknICAgICAgICAgICsgLy8gWzFdIHllYXJcbiAgJy0oWzAtOV1bMC05XSknICAgICAgICAgICAgICAgICAgICArIC8vIFsyXSBtb250aFxuICAnLShbMC05XVswLTldKSQnKTsgICAgICAgICAgICAgICAgICAgLy8gWzNdIGRheVxuXG52YXIgWUFNTF9USU1FU1RBTVBfUkVHRVhQID0gbmV3IFJlZ0V4cChcbiAgJ14oWzAtOV1bMC05XVswLTldWzAtOV0pJyAgICAgICAgICArIC8vIFsxXSB5ZWFyXG4gICctKFswLTldWzAtOV0/KScgICAgICAgICAgICAgICAgICAgKyAvLyBbMl0gbW9udGhcbiAgJy0oWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICArIC8vIFszXSBkYXlcbiAgJyg/OltUdF18WyBcXFxcdF0rKScgICAgICAgICAgICAgICAgICsgLy8gLi4uXG4gICcoWzAtOV1bMC05XT8pJyAgICAgICAgICAgICAgICAgICAgKyAvLyBbNF0gaG91clxuICAnOihbMC05XVswLTldKScgICAgICAgICAgICAgICAgICAgICsgLy8gWzVdIG1pbnV0ZVxuICAnOihbMC05XVswLTldKScgICAgICAgICAgICAgICAgICAgICsgLy8gWzZdIHNlY29uZFxuICAnKD86XFxcXC4oWzAtOV0qKSk/JyAgICAgICAgICAgICAgICAgKyAvLyBbN10gZnJhY3Rpb25cbiAgJyg/OlsgXFxcXHRdKihafChbLStdKShbMC05XVswLTldPyknICsgLy8gWzhdIHR6IFs5XSB0el9zaWduIFsxMF0gdHpfaG91clxuICAnKD86OihbMC05XVswLTldKSk/KSk/JCcpOyAgICAgICAgICAgLy8gWzExXSB0el9taW51dGVcblxuZnVuY3Rpb24gcmVzb2x2ZVlhbWxUaW1lc3RhbXAoZGF0Y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KHNraXBQcm90byAmJiBrZXkgPT0gJ3Byb3RvdHlwZScpICYmXG4gICAgICAgICEoc2tpcEVycm9yUHJvcHMgJiYgKGtleSA9PSAnbWVzc2FnZScgfHwga2V5ID09ICduYW1lJykpICYmXG4gICAgICAgICEoc2tpcEluZGV4ZXMgJiYgaXNJbmRleChrZXksIGxlbmd0aCkpICYmXG4gICAgICAgICEoa2V5ID09ICdjb25zdHJ1Y3RvcicgJiYgKGlzUHJvdG8gfHwgIWhhc093blByb3BlcnR5LmNhbGwob2JqZWN0LCBrZXkpKSkpIHtcbiAgICAgIHJlc3VsdC5wdXNoKGtleSk7XG4gICAgfVxuICB9XG4gIGlmIChzdXBwb3J0Lm5vbkVudW1TaGFkb3dzICYmIG9iamVjdCAhPT0gb2JqZWN0UHJvdG8pIHtcbiAgICB2YXIgdGFnID0gb2JqZWN0ID09PSBzdHJpbmdQcm90byA/IHN0cmluZ1RhZyA6IChvYmplY3QgPT09IGVycm9yUHJvdG8gPyBlcnJvclRhZyA6IG9ialRvU3RyaW5nLmNhbGwob2JqZWN0KSksXG4gICAgICAgIG5vbkVudW1zID0gbm9uRW51bVByb3BzW3RhZ10gfHwgbm9uRW51bVByb3BzW29iamVjdFRhZ107XG5cbiAgICBpZiAodGFnID09IG9iamVjdFRhZykge1xuICAgICAgcHJvdG8gPSBvYmplY3RQcm90bztcbiAgICB9XG4gICAgbGVuZ3RoID0gc2hhZG93UHJvcHMubGVuZ3RoO1xuICAgIHdoaWxlIChsZW5ndGgtLSkge1xuICAgICAga2V5ID0gc2hhZG93UHJvcHNbbGVuZ3RoXTtcbiAgICAgIHZhciBub25FbnVtID0gbm9uRW51bXNba2V5XTtcbiAgICAgIGlmICghKGlzUHJvdG8gJiYgbm9uRW51bSkgJiZcbiAgICAgICAgICAobm9uRW51bSA/IGhhc093blByb3BlcnR5LmNhbGwob2JqZWN0LCBrZXkpIDogb2JqZWN0W2tleV0gIT09IHByb3RvW2tleV0pKSB7XG4gICAgICAgIHJlc3V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4gICAgICAgIHZhciB0YXNrLCBkb21haW47XG5cbiAgICAgICAgd2hpbGUgKGhlYWQubmV4dCkge1xuICAgICAgICAgICAgaGVhZCA9IGhlYWQubmV4dDtcbiAgICAgICAgICAgIHRhc2sgPSBoZWFkLnRhc2s7XG4gICAgICAgICAgICBoZWFkLnRhc2sgPSB2b2lkIDA7XG4gICAgICAgICAgICBkb21haW4gPSBoZWFkLmRvbWFpbjtcblxuICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICAgIGhlYWQuZG9tYWluID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgIGRvbWFpbi5lbnRlcigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcnVuU2luZ2xlKHRhc2ssIGRvbWFpbik7XG5cbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAobGF0ZXJRdWV1ZS5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRhc2sgPSBsYXRlclF1ZXVlLnBvcCgpO1xuICAgICAgICAgICAgcnVuU2luZ2xlKHRhc2spO1xuICAgICAgICB9XG4gICAgICAgIGZsdXNoaW5nID0gZmFsc2U7XG4gICAgfVxuICAgIC8vIHJ1bnMgYSBzaW5nbGUgZnVuY3Rpb24gaW4gdGhlIGFzeW5jIHF1ZXVlXG4gICAgZnVuY3Rpb24gcnVuU2luZ2xlKHRhc2ssIGRvbWFpbikge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGFzaygpO1xuXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIGlmIChpc05vZGVKUykge1xuICAgICAgICAgICAgICAgIC8vIEluIG5vZGUsIHVuY2F1Z2h0IGV4Y2VwdGlvbnMgYXJlIGNvbnNpZGVyZWQgZmF0YWwgZXJyb3JzLlxuICAgICAgICAgICAgICAgIC8vIFJlLXRocm93IHRoZW0gc3luY2hyb25vdXNseSB0byBpbnRlcnJ1cHQgZmx1c2hpbmchXG5cbiAgICAgICAgICAgICAgICAvLyBFbnN1cmUgY29udGludWF0aW9uIGlmIHRoZSB1bmNhdWdodCBleGNlcHRpb24gaXMgc3VwcHJlc3NlZFxuICAgICAgICAgICAgICAgIC8vIGxpc3RlbmluZyBcInVuY2F1Z2h0RXhjZXB0aW9uXCIgZXZlbnRzIChhcyBkb21haW5zIGRvZXMpLlxuICAgICAgICAgICAgICAgIC8vIENvbnRpbnVlIGluIG5leHQgZXZlbnQgdG8gYXZvaWQgdGljayByZWN1cnNpb24uXG4gICAgICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICAgICAgICBkb21haW4uZXhpdCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZsdXNoLCAwKTtcbiAgICAgICAgICAgICAgICBpZiAoZG9tYWluKSB7XG4gICAgICAgICAgICAgICAgICAgIGRvbWFpbi5lbnRlcigpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRocm93IGU7XG5cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gSW4gYnJvd3NlcnMsIHVuY2F1Z2h0IGV4Y2VwdGlvbnMgYXJlIG5vdCBmYXRhbC5cbiAgICAgICAgICAgICAgICAvLyBSZS10aHJvdyB0aGVtIGFzeW5jaHJvbm91c2x5IHRvIGF2b2lkIHNsb3ctZG93bnMuXG4gICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgICAgICAgICAgfSwgMCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZG9tYWluKSB7XG4gICAgICAgICAgICBkb21haW4uZXhpdCgpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgbmV4dFRpY2sgPSBmdW5jdGlvbiAodGFzaykge1xuICAgICAgICB0YWlsID0gdGFpbC5uZXh0ID0ge1xuICAgICAgICAg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ICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCsraW5kZXggPj0gbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IHdoaWxlICgxKTtcbiAgICAgICAgfVxuICAgICAgICAvLyByZWR1Y2VcbiAgICAgICAgZm9yICg7IGluZGV4IDwgbGVuZ3RoOyBpbmRleCsrKSB7XG4gICAgICAgICAgICAvLyBhY2NvdW50IGZvciB0aGUgcG9zc2liaWxpdHkgdGhhdCB0aGUgYXJyYXkgaXMgc3BhcnNlXG4gICAgICAgICAgICBpZiAoaW5kZXggaW4gdGhpcykge1xuICAgICAgICAgICAgICAgIGJhc2lzID0gY2FsbGJhY2soYmFzaXMsIHRoaXNbaW5kZXhdLCBpbmRleCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGJhc2lzO1xuICAgIH1cbik7XG5cbnZhciBhcnJheV9pbmRleE9mID0gdW5jdXJyeVRoaXMoXG4gICAgQXJyYXkucHJvdG90eXBlLmluZGV4T2YgfHwgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIC8vIG5vdCBhIHZlcnkgZ29vZCBzaGltLCBidXQgZ29vZCBlbm91Z2ggZm9yIG91ciBvbmUgdXNlIG9mIGl0XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKHRoaXNbaV0gPT09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIC0xO1xuICAgIH1cbik7XG5cbnZhciBhcnJheV9tYXAgPSB1bmN1cnJ5VGhpcyhcbiAgICBBcnJheS5wcm90b3R5cGUubWFwIH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yk7XG4gICAgICAgICAgICBpZiAob3AgPT09IFwid2hlblwiICYmIG9wZXJhbmRzWzFdKSB7IC8vIHByb2dyZXNzIG9wZXJhbmRcbiAgICAgICAgICAgICAgICBwcm9ncmVzc0xpc3RlbmVycy5wdXNoKG9wZXJhbmRzWzFdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIFEubmV4dFRpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJlc29sdmVkUHJvbWlzZS5wcm9taXNlRGlzcGF0Y2guYXBwbHkocmVzb2x2ZWRQcm9taXNlLCBhcmdzKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIC8vIFhYWCBkZXByZWNhdGVkXG4gICAgcHJvbWlzZS52YWx1ZU9mID0gZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAobWVzc2FnZXMpIHtcbiAgICAgICAgICAgIHJldHVybiBwcm9taXNlO1xuICAgICAgICB9XG4gICAgICAgIHZhciBuZWFyZXJWYWx1ZSA9IG5lYXJlcihyZXNvbHZlZFByb21pc2UpO1xuICAgICAgICBpZiAoaXNQcm9taXNlKG5lYXJlclZhbHVlKSkge1xuICAgICAgICAgICAgcmVzb2x2ZWRQcm9taXNlID0gbmVhcmVyVmFsdWU7IC8vIHNob3J0ZW4gY2hhaW5cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmVhcmVyVmFsdWU7XG4gICAgfTtcblxuICAgIHByb21pc2UuaW5zcGVjdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKCFyZXNvbHZlZFByb21pc2UpIHtcbiAgICAgICAgICAgIHJldHVybiB7IHN0YXRlOiBcInBlbmRpbmdcIiB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNvbHZlZFByb21pc2UuaW5zcGVjdCgpO1xuICAgIH07XG5cbiAgICBpZiAoUS5sb25nU3RhY2tTdXBwb3J0ICYmI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gUHJvbWlzZTtcbmZ1bmN0aW9uIFByb21pc2UoZGVzY3JpcHRvciwgZmFsbGJhY2ssIGluc3BlY3QpIHtcbiAgICBpZiAoZmFsbGJhY2sgPT09IHZvaWQgMCkge1xuICAgICAgICBmYWxsYmFjayA9IGZ1bmN0aW9uIChvcCkge1xuICAgICAgICAgICAgcmV0dXJuIHJlamVjdChuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgXCJQcm9taXNlIGRvZXMgbm90IHN1cHBvcnQgb3BlcmF0aW9uOiBcIiArIG9wXG4gICAgICAgICAgICApKTtcbiAgICAgICAgfTtcbiAgICB9XG4gICAgaWYgKGluc3BlY3QgPT09IHZvaWQgMCkge1xuICAgICAgICBpbnNwZWN0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHtzdGF0ZTogXCJ1bmtub3duXCJ9O1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIHZhciBwcm9taXNlID0gb2JqZWN0X2NyZWF0ZShQcm9taXNlLnByb3RvdHlwZSk7XG5cbiAgICBwcm9taXNlLnByb21pc2VEaXNwYXRjaCA9IGZ1bmN0aW9uIChyZXNvbHZlLCBvcCwgYXJncykge1xuICAgICAgICB2YXIgcmVzdWx0O1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgaWYgKGRlc2NyaXB0b3Jbb3BdKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZGVzY3JpcHRvcltvcF0uYXBwbHkocHJvbWlzZSwgYXJncyk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGZhbGxiYWNrLmNhbGwocHJvbWlzZSwgb3AsIGFyZ3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChleGNlcHRpb24pIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHJlamVjdChleGNlcHRpb24pO1xuICAgICAgICB9XG4gICAgICAgIGlmIChyZXNvbHZlKSB7XG4gICAgIC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leHRUaWNrKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgc2VsZi5wcm9taXNlRGlzcGF0Y2goZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICBpZiAoZG9uZSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xuXG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKF9mdWxmaWxsZWQodmFsdWUpKTtcbiAgICAgICAgfSwgXCJ3aGVuXCIsIFtmdW5jdGlvbiAoZXhjZXB0aW9uKSB7XG4gICAgICAgICAgICBpZiAoZG9uZSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xuXG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKF9yZWplY3RlZChleGNlcHRpb24pKTtcbiAgICAgICAgfV0pO1xuICAgIH0pO1xuXG4gICAgLy8gUHJvZ3Jlc3MgcHJvcGFnYXRvciBuZWVkIHRvIGJlIGF0dGFjaGVkIGluIHRoZSBjdXJyZW50IHRpY2suXG4gICAgc2VsZi5wcm9taXNlRGlzcGF0Y2godm9pZCAwLCBcIndoZW5cIiwgW3ZvaWQgMCwgZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIHZhciBuZXdWYWx1ZTtcbiAgICAgICAgdmFyIHRocmV3ID0gZmFsc2U7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBuZXdWYWx1ZSA9IF9wcm9ncmVzc2VkKHZhbHVlKTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgdGhyZXcgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKFEub25lcnJvcikge1xuICAgICAgICAgICAgICAgIFEub25lcnJvcihlKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAg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gIHJldHVybiBQcm9taXNlKHtcbiAgICAgICAgXCJ3aGVuXCI6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgfSxcbiAgICAgICAgXCJnZXRcIjogZnVuY3Rpb24gKG5hbWUpIHtcbiAgICAgICAgICAgIHJldHVybiB2YWx1ZVtuYW1lXTtcbiAgICAgICAgfSxcbiAgICAgICAgXCJzZXRcIjogZnVuY3Rpb24gKG5hbWUsIHJocykge1xuICAgICAgICAgICAgdmFsdWVbbmFtZV0gPSByaHM7XG4gICAgICAgIH0sXG4gICAgICAgIFwiZGVsZXRlXCI6IGZ1bmN0aW9uIChuYW1lKSB7XG4gICAgICAgICAgICBkZWxldGUgdmFsdWVbbmFtZV07XG4gICAgICAgIH0sXG4gICAgICAgIFwicG9zdFwiOiBmdW5jdGlvbiAobmFtZSwgYXJncykge1xuICAgICAgICAgICAgLy8gTWFyayBNaWxsZXIgcHJvcG9zZXMgdGhhdCBwb3N0IHdpdGggbm8gbmFtZSBzaG91bGQgYXBwbHkgYVxuICAgICAgICAgICAgLy8gcHJvbWlzZWQgZnVuY3Rpb24uXG4gICAgICAgICAgICBpZiAobmFtZSA9PT0gbnVsbCB8fCBuYW1lID09PSB2b2lkIDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWUuYXBwbHkodm9pZCAwLCBhcmdzKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlW25hbWVdLmFwcGx5KHZhbHVlLCBhcmdzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJhcHBseVwiOiBmdW5jdGlvbiAodGhpc3AsIGFyZ3MpIHtcbiAgICAgICAgICAgIHJldHVybiB2YWx1ZS5hcHBseSh0aGlzcCwgYXJncyk7XG4gICAgICAgIH0sXG4gICAgICAgIFwia2V5c1wiOiBmdW5jdGlvbiAoKSB7XG4gICAgICAg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cmF0b3JbdmVyYl0oYXJnKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChleGNlcHRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChleGNlcHRpb24pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0LmRvbmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFEocmVzdWx0LnZhbHVlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gd2hlbihyZXN1bHQudmFsdWUsIGNhbGxiYWNrLCBlcnJiYWNrKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIFNwaWRlck1vbmtleSBHZW5lcmF0b3JzXG4gICAgICAgICAgICAgICAgLy8gRklYTUU6IFJlbW92ZSB0aGlzIGNhc2Ugd2hlbiBTTSBkb2VzIEVTNiBnZW5lcmF0b3JzLlxuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IGdlbmVyYXRvclt2ZXJiXShhcmcpO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGV4Y2VwdGlvbikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNTdG9wSXRlcmF0aW9uKGV4Y2VwdGlvbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBRKGV4Y2VwdGlvbi52YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KGV4Y2VwdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdoZW4ocmVzdWx0LCBjYWxsYmFjaywgZXJyYmFjayk7XG4gICAgICAgICAgICB9XG4gIC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tcbiAgICAgICAgICAgICAgICB3aGVuKFxuICAgICAgICAgICAgICAgICAgICBwcm9taXNlLFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb21pc2VzW2luZGV4XSA9IHZhbHVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC0tcGVuZGluZ0NvdW50ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShwcm9taXNlcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdCxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKHByb2dyZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5ub3RpZnkoeyBpbmRleDogaW5kZXgsIHZhbHVlOiBwcm9ncmVzcyB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHZvaWQgMCk7XG4gICAgICAgIGlmIChwZW5kaW5nQ291bnQgPT09IDApIHtcbiAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUocHJvbWlzZXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkZWZlcnJlZC5wcm9taXNlO1xuICAgIH0pO1xufVxuXG5Qcm9taXNlLnByb3RvdHlwZS5hbGwgPSBmdW5jdGlvbiAoKSB7XG4gICAgcmV0dXJuIGFsbCh0aGlzKTtcbn07XG5cbi8qKlxuICogUmV0dXJucyB0aGUgZmlyc3QgcmVzb2x2ZWQgcHJvbWlzZSBvZiBhbiBhcnJheS4gUHJpb3IgcmVqZWN0ZWQgcHJvbWlzZXMgYXJlXG4gKiBpZ25vcmVkLiAgUmVqZWN0cyBvbmx5IGlmIGFsbCBwcm9taXN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bHRpbmcgdGhlIGAudHlwZSgpYCB0byBcImpzb25cIiB3aGVuXG4gKiBhbiBvYmplY3QgaXMgZ2l2ZW4uXG4gKlxuICogRXhhbXBsZXM6XG4gKlxuICogICAgICAgLy8gbWFudWFsIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnanNvbicpXG4gKiAgICAgICAgIC5zZW5kKCd7XCJuYW1lXCI6XCJ0alwifScpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byBqc29uXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnNlbmQoeyBuYW1lOiAndGonIH0pXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gbWFudWFsIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdmb3JtJylcbiAqICAgICAgICAgLnNlbmQoJ25hbWU9dGonKVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGF1dG8geC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBkZWZhdWx0cyB0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgLnNlbmQoJ25hbWU9dG9iaScpXG4gKiAgICAgICAgLnNlbmQoJ3NwZWNpZXM9ZmVycmV0JylcbiAqICAgICAgICAuZW5kKGNhbGxiYWNrKVxuIC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3cuU3dhZ2dlclVpLnV0aWxzO1xuXG4gICAgICAgIGlmICghQXJyYXkuaXNBcnJheShzZWN1cml0eSkpIHsgcmV0dXJuIG51bGw7IH1cblxuICAgICAgICBzZWN1cml0eS5mb3JFYWNoKGZ1bmN0aW9uIChpdGVtKSB7XG4gICAgICAgICAgICB2YXIgc2luZ2xlU2VjdXJpdHkgPSB7fTtcbiAgICAgICAgICAgIHZhciBzaW5nbGVPYXV0aDJTZWN1cml0eSA9IHt9O1xuXG4gICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gaXRlbSkge1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGl0ZW1ba2V5XSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFhdXRoc1trZXldKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICAgICAgICAgIGF1dGhzW2tleV0gPSBhdXRoc1trZXldIHx8IHt9O1xuICAgICAgICAgICAgICAgICAgICBpZiAoYXV0aHNba2V5XS50eXBlID09PSAnb2F1dGgyJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2luZ2xlT2F1dGgyU2VjdXJpdHlba2V5XSA9IE9iamVjdC5hc3NpZ24oe30sIGF1dGhzW2tleV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgc2luZ2xlT2F1dGgyU2VjdXJpdHlba2V5XS5zY29wZXMgPSBPYmplY3QuYXNzaWduKHt9LCBhdXRoc1trZXldLnNjb3Blcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIHNpbmdsZU9hdXRoMlNlY3VyaXR5W2tleV0uc2NvcGVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW1ba2V5XS5pbmRleE9mKGkpIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgc2luZ2xlT2F1dGgyU2VjdXJpdHlba2V5XS5zY29wZXNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgc2luZ2xlT2F1dGgyU2VjdXJpdHlba2V5XS5zY29wZXMgPSB1dGlscy5wYXJzZU9hdXRoMlNjb3BlcyhzaW5nbGVPYXV0aDJTZWN1cml0eVtrZXldLnNjb3Blcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzY29wZXMgPSBfLm1lcmdlKHNjb3Blcywgc2luZ2xlT2F1dGgyU2VjdXJpdHlba2V5XS5zY29wZXMpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2luZ2xlU2VjdXJpdHlba2V5XSA9IE9iamVjdC5hc3NpZ24oe30sIGF1dGhzW2tleV0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW1ba2V5XS50eXBlID09PSAnb2F1dGgyJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2luZ2xlT2F1dGgyU2VjdXJpdHlba2V5XSA9IE9iamVjdC5hc3NpZ24oe30sIGl0ZW1ba2V5XSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVPYXV0aDJTZWN1cml0eVtrZXldLnNjb3BlcyA9IHV0aWxzLnBhcnNlT2F1dGgyU2NvcGVzKHNpbmdsZU9hdXRoMlNlY3VyaXR5W2tleV0uc2NvcGVzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlcyA9IF8ubWVyZ2Uoc2NvcGVzLCBzaW5nbGVPYXV0aDJTZWN1cml0eVtrZXldLnNjb3Blcyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVTZWN1cml0eVtrZXldID0gaXRlbVtrZXldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIV8uaXNFbXB0eShzaW5nbGVTZWN1cml0eSkpIHtcbiAgICAgICAgICAgICAgICBhdXRoc0Fyci5wdXNoKHNpbmdsZVNlY3VyaXR5KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFfLmlzRW1wdHkoc2luZ2xlT2F1dGgyU2VjdXJpdHkpKXtcbiAgICAgICAgICAgICAgICBvYXV0aDJBcnIucHVzaChzaW5nbGVPYXV0aDJTZWN1cml0eSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBhdXRocyA6IGF1dGhzQXJyLFxuICAgICAgICAgICAgb2F1dGgyOiBvYXV0aDJBcnIsXG4gICAgICAgICAgICBzY29wZXM6IHNjb3Blc1xuICAgICAgICB9O1xuICAgIH0sXG5cbiAgICBwYXJzZU9hdXRoMlNjb3BlczogZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgdmFyIHNjb3BlcyA9IE9iamVjdC5hc3NpZ24oe30sIGRhdGEpO1xuICAgICAgICB2YXIgcmVzdWx0ID0gW107XG4gICAgICAgIHZhciBrZXk7XG5cbiAgICAgICAgZm9yIChrZXkgaW4gc2NvcGVzKSB7XG4gICAgICAgICAgICByZXN1bHQucHVzaCh7c2NvcGU6IGtleSwgZGVzY3JpcHRpb246IHNjb3Blc1trZXldfSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH0sXG5cbiAgICBzYW5pdGl6ZTogZnVuY3Rpb24oaHRtbCkge1xuICAgICAgICAvLyBTdHJpcCB0aGUgc2NyaXB0IHRhZ3MgZnJvbSB0aGUgaHRtbCBhbmQgaW5saW5lIGV2ZW5oYW5kbGVyc1xuICAgICAgICBodG1sID0gaHRtbC5yZXBsYWNlKC88c2NyaXB0XFxiW148XSooPzooPyE8XFwvc2NyaXB0Pik8W148X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AgICAgICAgfSwgdGhpcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhcmdzWzBdID0gdGhpcy5oYW5kbGVPbmUobW9kZWwpO1xuICAgICAgICB9XG5cbiAgICAgICAgQmFja2JvbmUuQ29sbGVjdGlvbi5wcm90b3R5cGUuYWRkLmFwcGx5KHRoaXMsIGFyZ3MpO1xuICAgIH0sXG5cbiAgICBoYW5kbGVPbmU6IGZ1bmN0aW9uIChtb2RlbCkge1xuICAgICAgICB2YXIgcmVzdWx0ID0gbW9kZWw7XG5cbiAgICAgICAgaWYgKCEgKG1vZGVsIGluc3RhbmNlb2YgQmFja2JvbmUuTW9kZWwpICkge1xuICAgICAgICAgICAgc3dpdGNoIChtb2RlbC50eXBlKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnb2F1dGgyJzpcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gbmV3IFN3YWdnZXJVaS5Nb2RlbHMuT2F1dGgyTW9kZWwobW9kZWwpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdiYXNpYyc6XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IG5ldyBTd2FnZ2VyVWkuTW9kZWxzLkJhc2ljQXV0aE1vZGVsKG1vZGVsKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnYXBpS2V5JzpcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gbmV3IFN3YWdnZXJVaS5Nb2RlbHMuQXBpS2V5QXV0aE1vZGVsKG1vZGVsKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gbmV3IEJhY2tib25lLk1vZGVsKG1vZGVsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXN1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BhdXRoeltuYW1lXS5wYXNzd29yZDtcblxuICAgICAgICAgICAgXy5leHRlbmQoYXV0aCwge1xuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgaWYgKGF1dGh6W25hbWVdIHx8IGlzQmFzaWMpIHtcbiAgICAgICAgICAgICAgICBfLmV4dGVuZChhdXRoLCB7XG4gICAgICAgICAgICAgICAgICAgIGlzTG9nb3V0OiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogaXNCYXNpYyA/IHVuZGVmaW5lZCA6IGF1dGh6W25hbWVdLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICB1c2VybmFtZTogaXNCYXNpYyA/IGF1dGh6W25hbWVdLnVzZXJuYW1lIDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICBwYXNzd29yZDogaXNCYXNpYyA/IGF1dGh6W25hbWVdLnBhc3N3b3JkIDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB2YWxpZDogdHJ1ZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gYXV0aDtcbiAgICAgICAgfSk7XG4gICAgfVxufSk7IiwiJ3VzZSBzdHJpY3QnO1xuXG5Td2FnZ2VyVWkuVmlld3MuQXV0aHNDb2xsZWN0aW9uVmlldyA9IEJhY2tib25lLlZpZXcuZXh0ZW5kKHtcblxuICAgIGluaXRpYWxpemU6IGZ1bmN0aW9uKG9wdHMpIHtcbiAgICAgICAgdGhpcy5vcHRpb25zID0gb3B0cyB8fCB7fTtcbiAgICAgICAgdGhpcy5vcHRpb25zLmRhdGEgPSB0aGlzLm9wdGlvbnMuZGF0YSB8fCB7fTtcbiAgICAgICAgdGhpcy5yb3V0ZXIgPSB0aGlzLm9wdGlvbnMucm91dGVyO1xuXG4gICAgICAgIHRoaXMuY29sbGVjdGlvbiA9IG5ldyBTd2FnZ2Vy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gICAgfSxcblxuICAgIHJlbmRlcjogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLiRpbm5lckVsLmh0bWwodGhpcy5hdXRoc0NvbGxlY3Rpb25WaWV3LnJlbmRlcigpLmVsKTtcblxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgYXV0aG9yaXplQ2xpY2s6IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcblxuICAgICAgICBpZiAodGhpcy5hdXRoc0NvbGxlY3Rpb25WaWV3LmNvbGxlY3Rpb24uaXNWYWxpZCgpKSB7XG4gICAgICAgICAgICB0aGlzLmF1dGhvcml6ZSgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5hdXRoc0NvbGxlY3Rpb25WaWV3LmhpZ2hsaWdodEludmFsaWQoKTtcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBhdXRob3JpemU6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5hdXRoc0NvbGxlY3Rpb25WaWV3LmNvbGxlY3Rpb24uZm9yRWFjaChmdW5jdGlvbiAoYXV0aCkge1xuICAgICAgICAgICAgdmFyIGtleUF1dGgsIGJhc2ljQXV0aDtcbiAgICAgICAgICAgIHZhciB0eXBlID0gYXV0aC5nZXQoJ3R5cGUnKTtcblxuICAgICAgICAgICAgaWYgKHR5cGUgPT09ICdhcGlLZXknKSB7XG4gICAgICAgICAgICAgICAga2V5QXV0aCA9IG5ldyBTd2FnZ2VyQ2xpZW50LkFwaUtleUF1dGhvcml6YXRpb24oXG4gICAgICAgICAgICAgICAgICAgIGF1dGguZ2V0KCduYW1lJyksXG4gICAgICAgICAgICAgICAgICAgIGF1dGguZ2V0KCd2YWx1ZScpLFxuICAgICAgICAgICAgICAgICAgICBhdXRoLmdldCgnaW4nKVxuICAgICAgICAgICAgICAgICk7XG5cbiA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ICAgICAgICAgICAgIHVybCA9IGRldHMubG9naW5FbmRwb2ludC51cmwgKyAnP3Jlc3BvbnNlX3R5cGU9dG9rZW4nO1xuICAgICAgICAgICAgICAgICAgICBjb250YWluZXIudG9rZW5OYW1lID0gZ2V0VG9rZW5OYW1lKGRldHMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChvLmhhc093blByb3BlcnR5KHQpICYmIHQgPT09ICdhY2Nlc3NDb2RlJykge1xuICAgICAgICAgICAgICAgICAgICBkZXRzID0gb1t0XTtcbiAgICAgICAgICAgICAgICAgICAgZXAgPSBkZXRzLnRva2VuUmVxdWVzdEVuZHBvaW50LnVybDtcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gZGV0cy50b2tlblJlcXVlc3RFbmRwb2ludC51cmwgKyAnP3Jlc3BvbnNlX3R5cGU9Y29kZSc7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci50b2tlbk5hbWUgPSBnZXRUb2tlbk5hbWUoZGV0cyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmVkaXJlY3RfdXJpID0gcmVkaXJlY3RVcmw7XG5cbiAgICAgICAgdXJsICs9ICcmcmVkaXJlY3RfdXJpPScgKyBlbmNvZGVVUklDb21wb25lbnQocmVkaXJlY3RVcmwpO1xuICAgICAgICB1cmwgKz0gJyZyZWFsbT0nICsgZW5jb2RlVVJJQ29tcG9uZW50KHJlYWxtKTtcbiAgICAgICAgdXJsICs9ICcmY2xpZW50X2lkPScgKyBlbmNvZGVVUklDb21wb25lbnQoY2xpZW50SWQpO1xuICAgICAgICB1cmwgKz0gJyZzY29wZT0nICsgZW5jb2RlVVJJQ29tcG9uZW50KHNjb3Blcy5qb2luKHNjb3BlU2VwYXJhdG9yKSk7XG4gICAgICAgIHVybCArPSAnJnN0YXRlPScgKyBlbmNvZGVVUklDb21wb25lbnQoc3RhdGUpO1xuICA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cGUnOiBncmFudFR5cGVcbiAgICAgICAgfSwgcGFyYW1zKTtcblxuICAgICAgICB2YXIgaGVhZGVycz0ge307XG5cbiAgICAgICAgc3dpdGNoIChvYXV0aC5jbGllbnRBdXRoZW50aWNhdGlvblR5cGUpIHtcbiAgICAgICAgICAgIGNhc2UgJ2Jhc2ljJzpcbiAgICAgICAgICAgICAgICBoZWFkZXJzLkF1dGhvcml6YXRpb24gPSAnQmFzaWMgJyArIGJ0b2Eob2F1dGguY2xpZW50SWQgKyAnOicgKyBvYXV0aC5jbGllbnRTZWNyZXQpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAncmVxdWVzdC1ib2R5JzpcbiAgICAgICAgICAgICAgICBwYXJhbXMuY2xpZW50X2lkID0gb2F1dGguY2xpZW50SWQ7XG4gICAgICAgICAgICAgICAgcGFyYW1zLmNsaWVudF9zZWNyZXQgPSBvYXV0aC5jbGllbnRTZWNyZXQ7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICAkLmFqYXgoe1xuICAgICAgICAgICAgdXJsIDogb2F1dGgudG9rZW5VcmwsXG4gICAgICAgICAgICB0eXBlOiAnUE9TVCcsXG4gICAgICAgICAgICBkYXRhOiBwYXJhbXMsXG4gICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxuICAgICAgICAgICAgc3VjY2VzczogZnVuY3Rpb24gKGRhdGEpXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgb25PQXV0aENvbXBsZXRlKGRhdGEsIE9BdXRoU2NoZW1lS2V5KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBlcnJvcjogZnVuY3Rpb24gKClcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBvbk9BdXRoQ29tcGxldGUoJycpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG59KTtcbiIsIid1c2Ugc3RyaWN0JztcblxuU3dhZ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G4gICAgfSxcblxuICAgIGluaXRpYWxpemU6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYodGhpcy5hdHRyaWJ1dGVzICYmIHRoaXMuYXR0cmlidXRlcy5zY29wZXMpIHtcbiAgICAgICAgICAgIHZhciBhdHRyaWJ1dGVzID0gXy5jbG9uZURlZXAodGhpcy5hdHRyaWJ1dGVzKTtcbiAgICAgICAgICAgIHZhciBpLCBzY29wZXMgPSBbXTtcbiAgICAgICAgICAgIGZvcihpIGluIGF0dHJpYnV0ZXMuc2NvcGVzKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNjb3BlID0gYXR0cmlidXRlcy5zY29wZXNbaV07XG4gICAgICAgICAgICAgICAgaWYodHlwZW9mIHNjb3BlLmRlc2NyaXB0aW9uID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICBzY29wZXNbc2NvcGVdID0gYXR0cmlidXRlcy5zY29wZXNbaV07XG4gICAgICAgICAgICAgICAgICAgIHNjb3Blcy5wdXNoKGF0dHJpYnV0ZXMuc2NvcGVzW2ldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhdHRyaWJ1dGVzLnNjb3BlcyA9IHNjb3BlcztcbiAgICAgICAgICAgIHRoaXMuYXR0cmlidXRlcyA9IGF0dHJpYnV0ZXM7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5hdHRyaWJ1dGVzICYmIHRoaXMuYXR0cmlidXRlcy5mbG93KSB7XG4gICAgICAgICAgICB2YXIgZmxvdyA9IHRoaXMuYXR0cmlidXRlcy5mbG93O1xuICAgICAgICAgICAgdGhpcy5zZXQoJ2lzUGFzc3dvcmRGbG93JywgZmxvdyA9PT0gJ3Bhc3N3b3JkJyk7XG4gICAgICAgICAgICB0aGlzLnNldCgncmVxdWlyZUNsaWVudEF1dGhlbnRpY2F0aW9uJywgZmxvdyA9PT0gJ2FwcGxpY2F0aW9uJyk7XG4gICAgICAgICAgIC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AgICAgICAgICAgJGVsLmZpbmQoJy5vYXV0aC1jbGllbnQtYXV0aGVudGljYXRpb24nKS5oaWRlKCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdiYXNpYyc6XG4gICAgICAgICAgICBjYXNlICdyZXF1ZXN0LWJvZHknOlxuICAgICAgICAgICAgICAgICRlbC5maW5kKCcub2F1dGgtY2xpZW50LWlkJykucmVtb3ZlQ2xhc3ModGhpcy5jbHMuZXJyb3IpO1xuICAgICAgICAgICAgICAgICRlbC5maW5kKCcub2F1dGgtY2xpZW50LWF1dGhlbnRpY2F0aW9uJykuc2hvdygpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIHNldENsaWVudElkOiBmdW5jdGlvbiAoZSkge1xuICAgICAgICB2YXIgdmFsID0gJChlLnRhcmdldCkudmFsKCk7XG4gICAgICAgIHRoaXMubW9kZWwuc2V0KCdjbGllbnRJZCcsIHZhbCk7XG4gICAgICAgIGlmICh2YWwpIHtcbiAgICAgICAgICAgICQoZS50YXJnZXQpLnJlbW92ZUNsYXNzKHRoaXMuY2xzLmVycm9yKTtcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBzZXRDbGllbnRTZWNyZXQ6IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgIHRoaXMubW9kZWwuc2V0KCdjbGllbnRTZWNyZXQnLCAkKGUudGFyZ2V0KS52YWwoKSk7XG4gICAgICAgICQoZS50YXJnZXQpLnJlbW92ZUNsYXNzKCdlcnJvcicpO1xuICAgIH0sXG5cbiAgICBoaWdobGlnaHRJbnZhbGlkOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICghdGhpcy5tb2RlbC5nZXQoJ3VzZXJuYW1lJykpIHtcbiAgICAgICAgICAgIHRoaXMuJGVsLmZpbmQoJy5vYXV0aC11c2VybmFtZScpLmFkZENsYXNzKHRoaXMuY2xzLmVycm9yKTtcbiAgICAgICAg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ykge1xuICAgICAgaWYgKEFycmF5LmlzQXJyYXkobW9kZWxBdXRocykpIHtcbiAgICAgICAgZm9yIChsID0gMCwgbGVuID0gbW9kZWxBdXRocy5sZW5ndGg7IGwgPCBsZW47IGwrKykge1xuICAgICAgICAgIGF1dGhzID0gbW9kZWxBdXRoc1tsXTtcbiAgICAgICAgICBmb3IgKGtleSBpbiBhdXRocykge1xuICAgICAgICAgICAgZm9yIChhIGluIHRoaXMuYXV0aHMpIHtcbiAgICAgICAgICAgICAgYXV0aCA9IHRoaXMuYXV0aHNbYV07XG4gICAgICAgICAgICAgIGlmIChrZXkgPT09IGF1dGgubmFtZSkge1xuICAgICAgICAgICAgICAgIGlmIChhdXRoLnR5cGUgPT09ICdvYXV0aDInKSB7XG4gICAgICAgICAgICAgICAgICB0aGlzLm1vZGVsLm9hdXRoID0ge307XG4gICAgICAgICAgICAgICAgICB0aGlzLm1vZGVsLm9hdXRoLnNjb3BlcyA9IFtdO1xuICAgICAgICAgICAgICAgICAgcmVmMSA9IGF1dGgudmFsdWUuc2NvcGVzO1xuICAgICAgICAgICAgICAgICAgZm9yIChrIGluIHJlZjEpIHtcbiAgICAgICAgICAgICAgICAgICAgdiA9IHJlZjFba107XG4gICAgICAgICAgICAgICAgICAgIHNjb3BlSW5kZXggPSBhdXRoc1trZXldLmluZGV4T2Yoayk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzY29wZUluZGV4ID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICBvID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGU6IGssXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdGlvbjogdlxuICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgdGhpcy5tb2RlbC5vYXV0aC5zY29wZXMucHVzaChvKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZm9yIChrIGluIG1vZGVsQXV0aHMpIHtcbiAgICAgICAgICB2ID0gbW9kZWxBdXRoc1trXTtcbiAgICAgICAgICBpZiAoayA9PT0gJ29hdXRoMicpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLm1vZGVsLm9hdXRoID09PSBudWxsKSB7XG4gICAgICAgICAgICAgIHRoaXMubW9kZWwub2F1dGggPSB7fTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLm1vZGVsLm9hdXRoLnNjb3BlcyA9PT0gdm9pZCAwKSB7XG4gICAgICAgICAgICAgIHRoaXMubW9kZWwub2F1dGguc2NvcGVzID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKG0gPSAwLCBsZW4xID0gdi5sZW5ndGg7IG0gPCBsZW4xOyBtKyspIHtcbiAgICAgICAgICAgICAgbyA9IHZbbV07XG4gICAgICAgICAgICAgIHRoaXMubW9kZWwub2F1dGguc2NvcGVzLnB1c2gobyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGlmICh0eXBlb2YgdGhpcy5tb2RlbC5yZXNwb25zZXMgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICB0aGlzLm1vZGVsLnJlc3BvbnNlTWVzc2FnZXMgPSBbXTtcbiAgICAgIHJlZjIgPSB0aGlzLm1vZGVsLnJlc3BvbnNlcztcbiAgICAgIGZvciAoY29kZSBpbiByZWYyKSB7XG4gICAgICAgIHZhbHVlID0gcmVmMltjb2RlXTtcbiAgICAgICAgc2NoZW1hID0gbnVsbDtcbiAgICAgICAgc2NoZW1hT2JqID0gdGhpcy5tb2RlbC5yZXNwb25zZXNbY29kZV0uc2NoZW1hO1xuICAgICAgICBpZiAoc2NoZW1hT2JqICYmIHNjaGVtY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gICB0eXBlcyA9IHtcbiAgICAgICAgc2luZ2xlOiBCb29sZWFuKGxuLm1hdGNoKC88LitcXC8+LykpLFxuICAgICAgICBjbG9zaW5nOiBCb29sZWFuKGxuLm1hdGNoKC88XFwvLis+LykpLFxuICAgICAgICBvcGVuaW5nOiBCb29sZWFuKGxuLm1hdGNoKC88W14hP10uKj4vKSlcbiAgICAgIH07XG4gICAgICB0eXBlID0gKChmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIHJlc3VsdHM7XG4gICAgICAgIHJlc3VsdHMgPSBbXTtcbiAgICAgICAgZm9yIChrZXkgaW4gdHlwZXMpIHtcbiAgICAgICAgICB2YWx1ZSA9IHR5cGVzW2tleV07XG4gICAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgICByZXN1bHRzLnB1c2goa2V5KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdHM7XG4gICAgICB9KSgpKVswXTtcbiAgICAgIHR5cGUgPSB0eXBlID09PSB2b2lkIDAgPyAnb3RoZXInIDogdHlwZTtcbiAgICAgIGZyb21UbyA9IGxhc3RUeXBlICsgJy0+JyArIHR5cGU7XG4gICAgICBsYXN0VHlwZSA9IHR5cGU7XG4gICAgICBwYWRkaW5nID0gJyc7XG4gICAgICBpbmRlbnQgKz0gdHJhbnNpdGlvbnNbZnJvbVRvXTtcbiAgICAgIHBhZGRpbmcgPSAoKGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgbSwgcmVmMSwgcmVzdWx0cztcbiAgICAgICAgcmVzdWx0cyA9IFtdO1xuICAgICAgICBmb3IgKGogPSBtID0gMCwgcmVmMSA9IGluZGVudDsgMCA8PSByZWYxID8gbSA8IHJlZjEgOiBtID4gcmVmMTsgaiA9IDAgPD0gcmVmMSA/ICsrbSA6IC0tbSkge1xuICAgICAgICAgIHJlc3VsdHMucHVzaCgnICAnKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdW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iB0aGlzLm1vZGVsLmRlZmF1bHQsXG4gICAgICAgICAgICAgICAgICAgICAgICBhamF4OnRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlX3Byb3BlcnRpZXM6dHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVfZWRpdF9qc29uOnRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBpY29ubGliOiAnc3dhZ2dlcicgfSk7XG4gICAgICAvLyBUaGlzIGlzIHNvIHRoYXQgdGhlIHNpZ25hdHVyZSBjYW4gc2VuZCBiYWNrIHRoZSBzYW1wbGUgdG8gdGhlIGpzb24gZWRpdG9yXG4gICAgICAvLyBUT0RPOiBTaWduYXR1cmVWaWV3IHNob3VsZCBleHBvc2UgYW4gZXZlbnQgXCJvblNhbXBsZUNsaWNrZWRcIiBpbnN0ZWFkXG4gICAgICBzaWduYXR1cmVNb2RlbC5qc29uRWRpdG9yID0gdGhpcy5tb2RlbC5qc29uRWRpdG9yO1xuICAgICAgJCgnLmJvZHktdGV4dGFyZWEnLCAkc2VsZikuaGlkZSgpO1xuICAgICAgJCgnLmVkaXRvcl9ob2xkZXInLCAkc2VsZikuc2hvdygpO1xuICAgICAgJCgnLnBhcmFtZXRlci1jb250ZW50LXR5cGUnLCAkc2VsZilcbiAgICAgICAgLmNoYW5nZShmdW5jdGlvbihlKXtcbiAgICAgICAgICAgIGlmKGUudGFyZ2V0LnZhbHVlID09PSAnYXBwbGljYXRpb24veG1sJyl7XG4gICAgICAgICAgICAgICQoJy5ib2R5LXRleHRhcmVhJywgJHNlbGYpLnNob3coKTtcbiAgICAgICAgICAgICAgJCgnLmVkaXRvcl9ob2xkZXInLCAkc2VsZikuaGlkZSgpO1xuICAgICAgICAgICAgICB0aGlzLm1vZGVsLmpzb25FZGl0b3IuZGlzYWJsZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICQoJy5ib2R5LXRleHRhc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bWJlcic6XG4gICAgICAgIGlmIChzY2hlbWEubWluaW11bSkge1xuICAgICAgICAgIG9wdGlvbnMgKz0gb3B0aW9uSHRtbCgnTWluLiBWYWx1ZScsIHNjaGVtYS5taW5pbXVtKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzY2hlbWEuZXhjbHVzaXZlTWluaW11bSkge1xuICAgICAgICAgIG9wdGlvbnMgKz0gb3B0aW9uSHRtbCgnRXhjbHVzaXZlIE1pbi4nLCAndHJ1ZScpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHNjaGVtYS5tYXhpbXVtKSB7XG4gICAgICAgICAgb3B0aW9ucyArPSBvcHRpb25IdG1sKCdNYXguIFZhbHVlJywgc2NoZW1hLm1heGltdW0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHNjaGVtYS5leGNsdXNpdmVNYXhpbXVtKSB7XG4gICAgICAgICAgb3B0aW9ucyArPSBvcHRpb25IdG1sKCdFeGNsdXNpdmUgTWF4LicsICd0cnVlJyk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc2NoZW1hLm11bHRpcGxlT2YpIHtcbiAgICAgICAgICBvcHRpb25zICs9IG9wdGlvbkh0bWwoJ011bHRpcGxlIE9mJywgc2NoZW1hLm11bHRpcGxlT2YpO1xuICAgICAgICB9XG5cbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG5cbiAgICAgIGlmIChpc0FycmF5KSB7XG4gICAgICAgIGlmIChzY2hlbWEubWluSXRlbXMpIHtcbiAgICAgICAgICBvcHRpb25zICs9IG9wdGlvbkh0bWwoJ01pbi4gSXRlbXMnLCBzY2hlbWEubWluSXRlbXMpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHNjaGVtYS5tYXhJdGVtcykge1xuICAgICAgICAgIG9wdGlvbnMgKz0gb3B0aW9uSHRtbCgnTWF4LiBJdGVtcycsIHNjaGVtYS5tYXhJdGVtcyk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc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HVybiBodG1sO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHByb2Nlc3NNb2RlbChzY2hlbWEsIG5hbWUpIHtcbiAgICAgIHZhciB0eXBlID0gc2NoZW1hLnR5cGUgfHwgJ29iamVjdCc7XG4gICAgICB2YXIgaXNBcnJheSA9IHNjaGVtYS50eXBlID09PSAnYXJyYXknO1xuICAgICAgdmFyIGh0bWwgPSBzdHJvbmdPcGVuICsgbmFtZSArICcgJyArIChpc0FycmF5ID8gJ1snIDogJ3snKSArIHN0cm9uZ0Nsb3NlO1xuICAgICAgdmFyIGNvbnRlbnRzO1xuXG4gICAgICBpZiAobmFtZSkge1xuICAgICAgICBzZWVuTW9kZWxzLnB1c2gobmFtZSk7XG4gICAgICB9XG5cbiAgICAgIGlmIChpc0FycmF5KSB7XG4gICAgICAgIGlmIChfLmlzQXJyYXkoc2NoZW1hLml0ZW1zKSkge1xuICAgICAgICAgIGh0bWwgKz0gJzxkaXY+JyArIF8ubWFwKHNjaGVtYS5pdGVtcywgZnVuY3Rpb24gKGl0ZW0pIHtcbiAgICAgICAgICAgIHZhciB0eXBlID0gaXRlbS50eXBlIHx8ICdvYmplY3QnO1xuXG4gICAgICAgICAgICBpZiAoXy5pc1VuZGVmaW5lZChpdGVtLiRyZWYpKSB7XG4gICAgICAgICAgICAgIGlmIChfLmluZGV4T2YoWydhcnJheScsICdvYmplY3QnXSwgdHlwZSkgPiAtMSkge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSAnb2JqZWN0JyAmJiBfLmlzVW5kZWZpbmVkKGl0ZW0ucHJvcGVydGllcykpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiAnb2JqZWN0JztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIGFkZFJlZmVyZW5jZShpdGVtKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJu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7XG5cbiAgICAgICAgICAgICAgaWYoIXByb3BlcnR5SXNSZXF1aXJlZCkge1xuICAgICAgICAgICAgICAgIGh0bWwgKz0gJywgPHNwYW4gY2xhc3M9XCJwcm9wT3B0S2V5XCI+b3B0aW9uYWw8L3NwYW4+JztcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmKHByb3BlcnR5LnJlYWRPbmx5KSB7XG4gICAgICAgICAgICAgICAgICBodG1sICs9ICcsIDxzcGFuIGNsYXNzPVwicHJvcFJlYWRPbmx5XCI+cmVhZCBvbmx5PC9zcGFuPic7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBodG1sICs9ICcpJztcblxuICAgICAgICAgICAgICByZXR1cm4gJzxkaXYnICsgKHByb3BlcnR5LnJlYWRPbmx5ID8gJyBjbGFzcz1cInJlYWRPbmx5XCInIDogJycpICsgJz4nICsgcHJpbWl0aXZlVG9PcHRpb25zSFRNTChjUHJvcGVydHksIGh0bWwpO1xuICAgICAgICAgICAgfSkuam9pbignLDwvZGl2PicpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChjb250ZW50cykge1xuICAgICAgICAgICAgaHRtbCArPSBjb250ZW50cyArICc8L2Rpdj4nO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBodG1sICs9ICc8ZGl2PicgKyBwcmltaXRpdmVUb09wdGlvbnNIVE1MKHNjaGVtYSwgdHlwZSkgKyAnPC9kaXY+JztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICByZXR1cm4gaHRtbCArIHN0cm9uZ09wZW4gKyAoaXNBcnJheSA/ICddJyA6ICd9JykgKyBzdHJvbmdDbG9zZTtcbiAgICB9XG5cbiAgfTtcblxuICAvLyBjb3B5LXBhc3RlZCBmcm9tIHN3YWdnZXItanNcbiAgdmFyIHNjaGVtYVRvSlNPTiA9IGZ1bmN0aW9uIChzY2hlbWEsIG1vZGVscywgbW9kZWxzVG9JZ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