daddyx

dady

Feb 3rd, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 192.30 KB | None | 0 0
  1. (function() {
  2. function a(b) {
  3. return b.replace(/<.[^<>]*?>/g, " ").replace(/&nbsp;|&#160;/gi, " ").replace(/[.(),;:!?%#$'"_+=\/-]*/g, "");
  4. }
  5. jQuery.validator.addMethod("maxWords", function(c, b, d) {
  6. return this.optional(b) || a(c).match(/\b\w+\b/g).length <= d;
  7. }, jQuery.validator.format("Please enter {0} words or less."));
  8. jQuery.validator.addMethod("minWords", function(c, b, d) {
  9. return this.optional(b) || a(c).match(/\b\w+\b/g).length >= d;
  10. }, jQuery.validator.format("Please enter at least {0} words."));
  11. jQuery.validator.addMethod("rangeWords", function(e, b, f) {
  12. var d = a(e);
  13. var c = /\b\w+\b/g;
  14. return this.optional(b) || d.match(c).length >= f[0] && d.match(c).length <= f[1];
  15. }, jQuery.validator.format("Please enter between {0} and {1} words."));
  16. })();
  17.  
  18. jQuery.validator.addMethod("letterswithbasicpunc", function(b, a) {
  19. return this.optional(a) || /^[a-z\-.,()'\"\s]+$/i.test(b);
  20. }, "Letters or punctuation only please");
  21.  
  22. jQuery.validator.addMethod("alphanumeric", function(b, a) {
  23. return this.optional(a) || /^\w+$/i.test(b);
  24. }, "Letters, numbers, and underscores only please");
  25.  
  26. jQuery.validator.addMethod("lettersonly", function(b, a) {
  27. return this.optional(a) || /^[a-z]+$/i.test(b);
  28. }, "Letters only please");
  29.  
  30. jQuery.validator.addMethod("nowhitespace", function(b, a) {
  31. return this.optional(a) || /^\S+$/i.test(b);
  32. }, "No white space please");
  33.  
  34. jQuery.validator.addMethod("ziprange", function(b, a) {
  35. return this.optional(a) || /^90[2-5]\d\{2\}-\d{4}$/.test(b);
  36. }, "Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");
  37.  
  38. jQuery.validator.addMethod("zipcodeUS", function(b, a) {
  39. return this.optional(a) || /\d{5}-\d{4}$|^\d{5}$/.test(b);
  40. }, "The specified US ZIP Code is invalid");
  41.  
  42. jQuery.validator.addMethod("integer", function(b, a) {
  43. return this.optional(a) || /^-?\d+$/.test(b);
  44. }, "A positive or negative non-decimal number please");
  45.  
  46. jQuery.validator.addMethod("vinUS", function(o) {
  47. if (o.length != 17) {
  48. return false;
  49. }
  50. var h, a, l, j, b, k;
  51. var c = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ];
  52. var m = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ];
  53. var g = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ];
  54. var e = 0;
  55. for (h = 0; h < 17; h++) {
  56. j = g[h];
  57. l = o.slice(h, h + 1);
  58. if (h == 8) {
  59. k = l;
  60. }
  61. if (!isNaN(l)) {
  62. l *= j;
  63. } else {
  64. for (a = 0; a < c.length; a++) {
  65. if (l.toUpperCase() === c[a]) {
  66. l = m[a];
  67. l *= j;
  68. if (isNaN(k) && a == 8) {
  69. k = c[a];
  70. }
  71. break;
  72. }
  73. }
  74. }
  75. e += l;
  76. }
  77. b = e % 11;
  78. if (b == 10) {
  79. b = "X";
  80. }
  81. if (b == k) {
  82. return true;
  83. }
  84. return false;
  85. }, "The specified vehicle identification number (VIN) is invalid.");
  86.  
  87. jQuery.validator.addMethod("dateITA", function(e, c) {
  88. var a = false;
  89. var g = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
  90. if (g.test(e)) {
  91. var i = e.split("/");
  92. var d = parseInt(i[0], 10);
  93. var b = parseInt(i[1], 10);
  94. var f = parseInt(i[2], 10);
  95. var h = new Date(f, b - 1, d);
  96. if (h.getFullYear() == f && h.getMonth() == b - 1 && h.getDate() == d) {
  97. a = true;
  98. } else {
  99. a = false;
  100. }
  101. } else {
  102. a = false;
  103. }
  104. return this.optional(c) || a;
  105. }, "Please enter a correct date");
  106.  
  107. jQuery.validator.addMethod("dateNL", function(b, a) {
  108. return this.optional(a) || /^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(b);
  109. }, "Vul hier een geldige datum in.");
  110.  
  111. jQuery.validator.addMethod("time", function(b, a) {
  112. return this.optional(a) || /^([0-1]\d|2[0-3]):([0-5]\d)$/.test(b);
  113. }, "Please enter a valid time, between 00:00 and 23:59");
  114.  
  115. jQuery.validator.addMethod("time12h", function(b, a) {
  116. return this.optional(a) || /^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$/i.test(b);
  117. }, "Please enter a valid time, between 00:00 am and 12:00 pm");
  118.  
  119. jQuery.validator.addMethod("phoneUS", function(a, b) {
  120. a = a.replace(/\s+/g, "");
  121. return this.optional(b) || a.length > 9 && a.match(/^(\+?1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
  122. }, "Please specify a valid phone number");
  123.  
  124. jQuery.validator.addMethod("phoneUK", function(a, b) {
  125. a = a.replace(/\(|\)|\s+|-/g, "");
  126. return this.optional(b) || a.length > 9 && a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:(?:\d{5}\)?\s?\d{4,5})|(?:\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3}))|(?:\d{3}\)?\s?\d{3}\s?\d{3,4})|(?:\d{2}\)?\s?\d{4}\s?\d{4}))$/);
  127. }, "Please specify a valid phone number");
  128.  
  129. jQuery.validator.addMethod("mobileUK", function(a, b) {
  130. a = a.replace(/\s+|-/g, "");
  131. return this.optional(b) || a.length > 9 && a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[45789]\d{2}|624)\s?\d{3}\s?\d{3})$/);
  132. }, "Please specify a valid mobile number");
  133.  
  134. jQuery.validator.addMethod("phonesUK", function(a, b) {
  135. a = a.replace(/\s+|-/g, "");
  136. return this.optional(b) || a.length > 9 && a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[45789]\d{8}|624\d{6})))$/);
  137. }, "Please specify a valid uk phone number");
  138.  
  139. jQuery.validator.addMethod("postcodeUK", function(a, b) {
  140. a = a.toUpperCase().replace(/\s+/g, "");
  141. return this.optional(b) || a.match(/^([^QZ][^IJZ]{0,1}\d{1,2})(\d[^CIKMOV]{2})$/) || a.match(/^([^QV]\d[ABCDEFGHJKSTUW])(\d[^CIKMOV]{2})$/) || a.match(/^([^QV][^IJZ]\d[ABEHMNPRVWXY])(\d[^CIKMOV]{2})$/) || a.match(/^(GIR)(0AA)$/) || a.match(/^(BFPO)(\d{1,4})$/) || a.match(/^(BFPO)(C\/O\d{1,3})$/);
  142. }, "Please specify a valid postcode");
  143.  
  144. jQuery.validator.addMethod("strippedminlength", function(b, a, c) {
  145. return jQuery(b).text().length >= c;
  146. }, jQuery.validator.format("Please enter at least {0} characters"));
  147.  
  148. jQuery.validator.addMethod("email2", function(b, a, c) {
  149. return this.optional(a) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(b);
  150. }, jQuery.validator.messages.email);
  151.  
  152. jQuery.validator.addMethod("url2", function(b, a, c) {
  153. return this.optional(a) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(b);
  154. }, jQuery.validator.messages.url);
  155.  
  156. jQuery.validator.addMethod("creditcardtypes", function(b, a, c) {
  157. if (/[^0-9-]+/.test(b)) {
  158. return false;
  159. }
  160. b = b.replace(/\D/g, "");
  161. var d = 0;
  162. if (c.mastercard) {
  163. d |= 1;
  164. }
  165. if (c.visa) {
  166. d |= 2;
  167. }
  168. if (c.amex) {
  169. d |= 4;
  170. }
  171. if (c.dinersclub) {
  172. d |= 8;
  173. }
  174. if (c.enroute) {
  175. d |= 16;
  176. }
  177. if (c.discover) {
  178. d |= 32;
  179. }
  180. if (c.jcb) {
  181. d |= 64;
  182. }
  183. if (c.unknown) {
  184. d |= 128;
  185. }
  186. if (c.all) {
  187. d = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128;
  188. }
  189. if (d & 1 && /^(5[12345])/.test(b)) {
  190. return b.length == 16;
  191. }
  192. if (d & 2 && /^(4)/.test(b)) {
  193. return b.length == 16;
  194. }
  195. if (d & 4 && /^(3[47])/.test(b)) {
  196. return b.length == 15;
  197. }
  198. if (d & 8 && /^(3(0[012345]|[68]))/.test(b)) {
  199. return b.length == 14;
  200. }
  201. if (d & 16 && /^(2(014|149))/.test(b)) {
  202. return b.length == 15;
  203. }
  204. if (d & 32 && /^(6011)/.test(b)) {
  205. return b.length == 16;
  206. }
  207. if (d & 64 && /^(3)/.test(b)) {
  208. return b.length == 16;
  209. }
  210. if (d & 64 && /^(2131|1800)/.test(b)) {
  211. return b.length == 15;
  212. }
  213. if (d & 128) {
  214. return true;
  215. }
  216. return false;
  217. }, "Please enter a valid credit card number.");
  218.  
  219. jQuery.validator.addMethod("ipv4", function(b, a, c) {
  220. return this.optional(a) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(b);
  221. }, "Please enter a valid IP v4 address.");
  222.  
  223. jQuery.validator.addMethod("ipv6", function(b, a, c) {
  224. return this.optional(a) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(b);
  225. }, "Please enter a valid IP v6 address.");
  226.  
  227. jQuery.validator.addMethod("pattern", function(b, a, c) {
  228. if (this.optional(a)) {
  229. return true;
  230. }
  231. if (typeof c === "string") {
  232. c = new RegExp("^(?:" + c + ")$");
  233. }
  234. return c.test(b);
  235. }, "Invalid format.");
  236.  
  237. jQuery.validator.addMethod("require_from_group", function(g, f, d) {
  238. var e = this;
  239. var b = d[1];
  240. var c = $(b, f.form).filter(function() {
  241. return e.elementValue(this);
  242. }).length >= d[0];
  243. if (!$(f).data("being_validated")) {
  244. var a = $(b, f.form);
  245. a.data("being_validated", true);
  246. a.valid();
  247. a.data("being_validated", false);
  248. }
  249. return c;
  250. }, jQuery.format("Please fill at least {0} of these fields."));
  251.  
  252. jQuery.validator.addMethod("skip_or_fill_minimum", function(f, d, b) {
  253. var c = this;
  254. numberRequired = b[0];
  255. selector = b[1];
  256. var g = $(selector, d.form).filter(function() {
  257. return c.elementValue(this);
  258. }).length;
  259. var e = g >= numberRequired || g === 0;
  260. if (!$(d).data("being_validated")) {
  261. var a = $(selector, d.form);
  262. a.data("being_validated", true);
  263. a.valid();
  264. a.data("being_validated", false);
  265. }
  266. return e;
  267. }, jQuery.format("Please either skip these fields or fill at least {0} of them."));
  268.  
  269. jQuery.validator.addMethod("accept", function(e, c, g) {
  270. var f = typeof g === "string" ? g.replace(/,/g, "|") : "image/*", d = this.optional(c), b, a;
  271. if (d) {
  272. return d;
  273. }
  274. if ($(c).attr("type") === "file") {
  275. f = f.replace("*", ".*");
  276. if (c.files && c.files.length) {
  277. for (b = 0; b < c.files.length; b++) {
  278. a = c.files[b];
  279. if (!a.type.match(new RegExp(".?(" + f + ")$", "i"))) {
  280. return false;
  281. }
  282. }
  283. }
  284. }
  285. return true;
  286. }, jQuery.format("Please enter a value with a valid mimetype."));
  287.  
  288. jQuery.validator.addMethod("extension", function(b, a, c) {
  289. c = typeof c === "string" ? c.replace(/,/g, "|") : "png|jpe?g|gif";
  290. return this.optional(a) || b.match(new RegExp(".(" + c + ")$", "i"));
  291. }, jQuery.format("Please enter a value with a valid extension."));
  292.  
  293. var _gaq = _gaq || [];
  294.  
  295. _gaq.push([ "_setAccount", sellerTracking.googleAnalyticsId ]);
  296.  
  297. _gaq.push([ "_trackPageview" ]);
  298.  
  299. (function() {
  300. var ga = document.createElement("script");
  301. ga.type = "text/javascript";
  302. ga.async = true;
  303. ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
  304. var s = document.getElementsByTagName("script")[0];
  305. s.parentNode.insertBefore(ga, s);
  306. })();
  307.  
  308. if (window.location.hostname === "seller.flipkart.com") {
  309. var pageURL = window.location.href;
  310. window.onerror = function(message, url, linenumber) {
  311. if (_gaq && _gaq.push) {
  312. _gaq.push([ "_trackEvent", "JavascriptError on " + window.location.hostname, pageURL, message + " on line " + linenumber + " for " + url + " for sellerId " + FK.getSellerId() ]);
  313. }
  314. };
  315. }
  316.  
  317. function pushToGa(category, action, label, val) {
  318. if (whiteListedGACategory.length === 0 || whiteListedGACategory.length > 0 && whiteListedGACategory.indexOf(category) > -1) {
  319. _gaq.push([ "_trackEvent", category, action, label ]);
  320. }
  321. }
  322.  
  323. var FKSP = FKSP || {};
  324.  
  325. FKSP.SnoopyAnalytics = function(identifier, org, channel) {
  326. var config;
  327. function track(event) {
  328. var oThis = this;
  329. if (!event.entity) throw new Error("Entity must be defined");
  330. if (!event.category) throw new Error("Category must be defined");
  331. config.event.action = !event.action ? "CLICK" : config.event.action;
  332. config.event.entity = event.entity;
  333. config.event.data_category = event.category;
  334. oThis.flowCounter = 0;
  335. if (oThis.previousPage !== _getHash()) {
  336. oThis.flowCounter++;
  337. oThis.previousPage = _getHash();
  338. }
  339. config.event.value = JSON.stringify(event.value || {});
  340. config.event.page_load_id = _getHash() || "Landing Page";
  341. config.event.event_no = String(oThis.flowCounter);
  342. config.event.flow_id = String(oThis.flowCounter);
  343. config.event.source = window.localStorage.source || "Direct";
  344. config.event.medium = window.localStorage.medium || null;
  345. config.event.term = window.localStorage.term || null;
  346. config.event.campaign = window.localStorage.campaign || null;
  347. config.timestamp = new Date().getTime();
  348. _callAPI(config);
  349. }
  350. function _getHash(url) {
  351. url = url || _getUrl();
  352. var oUrl = _parseUrl(url);
  353. return oUrl.hash;
  354. }
  355. function _getUrl(thisWindow) {
  356. thisWindow = thisWindow || window;
  357. return thisWindow.location.href;
  358. }
  359. function _parseUrl(url) {
  360. var a = document.createElement("a"), protocol, hostname, port;
  361. a.href = url;
  362. protocol = a.protocol || location.protocol;
  363. hostname = a.hostname || location.hostname;
  364. port = a.port || location.port;
  365. return {
  366. source: url,
  367. protocol: protocol.replace(":", ""),
  368. host: hostname,
  369. port: port,
  370. query: a.search,
  371. hash: a.hash.replace("#", ""),
  372. path: a.pathname.replace(/^([^/])/, "/$1"),
  373. segments: a.pathname.replace(/^\//, "").split("/"),
  374. params: function() {
  375. var params = {}, paramKeyValue, paramsKeyValue, paramsLength, paramIndex;
  376. paramsKeyValue = a.search.replace(/^.*\?/, "").split("&");
  377. paramsLength = paramsKeyValue.length;
  378. for (paramIndex = 0; paramIndex < paramsLength; paramIndex++) {
  379. if (!paramsKeyValue[paramIndex]) {
  380. continue;
  381. }
  382. paramKeyValue = paramsKeyValue[paramIndex].split("=");
  383. params[paramKeyValue[0]] = paramKeyValue[1];
  384. }
  385. return params;
  386. }()
  387. };
  388. }
  389. function _callAPI(data) {
  390. var xhr = new XMLHttpRequest();
  391. xhr.open("POST", "snoopyIngestion");
  392. xhr.setRequestHeader("Content-Type", "application/json; charset=UTF-8");
  393. xhr.send(JSON.stringify(data));
  394. }
  395. function _init() {
  396. if (!identifier) throw new Error("Identifier must be defined");
  397. config = {
  398. type: identifier,
  399. event: {
  400. org: !org ? "SP" : org,
  401. channel: !channel ? "web" : channel
  402. }
  403. };
  404. }
  405. _init();
  406. return {
  407. track: track
  408. };
  409. }(function() {
  410. var $continueAnyway = $("#continue-anyway"), $browserCompatibilityModal = $("#browser-compatibility"), $blackOverlay = $("#black-overlay"), $header = $("header"), isLocalStorageSupported = supports_local_storage();
  411. var upgradeHtml = '<div id="upgrade-browser">This browser is not supported by Flipkart Marketplace, please ' + '<a id="upgrade">upgrade</a>' + " to one of the supported browsers.</div>";
  412. function showModal() {
  413. $blackOverlay.removeClass("hide");
  414. $browserCompatibilityModal.removeClass("hide");
  415. }
  416. function hideModal() {
  417. $blackOverlay.addClass("hide");
  418. $browserCompatibilityModal.addClass("hide");
  419. }
  420. function removeUpgradeHeader() {
  421. $("#upgrade-browser").remove();
  422. }
  423. function addUpgradeHeader() {
  424. $header.append(upgradeHtml);
  425. $("#upgrade").click(function(e) {
  426. showModal();
  427. removeUpgradeHeader();
  428. });
  429. }
  430. function supports_local_storage() {
  431. try {
  432. return "localStorage" in window && window["localStorage"] !== null;
  433. } catch (e) {
  434. return false;
  435. }
  436. }
  437. $continueAnyway.click(function(e) {
  438. hideModal();
  439. addUpgradeHeader();
  440. $header.scrollTop(0);
  441. if (isLocalStorageSupported) {
  442. localStorage.setItem("clickedUpdateBrowser", "true");
  443. }
  444. });
  445. (function() {
  446. if (isLocalStorageSupported === true) {
  447. var hasClickedUpdateBrowser = localStorage.getItem("clickedUpdateBrowser");
  448. if (hasClickedUpdateBrowser === "true" && allowContinueIfIncompatible) {
  449. hideModal();
  450. addUpgradeHeader();
  451. } else {
  452. showModal();
  453. }
  454. } else {
  455. showModal();
  456. }
  457. })();
  458. })();
  459.  
  460. (function(root, factory) {
  461. if (typeof define === "function" && define.amd) {
  462. define([ "$" ], factory);
  463. } else if (typeof exports === "object") {
  464. module.exports = factory(require("jquery"));
  465. } else {
  466. root.fk_omniAnalytics = factory(root.$);
  467. }
  468. })(this, function($) {
  469. var fk_omniAnalytics = {
  470. track: function(eventData, event) {
  471. var s = window.s || s;
  472. window.digitalData = window.digitalData || {};
  473. if (eventData) {
  474. $.extend(true, window.digitalData, eventData);
  475. }
  476. var isLoginPage = false;
  477. isLoginPage = window.digitalData && window.digitalData && window.digitalData.page && window.digitalData.page.pageName && window.digitalData.page.pageName == "seller: Login Page";
  478. var sellerIdOnSellerObjPresent = isLoginPage ? "" : window.seller && window.seller.sellerId;
  479. var sellerIdOnFkPresent = isLoginPage ? "" : window.FK && window.FK.getSellerId && window.FK.getSellerId();
  480. if (sellerIdOnSellerObjPresent || sellerIdOnFkPresent) {
  481. if (sellerIdOnSellerObjPresent) {
  482. $.extend(true, window.digitalData, {
  483. user: {
  484. sellerID: sellerIdOnSellerObjPresent
  485. }
  486. });
  487. } else if (sellerIdOnFkPresent) {
  488. $.extend(true, window.digitalData, {
  489. user: {
  490. sellerID: sellerIdOnFkPresent
  491. }
  492. });
  493. }
  494. }
  495. if (window._satellite && event) {
  496. if (s && typeof s.manageVars === "function") {
  497. s.manageVars("clearVars");
  498. }
  499. _satellite.track(event);
  500. }
  501. }
  502. };
  503. return fk_omniAnalytics;
  504. });
  505.  
  506. (function() {
  507. var digitalData = {}, eventName;
  508. digitalData = {
  509. page: {
  510. pageName: "seller: Login Page",
  511. section: "Login Page",
  512. subSection: "Login Page",
  513. subSubSection: "Login Page",
  514. contentHierarchy: "Login Page"
  515. }
  516. };
  517. eventName = "pageload";
  518. window.fk_omniAnalytics.track(digitalData, eventName);
  519. })();
  520.  
  521. var FK = window.FK || {};
  522.  
  523. FK.sellerObject = {};
  524.  
  525. FK.mainStart = FK.mainStart || new Date().getTime();
  526.  
  527. FK.localStart = new Date().getTime();
  528.  
  529. var monthNames = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
  530.  
  531. var banks, bankBranches;
  532.  
  533. FK.getTemplate = function() {
  534. var cache = {};
  535. return function(name) {
  536. if (typeof cache[name] === "undefined") {
  537. $.ajax("templates/" + name + ".jade", {
  538. async: false,
  539. success: function(data) {
  540. cache[name] = jade.compile(data);
  541. }
  542. });
  543. }
  544. return cache[name];
  545. };
  546. }();
  547.  
  548. FK.addPageContent = function(data, textStatus, jqXHR) {
  549. "use strict";
  550. $("outer-tab-content").html(data);
  551. $("#processingContainer").hide();
  552. };
  553.  
  554. FK.getSellerId = function() {
  555. var queryObject = FK.searchToObject();
  556. if (queryObject.hasOwnProperty("sellerId")) {
  557. this.debug(queryObject.sellerId);
  558. return queryObject.sellerId;
  559. } else {
  560. return $.cookie("sellerId") || "abc";
  561. }
  562. };
  563.  
  564. FK.getSellerIdFromQuery = function() {
  565. return FK.searchToObject().sellerId;
  566. };
  567.  
  568. FK.getSellerObjectBySellerId = function(callback) {
  569. $.ajax({
  570. type: "GET",
  571. cache: false,
  572. headers: {
  573. "cache-control": "no-cache",
  574. pragma: "no-cache"
  575. },
  576. url: "seller/" + FK.getSellerId(),
  577. success: function(result) {
  578. callback(result);
  579. },
  580. error: function(err) {
  581. callback(null, err);
  582. }
  583. });
  584. };
  585.  
  586. FK.getCityByPincode = function(pincode, callback) {
  587. $.ajax("onboarding/fkl/" + encodeURIComponent(pincode) + "/get_city", {
  588. success: function(response) {
  589. if (JSON.parse(response).code === 1e3) {
  590. var city = JSON.parse(response).data;
  591. callback(city, null);
  592. }
  593. },
  594. error: function(error) {
  595. callback(null, error);
  596. }
  597. });
  598. };
  599.  
  600. FK.getPincodeServiceability = function(pincode, callback) {
  601. $.ajax("onboarding/fkl/" + encodeURIComponent(pincode) + "/check_serviceability", {
  602. success: function(result) {
  603. callback(result, null);
  604. },
  605. error: function(error) {
  606. callback(null, error);
  607. }
  608. });
  609. };
  610.  
  611. FK.getSellerBank = function(callback) {
  612. $.ajax({
  613. type: "GET",
  614. headers: {
  615. "cache-control": "no-cache"
  616. },
  617. url: encodeURI("seller/" + FK.getSellerId() + "/bank"),
  618. success: function(data) {
  619. callback(data);
  620. },
  621. error: function(err) {
  622. callback(null, err);
  623. }
  624. });
  625. };
  626.  
  627. FK.getBanks = function(callback, bankName) {
  628. $.ajax({
  629. type: "GET",
  630. url: encodeURI("manageProfile/banks"),
  631. success: function(data) {
  632. banks = data;
  633. callback(data);
  634. FK.getStatesByBankName(bankName, setBankStatesDropdown);
  635. }
  636. });
  637. };
  638.  
  639. FK.getStatesByBankName = function(bank, callback) {
  640. var bankId = FK.getBankId(bank);
  641. $.ajax({
  642. type: "GET",
  643. url: encodeURI("manageProfile/banks?bankId=" + bankId),
  644. success: function(data) {
  645. callback(data);
  646. if (sellerBankState) {
  647. FK.getCitiesByBankAndState(bank, sellerBankState, setBankCitiesDropdown);
  648. }
  649. }
  650. });
  651. };
  652.  
  653. FK.getCitiesByBankName = function(bank, callback) {
  654. var bankId = FK.getBankId(bank);
  655. $.ajax({
  656. type: "GET",
  657. url: encodeURI("manageProfile/banks?bankId=" + bankId),
  658. success: function(data) {
  659. callback(data);
  660. if (sellerBankCity) {
  661. FK.getBankBranches(bank, sellerBankCity, setBankBranchesDropdown);
  662. }
  663. }
  664. });
  665. };
  666.  
  667. FK.getCitiesByBankAndState = function(bank, state, callback) {
  668. var bankId = FK.getBankId(bank);
  669. $.ajax({
  670. type: "GET",
  671. url: encodeURI("manageProfile/banks?bankId=" + bankId + "&state=" + state),
  672. success: function(data) {
  673. callback(data);
  674. if (sellerBankCity) {
  675. FK.getBankBranches(bank, sellerBankCity, setBankBranchesDropdown);
  676. }
  677. }
  678. });
  679. };
  680.  
  681. FK.getBankBranches = function(bank, city, callback) {
  682. var bankId = FK.getBankId(bank);
  683. $.ajax({
  684. type: "GET",
  685. url: encodeURI("manageProfile/banks?bankId=" + bankId + "&city=" + city),
  686. success: function(data) {
  687. bankBranches = data;
  688. callback(data);
  689. }
  690. });
  691. };
  692.  
  693. FK.getBankId = function(bankName) {
  694. var i = 0, bankId;
  695. while (i < banks.length && !(banks[i].name === bankName)) {
  696. i++;
  697. }
  698. bankId = banks[i].id;
  699. return bankId;
  700. };
  701.  
  702. FK.removeCookies = function() {
  703. $.removeCookie("is_login");
  704. $.removeCookie("sellerId");
  705. FK.loggedIn = false;
  706. };
  707.  
  708. FK.logout = function() {
  709. FK.debug("LogOut Called");
  710. $.ajax({
  711. type: "GET",
  712. url: "logout",
  713. success: function(result) {
  714. if (result) {
  715. var url = "/";
  716. $(location).attr("href", url);
  717. }
  718. }
  719. });
  720. FK.removeCookies();
  721. return false;
  722. };
  723.  
  724. FK.isDefined = function(v) {
  725. return v != null && typeof v !== "undefined";
  726. };
  727.  
  728. FK.apply = function(o, c, defaults) {
  729. if (defaults) {
  730. FK.apply(o, defaults);
  731. }
  732. if (o && c && typeof c == "object") {
  733. for (var p in c) {
  734. if (FK.isDefined(c[p])) {
  735. o[p] = c[p];
  736. }
  737. }
  738. }
  739. return o;
  740. };
  741.  
  742. FK.applyIf = function(o, c) {
  743. if (o) {
  744. for (var p in c) {
  745. if (!FK.isDefined(o[p])) {
  746. o[p] = c[p];
  747. }
  748. }
  749. }
  750. return o;
  751. };
  752.  
  753. FK.extend = function(b, opts) {
  754. if (typeof b === "function") {
  755. return function(config) {
  756. var props = {};
  757. if (opts != undefined) {
  758. for (var key in opts) {
  759. if (opts.hasOwnProperty(key)) {
  760. props[key] = {
  761. value: opts[key],
  762. enumerable: true,
  763. writable: true
  764. };
  765. }
  766. }
  767. }
  768. var parent = new b();
  769. var obj = Object.create(parent, props);
  770. if (obj.init && typeof obj.init === "function") obj.init(config);
  771. return obj;
  772. };
  773. }
  774. return false;
  775. };
  776.  
  777. FK.Bus = function() {
  778. var map = {};
  779. return {
  780. on: function(token, listener) {
  781. map[token] = listener;
  782. },
  783. fire: function(token, data) {
  784. map[token](data);
  785. }
  786. };
  787. }();
  788.  
  789. FK.searchToObject = function() {
  790. var pairs = window.location.search.substring(1).split("&"), obj = {}, pair, i;
  791. for (i = 0; i < pairs.length; i++) {
  792. if (pairs[i] === "") continue;
  793. pair = pairs[i].split("=");
  794. obj[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
  795. }
  796. return obj;
  797. };
  798.  
  799. FK.formToJSON = function($form) {
  800. if (!($form instanceof jQuery)) {
  801. $form = $($form);
  802. }
  803. var o = {};
  804. var a = $form.serializeArray();
  805. $.each(a, function() {
  806. if (o[this.name] !== undefined) {
  807. if (!o[this.name].push) {
  808. o[this.name] = [ o[this.name] ];
  809. }
  810. o[this.name].push(this.value || "");
  811. } else {
  812. o[this.name] = this.value || "";
  813. }
  814. });
  815. return o;
  816. };
  817.  
  818. function rawurlencode(str) {
  819. str = (str + "").toString();
  820. return encodeURIComponent(str).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A");
  821. }
  822.  
  823. FK.encodePassword = function(plainTextPassword) {
  824. var y = rawurlencode(plainTextPassword);
  825. var map = [ [ "@", "%40" ], [ "*", "%2A" ], [ "/", "%2F" ], [ "+", "%2B" ], [ "%7E", "~" ] ];
  826. var i;
  827. for (i = 0; i < map.length; i++) {
  828. y = y.replace(map[i][1], map[i][0]);
  829. }
  830. y = $.trim(y);
  831. return MD5(y);
  832. };
  833.  
  834. FK.debug = function(msg) {
  835. if ("undefined" != typeof console) {
  836. console.log(msg);
  837. }
  838. };
  839.  
  840. FK.disableSellerMenu = function() {
  841. $("#listings, #accountingLinkAnchor, #ordersLinkAnchor").addClass("disabled").click(function(e) {
  842. e.preventDefault();
  843. });
  844. $("#accountingCaret, #ordersCaret").addClass("disabled");
  845. };
  846.  
  847. FK.nullLinkHandler = function(e) {
  848. e.preventDefault();
  849. };
  850.  
  851. if (typeof String.prototype.trim !== "function") {
  852. String.prototype.trim = function() {
  853. return this.replace(/^\s+|\s+$/g, "");
  854. };
  855. }
  856.  
  857. if (!Function.prototype.bind) {
  858. Function.prototype.bind = function(oThis) {
  859. if (typeof this !== "function") {
  860. throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  861. }
  862. var aArgs = Array.prototype.slice.call(arguments, 1), fToBind = this, fNOP = function() {}, fBound = function() {
  863. return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
  864. };
  865. fNOP.prototype = this.prototype;
  866. fBound.prototype = new fNOP();
  867. return fBound;
  868. };
  869. }
  870.  
  871. FK.setUpWarnings = function() {
  872. var sellerChecklist = {};
  873. var featureConfigs = jQuery.parseJSON($("#featureConfigsDashboard").val()), bankAccountVerificationActive = featureConfigs && featureConfigs.bankAccountVerification || false;
  874. if (bankAccountVerificationActive) {
  875. $.ajax({
  876. type: "GET",
  877. headers: {
  878. "cache-control": "no-cache"
  879. },
  880. url: "seller/" + FK.getSellerId() + "/status?sellerId=" + FK.getSellerId(),
  881. success: function(data) {
  882. sellerChecklist = data.data.checklist;
  883. $.ajax({
  884. type: "GET",
  885. headers: {
  886. "cache-control": "no-cache"
  887. },
  888. url: "manageProfile/verification/bankAccount/transferData?sellerId=" + FK.getSellerId(),
  889. success: function(transferData) {
  890. var latestTransferData = jQuery.parseJSON(transferData);
  891. if (latestTransferData.content && latestTransferData.content.length > 0 && latestTransferData.content[0].disbursement_status === "SCHEDULED") {
  892. FK.alert.persist("Please go to your Profile and confirm your Bank Account.", "bank-info");
  893. } else if (latestTransferData.code == 1e3) {
  894. if (!(sellerChecklist.bank == "verification_success")) {
  895. if (latestTransferData.data && latestTransferData.data.length > 0 && latestTransferData.data[0].state == "INITIATED") {
  896. FK.alert.persist("Please go to your Profile and confirm your Bank Account.", "bank-info");
  897. }
  898. }
  899. }
  900. }
  901. });
  902. }
  903. });
  904. }
  905. };
  906.  
  907. FK.alert = {
  908. _alert: function(message, classes) {
  909. var a = $('<div class="alert ' + classes + '" data-target="#message-area">' + '<button type="button" class="close" data-dismiss="alert">×</button>' + message + "</div>"), $messageArea = $("#message-area");
  910. if (a.hasClass("persistent-message")) {
  911. a.find(".close").remove();
  912. }
  913. if (classes.indexOf("error") != -1) {
  914. $messageArea.find(".alert-error").remove();
  915. }
  916. $("#message-area").append(a).show();
  917. a.alert().trigger("fk.alert");
  918. if (classes.indexOf("alert-success") > -1) {
  919. setTimeout(function() {
  920. a.alert("close");
  921. }, 5e3);
  922. }
  923. },
  924. error: function(message, helper) {
  925. this._alert(message, "alert-error " + helper);
  926. },
  927. success: function(message) {
  928. this._alert(message, "alert-success");
  929. },
  930. information: function(message) {
  931. this._alert(message, "alert-info");
  932. },
  933. warning: function(message) {
  934. "use strict";
  935. this._alert(message, "alert-warning");
  936. },
  937. persist: function(message, type) {
  938. "use strict";
  939. this._alert(message, "alert-warning persistent-message " + type);
  940. },
  941. remove: function(type) {
  942. "use strict";
  943. $("#message-area").find("." + type).remove();
  944. },
  945. allowLink: function(message, type) {
  946. "use strict";
  947. this._alert(message, "alert-" + type + " with-link");
  948. }
  949. };
  950.  
  951. FK.getQueryParameterByName = function(name) {
  952. var match = RegExp("[?&]" + name + "=([^&]*)").exec(window.location.search);
  953. return match && decodeURIComponent(match[1].replace(/\+/g, " "));
  954. };
  955.  
  956. FK.getUrlParameterByName = function(name) {
  957. var match = RegExp(name + "\\/(.+)").exec(window.location.href);
  958. return match && decodeURIComponent(match[1].replace(/\+/g, " "));
  959. };
  960.  
  961. FK.getAllUrlParameterByName = function(name) {
  962. var match = RegExp(name + "\\/([a-zA-Z0-9-_]*)").exec(window.location.href);
  963. return match && decodeURIComponent(match[1].replace(/\+/g, " "));
  964. };
  965.  
  966. FK.formatDate = function(date) {
  967. if (date == "-" || date == null) return;
  968. var date = new Date(date);
  969. return monthNames[date.getMonth()] + " " + date.getDate() + ", " + +date.getFullYear();
  970. };
  971.  
  972. FK.activateRateCardLink = function(ordDate) {
  973. var activate = false;
  974. var limitDate = "2016-06-20";
  975. if (!ordDate) return activate;
  976. var oDate = new Date(ordDate);
  977. var dd = oDate.getDate();
  978. var mm = oDate.getMonth() + 1;
  979. var yyyy = oDate.getFullYear();
  980. dd = dd < 10 ? dd = "0" + dd : dd;
  981. mm = mm < 10 ? mm = "0" + mm : mm;
  982. var orderDate = yyyy + "-" + mm + "-" + dd;
  983. if (orderDate >= limitDate) {
  984. activate = true;
  985. }
  986. return activate;
  987. };
  988.  
  989. FK.autoCommaMoneyValues = function(amount) {
  990. "use strict";
  991. if (typeof amount !== "string") {
  992. amount = amount.toString();
  993. }
  994. var delimiter = ",", a = amount.split(".", 2), d = a[1], i = parseInt(a[0]), minus = "", n = new String(i), nn = "";
  995. if (isNaN(i)) {
  996. return "";
  997. }
  998. if (i < 0) {
  999. minus = "-";
  1000. }
  1001. i = Math.abs(i);
  1002. a = [];
  1003. nn = n.substr(n.length - 3);
  1004. a.unshift(nn);
  1005. n = n.substr(0, n.length - 3);
  1006. while (n.length > 2) {
  1007. nn = n.substr(n.length - 2);
  1008. a.unshift(nn);
  1009. n = n.substr(0, n.length - 2);
  1010. }
  1011. if (n.length > 0) {
  1012. a.unshift(n);
  1013. }
  1014. n = a.join(delimiter);
  1015. if (d === undefined || d.length < 1) {
  1016. amount = n;
  1017. } else {
  1018. amount = n + "." + d;
  1019. }
  1020. amount = minus + amount;
  1021. return amount;
  1022. };
  1023.  
  1024. FK.checkBulkRTS = function() {
  1025. FK.checkProcessingStatus();
  1026. };
  1027.  
  1028. FK.checkProcessingStatus = function() {
  1029. $.ajax({
  1030. url: "onboarding/seller/" + FK.getSellerId() + "/bulk_rts/is_processed",
  1031. dataType: "json",
  1032. success: function(data, textStatus, jqXHR) {
  1033. if (data.code == 1e3) {
  1034. if (data.data.processed === "DONE") {
  1035. $("#orders-acknowledged").trigger({
  1036. type: "processed_rts",
  1037. error_count: data.data.error_count,
  1038. success_count: data.data.success_count,
  1039. order_item_ids: data.data.order_item_ids
  1040. });
  1041. } else if (data.data.processed === "PROCESSING") {
  1042. $("#orders-acknowledged").trigger("processing_rts");
  1043. FK.alert.information("Please refresh your page to check if the uploaded file has been processed.");
  1044. }
  1045. }
  1046. }
  1047. });
  1048. };
  1049.  
  1050. FK.getQueryParams = function(params) {
  1051. var value = "";
  1052. for (var key in params) {
  1053. if (params[key]) {
  1054. value += "&" + key + "=" + params[key];
  1055. }
  1056. }
  1057. return value;
  1058. };
  1059.  
  1060. FK.getErrorsURLInBulkRTS = function(e) {
  1061. "use strict";
  1062. var td = new Date();
  1063. var csv_errors = FK.getQueryParams({
  1064. url: encodeURIComponent("/proxy/seller/" + FK.getSellerId() + "/bulk_rts/errors"),
  1065. fields: "orderId,orderItemId,orderCreatedDate,sku,imei,productId,quantity,invoiceNo,invoiceDate,invoiceAmount,taxAmount,status,errors",
  1066. headerFields: "Order Id,Order Item Id,Order Date,SKU,IMEI,Product Id,Quantity,Invoice No,Invoice Date,Invoice Amount,Tax Amount,Status,ERRORS",
  1067. root: "data.errors",
  1068. filename: "errors-confirmed-orders-" + td.getFullYear() + "-" + (td.getMonth() + 1) + "-" + td.getDate()
  1069. });
  1070. return csv_errors;
  1071. };
  1072.  
  1073. FK.compareByField = function(prop) {
  1074. return function(a, b) {
  1075. if (a[prop] < b[prop]) {
  1076. return -1;
  1077. } else if (a[prop] > b[prop]) {
  1078. return 1;
  1079. } else {
  1080. return 0;
  1081. }
  1082. };
  1083. };
  1084.  
  1085. $(function() {
  1086. $("#forgotPasswordLink").click(function() {
  1087. $("#forgotPasswordError").hide();
  1088. $("#forgotPasswordSuccess").hide();
  1089. $("#forgotPasswordForm")[0].reset();
  1090. });
  1091. $("#forgotPasswordForm").validate({
  1092. rules: {
  1093. forgotPasswordEmail: {
  1094. email: true,
  1095. required: true
  1096. }
  1097. },
  1098. messages: {
  1099. forgotPasswordEmail: {
  1100. email: "Please enter a valid email address"
  1101. }
  1102. },
  1103. submitHandler: function(form) {
  1104. $("#forgotPasswordButton").data("type", "button");
  1105. $("#forgotPasswordButton").html('<img src="images/btn-primary-loader.gif">');
  1106. $.ajax({
  1107. type: "POST",
  1108. data: $(form).serialize(),
  1109. url: "/forgot",
  1110. success: function(data) {
  1111. $("#forgotPasswordButton").data("type", "submit");
  1112. $("#forgotPasswordButton").html("Send Email");
  1113. $("#forgotPasswordError").hide();
  1114. $("#forgotPasswordSuccess").html("The link to create a new password has been sent to your email address at " + $("#emailId").val() + ". Please check your inbox").show();
  1115. },
  1116. error: function(err) {
  1117. $("#forgotPasswordButton").data("type", "submit");
  1118. $("#forgotPasswordButton").html("Send Email");
  1119. err = jQuery.parseJSON(err.responseText);
  1120. if (err.code === 1008) {
  1121. $("#forgotPasswordSuccess").hide();
  1122. $("#forgotPasswordError").html("Account does not exist").show();
  1123. } else {
  1124. $("#forgotPasswordSuccess").hide();
  1125. $("#forgotPasswordError").html("Something went wrong. Please try again").show();
  1126. }
  1127. }
  1128. });
  1129. return false;
  1130. }
  1131. });
  1132. });
  1133.  
  1134. (function(l, f) {
  1135. function m() {
  1136. var a = e.elements;
  1137. return "string" == typeof a ? a.split(" ") : a;
  1138. }
  1139. function i(a) {
  1140. var b = n[a[o]];
  1141. b || (b = {}, h++, a[o] = h, n[h] = b);
  1142. return b;
  1143. }
  1144. function p(a, b, c) {
  1145. b || (b = f);
  1146. if (g) return b.createElement(a);
  1147. c || (c = i(b));
  1148. b = c.cache[a] ? c.cache[a].cloneNode() : r.test(a) ? (c.cache[a] = c.createElem(a)).cloneNode() : c.createElem(a);
  1149. return b.canHaveChildren && !s.test(a) ? c.frag.appendChild(b) : b;
  1150. }
  1151. function t(a, b) {
  1152. if (!b.cache) b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment,
  1153. b.frag = b.createFrag();
  1154. a.createElement = function(c) {
  1155. return !e.shivMethods ? b.createElem(c) : p(c, a, b);
  1156. };
  1157. a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + m().join().replace(/\w+/g, function(a) {
  1158. b.createElem(a);
  1159. b.frag.createElement(a);
  1160. return 'c("' + a + '")';
  1161. }) + ");return n}")(e, b.frag);
  1162. }
  1163. function q(a) {
  1164. a || (a = f);
  1165. var b = i(a);
  1166. if (e.shivCSS && !j && !b.hasCSS) {
  1167. var c, d = a;
  1168. c = d.createElement("p");
  1169. d = d.getElementsByTagName("head")[0] || d.documentElement;
  1170. c.innerHTML = "x<style>article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
  1171. c = d.insertBefore(c.lastChild, d.firstChild);
  1172. b.hasCSS = !!c;
  1173. }
  1174. g || t(a, b);
  1175. return a;
  1176. }
  1177. var k = l.html5 || {}, s = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, r = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i, j, o = "_html5shiv", h = 0, n = {}, g;
  1178. (function() {
  1179. try {
  1180. var a = f.createElement("a");
  1181. a.innerHTML = "<xyz></xyz>";
  1182. j = "hidden" in a;
  1183. var b;
  1184. if (!(b = 1 == a.childNodes.length)) {
  1185. f.createElement("a");
  1186. var c = f.createDocumentFragment();
  1187. b = "undefined" == typeof c.cloneNode || "undefined" == typeof c.createDocumentFragment || "undefined" == typeof c.createElement;
  1188. }
  1189. g = b;
  1190. } catch (d) {
  1191. g = j = !0;
  1192. }
  1193. })();
  1194. var e = {
  1195. elements: k.elements || "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video",
  1196. version: "3.6.2",
  1197. shivCSS: !1 !== k.shivCSS,
  1198. supportsUnknownElements: g,
  1199. shivMethods: !1 !== k.shivMethods,
  1200. type: "default",
  1201. shivDocument: q,
  1202. createElement: p,
  1203. createDocumentFragment: function(a, b) {
  1204. a || (a = f);
  1205. if (g) return a.createDocumentFragment();
  1206. for (var b = b || i(a), c = b.frag.cloneNode(), d = 0, e = m(), h = e.length; d < h; d++) c.createElement(e[d]);
  1207. return c;
  1208. }
  1209. };
  1210. l.html5 = e;
  1211. q(f);
  1212. })(this, document);
  1213.  
  1214. $(function() {
  1215. var ajaxCallTimeout = 2e3;
  1216. var queryString = location.search;
  1217. $("#contactModalClose").on("click", function() {
  1218. $("#contactSSSuccess").hide();
  1219. $("#contactSSError").hide();
  1220. $("#altEmailLabel").hide();
  1221. $("#alt-emailId").hide();
  1222. $("#alt-emailId").next("label").hide();
  1223. $("#contactSS").text(" Submit");
  1224. $("#contactSS").removeAttr("disabled");
  1225. $("#contactSSForm").trigger("reset");
  1226. });
  1227. $(".start-selling-btn").each(function() {
  1228. $(this).attr("href", $(this).attr("href") + queryString);
  1229. });
  1230. $("#edit-submit").on("click", function() {
  1231. _gaq.push([ "_trackEvent", "SLP", "Login", "Login" ]);
  1232. });
  1233. $("#edit-submit--2").on("click", function() {
  1234. _gaq.push([ "_trackEvent", "SLP", "Start_Selling", "Register_today" ]);
  1235. });
  1236. $("#rcb").on("click", function() {
  1237. if (!$("#rcb").is(":checked")) {
  1238. $("#phoneNumber").next("label").hide();
  1239. }
  1240. });
  1241. $(".slp_seller_form").each(function() {
  1242. $(this).validate({
  1243. rules: {
  1244. email: {
  1245. required: true,
  1246. email: true
  1247. },
  1248. phone: {
  1249. required: true,
  1250. phoneNumber: true
  1251. }
  1252. }
  1253. });
  1254. });
  1255. $(".slp_seller_form").on("submit", function(event) {
  1256. event.preventDefault();
  1257. if ($(this).valid()) {
  1258. var formData = $(this).serializeArray();
  1259. for (var i = 0; i < formData.length; i++) {
  1260. sessionSetItem(formData[i].name, formData[i].value);
  1261. }
  1262. location.href = "/index.html#signUp/accountCreation/new" + queryString;
  1263. }
  1264. });
  1265. var sessionSetItem = function(key, value) {
  1266. var appData = sessionStorage.getItem("__appData");
  1267. if (appData == null) {
  1268. appData = {};
  1269. } else {
  1270. appData = JSON.parse(appData);
  1271. }
  1272. appData[key] = value;
  1273. return sessionStorage.setItem("__appData", JSON.stringify(appData));
  1274. };
  1275. $.validator.addMethod("phoneNumber", function(value, element) {
  1276. if (this.optional(element)) {
  1277. return true;
  1278. }
  1279. return /^[1-9][0-9]{9}$/.test(value);
  1280. }, "Please enter a valid phone number");
  1281. $.validator.addMethod("alternativeEmail", function(value, element) {
  1282. if (this.optional(element)) {
  1283. return true;
  1284. }
  1285. return /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(value);
  1286. }, "Please enter a valid Email Id");
  1287. $.ajax("/sellerRegistrationConfigs", {
  1288. success: function(sellerRegistrationConfigsResponse) {
  1289. var responseJson = jQuery.parseJSON(sellerRegistrationConfigsResponse).data;
  1290. ajaxCallTimeout = responseJson.configs.ajaxCallTimeOut;
  1291. }
  1292. });
  1293. $.ajax("/accessControl", {
  1294. timeout: ajaxCallTimeout,
  1295. success: function(responseData) {
  1296. var responseJson = jQuery.parseJSON(responseData).data;
  1297. var accessControl = responseJson.invitationOnly;
  1298. if (!accessControl) {
  1299. $("#startSellingButton").show();
  1300. $("#signUpLink").show();
  1301. $("#division").show();
  1302. } else {
  1303. $("#sellerInvitationText").show();
  1304. }
  1305. }
  1306. });
  1307. $("#loginInModalLink").click(function() {
  1308. $("#loginError").hide();
  1309. $("#password").val("");
  1310. $("#username").val("");
  1311. $(".contactSellerSupport").hide();
  1312. });
  1313. $(".issueSelect").click(function() {
  1314. var radioValue = $("input[name='issue']:checked").val();
  1315. if (radioValue == 3) {
  1316. $("#altEmailLabel").show();
  1317. $("#alt-emailId").show();
  1318. } else {
  1319. $("#altEmailLabel").hide();
  1320. $("#alt-emailId").hide();
  1321. $("#alt-emailId").next("label").hide();
  1322. }
  1323. });
  1324. function sendLoginEventsForSnoopy(statusCode) {
  1325. var statusCodeMappings = {
  1326. 1e3: "LOGIN_SUCCEEDED",
  1327. 1003: "INVALID_LOGIN_ID",
  1328. 1012: "PASSWORD_INVALID",
  1329. 1031: "ATTEMPT_EXCEEDED",
  1330. 1032: "ACCOUNT_NOT_ACTIVE",
  1331. 1002: "VALIDATION_FAILED",
  1332. 500: "LOGIN_FAILED",
  1333. default: "LOGIN_FAILED"
  1334. };
  1335. var snoopyHelper = FKSP.SnoopyAnalytics("SDDB"), incidentSubmit = {
  1336. entity: {
  1337. name: "Login Errors",
  1338. child: {
  1339. name: "Landing page",
  1340. child: {
  1341. name: statusCodeMappings[statusCode] || statusCodeMappings["default"]
  1342. }
  1343. }
  1344. },
  1345. category: "Login Errors"
  1346. };
  1347. snoopyHelper.track(incidentSubmit);
  1348. }
  1349. function handleLogin(passwordFieldId, password, formId) {
  1350. $.ajax({
  1351. type: "POST",
  1352. data: $(formId).serialize(),
  1353. url: "/login",
  1354. timeout: ajaxCallTimeout,
  1355. success: function(data) {
  1356. var response = data || {};
  1357. if (response.code == 1e3) {
  1358. if (response.data.sellerId) {
  1359. $.cookie("sellerId", response.data.sellerId, {
  1360. path: "/"
  1361. });
  1362. }
  1363. $.cookie("is_login", "true", {
  1364. path: "/"
  1365. });
  1366. $.ajax({
  1367. type: "GET",
  1368. url: "getFeaturesForSeller",
  1369. timeout: ajaxCallTimeout,
  1370. success: updateFeatureStore,
  1371. error: doLogin
  1372. });
  1373. function updateFeatureStore(features) {
  1374. var appData = localStorage.getItem("__appData");
  1375. try {
  1376. if (appData == null || appData === "") {
  1377. throw new Error("invalidJSONString", appData);
  1378. }
  1379. appData = JSON.parse(appData);
  1380. } catch (ex) {
  1381. console.debug(ex);
  1382. appData = {};
  1383. }
  1384. appData["sellerConfig"] = features;
  1385. localStorage.setItem("__appData", JSON.stringify(appData));
  1386. if (features.enableBeta) {
  1387. $.cookie("beta", "true", {
  1388. path: "/",
  1389. expires: 30
  1390. });
  1391. } else {
  1392. $.removeCookie("beta");
  1393. }
  1394. doLogin();
  1395. }
  1396. function doLogin() {
  1397. if (response.data.sellerId) {
  1398. $.cookie("sellerId", response.data.sellerId, {
  1399. path: "/"
  1400. });
  1401. } else {
  1402. window.location.href = "index.html#multi-seller-select";
  1403. return;
  1404. }
  1405. if (response.data.isOnBehalf) {
  1406. if (response.data.onBehalfHomePage) {
  1407. window.location.href = response.data.onBehalfHomePage;
  1408. } else {
  1409. window.location.href = "index.html#dashboard/listings-management?listingState=ACTIVE";
  1410. }
  1411. } else {
  1412. if (response.data.redirectState === 5) {
  1413. var referral_url = FK.searchToObject("referral_url").referral_url;
  1414. var path_regex = /^(?:\/{1}(?:([^\/\\?#]+)))+(?:\/)?(?:\?([^#]*))?(?:#(.*))?$/;
  1415. if (referral_url && path_regex.test(referral_url)) {
  1416. window.location.href = referral_url + window.location.hash;
  1417. } else {
  1418. if (response.data.newStatus === "ONBOARDING") {
  1419. window.location.href = "index.html#dashboard/onboarding/summary";
  1420. } else {
  1421. window.location.href = "index.html#dashboard/home-page";
  1422. }
  1423. }
  1424. } else {
  1425. if (!response.data.task || response.data.task === "mobileVerification") {
  1426. window.location.href = "index.html#dashboard/onboarding/mobileVerification";
  1427. } else {
  1428. window.location.href = "index.html#dashboard/onboarding";
  1429. }
  1430. }
  1431. }
  1432. }
  1433. } else if (response.code == 500) {
  1434. $(".login-err").html("Something went wrong, please try again.").show();
  1435. $(".contactSellerSupport").show();
  1436. $(passwordFieldId).val("");
  1437. } else {
  1438. $(".login-err").html(response.message).show();
  1439. $(".contactSellerSupport").show();
  1440. $(passwordFieldId).val("");
  1441. }
  1442. sendLoginEventsForSnoopy(response.code);
  1443. },
  1444. error: function(error) {
  1445. $(".login-err").html("Something went wrong, please try again.").show();
  1446. $(".contactSellerSupport").show();
  1447. $("#password").val("");
  1448. sendLoginEventsForSnoopy();
  1449. return false;
  1450. }
  1451. });
  1452. }
  1453. function handler(a) {
  1454. var password = $("#password").val();
  1455. handleLogin("#password", password, "#loginForm");
  1456. return false;
  1457. }
  1458. function handlerNew(a) {
  1459. var password = $("#password").val();
  1460. handleLogin("#password", password, "#slp_login_form");
  1461. return false;
  1462. }
  1463. function handlerSmall(a) {
  1464. var password = $("#password-small").val();
  1465. handleLogin("#password-small", password, "#loginForm-small");
  1466. return false;
  1467. }
  1468. $("#loginForm-small").validate({
  1469. rules: {
  1470. username: {
  1471. required: true,
  1472. allowedCharacters: true
  1473. },
  1474. password: {
  1475. required: true
  1476. }
  1477. },
  1478. messages: {
  1479. username: {
  1480. required: ""
  1481. },
  1482. password: {
  1483. required: ""
  1484. }
  1485. },
  1486. submitHandler: handlerSmall
  1487. });
  1488. $("#loginForm").validate({
  1489. rules: {
  1490. username: {
  1491. required: true,
  1492. allowedCharacters: true
  1493. },
  1494. password: {
  1495. required: true
  1496. }
  1497. },
  1498. messages: {
  1499. username: {
  1500. required: ""
  1501. },
  1502. password: {
  1503. required: ""
  1504. }
  1505. },
  1506. submitHandler: handler,
  1507. errorPlacement: function(error, element) {
  1508. error.appendTo($("#errorContainer"));
  1509. }
  1510. });
  1511. $("#slp_login_form").validate({
  1512. rules: {
  1513. username: {
  1514. required: true,
  1515. allowedCharacters: true
  1516. },
  1517. password: {
  1518. required: true
  1519. }
  1520. },
  1521. messages: {
  1522. username: {
  1523. required: ""
  1524. },
  1525. password: {
  1526. required: ""
  1527. }
  1528. },
  1529. submitHandler: handlerNew,
  1530. errorPlacement: function(error, element) {
  1531. error.appendTo($("#errorContainer"));
  1532. }
  1533. });
  1534. $("#forgotPasswordForm").validate({
  1535. rules: {
  1536. forgotPasswordEmail: {
  1537. email: true,
  1538. required: true
  1539. }
  1540. },
  1541. messages: {
  1542. forgotPasswordEmail: {
  1543. email: "Please enter a valid email address"
  1544. }
  1545. },
  1546. submitHandler: function(form) {
  1547. $.ajax({
  1548. type: "POST",
  1549. data: $(form).serialize(),
  1550. url: "/forgot",
  1551. timeout: ajaxCallTimeout,
  1552. success: function(data) {
  1553. $("#forgotPasswordError").hide();
  1554. $("#forgotPasswordSuccess").html("An email is sent to " + $("#emailId").val() + ". Please check your email.").show();
  1555. },
  1556. error: function(err) {
  1557. err = jQuery.parseJSON(err.responseText);
  1558. if (err.text) {
  1559. var text = JSON.parse(err.text);
  1560. }
  1561. if (err.code === 1008) {
  1562. $("#forgotPasswordSuccess").hide();
  1563. $("#forgotPasswordError").html("Account does not exist").show();
  1564. } else if (err.statusCode === 400) {
  1565. $("#forgotPasswordSuccess").hide();
  1566. $("#forgotPasswordError").html(text.errors[0].message).show();
  1567. } else {
  1568. $("#forgotPasswordSuccess").hide();
  1569. $("#forgotPasswordError").html("Something went wrong. Please try again").show();
  1570. }
  1571. }
  1572. });
  1573. return false;
  1574. }
  1575. });
  1576. $("#contactSSForm").validate({
  1577. rules: {
  1578. registeredEmail: {
  1579. email: true,
  1580. required: true
  1581. },
  1582. alternativeEmail: {
  1583. email: "#issue[value='3']:checked" || false,
  1584. required: "#issue[value='3']:checked" || false
  1585. },
  1586. phoneNumber: {
  1587. phoneNumber: true,
  1588. required: "#rcb:checked" || false
  1589. },
  1590. issueDesc: {
  1591. required: true
  1592. }
  1593. },
  1594. messages: {
  1595. registeredEmail: {
  1596. email: "Please enter a valid email address"
  1597. },
  1598. alternativeEmail: {
  1599. email: "Please enter a valid email address"
  1600. },
  1601. phoneNumber: {
  1602. phoneNumber: "Please enter a valid phone number"
  1603. }
  1604. },
  1605. submitHandler: function(form) {
  1606. $("#contactSS").text(" Submitting...");
  1607. $("#contactSS").attr("disabled", true);
  1608. var snoopyHelper = FKSP.SnoopyAnalytics("SDDB"), incidentSubmit = {
  1609. entity: {
  1610. name: "Incident Creation",
  1611. child: {
  1612. name: "Landing page",
  1613. child: {
  1614. name: "Unable to login? - Popup",
  1615. child: {
  1616. name: "Submit - Incident"
  1617. }
  1618. }
  1619. }
  1620. },
  1621. category: "Incident Creation"
  1622. };
  1623. snoopyHelper.track(incidentSubmit);
  1624. $.ajax({
  1625. type: "POST",
  1626. data: $(form).serialize(),
  1627. url: "/napi/srm/preLoginIncident",
  1628. timeout: ajaxCallTimeout,
  1629. success: function(data) {
  1630. $("#contactSSError").hide();
  1631. $("#contactSS").text(" Submitted");
  1632. if (data.result && data.result.attemptStart) {
  1633. var startDate = new Date(data.result.attemptStart), date = startDate.toLocaleDateString(), rcbTime = startDate.toLocaleTimeString(), time = date + " : " + rcbTime;
  1634. $("#contactSSSuccess").html(data.result.incidentId + " is Successfully Created. Seller support executive will call you by " + time).show();
  1635. } else if (data.result.callSlotNotAvailable) {
  1636. $("#contactSSSuccess").html(data.result.issueId + " is Successfully Created. Seller support executive will get in touch with you on your email id as no slots found for a callback.").show();
  1637. } else {
  1638. $("#contactSSSuccess").html(data.result.issueId + " is successfully created. Seller support executive will get in touch with you on your email id.").show();
  1639. }
  1640. },
  1641. error: function(err) {
  1642. $("#contactSS").text(" Submit");
  1643. $("#contactSS").removeAttr("disabled");
  1644. err = jQuery.parseJSON(err.responseText);
  1645. if (err.text) {
  1646. var text = JSON.parse(err.text);
  1647. }
  1648. if (err.error.statusCode === 1008) {
  1649. $("#contactSSSuccess").hide();
  1650. $("#contactSSError").html("Account does not exist").show();
  1651. } else if (err.error.statusCode === 400) {
  1652. var errMsg = typeof err.error.error.errors[0].message === "undefined" ? "" : err.error.error.errors[0].message, errCode = typeof err.error.error.errors[0].code === "undefined" ? "" : err.error.error.errors[0].code;
  1653. if (errMsg) {
  1654. $("#contactSSSuccess").hide();
  1655. $("#contactSSError").html(errMsg).show();
  1656. }
  1657. } else {
  1658. $("#contactSSSuccess").hide();
  1659. $("#contactSSError").html("Something went wrong. Please try again").show();
  1660. }
  1661. }
  1662. });
  1663. return false;
  1664. }
  1665. });
  1666. });
  1667.  
  1668. if (typeof JSON !== "object") {
  1669. JSON = {};
  1670. }
  1671.  
  1672. (function() {
  1673. "use strict";
  1674. function f(n) {
  1675. return n < 10 ? "0" + n : n;
  1676. }
  1677. if (typeof Date.prototype.toJSON !== "function") {
  1678. Date.prototype.toJSON = function(key) {
  1679. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null;
  1680. };
  1681. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(key) {
  1682. return this.valueOf();
  1683. };
  1684. }
  1685. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1686. "\b": "\\b",
  1687. "\t": "\\t",
  1688. "\n": "\\n",
  1689. "\f": "\\f",
  1690. "\r": "\\r",
  1691. '"': '\\"',
  1692. "\\": "\\\\"
  1693. }, rep;
  1694. function quote(string) {
  1695. escapable.lastIndex = 0;
  1696. return escapable.test(string) ? '"' + string.replace(escapable, function(a) {
  1697. var c = meta[a];
  1698. return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
  1699. }) + '"' : '"' + string + '"';
  1700. }
  1701. function str(key, holder) {
  1702. var i, k, v, length, mind = gap, partial, value = holder[key];
  1703. if (value && typeof value === "object" && typeof value.toJSON === "function") {
  1704. value = value.toJSON(key);
  1705. }
  1706. if (typeof rep === "function") {
  1707. value = rep.call(holder, key, value);
  1708. }
  1709. switch (typeof value) {
  1710. case "string":
  1711. return quote(value);
  1712.  
  1713. case "number":
  1714. return isFinite(value) ? String(value) : "null";
  1715.  
  1716. case "boolean":
  1717. case "null":
  1718. return String(value);
  1719.  
  1720. case "object":
  1721. if (!value) {
  1722. return "null";
  1723. }
  1724. gap += indent;
  1725. partial = [];
  1726. if (Object.prototype.toString.apply(value) === "[object Array]") {
  1727. length = value.length;
  1728. for (i = 0; i < length; i += 1) {
  1729. partial[i] = str(i, value) || "null";
  1730. }
  1731. v = partial.length === 0 ? "[]" : gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial.join(",") + "]";
  1732. gap = mind;
  1733. return v;
  1734. }
  1735. if (rep && typeof rep === "object") {
  1736. length = rep.length;
  1737. for (i = 0; i < length; i += 1) {
  1738. if (typeof rep[i] === "string") {
  1739. k = rep[i];
  1740. v = str(k, value);
  1741. if (v) {
  1742. partial.push(quote(k) + (gap ? ": " : ":") + v);
  1743. }
  1744. }
  1745. }
  1746. } else {
  1747. for (k in value) {
  1748. if (Object.prototype.hasOwnProperty.call(value, k)) {
  1749. v = str(k, value);
  1750. if (v) {
  1751. partial.push(quote(k) + (gap ? ": " : ":") + v);
  1752. }
  1753. }
  1754. }
  1755. }
  1756. v = partial.length === 0 ? "{}" : gap ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial.join(",") + "}";
  1757. gap = mind;
  1758. return v;
  1759. }
  1760. }
  1761. if (typeof JSON.stringify !== "function") {
  1762. JSON.stringify = function(value, replacer, space) {
  1763. var i;
  1764. gap = "";
  1765. indent = "";
  1766. if (typeof space === "number") {
  1767. for (i = 0; i < space; i += 1) {
  1768. indent += " ";
  1769. }
  1770. } else if (typeof space === "string") {
  1771. indent = space;
  1772. }
  1773. rep = replacer;
  1774. if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
  1775. throw new Error("JSON.stringify");
  1776. }
  1777. return str("", {
  1778. "": value
  1779. });
  1780. };
  1781. }
  1782. if (typeof JSON.parse !== "function") {
  1783. JSON.parse = function(text, reviver) {
  1784. var j;
  1785. function walk(holder, key) {
  1786. var k, v, value = holder[key];
  1787. if (value && typeof value === "object") {
  1788. for (k in value) {
  1789. if (Object.prototype.hasOwnProperty.call(value, k)) {
  1790. v = walk(value, k);
  1791. if (v !== undefined) {
  1792. value[k] = v;
  1793. } else {
  1794. delete value[k];
  1795. }
  1796. }
  1797. }
  1798. }
  1799. return reviver.call(holder, key, value);
  1800. }
  1801. text = String(text);
  1802. cx.lastIndex = 0;
  1803. if (cx.test(text)) {
  1804. text = text.replace(cx, function(a) {
  1805. return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
  1806. });
  1807. }
  1808. if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
  1809. j = eval("(" + text + ")");
  1810. return typeof reviver === "function" ? walk({
  1811. "": j
  1812. }, "") : j;
  1813. }
  1814. throw new SyntaxError("JSON.parse");
  1815. };
  1816. }
  1817. })();
  1818.  
  1819. window.Modernizr = function(a, b, c) {
  1820. function D(a) {
  1821. j.cssText = a;
  1822. }
  1823. function E(a, b) {
  1824. return D(n.join(a + ";") + (b || ""));
  1825. }
  1826. function F(a, b) {
  1827. return typeof a === b;
  1828. }
  1829. function G(a, b) {
  1830. return !!~("" + a).indexOf(b);
  1831. }
  1832. function H(a, b) {
  1833. for (var d in a) {
  1834. var e = a[d];
  1835. if (!G(e, "-") && j[e] !== c) return b == "pfx" ? e : !0;
  1836. }
  1837. return !1;
  1838. }
  1839. function I(a, b, d) {
  1840. for (var e in a) {
  1841. var f = b[a[e]];
  1842. if (f !== c) return d === !1 ? a[e] : F(f, "function") ? f.bind(d || b) : f;
  1843. }
  1844. return !1;
  1845. }
  1846. function J(a, b, c) {
  1847. var d = a.charAt(0).toUpperCase() + a.slice(1), e = (a + " " + p.join(d + " ") + d).split(" ");
  1848. return F(b, "string") || F(b, "undefined") ? H(e, b) : (e = (a + " " + q.join(d + " ") + d).split(" "),
  1849. I(e, b, c));
  1850. }
  1851. function K() {
  1852. e.input = function(c) {
  1853. for (var d = 0, e = c.length; d < e; d++) u[c[d]] = c[d] in k;
  1854. return u.list && (u.list = !!b.createElement("datalist") && !!a.HTMLDataListElement),
  1855. u;
  1856. }("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),
  1857. e.inputtypes = function(a) {
  1858. for (var d = 0, e, f, h, i = a.length; d < i; d++) k.setAttribute("type", f = a[d]),
  1859. e = k.type !== "text", e && (k.value = l, k.style.cssText = "position:absolute;visibility:hidden;",
  1860. /^range$/.test(f) && k.style.WebkitAppearance !== c ? (g.appendChild(k), h = b.defaultView,
  1861. e = h.getComputedStyle && h.getComputedStyle(k, null).WebkitAppearance !== "textfield" && k.offsetHeight !== 0,
  1862. g.removeChild(k)) : /^(search|tel)$/.test(f) || (/^(url|email)$/.test(f) ? e = k.checkValidity && k.checkValidity() === !1 : e = k.value != l)),
  1863. t[a[d]] = !!e;
  1864. return t;
  1865. }("search tel url email datetime date month week time datetime-local number range color".split(" "));
  1866. }
  1867. var d = "2.6.2", e = {}, f = !0, g = b.documentElement, h = "modernizr", i = b.createElement(h), j = i.style, k = b.createElement("input"), l = ":)", m = {}.toString, n = " -webkit- -moz- -o- -ms- ".split(" "), o = "Webkit Moz O ms", p = o.split(" "), q = o.toLowerCase().split(" "), r = {
  1868. svg: "http://www.w3.org/2000/svg"
  1869. }, s = {}, t = {}, u = {}, v = [], w = v.slice, x, y = function(a, c, d, e) {
  1870. var f, i, j, k, l = b.createElement("div"), m = b.body, n = m || b.createElement("body");
  1871. if (parseInt(d, 10)) while (d--) j = b.createElement("div"), j.id = e ? e[d] : h + (d + 1),
  1872. l.appendChild(j);
  1873. return f = [ "&#173;", '<style id="s', h, '">', a, "</style>" ].join(""), l.id = h,
  1874. (m ? l : n).innerHTML += f, n.appendChild(l), m || (n.style.background = "", n.style.overflow = "hidden",
  1875. k = g.style.overflow, g.style.overflow = "hidden", g.appendChild(n)), i = c(l, a),
  1876. m ? l.parentNode.removeChild(l) : (n.parentNode.removeChild(n), g.style.overflow = k),
  1877. !!i;
  1878. }, z = function(b) {
  1879. var c = a.matchMedia || a.msMatchMedia;
  1880. if (c) return c(b).matches;
  1881. var d;
  1882. return y("@media " + b + " { #" + h + " { position: absolute; } }", function(b) {
  1883. d = (a.getComputedStyle ? getComputedStyle(b, null) : b.currentStyle)["position"] == "absolute";
  1884. }), d;
  1885. }, A = function() {
  1886. function d(d, e) {
  1887. e = e || b.createElement(a[d] || "div"), d = "on" + d;
  1888. var f = d in e;
  1889. return f || (e.setAttribute || (e = b.createElement("div")), e.setAttribute && e.removeAttribute && (e.setAttribute(d, ""),
  1890. f = F(e[d], "function"), F(e[d], "undefined") || (e[d] = c), e.removeAttribute(d))),
  1891. e = null, f;
  1892. }
  1893. var a = {
  1894. select: "input",
  1895. change: "input",
  1896. submit: "form",
  1897. reset: "form",
  1898. error: "img",
  1899. load: "img",
  1900. abort: "img"
  1901. };
  1902. return d;
  1903. }(), B = {}.hasOwnProperty, C;
  1904. !F(B, "undefined") && !F(B.call, "undefined") ? C = function(a, b) {
  1905. return B.call(a, b);
  1906. } : C = function(a, b) {
  1907. return b in a && F(a.constructor.prototype[b], "undefined");
  1908. }, Function.prototype.bind || (Function.prototype.bind = function(b) {
  1909. var c = this;
  1910. if (typeof c != "function") throw new TypeError();
  1911. var d = w.call(arguments, 1), e = function() {
  1912. if (this instanceof e) {
  1913. var a = function() {};
  1914. a.prototype = c.prototype;
  1915. var f = new a(), g = c.apply(f, d.concat(w.call(arguments)));
  1916. return Object(g) === g ? g : f;
  1917. }
  1918. return c.apply(b, d.concat(w.call(arguments)));
  1919. };
  1920. return e;
  1921. }), s.flexbox = function() {
  1922. return J("flexWrap");
  1923. }, s.canvas = function() {
  1924. var a = b.createElement("canvas");
  1925. return !!a.getContext && !!a.getContext("2d");
  1926. }, s.canvastext = function() {
  1927. return !!e.canvas && !!F(b.createElement("canvas").getContext("2d").fillText, "function");
  1928. }, s.webgl = function() {
  1929. return !!a.WebGLRenderingContext;
  1930. }, s.touch = function() {
  1931. var c;
  1932. return "ontouchstart" in a || a.DocumentTouch && b instanceof DocumentTouch ? c = !0 : y([ "@media (", n.join("touch-enabled),("), h, ")", "{#modernizr{top:9px;position:absolute}}" ].join(""), function(a) {
  1933. c = a.offsetTop === 9;
  1934. }), c;
  1935. }, s.geolocation = function() {
  1936. return "geolocation" in navigator;
  1937. }, s.postmessage = function() {
  1938. return !!a.postMessage;
  1939. }, s.websqldatabase = function() {
  1940. return !!a.openDatabase;
  1941. }, s.indexedDB = function() {
  1942. return !!J("indexedDB", a);
  1943. }, s.hashchange = function() {
  1944. return A("hashchange", a) && (b.documentMode === c || b.documentMode > 7);
  1945. }, s.history = function() {
  1946. return !!a.history && !!history.pushState;
  1947. }, s.draganddrop = function() {
  1948. var a = b.createElement("div");
  1949. return "draggable" in a || "ondragstart" in a && "ondrop" in a;
  1950. }, s.websockets = function() {
  1951. return "WebSocket" in a || "MozWebSocket" in a;
  1952. }, s.rgba = function() {
  1953. return D("background-color:rgba(150,255,150,.5)"), G(j.backgroundColor, "rgba");
  1954. }, s.hsla = function() {
  1955. return D("background-color:hsla(120,40%,100%,.5)"), G(j.backgroundColor, "rgba") || G(j.backgroundColor, "hsla");
  1956. }, s.multiplebgs = function() {
  1957. return D("background:url(https://),url(https://),red url(https://)"), /(url\s*\(.*?){3}/.test(j.background);
  1958. }, s.backgroundsize = function() {
  1959. return J("backgroundSize");
  1960. }, s.borderimage = function() {
  1961. return J("borderImage");
  1962. }, s.borderradius = function() {
  1963. return J("borderRadius");
  1964. }, s.boxshadow = function() {
  1965. return J("boxShadow");
  1966. }, s.textshadow = function() {
  1967. return b.createElement("div").style.textShadow === "";
  1968. }, s.opacity = function() {
  1969. return E("opacity:.55"), /^0.55$/.test(j.opacity);
  1970. }, s.cssanimations = function() {
  1971. return J("animationName");
  1972. }, s.csscolumns = function() {
  1973. return J("columnCount");
  1974. }, s.cssgradients = function() {
  1975. var a = "background-image:", b = "gradient(linear,left top,right bottom,from(#9f9),to(white));", c = "linear-gradient(left top,#9f9, white);";
  1976. return D((a + "-webkit- ".split(" ").join(b + a) + n.join(c + a)).slice(0, -a.length)),
  1977. G(j.backgroundImage, "gradient");
  1978. }, s.cssreflections = function() {
  1979. return J("boxReflect");
  1980. }, s.csstransforms = function() {
  1981. return !!J("transform");
  1982. }, s.csstransforms3d = function() {
  1983. var a = !!J("perspective");
  1984. return a && "webkitPerspective" in g.style && y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}", function(b, c) {
  1985. a = b.offsetLeft === 9 && b.offsetHeight === 3;
  1986. }), a;
  1987. }, s.csstransitions = function() {
  1988. return J("transition");
  1989. }, s.fontface = function() {
  1990. var a;
  1991. return y('@font-face {font-family:"font";src:url("https://")}', function(c, d) {
  1992. var e = b.getElementById("smodernizr"), f = e.sheet || e.styleSheet, g = f ? f.cssRules && f.cssRules[0] ? f.cssRules[0].cssText : f.cssText || "" : "";
  1993. a = /src/i.test(g) && g.indexOf(d.split(" ")[0]) === 0;
  1994. }), a;
  1995. }, s.generatedcontent = function() {
  1996. var a;
  1997. return y([ "#", h, "{font:0/0 a}#", h, ':after{content:"', l, '";visibility:hidden;font:3px/1 a}' ].join(""), function(b) {
  1998. a = b.offsetHeight >= 3;
  1999. }), a;
  2000. }, s.video = function() {
  2001. var a = b.createElement("video"), c = !1;
  2002. try {
  2003. if (c = !!a.canPlayType) c = new Boolean(c), c.ogg = a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ""),
  2004. c.h264 = a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ""), c.webm = a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "");
  2005. } catch (d) {}
  2006. return c;
  2007. }, s.audio = function() {
  2008. var a = b.createElement("audio"), c = !1;
  2009. try {
  2010. if (c = !!a.canPlayType) c = new Boolean(c), c.ogg = a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""),
  2011. c.mp3 = a.canPlayType("audio/mpeg;").replace(/^no$/, ""), c.wav = a.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""),
  2012. c.m4a = (a.canPlayType("audio/x-m4a;") || a.canPlayType("audio/aac;")).replace(/^no$/, "");
  2013. } catch (d) {}
  2014. return c;
  2015. }, s.localstorage = function() {
  2016. try {
  2017. return localStorage.setItem(h, h), localStorage.removeItem(h), !0;
  2018. } catch (a) {
  2019. return !1;
  2020. }
  2021. }, s.sessionstorage = function() {
  2022. try {
  2023. return sessionStorage.setItem(h, h), sessionStorage.removeItem(h), !0;
  2024. } catch (a) {
  2025. return !1;
  2026. }
  2027. }, s.webworkers = function() {
  2028. return !!a.Worker;
  2029. }, s.applicationcache = function() {
  2030. return !!a.applicationCache;
  2031. }, s.svg = function() {
  2032. return !!b.createElementNS && !!b.createElementNS(r.svg, "svg").createSVGRect;
  2033. }, s.inlinesvg = function() {
  2034. var a = b.createElement("div");
  2035. return a.innerHTML = "<svg/>", (a.firstChild && a.firstChild.namespaceURI) == r.svg;
  2036. }, s.smil = function() {
  2037. return !!b.createElementNS && /SVGAnimate/.test(m.call(b.createElementNS(r.svg, "animate")));
  2038. }, s.svgclippaths = function() {
  2039. return !!b.createElementNS && /SVGClipPath/.test(m.call(b.createElementNS(r.svg, "clipPath")));
  2040. };
  2041. for (var L in s) C(s, L) && (x = L.toLowerCase(), e[x] = s[L](), v.push((e[x] ? "" : "no-") + x));
  2042. return e.input || K(), e.addTest = function(a, b) {
  2043. if (typeof a == "object") for (var d in a) C(a, d) && e.addTest(d, a[d]); else {
  2044. a = a.toLowerCase();
  2045. if (e[a] !== c) return e;
  2046. b = typeof b == "function" ? b() : b, typeof f != "undefined" && f && (g.className += " " + (b ? "" : "no-") + a),
  2047. e[a] = b;
  2048. }
  2049. return e;
  2050. }, D(""), i = k = null, function(a, b) {
  2051. function k(a, b) {
  2052. var c = a.createElement("p"), d = a.getElementsByTagName("head")[0] || a.documentElement;
  2053. return c.innerHTML = "x<style>" + b + "</style>", d.insertBefore(c.lastChild, d.firstChild);
  2054. }
  2055. function l() {
  2056. var a = r.elements;
  2057. return typeof a == "string" ? a.split(" ") : a;
  2058. }
  2059. function m(a) {
  2060. var b = i[a[g]];
  2061. return b || (b = {}, h++, a[g] = h, i[h] = b), b;
  2062. }
  2063. function n(a, c, f) {
  2064. c || (c = b);
  2065. if (j) return c.createElement(a);
  2066. f || (f = m(c));
  2067. var g;
  2068. return f.cache[a] ? g = f.cache[a].cloneNode() : e.test(a) ? g = (f.cache[a] = f.createElem(a)).cloneNode() : g = f.createElem(a),
  2069. g.canHaveChildren && !d.test(a) ? f.frag.appendChild(g) : g;
  2070. }
  2071. function o(a, c) {
  2072. a || (a = b);
  2073. if (j) return a.createDocumentFragment();
  2074. c = c || m(a);
  2075. var d = c.frag.cloneNode(), e = 0, f = l(), g = f.length;
  2076. for (;e < g; e++) d.createElement(f[e]);
  2077. return d;
  2078. }
  2079. function p(a, b) {
  2080. b.cache || (b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment,
  2081. b.frag = b.createFrag()), a.createElement = function(c) {
  2082. return r.shivMethods ? n(c, a, b) : b.createElem(c);
  2083. }, a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + l().join().replace(/\w+/g, function(a) {
  2084. return b.createElem(a), b.frag.createElement(a), 'c("' + a + '")';
  2085. }) + ");return n}")(r, b.frag);
  2086. }
  2087. function q(a) {
  2088. a || (a = b);
  2089. var c = m(a);
  2090. return r.shivCSS && !f && !c.hasCSS && (c.hasCSS = !!k(a, "article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),
  2091. j || p(a, c), a;
  2092. }
  2093. var c = a.html5 || {}, d = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i, e = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i, f, g = "_html5shiv", h = 0, i = {}, j;
  2094. (function() {
  2095. try {
  2096. var a = b.createElement("a");
  2097. a.innerHTML = "<xyz></xyz>", f = "hidden" in a, j = a.childNodes.length == 1 || function() {
  2098. b.createElement("a");
  2099. var a = b.createDocumentFragment();
  2100. return typeof a.cloneNode == "undefined" || typeof a.createDocumentFragment == "undefined" || typeof a.createElement == "undefined";
  2101. }();
  2102. } catch (c) {
  2103. f = !0, j = !0;
  2104. }
  2105. })();
  2106. var r = {
  2107. elements: c.elements || "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",
  2108. shivCSS: c.shivCSS !== !1,
  2109. supportsUnknownElements: j,
  2110. shivMethods: c.shivMethods !== !1,
  2111. type: "default",
  2112. shivDocument: q,
  2113. createElement: n,
  2114. createDocumentFragment: o
  2115. };
  2116. a.html5 = r, q(b);
  2117. }(this, b), e._version = d, e._prefixes = n, e._domPrefixes = q, e._cssomPrefixes = p,
  2118. e.mq = z, e.hasEvent = A, e.testProp = function(a) {
  2119. return H([ a ]);
  2120. }, e.testAllProps = J, e.testStyles = y, e.prefixed = function(a, b, c) {
  2121. return b ? J(a, b, c) : J(a, "pfx");
  2122. }, g.className = g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + v.join(" ") : ""),
  2123. e;
  2124. }(this, this.document), function(a, b, c) {
  2125. function d(a) {
  2126. return "[object Function]" == o.call(a);
  2127. }
  2128. function e(a) {
  2129. return "string" == typeof a;
  2130. }
  2131. function f() {}
  2132. function g(a) {
  2133. return !a || "loaded" == a || "complete" == a || "uninitialized" == a;
  2134. }
  2135. function h() {
  2136. var a = p.shift();
  2137. q = 1, a ? a.t ? m(function() {
  2138. ("c" == a.t ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1);
  2139. }, 0) : (a(), h()) : q = 0;
  2140. }
  2141. function i(a, c, d, e, f, i, j) {
  2142. function k(b) {
  2143. if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null,
  2144. b)) {
  2145. "img" != a && m(function() {
  2146. t.removeChild(l);
  2147. }, 50);
  2148. for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload();
  2149. }
  2150. }
  2151. var j = j || B.errorTimeout, l = b.createElement(a), o = 0, r = 0, u = {
  2152. t: d,
  2153. s: c,
  2154. e: f,
  2155. a: i,
  2156. x: j
  2157. };
  2158. 1 === y[c] && (r = 1, y[c] = []), "object" == a ? l.data = c : (l.src = c, l.type = a),
  2159. l.width = l.height = "0", l.onerror = l.onload = l.onreadystatechange = function() {
  2160. k.call(this, r);
  2161. }, p.splice(e, 0, u), "img" != a && (r || 2 === y[c] ? (t.insertBefore(l, s ? null : n),
  2162. m(k, j)) : y[c].push(l));
  2163. }
  2164. function j(a, b, c, d, f) {
  2165. return q = 0, b = b || "j", e(a) ? i("c" == b ? v : u, a, b, this.i++, c, d, f) : (p.splice(this.i++, 0, a),
  2166. 1 == p.length && h()), this;
  2167. }
  2168. function k() {
  2169. var a = B;
  2170. return a.loader = {
  2171. load: j,
  2172. i: 0
  2173. }, a;
  2174. }
  2175. var l = b.documentElement, m = a.setTimeout, n = b.getElementsByTagName("script")[0], o = {}.toString, p = [], q = 0, r = "MozAppearance" in l.style, s = r && !!b.createRange().compareNode, t = s ? l : n.parentNode, l = a.opera && "[object Opera]" == o.call(a.opera), l = !!b.attachEvent && !l, u = r ? "object" : l ? "script" : "img", v = l ? "script" : u, w = Array.isArray || function(a) {
  2176. return "[object Array]" == o.call(a);
  2177. }, x = [], y = {}, z = {
  2178. timeout: function(a, b) {
  2179. return b.length && (a.timeout = b[0]), a;
  2180. }
  2181. }, A, B;
  2182. B = function(a) {
  2183. function b(a) {
  2184. var a = a.split("!"), b = x.length, c = a.pop(), d = a.length, c = {
  2185. url: c,
  2186. origUrl: c,
  2187. prefixes: a
  2188. }, e, f, g;
  2189. for (f = 0; f < d; f++) g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g));
  2190. for (f = 0; f < b; f++) c = x[f](c);
  2191. return c;
  2192. }
  2193. function g(a, e, f, g, h) {
  2194. var i = b(a), j = i.autoCallback;
  2195. i.url.split(".").pop().split("?").shift(), i.bypass || (e && (e = d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]]),
  2196. i.instead ? i.instead(a, e, f, g, h) : (y[i.url] ? i.noexec = !0 : y[i.url] = 1,
  2197. f.load(i.url, i.forceCSS || !i.forceJS && "css" == i.url.split(".").pop().split("?").shift() ? "c" : c, i.noexec, i.attrs, i.timeout),
  2198. (d(e) || d(j)) && f.load(function() {
  2199. k(), e && e(i.origUrl, h, g), j && j(i.origUrl, h, g), y[i.url] = 2;
  2200. })));
  2201. }
  2202. function h(a, b) {
  2203. function c(a, c) {
  2204. if (a) {
  2205. if (e(a)) c || (j = function() {
  2206. var a = [].slice.call(arguments);
  2207. k.apply(this, a), l();
  2208. }), g(a, j, b, 0, h); else if (Object(a) === a) for (n in m = function() {
  2209. var b = 0, c;
  2210. for (c in a) a.hasOwnProperty(c) && b++;
  2211. return b;
  2212. }(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function() {
  2213. var a = [].slice.call(arguments);
  2214. k.apply(this, a), l();
  2215. } : j[n] = function(a) {
  2216. return function() {
  2217. var b = [].slice.call(arguments);
  2218. a && a.apply(this, b), l();
  2219. };
  2220. }(k[n])), g(a[n], j, b, n, h));
  2221. } else !c && l();
  2222. }
  2223. var h = !!a.test, i = a.load || a.both, j = a.callback || f, k = j, l = a.complete || f, m, n;
  2224. c(h ? a.yep : a.nope, !!i), i && c(i);
  2225. }
  2226. var i, j, l = this.yepnope.loader;
  2227. if (e(a)) g(a, 0, l, 0); else if (w(a)) for (i = 0; i < a.length; i++) j = a[i],
  2228. e(j) ? g(j, 0, l, 0) : w(j) ? B(j) : Object(j) === j && h(j, l); else Object(a) === a && h(a, l);
  2229. }, B.addPrefix = function(a, b) {
  2230. z[a] = b;
  2231. }, B.addFilter = function(a) {
  2232. x.push(a);
  2233. }, B.errorTimeout = 1e4, null == b.readyState && b.addEventListener && (b.readyState = "loading",
  2234. b.addEventListener("DOMContentLoaded", A = function() {
  2235. b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete";
  2236. }, 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function(a, c, d, e, i, j) {
  2237. var k = b.createElement("script"), l, o, e = e || B.errorTimeout;
  2238. k.src = a;
  2239. for (o in d) k.setAttribute(o, d[o]);
  2240. c = j ? h : c || f, k.onreadystatechange = k.onload = function() {
  2241. !l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null);
  2242. }, m(function() {
  2243. l || (l = 1, c(1));
  2244. }, e), i ? k.onload() : n.parentNode.insertBefore(k, n);
  2245. }, a.yepnope.injectCss = function(a, c, d, e, g, i) {
  2246. var e = b.createElement("link"), j, c = i ? h : c || f;
  2247. e.href = a, e.rel = "stylesheet", e.type = "text/css";
  2248. for (j in d) e.setAttribute(j, d[j]);
  2249. g || (n.parentNode.insertBefore(e, n), m(c, 0));
  2250. };
  2251. }(this, document), Modernizr.load = function() {
  2252. yepnope.apply(window, [].slice.call(arguments, 0));
  2253. };
  2254.  
  2255. (function() {
  2256. var unableToLogin = document.getElementById("contactSSId"), snoopyHelper = FKSP.SnoopyAnalytics("SDDB"), contactSSModal = document.getElementById(unableToLogin.getAttribute("data-target").substr(1)), unableToLoginEvent = {
  2257. entity: {
  2258. name: "Incident Creation",
  2259. child: {
  2260. name: "Landing page",
  2261. child: {
  2262. name: "Login Form",
  2263. child: {
  2264. name: "Unable to login?"
  2265. }
  2266. }
  2267. }
  2268. },
  2269. category: "Incident Creation"
  2270. }, popUpFailureEvent = {
  2271. entity: {
  2272. name: "Incident Creation",
  2273. child: {
  2274. name: "Landing page",
  2275. child: {
  2276. name: "Unable to login?",
  2277. child: {
  2278. name: "Popup couldn't open"
  2279. }
  2280. }
  2281. }
  2282. },
  2283. category: "Incident Creation"
  2284. };
  2285. if (unableToLogin && contactSSModal) {
  2286. unableToLogin.addEventListener("click", function() {
  2287. snoopyHelper.track(unableToLoginEvent);
  2288. setTimeout(function() {
  2289. if (contactSSModal.style.display !== "block") {
  2290. snoopyHelper.track(popUpFailureEvent);
  2291. }
  2292. }, 1500);
  2293. });
  2294. }
  2295. })();
  2296.  
  2297. !function(e) {
  2298. var t = {};
  2299. function n(o) {
  2300. if (t[o]) return t[o].exports;
  2301. var r = t[o] = {
  2302. i: o,
  2303. l: !1,
  2304. exports: {}
  2305. };
  2306. return e[o].call(r.exports, r, r.exports, n), r.l = !0, r.exports;
  2307. }
  2308. n.m = e, n.c = t, n.d = function(e, t, o) {
  2309. n.o(e, t) || Object.defineProperty(e, t, {
  2310. enumerable: !0,
  2311. get: o
  2312. });
  2313. }, n.r = function(e) {
  2314. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
  2315. value: "Module"
  2316. }), Object.defineProperty(e, "__esModule", {
  2317. value: !0
  2318. });
  2319. }, n.t = function(e, t) {
  2320. if (1 & t && (e = n(e)), 8 & t) return e;
  2321. if (4 & t && "object" == typeof e && e && e.__esModule) return e;
  2322. var o = Object.create(null);
  2323. if (n.r(o), Object.defineProperty(o, "default", {
  2324. enumerable: !0,
  2325. value: e
  2326. }), 2 & t && "string" != typeof e) for (var r in e) n.d(o, r, function(t) {
  2327. return e[t];
  2328. }.bind(null, r));
  2329. return o;
  2330. }, n.n = function(e) {
  2331. var t = e && e.__esModule ? function() {
  2332. return e.default;
  2333. } : function() {
  2334. return e;
  2335. };
  2336. return n.d(t, "a", t), t;
  2337. }, n.o = function(e, t) {
  2338. return Object.prototype.hasOwnProperty.call(e, t);
  2339. }, n.p = "", n(n.s = "./sw.js");
  2340. }({
  2341. "./node_modules/fbjs/lib/ExecutionEnvironment.js": function(e, t, n) {
  2342. "use strict";
  2343. var o = !("undefined" == typeof window || !window.document || !window.document.createElement), r = {
  2344. canUseDOM: o,
  2345. canUseWorkers: "undefined" != typeof Worker,
  2346. canUseEventListeners: o && !(!window.addEventListener && !window.attachEvent),
  2347. canUseViewport: o && !!window.screen,
  2348. isInWorker: !o
  2349. };
  2350. e.exports = r;
  2351. },
  2352. "./node_modules/fk-cp-bandwidth/dist/BandwidthCompute.js": function(e, t, n) {
  2353. "use strict";
  2354. Object.defineProperty(t, "__esModule", {
  2355. value: !0
  2356. });
  2357. var o = function() {
  2358. function e(e, t) {
  2359. for (var n = 0; n < t.length; n++) {
  2360. var o = t[n];
  2361. o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),
  2362. Object.defineProperty(e, o.key, o);
  2363. }
  2364. }
  2365. return function(t, n, o) {
  2366. return n && e(t.prototype, n), o && e(t, o), t;
  2367. };
  2368. }();
  2369. var r = function() {
  2370. function e() {
  2371. !function(e, t) {
  2372. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
  2373. }(this, e), this.currentNetInfo = null, this.isEnvWindow = "undefined" != typeof window,
  2374. this.isEnvSW = "undefined" != typeof ServiceWorkerGlobalScope, this.hasNetInfoSupported = "undefined" != typeof navigator && "connection" in navigator && void 0 !== navigator.connection.downlink,
  2375. this.hasResourceTimingSupported = "undefined" != typeof performance && performance.getEntriesByName,
  2376. this.downlinkRoundUpFactor = 25, this.computeMethods = {
  2377. NETINFO: "NETINFO",
  2378. RTAPI: "RTAPI",
  2379. FDW: "FDW"
  2380. };
  2381. }
  2382. return o(e, [ {
  2383. key: "loadCache",
  2384. value: function() {
  2385. return caches.open(e.bandwidthCache).then(function(e) {
  2386. var t = new Request("https://www.flipkart.com/netinfo");
  2387. return e.match(t);
  2388. }).then(function(e) {
  2389. return e.json();
  2390. }).then(function(e) {
  2391. return e;
  2392. }).catch(function() {
  2393. return null;
  2394. });
  2395. }
  2396. }, {
  2397. key: "writeToCache",
  2398. value: function(t) {
  2399. return caches.open(e.bandwidthCache).then(function(e) {
  2400. var n = new Request("https://www.flipkart.com/netinfo"), o = new Response(JSON.stringify(t));
  2401. return e.put(n, o);
  2402. }).catch(function() {
  2403. return null;
  2404. });
  2405. }
  2406. }, {
  2407. key: "clearCache",
  2408. value: function() {
  2409. return caches.delete(e.bandwidthCache);
  2410. }
  2411. }, {
  2412. key: "initializeNetInfo",
  2413. value: function() {
  2414. return {
  2415. downlink: 0,
  2416. downlinkMax: 1 / 0,
  2417. effectiveType: null,
  2418. rtt: 1 / 0,
  2419. type: null,
  2420. sessionCount: 0
  2421. };
  2422. }
  2423. }, {
  2424. key: "getCurrentNetInfo",
  2425. value: function() {
  2426. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = navigator.connection, n = this.initializeNetInfo();
  2427. for (var o in this.currentNetInfo = n, n) n.hasOwnProperty(o) && void 0 !== t[o] && (n[o] = t[o]);
  2428. return n.downlink *= 1e3, n.computeMethod = this.computeMethods.NETINFO, e.onChange && ("function" != typeof e.onChange ? console.warn('"onChange" property on config object should be a function !') : this.currentNetInfo.onChange = e.onChange),
  2429. n;
  2430. }
  2431. }, {
  2432. key: "getResouceTimingInformation",
  2433. value: function() {
  2434. var t = performance.getEntries().filter(function(t) {
  2435. return t.name.includes(e.imageURL);
  2436. })[0];
  2437. if (t) {
  2438. var n = t.domainLookupEnd - t.domainLookupStart + (t.connectEnd - t.connectStart) + (t.responseStart - t.requestStart) + (t.responseEnd - t.responseStart);
  2439. t.networkDuration = n;
  2440. }
  2441. return t;
  2442. }
  2443. }, {
  2444. key: "fetchTestFile",
  2445. value: function() {
  2446. var t = this;
  2447. return new Promise(function(n) {
  2448. var o = Date.now();
  2449. fetch(e.imageURL).then(function(e) {
  2450. var r = Date.now(), i = null;
  2451. t.hasResourceTimingSupported || ((i = {}).transferSize = 8 * e.headers.get("content-length") / 1e3,
  2452. i.duration = (r - o) / 1e3), n(i);
  2453. });
  2454. });
  2455. }
  2456. }, {
  2457. key: "roundOffToClosestMultipleof25",
  2458. value: function(e) {
  2459. if (e < 0) return 0;
  2460. var t = e % 25;
  2461. return t > 12 ? e + (25 - t) : e - t;
  2462. }
  2463. }, {
  2464. key: "compute",
  2465. value: function(e) {
  2466. var t = this;
  2467. return new Promise(function(n) {
  2468. var o = void 0;
  2469. t.isEnvSW ? t.hasNetInfoSupported ? n(t.getCurrentNetInfo(e)) : t.fetchTestFile().then(function(e) {
  2470. return o = t.initializeNetInfo(), t.loadCache().then(function(n) {
  2471. n && (o = n);
  2472. var r = o.downlink, i = o.sessionCount;
  2473. if (r *= i, o.sessionCount++, t.hasResourceTimingSupported) {
  2474. o.computeMethod = t.computeMethods.RTAPI;
  2475. var a = t.getResouceTimingInformation();
  2476. r += 8 * a.transferSize / 1e3 / (a.networkDuration / 1e3);
  2477. } else o.computeMethod = t.computeMethods.FDW, r += e.transferSize / e.duration;
  2478. return r = t.roundOffToClosestMultipleof25(Math.round(r)), o.downlink = r / (i + 1),
  2479. t.currentNetInfo = o, o;
  2480. }).then(function(e) {
  2481. return t.writeToCache(e);
  2482. }).then(function() {
  2483. n(o);
  2484. }).catch(function() {
  2485. n(null);
  2486. });
  2487. }) : n(null);
  2488. });
  2489. }
  2490. } ]), e;
  2491. }();
  2492. r.bandwidthCache = "BandwidthCache", r.imageURL = "https://rukminim1.flixcart.com/image/275/275/j7qi9ow0/bedsheet/w/e/y/ivyrose-8901633329624-flat-bombay-dyeing-original-imaexwy3ncqh663q.jpeg?q=80",
  2493. t.default = new r();
  2494. },
  2495. "./node_modules/fk-cp-bandwidth/index.js": function(e, t, n) {
  2496. e.exports = n("./node_modules/fk-cp-bandwidth/dist/BandwidthCompute.js");
  2497. },
  2498. "./node_modules/lodash/_baseGet.js": function(e, t, n) {
  2499. var o = n("./node_modules/lodash/_castPath.js"), r = n("./node_modules/lodash/_toKey.js");
  2500. e.exports = function(e, t) {
  2501. for (var n = 0, i = (t = o(t, e)).length; null != e && n < i; ) e = e[r(t[n++])];
  2502. return n && n == i ? e : void 0;
  2503. };
  2504. },
  2505. "./node_modules/lodash/_castPath.js": function(e, t, n) {
  2506. var o = n("./node_modules/lodash/isArray.js"), r = n("./node_modules/lodash/_isKey.js"), i = n("./node_modules/lodash/_stringToPath.js"), a = n("./node_modules/lodash/toString.js");
  2507. e.exports = function(e, t) {
  2508. return o(e) ? e : r(e, t) ? [ e ] : i(a(e));
  2509. };
  2510. },
  2511. "./node_modules/lodash/_isKey.js": function(e, t, n) {
  2512. var o = n("./node_modules/lodash/isArray.js"), r = n("./node_modules/lodash/isSymbol.js"), i = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, a = /^\w*$/;
  2513. e.exports = function(e, t) {
  2514. if (o(e)) return !1;
  2515. var n = typeof e;
  2516. return !("number" != n && "symbol" != n && "boolean" != n && null != e && !r(e)) || a.test(e) || !i.test(e) || null != t && e in Object(t);
  2517. };
  2518. },
  2519. "./node_modules/lodash/_memoizeCapped.js": function(e, t) {
  2520. e.exports = function(e) {
  2521. return e;
  2522. };
  2523. },
  2524. "./node_modules/lodash/_stringToPath.js": function(e, t, n) {
  2525. var o = /^\./, r = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, i = /\\(\\)?/g, a = n("./node_modules/lodash/_memoizeCapped.js")(function(e) {
  2526. var t = [];
  2527. return o.test(e) && t.push(""), e.replace(r, function(e, n, o, r) {
  2528. t.push(o ? r.replace(i, "$1") : n || e);
  2529. }), t;
  2530. });
  2531. e.exports = a;
  2532. },
  2533. "./node_modules/lodash/_toKey.js": function(e, t) {
  2534. e.exports = function(e) {
  2535. return e;
  2536. };
  2537. },
  2538. "./node_modules/lodash/get.js": function(e, t, n) {
  2539. var o = n("./node_modules/lodash/_baseGet.js");
  2540. e.exports = function(e, t, n) {
  2541. var r = null == e ? void 0 : o(e, t);
  2542. return void 0 === r ? n : r;
  2543. };
  2544. },
  2545. "./node_modules/lodash/isArray.js": function(e, t) {
  2546. var n = Array.isArray;
  2547. e.exports = n;
  2548. },
  2549. "./node_modules/lodash/isSymbol.js": function(e, t) {
  2550. e.exports = function() {
  2551. return !1;
  2552. };
  2553. },
  2554. "./node_modules/lodash/toString.js": function(e, t) {
  2555. e.exports = function(e) {
  2556. return e;
  2557. };
  2558. },
  2559. "./node_modules/serviceworker-cache-polyfill/index.js": function(e, t) {
  2560. !function() {
  2561. var e = Cache.prototype.addAll, t = navigator.userAgent.match(/(Firefox|Chrome)\/(\d+\.)/);
  2562. if (t) var n = t[1], o = parseInt(t[2]);
  2563. e && (!t || "Firefox" === n && o >= 46 || "Chrome" === n && o >= 50) || (Cache.prototype.addAll = function(e) {
  2564. var t = this;
  2565. function n(e) {
  2566. this.name = "NetworkError", this.code = 19, this.message = e;
  2567. }
  2568. return n.prototype = Object.create(Error.prototype), Promise.resolve().then(function() {
  2569. if (arguments.length < 1) throw new TypeError();
  2570. return e = e.map(function(e) {
  2571. return e instanceof Request ? e : String(e);
  2572. }), Promise.all(e.map(function(e) {
  2573. "string" == typeof e && (e = new Request(e));
  2574. var t = new URL(e.url).protocol;
  2575. if ("http:" !== t && "https:" !== t) throw new n("Invalid scheme");
  2576. return fetch(e.clone());
  2577. }));
  2578. }).then(function(o) {
  2579. if (o.some(function(e) {
  2580. return !e.ok;
  2581. })) throw new n("Incorrect response status");
  2582. return Promise.all(o.map(function(n, o) {
  2583. return t.put(e[o], n);
  2584. }));
  2585. }).then(function() {});
  2586. }, Cache.prototype.add = function(e) {
  2587. return this.addAll([ e ]);
  2588. });
  2589. }();
  2590. },
  2591. "./node_modules/sw-toolbox/lib/helpers.js": function(e, t, n) {
  2592. "use strict";
  2593. var o, r = n("./node_modules/sw-toolbox/lib/options.js"), i = n("./node_modules/sw-toolbox/lib/idb-cache-expiration.js");
  2594. function a(e, t) {
  2595. ((t = t || {}).debug || r.debug) && console.log("[sw-toolbox] " + e);
  2596. }
  2597. function s(e) {
  2598. var t;
  2599. return e && e.cache && (t = e.cache.name), t = t || r.cache.name, caches.open(t);
  2600. }
  2601. function c(e) {
  2602. var t = Array.isArray(e);
  2603. if (t && e.forEach(function(e) {
  2604. "string" == typeof e || e instanceof Request || (t = !1);
  2605. }), !t) throw new TypeError("The precache method expects either an array of strings and/or Requests or a Promise that resolves to an array of strings and/or Requests.");
  2606. return e;
  2607. }
  2608. e.exports = {
  2609. debug: a,
  2610. fetchAndCache: function(e, t) {
  2611. var n = (t = t || {}).successResponses || r.successResponses;
  2612. return fetch(e.clone()).then(function(c) {
  2613. return "GET" === e.method && n.test(c.status) && s(t).then(function(n) {
  2614. n.put(e, c).then(function() {
  2615. var s = t.cache || r.cache;
  2616. (s.maxEntries || s.maxAgeSeconds) && s.name && function(e, t, n) {
  2617. var r = function(e, t, n) {
  2618. var o = e.url, r = n.maxAgeSeconds, s = n.maxEntries, c = n.name, u = Date.now();
  2619. return a("Updating LRU order for " + o + ". Max entries is " + s + ", max age is " + r),
  2620. i.getDb(c).then(function(e) {
  2621. return i.setTimestampForUrl(e, o, u);
  2622. }).then(function(e) {
  2623. return i.expireEntries(e, s, r, u);
  2624. }).then(function(e) {
  2625. a("Successfully updated IDB.");
  2626. var n = e.map(function(e) {
  2627. return t.delete(e);
  2628. });
  2629. return Promise.all(n).then(function() {
  2630. a("Done with cache cleanup.");
  2631. });
  2632. }).catch(function(e) {
  2633. a(e);
  2634. });
  2635. }.bind(null, e, t, n);
  2636. o = o ? o.then(r) : r();
  2637. }(e, n, s);
  2638. });
  2639. }), c.clone();
  2640. });
  2641. },
  2642. openCache: s,
  2643. renameCache: function(e, t, n) {
  2644. return a("Renaming cache: [" + e + "] to [" + t + "]", n), caches.delete(t).then(function() {
  2645. return Promise.all([ caches.open(e), caches.open(t) ]).then(function(t) {
  2646. var n = t[0], o = t[1];
  2647. return n.keys().then(function(e) {
  2648. return Promise.all(e.map(function(e) {
  2649. return n.match(e).then(function(t) {
  2650. return o.put(e, t);
  2651. });
  2652. }));
  2653. }).then(function() {
  2654. return caches.delete(e);
  2655. });
  2656. });
  2657. });
  2658. },
  2659. cache: function(e, t) {
  2660. return s(t).then(function(t) {
  2661. return t.add(e);
  2662. });
  2663. },
  2664. uncache: function(e, t) {
  2665. return s(t).then(function(t) {
  2666. return t.delete(e);
  2667. });
  2668. },
  2669. precache: function(e) {
  2670. e instanceof Promise || c(e), r.preCacheItems = r.preCacheItems.concat(e);
  2671. },
  2672. validatePrecacheInput: c
  2673. };
  2674. },
  2675. "./node_modules/sw-toolbox/lib/idb-cache-expiration.js": function(e, t, n) {
  2676. "use strict";
  2677. var o = "sw-toolbox-", r = 1, i = "store", a = "url", s = "timestamp", c = {};
  2678. e.exports = {
  2679. getDb: function(e) {
  2680. return e in c || (c[e] = function(e) {
  2681. return new Promise(function(t, n) {
  2682. var c = indexedDB.open(o + e, r);
  2683. c.onupgradeneeded = function() {
  2684. c.result.createObjectStore(i, {
  2685. keyPath: a
  2686. }).createIndex(s, s, {
  2687. unique: !1
  2688. });
  2689. }, c.onsuccess = function() {
  2690. t(c.result);
  2691. }, c.onerror = function() {
  2692. n(c.error);
  2693. };
  2694. });
  2695. }(e)), c[e];
  2696. },
  2697. setTimestampForUrl: function(e, t, n) {
  2698. return new Promise(function(o, r) {
  2699. var a = e.transaction(i, "readwrite");
  2700. a.objectStore(i).put({
  2701. url: t,
  2702. timestamp: n
  2703. }), a.oncomplete = function() {
  2704. o(e);
  2705. }, a.onabort = function() {
  2706. r(a.error);
  2707. };
  2708. });
  2709. },
  2710. expireEntries: function(e, t, n, o) {
  2711. return function(e, t, n) {
  2712. return t ? new Promise(function(o, r) {
  2713. var c = 1e3 * t, u = [], l = e.transaction(i, "readwrite"), p = l.objectStore(i);
  2714. p.index(s).openCursor().onsuccess = function(e) {
  2715. var t = e.target.result;
  2716. if (t && n - c > t.value[s]) {
  2717. var o = t.value[a];
  2718. u.push(o), p.delete(o), t.continue();
  2719. }
  2720. }, l.oncomplete = function() {
  2721. o(u);
  2722. }, l.onabort = r;
  2723. }) : Promise.resolve([]);
  2724. }(e, n, o).then(function(n) {
  2725. return function(e, t) {
  2726. return t ? new Promise(function(n, o) {
  2727. var r = [], c = e.transaction(i, "readwrite"), u = c.objectStore(i), l = u.index(s), p = l.count();
  2728. l.count().onsuccess = function() {
  2729. var e = p.result;
  2730. e > t && (l.openCursor().onsuccess = function(n) {
  2731. var o = n.target.result;
  2732. if (o) {
  2733. var i = o.value[a];
  2734. r.push(i), u.delete(i), e - r.length > t && o.continue();
  2735. }
  2736. });
  2737. }, c.oncomplete = function() {
  2738. n(r);
  2739. }, c.onabort = o;
  2740. }) : Promise.resolve([]);
  2741. }(e, t).then(function(e) {
  2742. return n.concat(e);
  2743. });
  2744. });
  2745. }
  2746. };
  2747. },
  2748. "./node_modules/sw-toolbox/lib/listeners.js": function(e, t, n) {
  2749. "use strict";
  2750. n("./node_modules/serviceworker-cache-polyfill/index.js");
  2751. var o = n("./node_modules/sw-toolbox/lib/helpers.js"), r = n("./node_modules/sw-toolbox/lib/router.js"), i = n("./node_modules/sw-toolbox/lib/options.js");
  2752. function a(e) {
  2753. return e.reduce(function(e, t) {
  2754. return e.concat(t);
  2755. }, []);
  2756. }
  2757. e.exports = {
  2758. fetchListener: function(e) {
  2759. var t = r.match(e.request);
  2760. t ? e.respondWith(t(e.request)) : r.default && "GET" === e.request.method && 0 === e.request.url.indexOf("http") && e.respondWith(r.default(e.request));
  2761. },
  2762. activateListener: function(e) {
  2763. o.debug("activate event fired");
  2764. var t = i.cache.name + "$$$inactive$$$";
  2765. e.waitUntil(o.renameCache(t, i.cache.name));
  2766. },
  2767. installListener: function(e) {
  2768. var t = i.cache.name + "$$$inactive$$$";
  2769. o.debug("install event fired"), o.debug("creating cache [" + t + "]"), e.waitUntil(o.openCache({
  2770. cache: {
  2771. name: t
  2772. }
  2773. }).then(function(e) {
  2774. return Promise.all(i.preCacheItems).then(a).then(o.validatePrecacheInput).then(function(t) {
  2775. return o.debug("preCache list: " + (t.join(", ") || "(none)")), e.addAll(t);
  2776. });
  2777. }));
  2778. }
  2779. };
  2780. },
  2781. "./node_modules/sw-toolbox/lib/options.js": function(e, t, n) {
  2782. "use strict";
  2783. var o;
  2784. o = self.registration ? self.registration.scope : self.scope || new URL("./", self.location).href,
  2785. e.exports = {
  2786. cache: {
  2787. name: "$$$toolbox-cache$$$" + o + "$$$",
  2788. maxAgeSeconds: null,
  2789. maxEntries: null
  2790. },
  2791. debug: !1,
  2792. networkTimeoutSeconds: null,
  2793. preCacheItems: [],
  2794. successResponses: /^0|([123]\d\d)|(40[14567])|410$/
  2795. };
  2796. },
  2797. "./node_modules/sw-toolbox/lib/route.js": function(e, t, n) {
  2798. "use strict";
  2799. var o = new URL("./", self.location).pathname, r = n("./node_modules/sw-toolbox/node_modules/path-to-regexp/index.js"), i = function(e, t, n, i) {
  2800. t instanceof RegExp ? this.fullUrlRegExp = t : (0 !== t.indexOf("/") && (t = o + t),
  2801. this.keys = [], this.regexp = r(t, this.keys)), this.method = e, this.options = i,
  2802. this.handler = n;
  2803. };
  2804. i.prototype.makeHandler = function(e) {
  2805. var t;
  2806. if (this.regexp) {
  2807. var n = this.regexp.exec(e);
  2808. t = {}, this.keys.forEach(function(e, o) {
  2809. t[e.name] = n[o + 1];
  2810. });
  2811. }
  2812. return function(e) {
  2813. return this.handler(e, t, this.options);
  2814. }.bind(this);
  2815. }, e.exports = i;
  2816. },
  2817. "./node_modules/sw-toolbox/lib/router.js": function(e, t, n) {
  2818. "use strict";
  2819. var o = n("./node_modules/sw-toolbox/lib/route.js"), r = n("./node_modules/sw-toolbox/lib/helpers.js");
  2820. var i = function(e, t) {
  2821. for (var n = e.entries(), o = n.next(), r = []; !o.done; ) {
  2822. new RegExp(o.value[0]).test(t) && r.push(o.value[1]), o = n.next();
  2823. }
  2824. return r;
  2825. }, a = function() {
  2826. this.routes = new Map(), this.routes.set(RegExp, new Map()), this.default = null;
  2827. };
  2828. [ "get", "post", "put", "delete", "head", "any" ].forEach(function(e) {
  2829. a.prototype[e] = function(t, n, o) {
  2830. return this.add(e, t, n, o);
  2831. };
  2832. }), a.prototype.add = function(e, t, n, i) {
  2833. var a;
  2834. i = i || {}, a = t instanceof RegExp ? RegExp : (a = i.origin || self.location.origin) instanceof RegExp ? a.source : function(e) {
  2835. return e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
  2836. }(a), e = e.toLowerCase();
  2837. var s = new o(e, t, n, i);
  2838. this.routes.has(a) || this.routes.set(a, new Map());
  2839. var c = this.routes.get(a);
  2840. c.has(e) || c.set(e, new Map());
  2841. var u = c.get(e), l = s.regexp || s.fullUrlRegExp;
  2842. u.has(l.source) && r.debug('"' + t + '" resolves to same regex as existing route.'),
  2843. u.set(l.source, s);
  2844. }, a.prototype.matchMethod = function(e, t) {
  2845. var n = new URL(t), o = n.origin, r = n.pathname;
  2846. return this._match(e, i(this.routes, o), r) || this._match(e, [ this.routes.get(RegExp) ], t);
  2847. }, a.prototype._match = function(e, t, n) {
  2848. if (0 === t.length) return null;
  2849. for (var o = 0; o < t.length; o++) {
  2850. var r = t[o], a = r && r.get(e.toLowerCase());
  2851. if (a) {
  2852. var s = i(a, n);
  2853. if (s.length > 0) return s[0].makeHandler(n);
  2854. }
  2855. }
  2856. return null;
  2857. }, a.prototype.match = function(e) {
  2858. return this.matchMethod(e.method, e.url) || this.matchMethod("any", e.url);
  2859. }, e.exports = new a();
  2860. },
  2861. "./node_modules/sw-toolbox/lib/strategies/cacheFirst.js": function(e, t, n) {
  2862. "use strict";
  2863. var o = n("./node_modules/sw-toolbox/lib/helpers.js");
  2864. e.exports = function(e, t, n) {
  2865. return o.debug("Strategy: cache first [" + e.url + "]", n), o.openCache(n).then(function(t) {
  2866. return t.match(e).then(function(t) {
  2867. return t || o.fetchAndCache(e, n);
  2868. });
  2869. });
  2870. };
  2871. },
  2872. "./node_modules/sw-toolbox/lib/strategies/cacheOnly.js": function(e, t, n) {
  2873. "use strict";
  2874. var o = n("./node_modules/sw-toolbox/lib/helpers.js");
  2875. e.exports = function(e, t, n) {
  2876. return o.debug("Strategy: cache only [" + e.url + "]", n), o.openCache(n).then(function(t) {
  2877. return t.match(e);
  2878. });
  2879. };
  2880. },
  2881. "./node_modules/sw-toolbox/lib/strategies/fastest.js": function(e, t, n) {
  2882. "use strict";
  2883. var o = n("./node_modules/sw-toolbox/lib/helpers.js"), r = n("./node_modules/sw-toolbox/lib/strategies/cacheOnly.js");
  2884. e.exports = function(e, t, n) {
  2885. return o.debug("Strategy: fastest [" + e.url + "]", n), new Promise(function(i, a) {
  2886. var s = !1, c = [], u = function(e) {
  2887. c.push(e.toString()), s ? a(new Error('Both cache and network failed: "' + c.join('", "') + '"')) : s = !0;
  2888. }, l = function(e) {
  2889. e instanceof Response ? i(e) : u("No result returned");
  2890. };
  2891. o.fetchAndCache(e.clone(), n).then(l, u), r(e, t, n).then(l, u);
  2892. });
  2893. };
  2894. },
  2895. "./node_modules/sw-toolbox/lib/strategies/index.js": function(e, t, n) {
  2896. e.exports = {
  2897. networkOnly: n("./node_modules/sw-toolbox/lib/strategies/networkOnly.js"),
  2898. networkFirst: n("./node_modules/sw-toolbox/lib/strategies/networkFirst.js"),
  2899. cacheOnly: n("./node_modules/sw-toolbox/lib/strategies/cacheOnly.js"),
  2900. cacheFirst: n("./node_modules/sw-toolbox/lib/strategies/cacheFirst.js"),
  2901. fastest: n("./node_modules/sw-toolbox/lib/strategies/fastest.js")
  2902. };
  2903. },
  2904. "./node_modules/sw-toolbox/lib/strategies/networkFirst.js": function(e, t, n) {
  2905. "use strict";
  2906. var o = n("./node_modules/sw-toolbox/lib/options.js"), r = n("./node_modules/sw-toolbox/lib/helpers.js");
  2907. e.exports = function(e, t, n) {
  2908. var i = (n = n || {}).successResponses || o.successResponses, a = n.networkTimeoutSeconds || o.networkTimeoutSeconds;
  2909. return r.debug("Strategy: network first [" + e.url + "]", n), r.openCache(n).then(function(t) {
  2910. var o, s, c = [];
  2911. if (a) {
  2912. var u = new Promise(function(n) {
  2913. o = setTimeout(function() {
  2914. t.match(e).then(function(e) {
  2915. e && n(e);
  2916. });
  2917. }, 1e3 * a);
  2918. });
  2919. c.push(u);
  2920. }
  2921. var l = r.fetchAndCache(e, n).then(function(e) {
  2922. if (o && clearTimeout(o), i.test(e.status)) return e;
  2923. throw r.debug("Response was an HTTP error: " + e.statusText, n), s = e, new Error("Bad response");
  2924. }).catch(function(o) {
  2925. return r.debug("Network or response error, fallback to cache [" + e.url + "]", n),
  2926. t.match(e).then(function(e) {
  2927. if (e) return e;
  2928. if (s) return s;
  2929. throw o;
  2930. });
  2931. });
  2932. return c.push(l), Promise.race(c);
  2933. });
  2934. };
  2935. },
  2936. "./node_modules/sw-toolbox/lib/strategies/networkOnly.js": function(e, t, n) {
  2937. "use strict";
  2938. var o = n("./node_modules/sw-toolbox/lib/helpers.js");
  2939. e.exports = function(e, t, n) {
  2940. return o.debug("Strategy: network only [" + e.url + "]", n), fetch(e);
  2941. };
  2942. },
  2943. "./node_modules/sw-toolbox/lib/sw-toolbox.js": function(e, t, n) {
  2944. "use strict";
  2945. var o = n("./node_modules/sw-toolbox/lib/options.js"), r = n("./node_modules/sw-toolbox/lib/router.js"), i = n("./node_modules/sw-toolbox/lib/helpers.js"), a = n("./node_modules/sw-toolbox/lib/strategies/index.js"), s = n("./node_modules/sw-toolbox/lib/listeners.js");
  2946. i.debug("Service Worker Toolbox is loading"), self.addEventListener("install", s.installListener),
  2947. self.addEventListener("activate", s.activateListener), self.addEventListener("fetch", s.fetchListener),
  2948. e.exports = {
  2949. networkOnly: a.networkOnly,
  2950. networkFirst: a.networkFirst,
  2951. cacheOnly: a.cacheOnly,
  2952. cacheFirst: a.cacheFirst,
  2953. fastest: a.fastest,
  2954. router: r,
  2955. options: o,
  2956. cache: i.cache,
  2957. uncache: i.uncache,
  2958. precache: i.precache
  2959. };
  2960. },
  2961. "./node_modules/sw-toolbox/node_modules/isarray/index.js": function(e, t) {
  2962. e.exports = Array.isArray || function(e) {
  2963. return "[object Array]" == Object.prototype.toString.call(e);
  2964. };
  2965. },
  2966. "./node_modules/sw-toolbox/node_modules/path-to-regexp/index.js": function(e, t, n) {
  2967. var o = n("./node_modules/sw-toolbox/node_modules/isarray/index.js");
  2968. e.exports = h, e.exports.parse = i, e.exports.compile = function(e, t) {
  2969. return c(i(e, t));
  2970. }, e.exports.tokensToFunction = c, e.exports.tokensToRegExp = f;
  2971. var r = new RegExp([ "(\\\\.)", "([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))" ].join("|"), "g");
  2972. function i(e, t) {
  2973. for (var n, o = [], i = 0, a = 0, s = "", c = t && t.delimiter || "/"; null != (n = r.exec(e)); ) {
  2974. var p = n[0], d = n[1], f = n.index;
  2975. if (s += e.slice(a, f), a = f + p.length, d) s += d[1]; else {
  2976. var h = e[a], m = n[2], _ = n[3], E = n[4], v = n[5], y = n[6], T = n[7];
  2977. s && (o.push(s), s = "");
  2978. var g = null != m && null != h && h !== m, w = "+" === y || "*" === y, k = "?" === y || "*" === y, A = n[2] || c, S = E || v;
  2979. o.push({
  2980. name: _ || i++,
  2981. prefix: m || "",
  2982. delimiter: A,
  2983. optional: k,
  2984. repeat: w,
  2985. partial: g,
  2986. asterisk: !!T,
  2987. pattern: S ? l(S) : T ? ".*" : "[^" + u(A) + "]+?"
  2988. });
  2989. }
  2990. }
  2991. return a < e.length && (s += e.substr(a)), s && o.push(s), o;
  2992. }
  2993. function a(e) {
  2994. return encodeURI(e).replace(/[\/?#]/g, function(e) {
  2995. return "%" + e.charCodeAt(0).toString(16).toUpperCase();
  2996. });
  2997. }
  2998. function s(e) {
  2999. return encodeURI(e).replace(/[?#]/g, function(e) {
  3000. return "%" + e.charCodeAt(0).toString(16).toUpperCase();
  3001. });
  3002. }
  3003. function c(e) {
  3004. for (var t = new Array(e.length), n = 0; n < e.length; n++) "object" == typeof e[n] && (t[n] = new RegExp("^(?:" + e[n].pattern + ")$"));
  3005. return function(n, r) {
  3006. for (var i = "", c = n || {}, u = (r || {}).pretty ? a : encodeURIComponent, l = 0; l < e.length; l++) {
  3007. var p = e[l];
  3008. if ("string" != typeof p) {
  3009. var d, f = c[p.name];
  3010. if (null == f) {
  3011. if (p.optional) {
  3012. p.partial && (i += p.prefix);
  3013. continue;
  3014. }
  3015. throw new TypeError('Expected "' + p.name + '" to be defined');
  3016. }
  3017. if (o(f)) {
  3018. if (!p.repeat) throw new TypeError('Expected "' + p.name + '" to not repeat, but received `' + JSON.stringify(f) + "`");
  3019. if (0 === f.length) {
  3020. if (p.optional) continue;
  3021. throw new TypeError('Expected "' + p.name + '" to not be empty');
  3022. }
  3023. for (var h = 0; h < f.length; h++) {
  3024. if (d = u(f[h]), !t[l].test(d)) throw new TypeError('Expected all "' + p.name + '" to match "' + p.pattern + '", but received `' + JSON.stringify(d) + "`");
  3025. i += (0 === h ? p.prefix : p.delimiter) + d;
  3026. }
  3027. } else {
  3028. if (d = p.asterisk ? s(f) : u(f), !t[l].test(d)) throw new TypeError('Expected "' + p.name + '" to match "' + p.pattern + '", but received "' + d + '"');
  3029. i += p.prefix + d;
  3030. }
  3031. } else i += p;
  3032. }
  3033. return i;
  3034. };
  3035. }
  3036. function u(e) {
  3037. return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g, "\\$1");
  3038. }
  3039. function l(e) {
  3040. return e.replace(/([=!:$\/()])/g, "\\$1");
  3041. }
  3042. function p(e, t) {
  3043. return e.keys = t, e;
  3044. }
  3045. function d(e) {
  3046. return e.sensitive ? "" : "i";
  3047. }
  3048. function f(e, t, n) {
  3049. o(t) || (n = t || n, t = []);
  3050. for (var r = (n = n || {}).strict, i = !1 !== n.end, a = "", s = 0; s < e.length; s++) {
  3051. var c = e[s];
  3052. if ("string" == typeof c) a += u(c); else {
  3053. var l = u(c.prefix), f = "(?:" + c.pattern + ")";
  3054. t.push(c), c.repeat && (f += "(?:" + l + f + ")*"), a += f = c.optional ? c.partial ? l + "(" + f + ")?" : "(?:" + l + "(" + f + "))?" : l + "(" + f + ")";
  3055. }
  3056. }
  3057. var h = u(n.delimiter || "/"), m = a.slice(-h.length) === h;
  3058. return r || (a = (m ? a.slice(0, -h.length) : a) + "(?:" + h + "(?=$))?"), a += i ? "$" : r && m ? "" : "(?=" + h + "|$)",
  3059. p(new RegExp("^" + a, d(n)), t);
  3060. }
  3061. function h(e, t, n) {
  3062. return o(t) || (n = t || n, t = []), n = n || {}, e instanceof RegExp ? function(e, t) {
  3063. var n = e.source.match(/\((?!\?)/g);
  3064. if (n) for (var o = 0; o < n.length; o++) t.push({
  3065. name: o,
  3066. prefix: null,
  3067. delimiter: null,
  3068. optional: !1,
  3069. repeat: !1,
  3070. partial: !1,
  3071. asterisk: !1,
  3072. pattern: null
  3073. });
  3074. return p(e, t);
  3075. }(e, t) : o(e) ? function(e, t, n) {
  3076. for (var o = [], r = 0; r < e.length; r++) o.push(h(e[r], t, n).source);
  3077. return p(new RegExp("(?:" + o.join("|") + ")", d(n)), t);
  3078. }(e, t, n) : function(e, t, n) {
  3079. return f(i(e, n), t, n);
  3080. }(e, t, n);
  3081. }
  3082. },
  3083. "./sw.js": function(e, t, n) {
  3084. "use strict";
  3085. n.r(t);
  3086. var o, r, i, a, s, c, u = n("./node_modules/sw-toolbox/lib/sw-toolbox.js"), l = n.n(u), p = n("./node_modules/fbjs/lib/ExecutionEnvironment.js"), d = n.n(p);
  3087. function f(e, t, n) {
  3088. return t in e ? Object.defineProperty(e, t, {
  3089. value: n,
  3090. enumerable: !0,
  3091. configurable: !0,
  3092. writable: !0
  3093. }) : e[t] = n, e;
  3094. }
  3095. !function(e) {
  3096. e.NETBANKING = "NET_OPTIONS", e.CREDIT_CARD = "CREDIT", e.CASH_DELIVERY = "COD",
  3097. e.CARD_ON_DELIVERY = "DOD", e.PHONEPE_WALLET = "SCLP_WALLET", e.PHONEPE_WALLET_2 = "PHONEPE_WALLET",
  3098. e.PHONEPE_UPI = "PHONEPE", e.GIFT_CARD_WALLET = "QC_SCLP", e.EGV = "EGV", e.SAVED_CARD = "SAVED_CARD",
  3099. e.EMI = "EMI_OPTIONS", e.BNPL = "FLIPKART_CREDIT", e.EMI_CREDIT_CARD = "EMI_CREDIT",
  3100. e.PREFERRED_NET = "PREFERRED_NET";
  3101. }(a = a || (a = {})), function(e) {
  3102. e.LINKED_VOUCHERS = "LINKED_VOUCHERS", e.PREFERRED = "PREFERRED", e.OTHERS = "OTHERS",
  3103. e.NEW_VOUCHERS = "NEW_VOUCHERS";
  3104. }(s = s || (s = {})), function(e) {
  3105. e.PRE_APPROVED = "preapproved", e.NO_COST = "no_cost", e.INTEREST = "interest",
  3106. e.DEBIT_CARD = "debit-card", e.CREDIT_CARD = "credit-card", e.CONSUMER_LOAN = "consumer-loan",
  3107. e.NET_DEBIT = "net-debit", e.CONSUMER_DURABLE_LOAN = "consumer-durable-loan";
  3108. }(c = c || (c = {}));
  3109. var h;
  3110. !function(e) {
  3111. e.NO_STATUS_CODE = "NO_STATUS_CODE", e.KNOWN_PAYMENT_ERROR = "KNOWN_PAYMENT_ERROR",
  3112. e.JSON_PARSING_ERROR = "JSON_PARSING_ERROR", e.NON_200_SUCCESS_RESPONSE = "NON_200_SUCCESS_RESPONSE",
  3113. e.PAYMENT_OPTIONS_LOAD_ERROR = "PAYMENT_OPTIONS_LOAD_ERROR";
  3114. }(h = h || (h = {}));
  3115. var m;
  3116. new RegExp("\\d{16}"), new RegExp("\\d{6}");
  3117. !function(e) {
  3118. e.PAYMENT_OPTIONS = "PAYMENT_OPTIONS", e.WALLET_SELECT = "WALLET_SELECT", e.WALLET_UNSELECT = "WALLET_UNSELECT",
  3119. e.SUBMIT_PAY = "SUBMIT_PAY", e.PAY_WITH_DETAILS = "PAY_WITH_DETAILS", e.PROCESS_FULL_PAYMENT = "PROCESS_FULL_PAYMENT",
  3120. e.INSTRUMENT_CHECK = "INSTRUMENT_CHECK", e.NET_BANK_LIST = "NET_BANK_LIST", e.EMI_OPTIONS_LIST = "EMI_OPTIONS_LIST",
  3121. e.EMI_FAQ_TERMS = "EMI_FAQ_TERMS", e.EMI_TENURES = "EMI_TENURES", e.EMI_CARDS = "EMI_CARDS",
  3122. e.ADD_EGV = "ADD_EGV", e.PAYZIPPY_TERMS = "PAYZIPPY_TERMS", e.PHONE_PE_STATUS = "PHONE_PE_STATUS",
  3123. e.CAPTCHA = "CAPTCHA", e.OTP = "OTP", e.OTP_AUTH = "OTP_AUTH", e.RESEND_OTP = "RESEND_OTP",
  3124. e.OTP_FALLBACK_MODE = "OTP_FALLBACK_MODE", e.ITEM_LEVEL_BREAK_UP = "ITEM_LEVEL_BREAK_UP";
  3125. }(m = m || (m = {}));
  3126. var _, E, v, y, T, g;
  3127. m.PAYMENT_OPTIONS, m.WALLET_SELECT, m.WALLET_UNSELECT, m.SUBMIT_PAY, m.PROCESS_FULL_PAYMENT,
  3128. m.ADD_EGV, m.CAPTCHA, f(o = {}, m.PAYMENT_OPTIONS, "/fkpay/api/v1/payments/options?token={token_id}"),
  3129. f(o, m.WALLET_SELECT, "/fkpay/api/v1/payments/select"), f(o, m.WALLET_UNSELECT, "/fkpay/api/v1/payments/decline"),
  3130. f(o, m.SUBMIT_PAY, "/fkpay/api/v1/payments/pay?token={token_id}&instrument={instrument}"),
  3131. f(o, m.PAY_WITH_DETAILS, "/fkpay/api/v1/payments/paywithdetails?token={token_id}"),
  3132. f(o, m.PROCESS_FULL_PAYMENT, "/fkpay/api/v1/payments/complete"), f(o, m.INSTRUMENT_CHECK, "/fkpay/api/v1/payments/instrumentcheck?token={token_id}"),
  3133. f(o, m.NET_BANK_LIST, "/fkpay/api/v1/payments/net/options?token={token_id}"), f(o, m.EMI_OPTIONS_LIST, "/fkpay/api/v1/payments/emi/banks?token={token_id}"),
  3134. f(o, m.EMI_FAQ_TERMS, "/fkpay/api/v1/emi/terms?token={token_id}"), f(o, m.EMI_TENURES, "/fkpay/api/v2/payments/emi/tenures?token={token_id}"),
  3135. f(o, m.EMI_CARDS, "/fkpay/api/v1/payments/emi/cards"), f(o, m.ADD_EGV, "/fkpay/api/v1/payments/egv?token={token_id}"),
  3136. f(o, m.PAYZIPPY_TERMS, "/fkpay/api/v1/terms"), f(o, m.PHONE_PE_STATUS, "/fkpay/api/v1/payments/pgresponse"),
  3137. f(o, m.CAPTCHA, "/fkpay/api/v1/payments/captcha/{token_id}?token={token_id}"), f(o, m.OTP, "/fkpay/api/v1/payments/otp/modes/{token_id}"),
  3138. f(o, m.OTP_AUTH, "/fkpay/api/v1/payments/pg/complete"), f(o, m.RESEND_OTP, "/fkpay/api/v1/payments/otp/resend/{token_id}"),
  3139. f(o, m.OTP_FALLBACK_MODE, "/fkpay/api/v1/payments/otp/fallback/{token_id}"), f(o, m.ITEM_LEVEL_BREAK_UP, "/fkpay/api/v1/payments/emi/itemview"),
  3140. f(r = {}, m.PAYMENT_OPTIONS, "/fkpay/api/v1/payments/options?token={token_id}"),
  3141. f(r, m.WALLET_SELECT, "/fkpay/api/v1/payments/select"), f(r, m.WALLET_UNSELECT, "/fkpay/api/v1/payments/decline"),
  3142. f(r, m.SUBMIT_PAY, "/fkpay/api/v2/payments/pay?token={token_id}&instrument={instrument}"),
  3143. f(r, m.PAY_WITH_DETAILS, "/fkpay/api/v2/payments/paywithdetails?token={token_id}"),
  3144. f(r, m.PROCESS_FULL_PAYMENT, "/fkpay/api/v1/payments/complete"), f(r, m.INSTRUMENT_CHECK, "/fkpay/api/v1/payments/instrumentcheck?token={token_id}"),
  3145. f(r, m.NET_BANK_LIST, "/fkpay/api/v1/payments/net/options?token={token_id}"), f(r, m.EMI_OPTIONS_LIST, "/fkpay/api/v1/payments/emi/banks?token={token_id}"),
  3146. f(r, m.EMI_FAQ_TERMS, "/fkpay/api/v1/emi/terms?token={token_id}"), f(r, m.EMI_TENURES, "/fkpay/api/v2/payments/emi/tenures?token={token_id}"),
  3147. f(r, m.EMI_CARDS, "/fkpay/api/v1/payments/emi/cards"), f(r, m.ADD_EGV, "/fkpay/api/v1/payments/egv?token={token_id}"),
  3148. f(r, m.PAYZIPPY_TERMS, "/fkpay/api/v1/terms"), f(r, m.PHONE_PE_STATUS, "/fkpay/api/v1/payments/pgresponse"),
  3149. f(r, m.CAPTCHA, "/fkpay/api/v1/payments/captcha/{token_id}?token={token_id}"), f(r, m.OTP, "/fkpay/api/v1/payments/otp/modes/{token_id}"),
  3150. f(r, m.OTP_AUTH, "/fkpay/api/v1/payments/pg/complete"), f(r, m.RESEND_OTP, "/fkpay/api/v1/payments/otp/resend/{token_id}"),
  3151. f(r, m.OTP_FALLBACK_MODE, "/fkpay/api/v1/payments/otp/fallback/{token_id}"), f(r, m.ITEM_LEVEL_BREAK_UP, "/fkpay/api/v1/payments/emi/itemview"),
  3152. f(i = {}, m.PAYMENT_OPTIONS, "/fkpay/api/v3/payments/options?token={token_id}"),
  3153. f(i, m.WALLET_SELECT, "/fkpay/api/v3/payments/select"), f(i, m.WALLET_UNSELECT, "/fkpay/api/v3/payments/decline"),
  3154. f(i, m.SUBMIT_PAY, "/fkpay/api/v3/payments/pay?token={token_id}&instrument={instrument}"),
  3155. f(i, m.PAY_WITH_DETAILS, "/fkpay/api/v3/payments/paywithdetails?token={token_id}"),
  3156. f(i, m.PROCESS_FULL_PAYMENT, "/fkpay/api/v3/payments/complete"), f(i, m.INSTRUMENT_CHECK, "/fkpay/api/v3/payments/instrumentcheck?token={token_id}"),
  3157. f(i, m.NET_BANK_LIST, "/fkpay/api/v1/payments/net/options?token={token_id}"), f(i, m.EMI_OPTIONS_LIST, "/fkpay/api/v1/payments/emi/banks?token={token_id}"),
  3158. f(i, m.EMI_FAQ_TERMS, "/fkpay/api/v1/emi/terms?token={token_id}"), f(i, m.EMI_TENURES, "/fkpay/api/v2/payments/emi/tenures?token={token_id}"),
  3159. f(i, m.EMI_CARDS, "/fkpay/api/v1/payments/emi/cards"), f(i, m.ADD_EGV, "/fkpay/api/v3/payments/egv?token={token_id}"),
  3160. f(i, m.PAYZIPPY_TERMS, "/fkpay/api/v1/terms"), f(i, m.PHONE_PE_STATUS, "/fkpay/api/v1/payments/pgresponse"),
  3161. f(i, m.CAPTCHA, "/fkpay/api/v3/payments/captcha/{token_id}?token={token_id}"), f(i, m.OTP, "/fkpay/api/v1/payments/otp/modes/{token_id}"),
  3162. f(i, m.OTP_AUTH, "/fkpay/api/v1/payments/pg/complete"), f(i, m.RESEND_OTP, "/fkpay/api/v1/payments/otp/resend/{token_id}"),
  3163. f(i, m.OTP_FALLBACK_MODE, "/fkpay/api/v1/payments/otp/fallback/{token_id}"), f(i, m.ITEM_LEVEL_BREAK_UP, "/fkpay/api/v1/payments/emi/itemview");
  3164. !function(e) {
  3165. e.CASHBACK_ON_CARD = "CASHBACK_ON_CARD", e.CASHBACK_IN_WALLET = "CASHBACK_IN_WALLET",
  3166. e.INSTANT_DISCOUNT = "INSTANT_DISCOUNT";
  3167. }(_ = _ || (_ = {})), function(e) {
  3168. e.EMI_FULL_INTEREST_WAIVER = "EMI_FULL_INTEREST_WAIVER", e.NBFC_ZERO_INTEREST = "NBFC_ZERO_INTEREST",
  3169. e.PBO = "PBO";
  3170. }(E = E || (E = {})), function(e) {
  3171. e.APPLICABLE = "APPLICABLE", e.EXHAUSTED = "EXHAUSTED", e.PARTLY_EXHAUSTED = "PARTLY_EXHAUSTED",
  3172. e.FAILED = "FAILED";
  3173. }(v = v || (v = {})), function(e) {
  3174. e.EMI_PAYMENT = "EMI_PAYMENT", e.FULL_PAYMENT = "FULL_PAYMENT";
  3175. }(y = y || (y = {})), function(e) {
  3176. e.BAJAJFINSERV = "BAJAJFINSERV";
  3177. }(T = T || (T = {})), function(e) {
  3178. e.FLIPKART = "FLIPKART", e.PHONEPE = "PHONEPE";
  3179. }(g = g || (g = {}));
  3180. var w, k;
  3181. !function(e) {
  3182. e.BNPL = "pay_later", e.DEFAULT = "default";
  3183. }(w = w || (w = {})), function(e) {
  3184. e.CH_DC = "payments.flipkart.com", e.NM_DC = "www.payzippy.com";
  3185. }(k = k || (k = {}));
  3186. var A = d.a.canUseDOM, S = {
  3187. "X-user-agent": ("undefined" != typeof navigator ? navigator.userAgent : "StandardUA") + " FKUA/website/41/website/Desktop",
  3188. "Content-Type": "application/json"
  3189. };
  3190. A || Object.assign(S, {
  3191. compress: !0,
  3192. Connection: "keep-alive",
  3193. "Keep-Alive": "timeout=600"
  3194. });
  3195. var b = A ? "https" : "http", P = Object.assign({}, {
  3196. headers: S
  3197. }, {
  3198. protocol: b,
  3199. hostname: "www.flipkart.com",
  3200. credentials: "include",
  3201. fk_api_timeout: A ? 3e4 : 4e3
  3202. }), O = Object.assign({}, S, {
  3203. "x-device-source": "web"
  3204. });
  3205. delete O["X-user-agent"];
  3206. Object.assign({}, {
  3207. headers: O
  3208. }, {
  3209. protocol: b,
  3210. hostname: k.NM_DC,
  3211. credentials: "include",
  3212. fk_api_timeout: A ? 3e4 : 4e3
  3213. });
  3214. var R = n("./node_modules/sw-toolbox/lib/helpers.js"), x = n.n(R);
  3215. !function() {
  3216. for (var e = [], t = 0; t < 64; ) e[t] = 0 | 4294967296 * Math.abs(Math.sin(++t));
  3217. }();
  3218. var C, N, I = "KrWcJnCSZFBLFR39DtHYySjcDCHg2LeC3sxdx7646n7iy7oy";
  3219. function L(e, t, n) {
  3220. return t in e ? Object.defineProperty(e, t, {
  3221. value: n,
  3222. enumerable: !0,
  3223. configurable: !0,
  3224. writable: !0
  3225. }) : e[t] = n, e;
  3226. }
  3227. !function(e) {
  3228. e.GROCERY_STORE_LINK = "/grocery-supermart-store?marketplace=GROCERY", e.CONTINUE_SHOPPING_LINK = "/?otracker=Cart_Continue%20shopping",
  3229. e.CHECKOUT_URL = "/checkout/init", e.CONNEKT_BASE_URL = "connekt.flipkart.net",
  3230. e.CONNEKT_STAGE_PATHNAME_PREFIX = "/connekt", e.VIP_LANDING_URL = "/plus";
  3231. }(C = C || (C = {})), function(e) {
  3232. e.SFL = "SFL", e.CHECKOUT = "CHECKOUT";
  3233. }(N = N || (N = {}));
  3234. var j = {
  3235. cacheFirst: function(e, t, n) {
  3236. var o = e.url.replace(/sqid=([^&]*)/, "").replace(/ssid=([^&]*)/, "");
  3237. return x.a.openCache(n).then(function(t) {
  3238. return D(o, t, n, "get", e);
  3239. }).catch(function(e) {
  3240. throw new Error(e);
  3241. });
  3242. },
  3243. cachePost: function(e, t, n) {
  3244. return M(e.clone()).then(function(t) {
  3245. return x.a.openCache(n).then(function(o) {
  3246. return D(t, o, n, "post", e);
  3247. });
  3248. }).catch(function(e) {
  3249. throw new Error(e);
  3250. });
  3251. },
  3252. webpushCallBack: function(e, t, n) {
  3253. var o = {
  3254. type: "PN",
  3255. eventType: e,
  3256. timestamp: new Date().getTime(),
  3257. messageId: t.messageId,
  3258. contextId: t.contextId,
  3259. cargo: n
  3260. }, r = {
  3261. method: "POST",
  3262. headers: {
  3263. "Content-Type": "application/json",
  3264. "x-api-key": I
  3265. },
  3266. body: JSON.stringify(o)
  3267. }, i = "https://" + C.CONNEKT_BASE_URL + "/v1/push/callback/openweb/fkwebsite/" + t.deviceId;
  3268. return fetch(i, r);
  3269. },
  3270. uncache: function(e, t) {
  3271. return function() {
  3272. x.a.uncache(e, t);
  3273. };
  3274. }
  3275. };
  3276. function M(e) {
  3277. return e.json().then(function(t) {
  3278. var n = JSON.stringify(t).replace(/"(ssid|sqid)":".*?"/g, ""), o = function(e) {
  3279. var t = 0;
  3280. if (0 === e.length) return t;
  3281. for (var n = 0; n < e.length; n++) t = (t << 5) - t + e.charCodeAt(n), t &= t;
  3282. return t;
  3283. }(e.url + n);
  3284. return e.url + "?payload=" + o;
  3285. });
  3286. }
  3287. function D(e, t, n) {
  3288. var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "get", r = arguments[4], i = 1e3 * n.cache.maxAgeSeconds, a = new Request(e + (e.indexOf("?") > -1 ? "&" : "?") + "$cached$timestamp$");
  3289. return Promise.all([ t.match(e), t.match(a) ]).then(function(n) {
  3290. var s = n[0], c = n[1];
  3291. return s && c && Date.now() < parseInt(c.headers.get("created-time"), 10) + i ? s : "get" === o ? fetch(r).then(function(n) {
  3292. return 200 === n.status && (t.put(e, n.clone()), t.put(a, new Response(null, {
  3293. headers: L({}, "created-time", Date.now())
  3294. }))), n;
  3295. }) : function(e) {
  3296. return M(e.clone()).then(function(t) {
  3297. return fetch(e).then(function(e) {
  3298. return {
  3299. url: t,
  3300. response: e.clone()
  3301. };
  3302. });
  3303. });
  3304. }(r).then(function(n) {
  3305. return n.response.ok && (t.put(a, new Response(null, {
  3306. headers: L({}, "created-time", Date.now())
  3307. })), t.put(e, n.response.clone())), n.response;
  3308. });
  3309. });
  3310. }
  3311. var U = n("./node_modules/lodash/get.js"), F = n.n(U).a, H = n("./node_modules/fk-cp-bandwidth/index.js"), B = n.n(H), W = {};
  3312. [ "static", "mainBundles", "layouts", "pincodes", "fonts", "widgets", "sherlock", "facets", "summary", "swatches", "autosuggest", "searchSummary", "product", "reco", "lc", "self-serve", "reviews" ].forEach(function(e) {
  3313. W[e] = e + 8;
  3314. });
  3315. self.addEventListener("message", function(e) {
  3316. "BANDWIDTH_COMPUTE" === e.data && V();
  3317. });
  3318. var Y = 0, K = 3, $ = 5e3;
  3319. function V() {
  3320. return B.a.compute().then(function(e) {
  3321. if (Y++, e && e.downlink > 0 || Y > K) return Y = 0, q({
  3322. type: "BANDWIDTH",
  3323. data: e
  3324. });
  3325. setTimeout(V, $);
  3326. }).catch(function(e) {
  3327. ++Y < K ? setTimeout(V, $) : Y = 0;
  3328. });
  3329. }
  3330. var q = function(e) {
  3331. return self.clients.matchAll().then(function(t) {
  3332. return Promise.all(t.map(function(t) {
  3333. return t.postMessage(JSON.stringify(e));
  3334. }));
  3335. }).catch(G);
  3336. }, G = function(e) {
  3337. throw e;
  3338. };
  3339. self.addEventListener("install", function(e) {
  3340. e.waitUntil(self.skipWaiting());
  3341. }), self.addEventListener("activate", function(e) {
  3342. e.waitUntil(self.clients.claim()), e.waitUntil(caches.keys().then(function(e) {
  3343. var t = Object.keys(W).map(function(e) {
  3344. return W[e];
  3345. });
  3346. return Promise.all(e.map(function(e) {
  3347. return -1 === t.indexOf(e) && -1 === e.indexOf("$$$inactive$$$") ? caches.delete(e) : Promise.resolve();
  3348. }));
  3349. }));
  3350. }), self.addEventListener("push", function(e) {
  3351. if (e.data) try {
  3352. var t = e.data.json(), n = t.payload;
  3353. if (n) {
  3354. var o = F(n, [ "title" ]), r = {
  3355. body: n.body,
  3356. icon: n.icon,
  3357. image: n.image,
  3358. tag: "notification",
  3359. data: t
  3360. };
  3361. n.actions && n.actions.length > 0 && (r.actions = [], n.actions.forEach(function(e) {
  3362. r.actions.push({
  3363. icon: e.icon,
  3364. title: e.title,
  3365. action: e.action
  3366. });
  3367. })), e.waitUntil(Promise.all([ self.registration.showNotification(o, r), j.webpushCallBack("RECEIVED", t) ]));
  3368. }
  3369. } catch (e) {
  3370. G(e);
  3371. }
  3372. }), self.addEventListener("notificationclick", function(e) {
  3373. e.notification.close();
  3374. var t = void 0;
  3375. if (e.action) {
  3376. var n = F(e, [ "notification", "data", "payload", "actions" ]);
  3377. if (n && Array.isArray(n)) {
  3378. var o = n.filter(function(t) {
  3379. return e.action === t.action;
  3380. });
  3381. 1 === o.length && (t = F(o, [ 0, "landingUrl" ]));
  3382. }
  3383. } else t = F(e, [ "notification", "data", "payload", "landingUrl" ]);
  3384. t ? e.waitUntil(Promise.all([ clients.openWindow(t), j.webpushCallBack("READ", e.notification.data) ])) : e.waitUntil(self.skipWaiting());
  3385. }), self.addEventListener("notificationclose", function(e) {
  3386. e.waitUntil(j.webpushCallBack("DISMISS", e.notification.data));
  3387. }), navigator.userAgent.indexOf("Firefox/44.0") > -1 && self.addEventListener("fetch", function(e) {
  3388. e.respondWith(fetch(e.request));
  3389. });
  3390. var J = {
  3391. cache: {
  3392. maxEntries: 15
  3393. },
  3394. origin: "https://" + P.hostname
  3395. };
  3396. l.a.router.get("/lc/getData*", j.cacheFirst, Object.assign({}, J, {
  3397. cache: {
  3398. name: W.lc,
  3399. maxAgeSeconds: 1800
  3400. }
  3401. })), l.a.router.post("/api/1/product/smart-browse", j.cachePost, Object.assign({}, J, {
  3402. cache: {
  3403. name: W.sherlock,
  3404. maxAgeSeconds: 45
  3405. }
  3406. })), l.a.router.get("/api/1/product/smart-browse/facets*", j.cacheFirst, Object.assign({}, J, {
  3407. cache: {
  3408. name: W.facets,
  3409. maxAgeSeconds: 45
  3410. }
  3411. })), l.a.router.get("/api/4/product/swatch", j.cacheFirst, Object.assign({}, J, {
  3412. cache: {
  3413. name: W.swatches,
  3414. maxAgeSeconds: 120
  3415. }
  3416. })), l.a.router.post("/api/3/page/dynamic/product-reviews", j.cachePost, Object.assign({}, J, {
  3417. cache: {
  3418. name: W.reviews,
  3419. maxAgeSeconds: 120
  3420. }
  3421. })), l.a.router.get("/api/3/product/reviews", j.cacheFirst, Object.assign({}, J, {
  3422. cache: {
  3423. name: W.reviews,
  3424. maxAgeSeconds: 120
  3425. }
  3426. })), l.a.router.get("/api/3/product/aspect-reviews", j.cacheFirst, Object.assign({}, J, {
  3427. cache: {
  3428. name: W.reviews,
  3429. maxAgeSeconds: 120
  3430. }
  3431. })), l.a.router.post("/api/3/product/summary", j.cachePost, Object.assign({}, J, {
  3432. cache: {
  3433. name: W.summary,
  3434. maxAgeSeconds: 45
  3435. }
  3436. })), l.a.router.get("/api/3/user/autosuggest/pincodes", j.cacheFirst, Object.assign({}, J, {
  3437. cache: {
  3438. name: W.pincodes,
  3439. maxAgeSeconds: 86400
  3440. }
  3441. })), l.a.router.get("/api/1/self-serve/return/tnc/*", j.cacheFirst, Object.assign({}, J, {
  3442. cache: {
  3443. name: W["self-serve"],
  3444. maxAgeSeconds: 86400
  3445. }
  3446. })), l.a.router.get("/fk-cp-zion/fonts/(.*)", l.a.fastest, {
  3447. origin: "https://img1a.flixcart.com",
  3448. cache: {
  3449. name: W.fonts,
  3450. maxEntries: 5
  3451. }
  3452. });
  3453. }
  3454. });
  3455.  
  3456. function toggleCurrent(elem) {
  3457. var parent_li = elem.closest("li");
  3458. parent_li.siblings("li.current").removeClass("current");
  3459. parent_li.siblings().find("li.current").removeClass("current");
  3460. parent_li.find("> ul li.current").removeClass("current");
  3461. parent_li.toggleClass("current");
  3462. }
  3463.  
  3464. $(document).ready(function() {
  3465. $(document).on("click", "[data-toggle='wy-nav-top']", function() {
  3466. $("[data-toggle='wy-nav-shift']").toggleClass("shift");
  3467. $("[data-toggle='rst-versions']").toggleClass("shift");
  3468. });
  3469. $(document).on("click", ".wy-menu-vertical .current ul li a", function() {
  3470. var target = $(this);
  3471. $("[data-toggle='wy-nav-shift']").removeClass("shift");
  3472. $("[data-toggle='rst-versions']").toggleClass("shift");
  3473. toggleCurrent(target);
  3474. if (typeof window.SphinxRtdTheme != "undefined") {
  3475. window.SphinxRtdTheme.StickyNav.hashChange();
  3476. }
  3477. });
  3478. $(document).on("click", "[data-toggle='rst-current-version']", function() {
  3479. $("[data-toggle='rst-versions']").toggleClass("shift-up");
  3480. });
  3481. $("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");
  3482. $(".wy-menu-vertical ul").siblings("a").each(function() {
  3483. var link = $(this);
  3484. expand = $('<span class="toctree-expand"></span>');
  3485. expand.on("click", function(ev) {
  3486. toggleCurrent(link);
  3487. ev.stopPropagation();
  3488. return false;
  3489. });
  3490. link.prepend(expand);
  3491. });
  3492. });
  3493.  
  3494. window.SphinxRtdTheme = function(jquery) {
  3495. var stickyNav = function() {
  3496. var navBar, win, winScroll = false, linkScroll = false, winPosition = 0, enable = function() {
  3497. init();
  3498. reset();
  3499. win.on("hashchange", reset);
  3500. win.on("scroll", function() {
  3501. if (!linkScroll) {
  3502. winScroll = true;
  3503. }
  3504. });
  3505. setInterval(function() {
  3506. if (winScroll) {
  3507. winScroll = false;
  3508. var newWinPosition = win.scrollTop(), navPosition = navBar.scrollTop(), newNavPosition = navPosition + (newWinPosition - winPosition);
  3509. navBar.scrollTop(newNavPosition);
  3510. winPosition = newWinPosition;
  3511. }
  3512. }, 25);
  3513. }, init = function() {
  3514. navBar = jquery("nav.wy-nav-side:first");
  3515. win = jquery(window);
  3516. }, reset = function() {
  3517. var anchor = encodeURI(window.location.hash);
  3518. if (anchor) {
  3519. try {
  3520. var link = $(".wy-menu-vertical").find('[href="' + anchor + '"]');
  3521. $(".wy-menu-vertical li.toctree-l1 li.current").removeClass("current");
  3522. link.closest("li.toctree-l2").addClass("current");
  3523. link.closest("li.toctree-l3").addClass("current");
  3524. link.closest("li.toctree-l4").addClass("current");
  3525. } catch (err) {
  3526. console.log("Error expanding nav for anchor", err);
  3527. }
  3528. }
  3529. }, hashChange = function() {
  3530. linkScroll = true;
  3531. win.one("hashchange", function() {
  3532. linkScroll = false;
  3533. });
  3534. };
  3535. jquery(init);
  3536. return {
  3537. enable: enable,
  3538. hashChange: hashChange
  3539. };
  3540. }();
  3541. return {
  3542. StickyNav: stickyNav
  3543. };
  3544. }($);
  3545.  
  3546. (function() {
  3547. function q(a, c, d) {
  3548. if (a === c) return a !== 0 || 1 / a == 1 / c;
  3549. if (a == null || c == null) return a === c;
  3550. if (a._chain) a = a._wrapped;
  3551. if (c._chain) c = c._wrapped;
  3552. if (a.isEqual && b.isFunction(a.isEqual)) return a.isEqual(c);
  3553. if (c.isEqual && b.isFunction(c.isEqual)) return c.isEqual(a);
  3554. var e = l.call(a);
  3555. if (e != l.call(c)) return false;
  3556. switch (e) {
  3557. case "[object String]":
  3558. return a == String(c);
  3559.  
  3560. case "[object Number]":
  3561. return a != +a ? c != +c : a == 0 ? 1 / a == 1 / c : a == +c;
  3562.  
  3563. case "[object Date]":
  3564. case "[object Boolean]":
  3565. return +a == +c;
  3566.  
  3567. case "[object RegExp]":
  3568. return a.source == c.source && a.global == c.global && a.multiline == c.multiline && a.ignoreCase == c.ignoreCase;
  3569. }
  3570. if (typeof a != "object" || typeof c != "object") return false;
  3571. for (var f = d.length; f--; ) if (d[f] == a) return true;
  3572. d.push(a);
  3573. var f = 0, g = true;
  3574. if (e == "[object Array]") {
  3575. if (f = a.length, g = f == c.length) for (;f--; ) if (!(g = f in a == f in c && q(a[f], c[f], d))) break;
  3576. } else {
  3577. if ("constructor" in a != "constructor" in c || a.constructor != c.constructor) return false;
  3578. for (var h in a) if (b.has(a, h) && (f++, !(g = b.has(c, h) && q(a[h], c[h], d)))) break;
  3579. if (g) {
  3580. for (h in c) if (b.has(c, h) && !f--) break;
  3581. g = !f;
  3582. }
  3583. }
  3584. d.pop();
  3585. return g;
  3586. }
  3587. var r = this, G = r._, n = {}, k = Array.prototype, o = Object.prototype, i = k.slice, H = k.unshift, l = o.toString, I = o.hasOwnProperty, w = k.forEach, x = k.map, y = k.reduce, z = k.reduceRight, A = k.filter, B = k.every, C = k.some, p = k.indexOf, D = k.lastIndexOf, o = Array.isArray, J = Object.keys, s = Function.prototype.bind, b = function(a) {
  3588. return new m(a);
  3589. };
  3590. if (typeof exports !== "undefined") {
  3591. if (typeof module !== "undefined" && module.exports) exports = module.exports = b;
  3592. exports._ = b;
  3593. } else r._ = b;
  3594. b.VERSION = "1.3.1";
  3595. var j = b.each = b.forEach = function(a, c, d) {
  3596. if (a != null) if (w && a.forEach === w) a.forEach(c, d); else if (a.length === +a.length) for (var e = 0, f = a.length; e < f; e++) {
  3597. if (e in a && c.call(d, a[e], e, a) === n) break;
  3598. } else for (e in a) if (b.has(a, e) && c.call(d, a[e], e, a) === n) break;
  3599. };
  3600. b.map = b.collect = function(a, c, b) {
  3601. var e = [];
  3602. if (a == null) return e;
  3603. if (x && a.map === x) return a.map(c, b);
  3604. j(a, function(a, g, h) {
  3605. e[e.length] = c.call(b, a, g, h);
  3606. });
  3607. if (a.length === +a.length) e.length = a.length;
  3608. return e;
  3609. };
  3610. b.reduce = b.foldl = b.inject = function(a, c, d, e) {
  3611. var f = arguments.length > 2;
  3612. a == null && (a = []);
  3613. if (y && a.reduce === y) return e && (c = b.bind(c, e)), f ? a.reduce(c, d) : a.reduce(c);
  3614. j(a, function(a, b, i) {
  3615. f ? d = c.call(e, d, a, b, i) : (d = a, f = true);
  3616. });
  3617. if (!f) throw new TypeError("Reduce of empty array with no initial value");
  3618. return d;
  3619. };
  3620. b.reduceRight = b.foldr = function(a, c, d, e) {
  3621. var f = arguments.length > 2;
  3622. a == null && (a = []);
  3623. if (z && a.reduceRight === z) return e && (c = b.bind(c, e)), f ? a.reduceRight(c, d) : a.reduceRight(c);
  3624. var g = b.toArray(a).reverse();
  3625. e && !f && (c = b.bind(c, e));
  3626. return f ? b.reduce(g, c, d, e) : b.reduce(g, c);
  3627. };
  3628. b.find = b.detect = function(a, c, b) {
  3629. var e;
  3630. E(a, function(a, g, h) {
  3631. if (c.call(b, a, g, h)) return e = a, true;
  3632. });
  3633. return e;
  3634. };
  3635. b.filter = b.select = function(a, c, b) {
  3636. var e = [];
  3637. if (a == null) return e;
  3638. if (A && a.filter === A) return a.filter(c, b);
  3639. j(a, function(a, g, h) {
  3640. c.call(b, a, g, h) && (e[e.length] = a);
  3641. });
  3642. return e;
  3643. };
  3644. b.reject = function(a, c, b) {
  3645. var e = [];
  3646. if (a == null) return e;
  3647. j(a, function(a, g, h) {
  3648. c.call(b, a, g, h) || (e[e.length] = a);
  3649. });
  3650. return e;
  3651. };
  3652. b.every = b.all = function(a, c, b) {
  3653. var e = true;
  3654. if (a == null) return e;
  3655. if (B && a.every === B) return a.every(c, b);
  3656. j(a, function(a, g, h) {
  3657. if (!(e = e && c.call(b, a, g, h))) return n;
  3658. });
  3659. return e;
  3660. };
  3661. var E = b.some = b.any = function(a, c, d) {
  3662. c || (c = b.identity);
  3663. var e = false;
  3664. if (a == null) return e;
  3665. if (C && a.some === C) return a.some(c, d);
  3666. j(a, function(a, b, h) {
  3667. if (e || (e = c.call(d, a, b, h))) return n;
  3668. });
  3669. return !!e;
  3670. };
  3671. b.include = b.contains = function(a, c) {
  3672. var b = false;
  3673. if (a == null) return b;
  3674. return p && a.indexOf === p ? a.indexOf(c) != -1 : b = E(a, function(a) {
  3675. return a === c;
  3676. });
  3677. };
  3678. b.invoke = function(a, c) {
  3679. var d = i.call(arguments, 2);
  3680. return b.map(a, function(a) {
  3681. return (b.isFunction(c) ? c || a : a[c]).apply(a, d);
  3682. });
  3683. };
  3684. b.pluck = function(a, c) {
  3685. return b.map(a, function(a) {
  3686. return a[c];
  3687. });
  3688. };
  3689. b.max = function(a, c, d) {
  3690. if (!c && b.isArray(a)) return Math.max.apply(Math, a);
  3691. if (!c && b.isEmpty(a)) return -Infinity;
  3692. var e = {
  3693. computed: -Infinity
  3694. };
  3695. j(a, function(a, b, h) {
  3696. b = c ? c.call(d, a, b, h) : a;
  3697. b >= e.computed && (e = {
  3698. value: a,
  3699. computed: b
  3700. });
  3701. });
  3702. return e.value;
  3703. };
  3704. b.min = function(a, c, d) {
  3705. if (!c && b.isArray(a)) return Math.min.apply(Math, a);
  3706. if (!c && b.isEmpty(a)) return Infinity;
  3707. var e = {
  3708. computed: Infinity
  3709. };
  3710. j(a, function(a, b, h) {
  3711. b = c ? c.call(d, a, b, h) : a;
  3712. b < e.computed && (e = {
  3713. value: a,
  3714. computed: b
  3715. });
  3716. });
  3717. return e.value;
  3718. };
  3719. b.shuffle = function(a) {
  3720. var b = [], d;
  3721. j(a, function(a, f) {
  3722. f == 0 ? b[0] = a : (d = Math.floor(Math.random() * (f + 1)), b[f] = b[d], b[d] = a);
  3723. });
  3724. return b;
  3725. };
  3726. b.sortBy = function(a, c, d) {
  3727. return b.pluck(b.map(a, function(a, b, g) {
  3728. return {
  3729. value: a,
  3730. criteria: c.call(d, a, b, g)
  3731. };
  3732. }).sort(function(a, b) {
  3733. var c = a.criteria, d = b.criteria;
  3734. return c < d ? -1 : c > d ? 1 : 0;
  3735. }), "value");
  3736. };
  3737. b.groupBy = function(a, c) {
  3738. var d = {}, e = b.isFunction(c) ? c : function(a) {
  3739. return a[c];
  3740. };
  3741. j(a, function(a, b) {
  3742. var c = e(a, b);
  3743. (d[c] || (d[c] = [])).push(a);
  3744. });
  3745. return d;
  3746. };
  3747. b.sortedIndex = function(a, c, d) {
  3748. d || (d = b.identity);
  3749. for (var e = 0, f = a.length; e < f; ) {
  3750. var g = e + f >> 1;
  3751. d(a[g]) < d(c) ? e = g + 1 : f = g;
  3752. }
  3753. return e;
  3754. };
  3755. b.toArray = function(a) {
  3756. return !a ? [] : a.toArray ? a.toArray() : b.isArray(a) ? i.call(a) : b.isArguments(a) ? i.call(a) : b.values(a);
  3757. };
  3758. b.size = function(a) {
  3759. return b.toArray(a).length;
  3760. };
  3761. b.first = b.head = function(a, b, d) {
  3762. return b != null && !d ? i.call(a, 0, b) : a[0];
  3763. };
  3764. b.initial = function(a, b, d) {
  3765. return i.call(a, 0, a.length - (b == null || d ? 1 : b));
  3766. };
  3767. b.last = function(a, b, d) {
  3768. return b != null && !d ? i.call(a, Math.max(a.length - b, 0)) : a[a.length - 1];
  3769. };
  3770. b.rest = b.tail = function(a, b, d) {
  3771. return i.call(a, b == null || d ? 1 : b);
  3772. };
  3773. b.compact = function(a) {
  3774. return b.filter(a, function(a) {
  3775. return !!a;
  3776. });
  3777. };
  3778. b.flatten = function(a, c) {
  3779. return b.reduce(a, function(a, e) {
  3780. if (b.isArray(e)) return a.concat(c ? e : b.flatten(e));
  3781. a[a.length] = e;
  3782. return a;
  3783. }, []);
  3784. };
  3785. b.without = function(a) {
  3786. return b.difference(a, i.call(arguments, 1));
  3787. };
  3788. b.uniq = b.unique = function(a, c, d) {
  3789. var d = d ? b.map(a, d) : a, e = [];
  3790. b.reduce(d, function(d, g, h) {
  3791. if (0 == h || (c === true ? b.last(d) != g : !b.include(d, g))) d[d.length] = g,
  3792. e[e.length] = a[h];
  3793. return d;
  3794. }, []);
  3795. return e;
  3796. };
  3797. b.union = function() {
  3798. return b.uniq(b.flatten(arguments, true));
  3799. };
  3800. b.intersection = b.intersect = function(a) {
  3801. var c = i.call(arguments, 1);
  3802. return b.filter(b.uniq(a), function(a) {
  3803. return b.every(c, function(c) {
  3804. return b.indexOf(c, a) >= 0;
  3805. });
  3806. });
  3807. };
  3808. b.difference = function(a) {
  3809. var c = b.flatten(i.call(arguments, 1));
  3810. return b.filter(a, function(a) {
  3811. return !b.include(c, a);
  3812. });
  3813. };
  3814. b.zip = function() {
  3815. for (var a = i.call(arguments), c = b.max(b.pluck(a, "length")), d = Array(c), e = 0; e < c; e++) d[e] = b.pluck(a, "" + e);
  3816. return d;
  3817. };
  3818. b.indexOf = function(a, c, d) {
  3819. if (a == null) return -1;
  3820. var e;
  3821. if (d) return d = b.sortedIndex(a, c), a[d] === c ? d : -1;
  3822. if (p && a.indexOf === p) return a.indexOf(c);
  3823. for (d = 0, e = a.length; d < e; d++) if (d in a && a[d] === c) return d;
  3824. return -1;
  3825. };
  3826. b.lastIndexOf = function(a, b) {
  3827. if (a == null) return -1;
  3828. if (D && a.lastIndexOf === D) return a.lastIndexOf(b);
  3829. for (var d = a.length; d--; ) if (d in a && a[d] === b) return d;
  3830. return -1;
  3831. };
  3832. b.range = function(a, b, d) {
  3833. arguments.length <= 1 && (b = a || 0, a = 0);
  3834. for (var d = arguments[2] || 1, e = Math.max(Math.ceil((b - a) / d), 0), f = 0, g = Array(e); f < e; ) g[f++] = a,
  3835. a += d;
  3836. return g;
  3837. };
  3838. var F = function() {};
  3839. b.bind = function(a, c) {
  3840. var d, e;
  3841. if (a.bind === s && s) return s.apply(a, i.call(arguments, 1));
  3842. if (!b.isFunction(a)) throw new TypeError();
  3843. e = i.call(arguments, 2);
  3844. return d = function() {
  3845. if (!(this instanceof d)) return a.apply(c, e.concat(i.call(arguments)));
  3846. F.prototype = a.prototype;
  3847. var b = new F(), g = a.apply(b, e.concat(i.call(arguments)));
  3848. return Object(g) === g ? g : b;
  3849. };
  3850. };
  3851. b.bindAll = function(a) {
  3852. var c = i.call(arguments, 1);
  3853. c.length == 0 && (c = b.functions(a));
  3854. j(c, function(c) {
  3855. a[c] = b.bind(a[c], a);
  3856. });
  3857. return a;
  3858. };
  3859. b.memoize = function(a, c) {
  3860. var d = {};
  3861. c || (c = b.identity);
  3862. return function() {
  3863. var e = c.apply(this, arguments);
  3864. return b.has(d, e) ? d[e] : d[e] = a.apply(this, arguments);
  3865. };
  3866. };
  3867. b.delay = function(a, b) {
  3868. var d = i.call(arguments, 2);
  3869. return setTimeout(function() {
  3870. return a.apply(a, d);
  3871. }, b);
  3872. };
  3873. b.defer = function(a) {
  3874. return b.delay.apply(b, [ a, 1 ].concat(i.call(arguments, 1)));
  3875. };
  3876. b.throttle = function(a, c) {
  3877. var d, e, f, g, h, i = b.debounce(function() {
  3878. h = g = false;
  3879. }, c);
  3880. return function() {
  3881. d = this;
  3882. e = arguments;
  3883. var b;
  3884. f || (f = setTimeout(function() {
  3885. f = null;
  3886. h && a.apply(d, e);
  3887. i();
  3888. }, c));
  3889. g ? h = true : a.apply(d, e);
  3890. i();
  3891. g = true;
  3892. };
  3893. };
  3894. b.debounce = function(a, b) {
  3895. var d;
  3896. return function() {
  3897. var e = this, f = arguments;
  3898. clearTimeout(d);
  3899. d = setTimeout(function() {
  3900. d = null;
  3901. a.apply(e, f);
  3902. }, b);
  3903. };
  3904. };
  3905. b.once = function(a) {
  3906. var b = false, d;
  3907. return function() {
  3908. if (b) return d;
  3909. b = true;
  3910. return d = a.apply(this, arguments);
  3911. };
  3912. };
  3913. b.wrap = function(a, b) {
  3914. return function() {
  3915. var d = [ a ].concat(i.call(arguments, 0));
  3916. return b.apply(this, d);
  3917. };
  3918. };
  3919. b.compose = function() {
  3920. var a = arguments;
  3921. return function() {
  3922. for (var b = arguments, d = a.length - 1; d >= 0; d--) b = [ a[d].apply(this, b) ];
  3923. return b[0];
  3924. };
  3925. };
  3926. b.after = function(a, b) {
  3927. return a <= 0 ? b() : function() {
  3928. if (--a < 1) return b.apply(this, arguments);
  3929. };
  3930. };
  3931. b.keys = J || function(a) {
  3932. if (a !== Object(a)) throw new TypeError("Invalid object");
  3933. var c = [], d;
  3934. for (d in a) b.has(a, d) && (c[c.length] = d);
  3935. return c;
  3936. };
  3937. b.values = function(a) {
  3938. return b.map(a, b.identity);
  3939. };
  3940. b.functions = b.methods = function(a) {
  3941. var c = [], d;
  3942. for (d in a) b.isFunction(a[d]) && c.push(d);
  3943. return c.sort();
  3944. };
  3945. b.extend = function(a) {
  3946. j(i.call(arguments, 1), function(b) {
  3947. for (var d in b) a[d] = b[d];
  3948. });
  3949. return a;
  3950. };
  3951. b.defaults = function(a) {
  3952. j(i.call(arguments, 1), function(b) {
  3953. for (var d in b) a[d] == null && (a[d] = b[d]);
  3954. });
  3955. return a;
  3956. };
  3957. b.clone = function(a) {
  3958. return !b.isObject(a) ? a : b.isArray(a) ? a.slice() : b.extend({}, a);
  3959. };
  3960. b.tap = function(a, b) {
  3961. b(a);
  3962. return a;
  3963. };
  3964. b.isEqual = function(a, b) {
  3965. return q(a, b, []);
  3966. };
  3967. b.isEmpty = function(a) {
  3968. if (b.isArray(a) || b.isString(a)) return a.length === 0;
  3969. for (var c in a) if (b.has(a, c)) return false;
  3970. return true;
  3971. };
  3972. b.isElement = function(a) {
  3973. return !!(a && a.nodeType == 1);
  3974. };
  3975. b.isArray = o || function(a) {
  3976. return l.call(a) == "[object Array]";
  3977. };
  3978. b.isObject = function(a) {
  3979. return a === Object(a);
  3980. };
  3981. b.isArguments = function(a) {
  3982. return l.call(a) == "[object Arguments]";
  3983. };
  3984. if (!b.isArguments(arguments)) b.isArguments = function(a) {
  3985. return !(!a || !b.has(a, "callee"));
  3986. };
  3987. b.isFunction = function(a) {
  3988. return l.call(a) == "[object Function]";
  3989. };
  3990. b.isString = function(a) {
  3991. return l.call(a) == "[object String]";
  3992. };
  3993. b.isNumber = function(a) {
  3994. return l.call(a) == "[object Number]";
  3995. };
  3996. b.isNaN = function(a) {
  3997. return a !== a;
  3998. };
  3999. b.isBoolean = function(a) {
  4000. return a === true || a === false || l.call(a) == "[object Boolean]";
  4001. };
  4002. b.isDate = function(a) {
  4003. return l.call(a) == "[object Date]";
  4004. };
  4005. b.isRegExp = function(a) {
  4006. return l.call(a) == "[object RegExp]";
  4007. };
  4008. b.isNull = function(a) {
  4009. return a === null;
  4010. };
  4011. b.isUndefined = function(a) {
  4012. return a === void 0;
  4013. };
  4014. b.has = function(a, b) {
  4015. return I.call(a, b);
  4016. };
  4017. b.noConflict = function() {
  4018. r._ = G;
  4019. return this;
  4020. };
  4021. b.identity = function(a) {
  4022. return a;
  4023. };
  4024. b.times = function(a, b, d) {
  4025. for (var e = 0; e < a; e++) b.call(d, e);
  4026. };
  4027. b.escape = function(a) {
  4028. return ("" + a).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;").replace(/\//g, "&#x2F;");
  4029. };
  4030. b.mixin = function(a) {
  4031. j(b.functions(a), function(c) {
  4032. K(c, b[c] = a[c]);
  4033. });
  4034. };
  4035. var L = 0;
  4036. b.uniqueId = function(a) {
  4037. var b = L++;
  4038. return a ? a + b : b;
  4039. };
  4040. b.templateSettings = {
  4041. evaluate: /<%([\s\S]+?)%>/g,
  4042. interpolate: /<%=([\s\S]+?)%>/g,
  4043. escape: /<%-([\s\S]+?)%>/g
  4044. };
  4045. var t = /.^/, u = function(a) {
  4046. return a.replace(/\\\\/g, "\\").replace(/\\'/g, "'");
  4047. };
  4048. b.template = function(a, c) {
  4049. var d = b.templateSettings, d = "var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('" + a.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(d.escape || t, function(a, b) {
  4050. return "',_.escape(" + u(b) + "),'";
  4051. }).replace(d.interpolate || t, function(a, b) {
  4052. return "'," + u(b) + ",'";
  4053. }).replace(d.evaluate || t, function(a, b) {
  4054. return "');" + u(b).replace(/[\r\n\t]/g, " ") + ";__p.push('";
  4055. }).replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\t/g, "\\t") + "');}return __p.join('');", e = new Function("obj", "_", d);
  4056. return c ? e(c, b) : function(a) {
  4057. return e.call(this, a, b);
  4058. };
  4059. };
  4060. b.chain = function(a) {
  4061. return b(a).chain();
  4062. };
  4063. var m = function(a) {
  4064. this._wrapped = a;
  4065. };
  4066. b.prototype = m.prototype;
  4067. var v = function(a, c) {
  4068. return c ? b(a).chain() : a;
  4069. }, K = function(a, c) {
  4070. m.prototype[a] = function() {
  4071. var a = i.call(arguments);
  4072. H.call(a, this._wrapped);
  4073. return v(c.apply(b, a), this._chain);
  4074. };
  4075. };
  4076. b.mixin(b);
  4077. j("pop,push,reverse,shift,sort,splice,unshift".split(","), function(a) {
  4078. var b = k[a];
  4079. m.prototype[a] = function() {
  4080. var d = this._wrapped;
  4081. b.apply(d, arguments);
  4082. var e = d.length;
  4083. (a == "shift" || a == "splice") && e === 0 && delete d[0];
  4084. return v(d, this._chain);
  4085. };
  4086. });
  4087. j([ "concat", "join", "slice" ], function(a) {
  4088. var b = k[a];
  4089. m.prototype[a] = function() {
  4090. return v(b.apply(this._wrapped, arguments), this._chain);
  4091. };
  4092. });
  4093. m.prototype.chain = function() {
  4094. this._chain = true;
  4095. return this;
  4096. };
  4097. m.prototype.value = function() {
  4098. return this._wrapped;
  4099. };
  4100. }).call(this);
  4101.  
  4102. function validateImei(count, imeiNos, imeiString) {
  4103. return count === 0 || imeiString.length > 0;
  4104. }
  4105.  
  4106. jQuery.validator.addMethod("imeiCount", function(value, element) {
  4107. "use strict";
  4108. var imeiNos = value.split(",");
  4109. function noEmptyStrings(arr) {
  4110. var i, n;
  4111. for (i = 0, n = imeiNos.length; i < n; i++) {
  4112. if (arr[i].length === 0) {
  4113. return false;
  4114. }
  4115. }
  4116. return true;
  4117. }
  4118. var count = parseInt($(element).attr("imei-count"), 10);
  4119. return validateImei(count, imeiNos, value);
  4120. }, "Incorrect number of serial/imei numbers(numbers must be separated by a comma ',')");
  4121.  
  4122. jQuery.validator.addMethod("mobileDigits", function(value, element) {
  4123. return this.optional(element) || /^[0-9+]+$/.test(value);
  4124. }, "Mobile number contains invalid characters");
  4125.  
  4126. jQuery.validator.addMethod("mobileLength", function(value, element) {
  4127. if (value.indexOf("+91") == 0) {
  4128. return value.length == 13;
  4129. } else if (value.indexOf("0") == 0) {
  4130. return value.length == 11;
  4131. } else if (value.indexOf("+") >= 0) {
  4132. return false;
  4133. } else {
  4134. return value.length == 10;
  4135. }
  4136. }, "Please enter a valid 10-digit number");
  4137.  
  4138. jQuery.validator.addMethod("displayNameCharacters", function(value, element) {
  4139. return this.optional(element) || /^[a-zA-Z0-9]{3,22}$/.test(value);
  4140. }, "Display name contains invalid characters");
  4141.  
  4142. jQuery.validator.addMethod("invoiceValidation", function(value, element) {
  4143. return this.optional(element) || /^(?=.*\d)[a-zA-Z\d\\/#-]{1,29}$/.test(value);
  4144. }, "Invoice number contains invalid charachters");
  4145.  
  4146. jQuery.validator.addMethod("doesNotHaveFlipKart", function(value, element) {
  4147. "use strict";
  4148. var name = value.toLowerCase();
  4149. return name.indexOf("flip") === -1 && name.indexOf("kart") === -1;
  4150. }, "Display name cannot have 'flip' or 'kart'");
  4151.  
  4152. jQuery.validator.addMethod("panFormat", function(value, element) {
  4153. return this.optional(element) || /^[A-Za-z]{3}[CHFATBLJGPchfatbljgp]{1}[A-Za-z]{1}\d{4}[A-Za-z]{1}$/.test(value);
  4154. }, "PAN ID must belong to a company, firm, trust, or local authority");
  4155.  
  4156. jQuery.validator.addMethod("noURLinDescription", function(value, element) {
  4157. return this.optional(element) || !/(https:\/\/|http:\/\/|www|\w\w+\.com|\w\w+\.org|\w\w+\.in|\w\w+\.net)/.test(value);
  4158. }, "Links not allowed in description");
  4159.  
  4160. jQuery.validator.addMethod("passwordCheck", function(value, element) {
  4161. return this.optional(element) || /\d/.test(value) && /[a-zA-Z]/.test(value);
  4162. }, "Your password should contain atleast one digit and one alphabet");
  4163.  
  4164. jQuery.validator.addMethod("passwordLength", function(value, element) {
  4165. return value.length >= 4;
  4166. }, "Your password must be at least 4 characters long");
  4167.  
  4168. jQuery.validator.addMethod("letters", function(value, element) {
  4169. return this.optional(element) || /^[a-zA-Z]+$/.test(value);
  4170. }, "This field should contain only letters and no spaces");
  4171.  
  4172. jQuery.validator.addMethod("sameAsOldPassword", function(value, element) {
  4173. return $("#oldPassword").val() !== value;
  4174. }, "Enter a different password");
  4175.  
  4176. jQuery.validator.addMethod("notAccountNumber", function(value, element) {
  4177. return this.optional(element) || /^(?=.*[a-zA-Z]).+$/.test(value);
  4178. }, "You seem to have entered your account number instead of account name");
  4179.  
  4180. jQuery.validator.addMethod("taxLessThanAmt", function(value, element) {
  4181. var taxAmt = parseFloat(value), invAmt = parseFloat($(element).parents("fieldset").find(".invoice-amount").val());
  4182. return taxAmt <= invAmt;
  4183. }, "Tax is more than invoice amount");
  4184.  
  4185. jQuery.validator.addMethod("startDateLessThan", function(value, element) {
  4186. var endDateString = $("#toDate").val();
  4187. var startDate = moment(value, "DD/MM/YYYY");
  4188. var endDate = moment(endDateString, "DD/MM/YYYY");
  4189. if (endDate.isAfter(startDate) || endDate.isSame(startDate)) return true; else return false;
  4190. }, "Start Date should be less than End Date and start date and end date is mandatory");
  4191.  
  4192. jQuery.validator.addMethod("uploadTin", function(value, element) {
  4193. if (value !== $("#vatIdStatic").text() && value !== $("#invoiceCSTNumberLabel").text()) {
  4194. $(".cst-file").show();
  4195. } else {
  4196. $(".cst-file").hide();
  4197. }
  4198. return true;
  4199. }, "Please upload your new CST certificate");
  4200.  
  4201. (function() {
  4202. var t = [].indexOf || function(t) {
  4203. for (var e = 0, n = this.length; e < n; e++) {
  4204. if (e in this && this[e] === t) return e;
  4205. }
  4206. return -1;
  4207. }, e = [].slice;
  4208. (function(t, e) {
  4209. if (typeof define === "function" && define.amd) {
  4210. return define("waypoints", [ "jquery" ], function(n) {
  4211. return e(n, t);
  4212. });
  4213. } else {
  4214. return e(t.jQuery, t);
  4215. }
  4216. })(window, function(n, r) {
  4217. var i, o, l, s, f, u, c, a, h, d, p, y, v, w, g, m;
  4218. i = n(r);
  4219. a = t.call(r, "ontouchstart") >= 0;
  4220. s = {
  4221. horizontal: {},
  4222. vertical: {}
  4223. };
  4224. f = 1;
  4225. c = {};
  4226. u = "waypoints-context-id";
  4227. p = "resize.waypoints";
  4228. y = "scroll.waypoints";
  4229. v = 1;
  4230. w = "waypoints-waypoint-ids";
  4231. g = "waypoint";
  4232. m = "waypoints";
  4233. o = function() {
  4234. function t(t) {
  4235. var e = this;
  4236. this.$element = t;
  4237. this.element = t[0];
  4238. this.didResize = false;
  4239. this.didScroll = false;
  4240. this.id = "context" + f++;
  4241. this.oldScroll = {
  4242. x: t.scrollLeft(),
  4243. y: t.scrollTop()
  4244. };
  4245. this.waypoints = {
  4246. horizontal: {},
  4247. vertical: {}
  4248. };
  4249. this.element[u] = this.id;
  4250. c[this.id] = this;
  4251. t.bind(y, function() {
  4252. var t;
  4253. if (!(e.didScroll || a)) {
  4254. e.didScroll = true;
  4255. t = function() {
  4256. e.doScroll();
  4257. return e.didScroll = false;
  4258. };
  4259. return r.setTimeout(t, n[m].settings.scrollThrottle);
  4260. }
  4261. });
  4262. t.bind(p, function() {
  4263. var t;
  4264. if (!e.didResize) {
  4265. e.didResize = true;
  4266. t = function() {
  4267. n[m]("refresh");
  4268. return e.didResize = false;
  4269. };
  4270. return r.setTimeout(t, n[m].settings.resizeThrottle);
  4271. }
  4272. });
  4273. }
  4274. t.prototype.doScroll = function() {
  4275. var t, e = this;
  4276. t = {
  4277. horizontal: {
  4278. newScroll: this.$element.scrollLeft(),
  4279. oldScroll: this.oldScroll.x,
  4280. forward: "right",
  4281. backward: "left"
  4282. },
  4283. vertical: {
  4284. newScroll: this.$element.scrollTop(),
  4285. oldScroll: this.oldScroll.y,
  4286. forward: "down",
  4287. backward: "up"
  4288. }
  4289. };
  4290. if (a && (!t.vertical.oldScroll || !t.vertical.newScroll)) {
  4291. n[m]("refresh");
  4292. }
  4293. n.each(t, function(t, r) {
  4294. var i, o, l;
  4295. l = [];
  4296. o = r.newScroll > r.oldScroll;
  4297. i = o ? r.forward : r.backward;
  4298. n.each(e.waypoints[t], function(t, e) {
  4299. var n, i;
  4300. if (r.oldScroll < (n = e.offset) && n <= r.newScroll) {
  4301. return l.push(e);
  4302. } else if (r.newScroll < (i = e.offset) && i <= r.oldScroll) {
  4303. return l.push(e);
  4304. }
  4305. });
  4306. l.sort(function(t, e) {
  4307. return t.offset - e.offset;
  4308. });
  4309. if (!o) {
  4310. l.reverse();
  4311. }
  4312. return n.each(l, function(t, e) {
  4313. if (e.options.continuous || t === l.length - 1) {
  4314. return e.trigger([ i ]);
  4315. }
  4316. });
  4317. });
  4318. return this.oldScroll = {
  4319. x: t.horizontal.newScroll,
  4320. y: t.vertical.newScroll
  4321. };
  4322. };
  4323. t.prototype.refresh = function() {
  4324. var t, e, r, i = this;
  4325. r = n.isWindow(this.element);
  4326. e = this.$element.offset();
  4327. this.doScroll();
  4328. t = {
  4329. horizontal: {
  4330. contextOffset: r ? 0 : e.left,
  4331. contextScroll: r ? 0 : this.oldScroll.x,
  4332. contextDimension: this.$element.width(),
  4333. oldScroll: this.oldScroll.x,
  4334. forward: "right",
  4335. backward: "left",
  4336. offsetProp: "left"
  4337. },
  4338. vertical: {
  4339. contextOffset: r ? 0 : e.top,
  4340. contextScroll: r ? 0 : this.oldScroll.y,
  4341. contextDimension: r ? n[m]("viewportHeight") : this.$element.height(),
  4342. oldScroll: this.oldScroll.y,
  4343. forward: "down",
  4344. backward: "up",
  4345. offsetProp: "top"
  4346. }
  4347. };
  4348. return n.each(t, function(t, e) {
  4349. return n.each(i.waypoints[t], function(t, r) {
  4350. var i, o, l, s, f;
  4351. i = r.options.offset;
  4352. l = r.offset;
  4353. o = n.isWindow(r.element) ? 0 : r.$element.offset()[e.offsetProp];
  4354. if (n.isFunction(i)) {
  4355. i = i.apply(r.element);
  4356. } else if (typeof i === "string") {
  4357. i = parseFloat(i);
  4358. if (r.options.offset.indexOf("%") > -1) {
  4359. i = Math.ceil(e.contextDimension * i / 100);
  4360. }
  4361. }
  4362. r.offset = o - e.contextOffset + e.contextScroll - i;
  4363. if (r.options.onlyOnScroll && l != null || !r.enabled) {
  4364. return;
  4365. }
  4366. if (l !== null && l < (s = e.oldScroll) && s <= r.offset) {
  4367. return r.trigger([ e.backward ]);
  4368. } else if (l !== null && l > (f = e.oldScroll) && f >= r.offset) {
  4369. return r.trigger([ e.forward ]);
  4370. } else if (l === null && e.oldScroll >= r.offset) {
  4371. return r.trigger([ e.forward ]);
  4372. }
  4373. });
  4374. });
  4375. };
  4376. t.prototype.checkEmpty = function() {
  4377. if (n.isEmptyObject(this.waypoints.horizontal) && n.isEmptyObject(this.waypoints.vertical)) {
  4378. this.$element.unbind([ p, y ].join(" "));
  4379. return delete c[this.id];
  4380. }
  4381. };
  4382. return t;
  4383. }();
  4384. l = function() {
  4385. function t(t, e, r) {
  4386. var i, o;
  4387. if (r.offset === "bottom-in-view") {
  4388. r.offset = function() {
  4389. var t;
  4390. t = n[m]("viewportHeight");
  4391. if (!n.isWindow(e.element)) {
  4392. t = e.$element.height();
  4393. }
  4394. return t - n(this).outerHeight();
  4395. };
  4396. }
  4397. this.$element = t;
  4398. this.element = t[0];
  4399. this.axis = r.horizontal ? "horizontal" : "vertical";
  4400. this.callback = r.handler;
  4401. this.context = e;
  4402. this.enabled = r.enabled;
  4403. this.id = "waypoints" + v++;
  4404. this.offset = null;
  4405. this.options = r;
  4406. e.waypoints[this.axis][this.id] = this;
  4407. s[this.axis][this.id] = this;
  4408. i = (o = this.element[w]) != null ? o : [];
  4409. i.push(this.id);
  4410. this.element[w] = i;
  4411. }
  4412. t.prototype.trigger = function(t) {
  4413. if (!this.enabled) {
  4414. return;
  4415. }
  4416. if (this.callback != null) {
  4417. this.callback.apply(this.element, t);
  4418. }
  4419. if (this.options.triggerOnce) {
  4420. return this.destroy();
  4421. }
  4422. };
  4423. t.prototype.disable = function() {
  4424. return this.enabled = false;
  4425. };
  4426. t.prototype.enable = function() {
  4427. this.context.refresh();
  4428. return this.enabled = true;
  4429. };
  4430. t.prototype.destroy = function() {
  4431. delete s[this.axis][this.id];
  4432. delete this.context.waypoints[this.axis][this.id];
  4433. return this.context.checkEmpty();
  4434. };
  4435. t.getWaypointsByElement = function(t) {
  4436. var e, r;
  4437. r = t[w];
  4438. if (!r) {
  4439. return [];
  4440. }
  4441. e = n.extend({}, s.horizontal, s.vertical);
  4442. return n.map(r, function(t) {
  4443. return e[t];
  4444. });
  4445. };
  4446. return t;
  4447. }();
  4448. d = {
  4449. init: function(t, e) {
  4450. var r;
  4451. e = n.extend({}, n.fn[g].defaults, e);
  4452. if ((r = e.handler) == null) {
  4453. e.handler = t;
  4454. }
  4455. this.each(function() {
  4456. var t, r, i, s;
  4457. t = n(this);
  4458. i = (s = e.context) != null ? s : n.fn[g].defaults.context;
  4459. if (!n.isWindow(i)) {
  4460. i = t.closest(i);
  4461. }
  4462. i = n(i);
  4463. r = c[i[0][u]];
  4464. if (!r) {
  4465. r = new o(i);
  4466. }
  4467. return new l(t, r, e);
  4468. });
  4469. n[m]("refresh");
  4470. return this;
  4471. },
  4472. disable: function() {
  4473. return d._invoke.call(this, "disable");
  4474. },
  4475. enable: function() {
  4476. return d._invoke.call(this, "enable");
  4477. },
  4478. destroy: function() {
  4479. return d._invoke.call(this, "destroy");
  4480. },
  4481. prev: function(t, e) {
  4482. return d._traverse.call(this, t, e, function(t, e, n) {
  4483. if (e > 0) {
  4484. return t.push(n[e - 1]);
  4485. }
  4486. });
  4487. },
  4488. next: function(t, e) {
  4489. return d._traverse.call(this, t, e, function(t, e, n) {
  4490. if (e < n.length - 1) {
  4491. return t.push(n[e + 1]);
  4492. }
  4493. });
  4494. },
  4495. _traverse: function(t, e, i) {
  4496. var o, l;
  4497. if (t == null) {
  4498. t = "vertical";
  4499. }
  4500. if (e == null) {
  4501. e = r;
  4502. }
  4503. l = h.aggregate(e);
  4504. o = [];
  4505. this.each(function() {
  4506. var e;
  4507. e = n.inArray(this, l[t]);
  4508. return i(o, e, l[t]);
  4509. });
  4510. return this.pushStack(o);
  4511. },
  4512. _invoke: function(t) {
  4513. this.each(function() {
  4514. var e;
  4515. e = l.getWaypointsByElement(this);
  4516. return n.each(e, function(e, n) {
  4517. n[t]();
  4518. return true;
  4519. });
  4520. });
  4521. return this;
  4522. }
  4523. };
  4524. n.fn[g] = function() {
  4525. var t, r;
  4526. r = arguments[0], t = 2 <= arguments.length ? e.call(arguments, 1) : [];
  4527. if (d[r]) {
  4528. return d[r].apply(this, t);
  4529. } else if (n.isFunction(r)) {
  4530. return d.init.apply(this, arguments);
  4531. } else if (n.isPlainObject(r)) {
  4532. return d.init.apply(this, [ null, r ]);
  4533. } else if (!r) {
  4534. return n.error("jQuery Waypoints needs a callback function or handler option.");
  4535. } else {
  4536. return n.error("The " + r + " method does not exist in jQuery Waypoints.");
  4537. }
  4538. };
  4539. n.fn[g].defaults = {
  4540. context: r,
  4541. continuous: true,
  4542. enabled: true,
  4543. horizontal: false,
  4544. offset: 0,
  4545. triggerOnce: false
  4546. };
  4547. h = {
  4548. refresh: function() {
  4549. return n.each(c, function(t, e) {
  4550. return e.refresh();
  4551. });
  4552. },
  4553. viewportHeight: function() {
  4554. var t;
  4555. return (t = r.innerHeight) != null ? t : i.height();
  4556. },
  4557. aggregate: function(t) {
  4558. var e, r, i;
  4559. e = s;
  4560. if (t) {
  4561. e = (i = c[n(t)[0][u]]) != null ? i.waypoints : void 0;
  4562. }
  4563. if (!e) {
  4564. return [];
  4565. }
  4566. r = {
  4567. horizontal: [],
  4568. vertical: []
  4569. };
  4570. n.each(r, function(t, i) {
  4571. n.each(e[t], function(t, e) {
  4572. return i.push(e);
  4573. });
  4574. i.sort(function(t, e) {
  4575. return t.offset - e.offset;
  4576. });
  4577. r[t] = n.map(i, function(t) {
  4578. return t.element;
  4579. });
  4580. return r[t] = n.unique(r[t]);
  4581. });
  4582. return r;
  4583. },
  4584. above: function(t) {
  4585. if (t == null) {
  4586. t = r;
  4587. }
  4588. return h._filter(t, "vertical", function(t, e) {
  4589. return e.offset <= t.oldScroll.y;
  4590. });
  4591. },
  4592. below: function(t) {
  4593. if (t == null) {
  4594. t = r;
  4595. }
  4596. return h._filter(t, "vertical", function(t, e) {
  4597. return e.offset > t.oldScroll.y;
  4598. });
  4599. },
  4600. left: function(t) {
  4601. if (t == null) {
  4602. t = r;
  4603. }
  4604. return h._filter(t, "horizontal", function(t, e) {
  4605. return e.offset <= t.oldScroll.x;
  4606. });
  4607. },
  4608. right: function(t) {
  4609. if (t == null) {
  4610. t = r;
  4611. }
  4612. return h._filter(t, "horizontal", function(t, e) {
  4613. return e.offset > t.oldScroll.x;
  4614. });
  4615. },
  4616. enable: function() {
  4617. return h._invoke("enable");
  4618. },
  4619. disable: function() {
  4620. return h._invoke("disable");
  4621. },
  4622. destroy: function() {
  4623. return h._invoke("destroy");
  4624. },
  4625. extendFn: function(t, e) {
  4626. return d[t] = e;
  4627. },
  4628. _invoke: function(t) {
  4629. var e;
  4630. e = n.extend({}, s.vertical, s.horizontal);
  4631. return n.each(e, function(e, n) {
  4632. n[t]();
  4633. return true;
  4634. });
  4635. },
  4636. _filter: function(t, e, r) {
  4637. var i, o;
  4638. i = c[n(t)[0][u]];
  4639. if (!i) {
  4640. return [];
  4641. }
  4642. o = [];
  4643. n.each(i.waypoints[e], function(t, e) {
  4644. if (r(i, e)) {
  4645. return o.push(e);
  4646. }
  4647. });
  4648. o.sort(function(t, e) {
  4649. return t.offset - e.offset;
  4650. });
  4651. return n.map(o, function(t) {
  4652. return t.element;
  4653. });
  4654. }
  4655. };
  4656. n[m] = function() {
  4657. var t, n;
  4658. n = arguments[0], t = 2 <= arguments.length ? e.call(arguments, 1) : [];
  4659. if (h[n]) {
  4660. return h[n].apply(null, t);
  4661. } else {
  4662. return h.aggregate.call(null, n);
  4663. }
  4664. };
  4665. n[m].settings = {
  4666. resizeThrottle: 100,
  4667. scrollThrottle: 30
  4668. };
  4669. return i.on("load.waypoints", function() {
  4670. return n[m]("refresh");
  4671. });
  4672. });
  4673. }).call(this);
Add Comment
Please, Sign In to add comment