Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Modules in this bundle
- * @license
- *
- * nintendo-javascript-sdk:
- * version: 1.0.0
- *
- * babel-runtime:
- * license: MIT
- * author: Sebastian McKenzie <sebmck@gmail.com>
- * maintainers: sebmck <sebmck@gmail.com>
- * homepage: https://github.com/babel/babel#readme
- * version: 5.8.20
- *
- * core-js:
- * license: MIT
- * maintainers: zloirock <zloirock@zloirock.ru>
- * homepage: https://github.com/zloirock/core-js#readme
- * version: 1.1.3
- *
- * pct-encode:
- * license: BSD
- * maintainers: grncdr <glurgle@gmail.com>
- * contributors: Andrei Neculau <andrei.neculau@gmail.com>, Stephen Sugden <me@stephensugden.com>
- * homepage: https://github.com/grncdr/pct-encode#readme
- * version: 1.0.1
- *
- * punycode:
- * license: MIT
- * author: Mathias Bynens
- * contributors: Mathias Bynens, John-David Dalton
- * homepage: https://mths.be/punycode
- * version: 1.3.2
- *
- * querystring-es3:
- * licenses: MIT
- * author: Irakli Gozalishvili <rfobic@gmail.com>
- * homepage: https://github.com/mike-spainhower/querystring#readme
- * version: 0.2.1
- *
- * uri-template:
- * license: MIT
- * author: Stephen Sugden <me@stephensugden.com>
- * maintainers: grncdr <glurgle@gmail.com>, andreineculau <andrei.neculau@gmail.com>
- * contributors: Stephen Sugden <me@stephensugden.com>, Andrei Neculau <andrei.neculau@gmail.com>
- * homepage: https://github.com/grncdr/uri-template
- * version: 1.0.0
- *
- * url:
- * license: MIT
- * homepage: https://github.com/defunctzombie/node-url#readme
- * version: 0.10.3
- *
- * This header is generated by licensify (https://github.com/twada/licensify)
- */
- ! function e(t, r, n) {
- function o(i, a) {
- if (!r[i]) {
- if (!t[i]) {
- var u = "function" == typeof require && require;
- if (!a && u) return u(i, !0);
- if (s) return s(i, !0);
- var l = new Error("Cannot find module '" + i + "'");
- throw l.code = "MODULE_NOT_FOUND", l
- }
- var c = r[i] = {
- exports: {}
- };
- t[i][0].call(c.exports, function(e) {
- var r = t[i][1][e];
- return o(r ? r : e)
- }, c, c.exports, e, t, r, n)
- }
- return r[i].exports
- }
- for (var s = "function" == typeof require && require, i = 0; i < n.length; i++) o(n[i]);
- return o
- }({
- 1: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"],
- s = e("babel-runtime/helpers/define-property")["default"],
- i = e("babel-runtime/helpers/get")["default"],
- a = e("babel-runtime/helpers/inherits")["default"],
- u = e("babel-runtime/core-js/promise")["default"],
- l = e("babel-runtime/helpers/interop-require-wildcard")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var c = e("./util.js"),
- f = l(c),
- h = "notification",
- p = "request",
- d = "response",
- m = {},
- b = function() {
- function e(t) {
- var r;
- o(this, e), this.target = t, this.listeners = (r = {}, s(r, h, {}), s(r, p, {}), s(r, d, {}), r), this.channelId = f.origin() + ":" + f.sequence.next("channel"), m[this.channelId] = this
- }
- return n(e, [{
- key: "addRequestListener",
- value: function(e, t) {
- this.listeners[p][e] = t
- }
- }, {
- key: "removeRequestListener",
- value: function(e) {
- delete this.listeners[p][e]
- }
- }, {
- key: "addNotifyListener",
- value: function(e, t) {
- this.listeners[h][e] = t
- }
- }, {
- key: "removeNotifyListener",
- value: function(e) {
- delete this.listeners[h][e]
- }
- }, {
- key: "notify",
- value: function(e, t) {
- this.postMessage({
- type: h,
- topic: e,
- extra: t
- })
- }
- }, {
- key: "request",
- value: function(e, t, r) {
- var n = f.sequence.next("channel:" + this.channelId);
- this.listeners[d][n] = r, this.postMessage({
- type: p,
- topic: e,
- id: n,
- parameters: t
- })
- }
- }, {
- key: "response",
- value: function(e, t, r) {
- this.postMessage({
- type: d,
- topic: e,
- id: t,
- result: r
- })
- }
- }, {
- key: "dispatch",
- value: function(e) {
- var t = e.data,
- r = t.topic,
- n = !1;
- t.type === h && this.listeners[h][r] ? (this.listeners[h][r](t), n = !0) : t.type === p && this.listeners[p][r] ? (this.listeners[p][r](t), n = !0) : t.type === d && this.listeners[d][t.id] && (this.listeners[d][t.id](t), delete this.listeners[d][t.id], n = !0), n && "function" == typeof e.stopImmediatePropagation && e.stopImmediatePropagation()
- }
- }]), e
- }(),
- g = function(e) {
- function t(e, r, n) {
- o(this, t), i(Object.getPrototypeOf(t.prototype), "constructor", this).call(this, e), this.targetOrigin = r, this.sourceWindow = n, n.addEventListener("message", this)
- }
- return a(t, e), n(t, [{
- key: "dispose",
- value: function() {
- this.sourceWindow.removeEventListener("message", this), this.target = null, delete m[this.channelId]
- }
- }, {
- key: "handleEvent",
- value: function(e) {
- e.origin === this.targetOrigin && this.dispatch(e)
- }
- }, {
- key: "postMessage",
- value: function(e) {
- this.target ? "undefined" == typeof this.target.postMessage ? f.log.debug("WindowChannel.postMessage: called with non channel object ", this.target) : this.target.postMessage(e, this.targetOrigin) : f.log.debug("WindowChannel.postMessage: cannot called with disposed channel ", this)
- }
- }]), t
- }(b);
- r.WindowChannel = g;
- var y = function(e) {
- function t(e) {
- o(this, t), i(Object.getPrototypeOf(t.prototype), "constructor", this).call(this), e.addEventListener("message", this)
- }
- return a(t, e), n(t, [{
- key: "dispose",
- value: function() {
- this.target.removeEventListener("message", this), this.target = null, delete m[this.channelId]
- }
- }, {
- key: "handleEvent",
- value: function(e) {
- this.dispatch(e)
- }
- }, {
- key: "postMessage",
- value: function(e) {
- this.target.postMessage(e)
- }
- }]), t
- }(b);
- r.WorkerChannel = y;
- var v = function() {
- function e() {
- var t = arguments.length <= 0 || void 0 === arguments[0] ? [] : arguments[0];
- o(this, e), this.channels = t
- }
- return n(e, [{
- key: "add",
- value: function(e) {
- this.channels.push(e)
- }
- }, {
- key: "firstResolved",
- value: function(e, t, r) {
- return u.all(this.channels.map(function(n) {
- return new u(function(o, s) {
- n.request("can_handle", {
- type: e,
- topic: t,
- object: r
- }, function(e) {
- e.result.error ? o(e) : s(n)
- })
- })
- })).then(function(e) {
- return u.reject("no frames can handle this request")
- }, function(e) {
- return e
- })
- }
- }, {
- key: "notifyFirst",
- value: function(e, t) {
- return this.firstResolved(h, e, {
- extra: t
- }).then(function(r) {
- r.notify(e, t)
- })
- }
- }, {
- key: "requestFirst",
- value: function(e, t, r) {
- return this.firstResolved(p, e, {
- parameters: t
- }).then(function(n) {
- n.request(e, t, r)
- })
- }
- }, {
- key: "notifyAll",
- value: function(e, t) {
- this.channels.forEach(function(r) {
- r.notify(e, t)
- })
- }
- }, {
- key: "requestAll",
- value: function(e, t, r) {
- return u.all(this.channels.map(function(r) {
- return new u(function(n, o) {
- r.request(e, t, function(e, t) {
- e ? o(e) : n(t)
- })
- })
- })).then(function(e) {
- return r(null, e)
- }, function(e) {
- return r(e, null)
- })
- }
- }]), e
- }();
- r.Channels = v
- }, {
- "./util.js": 24,
- "babel-runtime/core-js/promise": 37,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/define-property": 43,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-wildcard": 47
- }],
- 2: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"],
- s = e("babel-runtime/core-js/object/keys")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var i = function() {
- function e() {
- o(this, e), this.modalIframeOpen = !1
- }
- return n(e, [{
- key: "createIframe",
- value: function(e, t) {
- var r = e.url;
- t = t || function() {};
- var n = document.createElement("iframe");
- return e.id && (n.name = e.id), t.done = !1, t && (n.onload = function() {
- n.onload = null, t.done || (t.done = !0, t(n))
- }), n.src = r, n
- }
- }, {
- key: "createInvisibleIframe",
- value: function(e, t) {
- var r = this.createIframe(e, t);
- return this.css(r, {
- display: "none",
- width: 0,
- height: 0
- }), document.body.appendChild(r), {
- window: r.contentWindow,
- iframe: r,
- dispose: function() {
- document.body.removeChild(r), r = null
- }
- }
- }
- }, {
- key: "createWindow",
- value: function(e) {
- e.windowFeatures = e.windowFeatures || "";
- var t = window.open(e.url, e.id, e.windowFeatures);
- return {
- window: t,
- dispose: function() {
- t && (t.close(), t = null)
- }
- }
- }
- }, {
- key: "adjust",
- value: function(e, t) {
- t = t || {}, this.css(e, {
- "margin-top": "-" + (e.offsetHeight / 2 + (t.y || 0)) + "px",
- "margin-left": "-" + (e.offsetWidth / 2 + (t.x || 0)) + "px"
- })
- }
- }, {
- key: "css",
- value: function(e, t) {
- var r = " ";
- s(t).forEach(function(e) {
- r += e + ": " + String(t[e]) + ";"
- }), e.style.cssText += r
- }
- }, {
- key: "addClass",
- value: function(e, t) {
- "" === e.className ? e.className = t : e.className += " " + t
- }
- }]), e
- }();
- r["default"] = new i, t.exports = r["default"]
- }, {
- "babel-runtime/core-js/object/keys": 35,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42
- }],
- 3: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/get")["default"],
- o = e("babel-runtime/helpers/inherits")["default"],
- s = e("babel-runtime/helpers/create-class")["default"],
- i = e("babel-runtime/helpers/class-call-check")["default"],
- a = e("babel-runtime/core-js/object/assign")["default"],
- u = e("babel-runtime/core-js/reflect/construct")["default"],
- l = e("babel-runtime/helpers/interop-require-wildcard")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var c = e("./util.js"),
- f = l(c),
- h = "https://accounts.nintendo.com",
- p = function(e) {
- function t(e) {
- if (i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).call(this), this.message = e, Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
- else {
- var r = new Error;
- r.stack && (this.stack = r.stack)
- }
- this.name = this.className
- }
- return o(t, e), s(t, [{
- key: "className",
- get: function() {
- return "ExtendableError"
- }
- }]), t
- }(Error);
- r.ExtendableError = p;
- var d = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "className",
- get: function() {
- return "NintendoInitError"
- }
- }]), t
- }(p);
- r.NintendoInitError = d;
- var m = {
- 300: "Multiple Choices",
- 301: "Moved Parmanently",
- 302: "Found",
- 303: "See Other",
- 304: "Not Modified",
- 307: "Temporary Redirect",
- 308: "Permanent Redirect",
- 400: "Bad Request",
- 401: "Unauthorized",
- 403: "Forbidden",
- 404: "Not Found",
- 405: "Method Not Allowed",
- 406: "Not Acceptable",
- 408: "Request Timeout",
- 409: "Conflict",
- 413: "Payload Too Large",
- 414: "URI Too Long",
- 429: "Too Many Request",
- 500: "Internal Server Error",
- 502: "Bad Gateway",
- 503: "Service Unavailable",
- 504: "Gateway Timeout"
- },
- b = function(e) {
- function t() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0];
- i(this, t);
- var r = e.body || "";
- n(Object.getPrototypeOf(t.prototype), "constructor", this).call(this, r), this.status = e.status || this.defaultStatus, this.headers = e.headers || {}, this.body = r
- }
- return o(t, e), s(t, [{
- key: "className",
- get: function() {
- return "HTTPError"
- }
- }, {
- key: "defaultStatus",
- get: function() {
- return 500
- }
- }]), s(t, [{
- key: "toAPIError",
- value: function() {
- var e = new RegExp("^application/problem\\+json", "i");
- if (e.test(this.headers["Content-Type"] || this.headers["content-type"])) return new w("object" == typeof this.body ? this.body : {
- status: this.status,
- errorCode: "malformed_response",
- title: "Malformed Response",
- detail: this.body
- });
- var t = m[this.status] || "Unknwon Error";
- return new w({
- status: this.status,
- errorCode: f.decamelize(t),
- title: t,
- detail: this.body
- })
- }
- }]), t
- }(p);
- r.HTTPError = b;
- var g = function(e) {
- function t() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? "Request Timeout" : arguments[0];
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).call(this, {
- body: e
- })
- }
- return o(t, e), s(t, [{
- key: "className",
- get: function() {
- return "HTTPTimeoutError"
- }
- }, {
- key: "defaultStatus",
- get: function() {
- return 503
- }
- }]), t
- }(b);
- r.HTTPTimeoutError = g;
- var y = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "className",
- get: function() {
- return "HTTPInternalError"
- }
- }]), t
- }(b);
- r.HTTPInternalError = y;
- var v = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "className",
- get: function() {
- return "HTTPResponseError"
- }
- }]), t
- }(b);
- r.HTTPResponseError = v;
- var j = void 0,
- $ = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "toObject",
- value: function() {
- var e = a({}, this);
- return {
- className: this.className,
- properties: e
- }
- }
- }], [{
- key: "create",
- value: function(e) {
- var t = j[e.className];
- return u(t, [e.properties])
- }
- }]), t
- }(p);
- r.SerializableError = $;
- var w = function(e) {
- function t() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0];
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).call(this, e.title), this.type = e.type || h + "/errors/1.0.0/" + e.status + "/" + e.errorCode, this.status = e.status, this.errorCode = e.errorCode, this.title = e.title, this.detail = e.detail, this.instance = e.instance
- }
- return o(t, e), s(t, [{
- key: "toAPIError",
- value: function() {
- return this
- }
- }, {
- key: "className",
- get: function() {
- return "APIError"
- }
- }], [{
- key: "create",
- value: function(e) {
- return e.toAPIError ? e.toAPIError() : new t({
- status: 500,
- errorCode: e.name.toLowerCase(),
- title: e.name,
- detail: e.message,
- instance: "about:blank"
- })
- }
- }, {
- key: "createFromOAuthResult",
- value: function(e) {
- return new t({
- status: 400,
- errorCode: e.response.error.toLowerCase(),
- title: e.response.error,
- detail: e.response.error_description,
- instance: "about:blank"
- })
- }
- }]), t
- }($);
- r.APIError = w, j = {
- APIError: w
- }
- }, {
- "./util.js": 24,
- "babel-runtime/core-js/object/assign": 30,
- "babel-runtime/core-js/reflect/construct": 38,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-wildcard": 47
- }],
- 4: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/interop-require-default")["default"],
- o = e("./nintendo.js"),
- s = n(o);
- window.ninAcc = s["default"]
- }, {
- "./nintendo.js": 5,
- "babel-runtime/helpers/interop-require-default": 46
- }],
- 5: [function(e, t, r) {
- "use strict";
- function n() {
- var e = "nintendoReady",
- t = void 0;
- "function" == typeof CustomEvent ? t = new CustomEvent(e, {}) : (t = document.createEvent("Event"), t.initEvent(e, !0, !0)), document.dispatchEvent(t)
- }
- var o = e("babel-runtime/helpers/create-class")["default"],
- s = e("babel-runtime/helpers/class-call-check")["default"],
- i = e("babel-runtime/core-js/promise")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"],
- u = e("babel-runtime/helpers/interop-require-wildcard")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var l = e("./nintendo/oauth.js"),
- c = a(l),
- f = e("./nintendo/event.js"),
- h = a(f),
- p = e("./nintendo/api.js"),
- d = a(p),
- m = e("./nintendo/client.js"),
- b = a(m),
- g = e("./nintendo/error.js"),
- y = a(g),
- v = e("url"),
- j = a(v),
- $ = e("./util.js"),
- w = u($),
- k = e("./chrome.js"),
- _ = a(k),
- x = e("./polyfill/deferred.js"),
- A = a(x),
- O = function() {
- function e() {
- s(this, e), this._readyState = new A["default"], this.client = new b["default"], this.oauth = new c["default"](this), this.event = new h["default"](this), this.api = new d["default"](this), this.error = new y["default"](this)
- }
- return o(e, [{
- key: "version",
- get: function() {
- return "2.0.0"
- }
- }, {
- key: "name",
- get: function() {
- return "nintendo-jssdk"
- }
- }]), o(e, [{
- key: "init",
- value: function(e) {
- var t = this;
- return i.resolve().then(function() {
- return w.log.debug("client initialization process start:", e), t.client.init(e), i.all([t.oauth.init(e), t.api.init(e)])
- }).then(function(e) {
- return w.log.debug("successfully finished client initialization process:", e), n(), t._readyState.resolve(t)
- }, function(e) {
- return w.log.error("catch exception on client initialization process:", e), t.ready
- })
- }
- }, {
- key: "_loadFrame",
- value: function(e, t) {
- return new i(function(r, n) {
- e && t ? ! function() {
- var n = j["default"].parse(t);
- _["default"].createInvisibleIframe({
- url: t,
- id: e
- }, function(t) {
- return r({
- name: e,
- origin: n.protocol + "//" + n.host,
- frame: t.contentWindow
- })
- })
- }() : n(e + " is not loaded")
- })
- }
- }, {
- key: "clearStorage",
- value: function() {
- w.log.debug("clear all storage data"), this.api.removeToken(), this.oauth.clearSessionState()
- }
- }, {
- key: "ready",
- get: function() {
- return this._readyState.promise
- }
- }]), e
- }();
- r["default"] = new O, t.exports = r["default"]
- }, {
- "./chrome.js": 2,
- "./nintendo/api.js": 6,
- "./nintendo/client.js": 13,
- "./nintendo/error.js": 14,
- "./nintendo/event.js": 15,
- "./nintendo/oauth.js": 17,
- "./polyfill/deferred.js": 18,
- "./util.js": 24,
- "babel-runtime/core-js/promise": 37,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/interop-require-default": 46,
- "babel-runtime/helpers/interop-require-wildcard": 47,
- url: 142
- }],
- 6: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"],
- s = e("babel-runtime/core-js/promise")["default"],
- i = e("babel-runtime/core-js/object/keys")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"],
- u = e("babel-runtime/helpers/interop-require-wildcard")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var l = e("url"),
- c = a(l),
- f = e("../util.js"),
- h = u(f),
- p = e("../channel.js"),
- d = e("../error.js"),
- m = e("../storage.js"),
- b = u(m),
- g = e("./api/pointWallet.js"),
- y = a(g),
- v = e("./api/missionStatus.js"),
- j = a(v),
- $ = e("./api/user.js"),
- w = a($),
- k = e("./api/userNotification.js"),
- _ = a(k),
- x = e("./api/eshopPrice.js"),
- A = a(x),
- O = {
- path: "/static/jssdk/xdframe.2.0.0.html",
- name: "proxy-frame",
- methods: {
- user: w["default"],
- userNotification: _["default"],
- pointWallet: y["default"],
- missionStatus: j["default"]
- }
- },
- q = {
- path: "/static/jssdk/eshopframe.2.0.0.html",
- name: "eshop-frame",
- methods: {
- eshopPrice: A["default"]
- }
- },
- P = function() {
- function e(t) {
- o(this, e), this.ninAcc = t, this.apiChannels = new p.Channels
- }
- return n(e, [{
- key: "init",
- value: function(e) {
- var t = this,
- r = e.apiOrigin,
- n = e.eshopOrigin,
- o = e.connectOrigin,
- a = "#parent_origin=" + h.origin() + "&connect_origin=" + o,
- u = [this.ninAcc._loadFrame(O.name, r + O.path + a)];
- return n && u.push(this.ninAcc._loadFrame(q.name, n + q.path + a)), s.all(u).then(function(e) {
- e.forEach(function(e) {
- var r = e.origin,
- n = e.name,
- o = e.frame,
- s = void 0;
- switch (n) {
- case O.name:
- s = O.methods;
- break;
- case q.name:
- s = q.methods
- }
- s && (t.apiChannels.add(new p.WindowChannel(o, r, window.self)), i(s).forEach(function(e) {
- t[e] = new s[e](r)
- }), h.log.debug("[ninAcc.api] " + n + " is loaded"))
- })
- })
- }
- }, {
- key: "sendRequest",
- value: function(e) {
- var t = this,
- r = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
- r = r || function() {}, this.sendRequestNoRetry(e)["catch"](function(r) {
- if (r && r instanceof d.APIError && 401 == r.status) return t.refreshToken().then(function() {
- return t.sendRequestNoRetry(e)
- });
- throw r
- }).then(function(e) {
- r(null, e)
- }, function(e) {
- r(e, null)
- })
- }
- }, {
- key: "sendRequestNoRetry",
- value: function(e) {
- var t = this;
- return new s(function(r, n) {
- var o = e.origin + c["default"].format({
- pathname: e.path,
- query: e.query || {}
- }),
- s = {
- method: e.method,
- url: o,
- headers: e.headers,
- body: e.body,
- options: {
- noAuth: e.noAuth || !1,
- storage_suffix: b.sessionState.get(t.ninAcc.client.clientId)
- }
- };
- t.apiChannels.requestFirst("api_request", s, function(e) {
- var t = e.result;
- if (t.error) {
- var s = d.SerializableError.create(t.error);
- s instanceof d.APIError && (s.instance = o), n(s)
- } else r(t.data)
- })["catch"](function(e) {
- return n(new d.APIError({
- status: 400,
- errorCode: "unsupportedRequest",
- title: "unsupported request",
- detail: e
- }))
- })
- })
- }
- }, {
- key: "refreshToken",
- value: function() {
- var e = this,
- t = this._tokenState;
- return this._tokenState || (t = this._tokenState = new s(function(t, r) {
- var n = b.sessionState.get(e.ninAcc.client.clientId);
- e.ninAcc.oauth.retryAuthorization({
- sessionState: n
- }, function(n, o) {
- if (n) {
- var s = d.APIError.createFromOAuthResult(n);
- r(s)
- } else t();
- e._tokenState = null
- })
- })), t
- }
- }, {
- key: "removeToken",
- value: function() {
- var e = b.sessionState.get(this.ninAcc.client.clientId);
- this.apiChannels.notifyAll("remove_token", {
- storage_suffix: e
- })
- }
- }]), e
- }();
- r["default"] = P, t.exports = r["default"]
- }, {
- "../channel.js": 1,
- "../error.js": 3,
- "../storage.js": 19,
- "../util.js": 24,
- "./api/eshopPrice.js": 8,
- "./api/missionStatus.js": 9,
- "./api/pointWallet.js": 10,
- "./api/user.js": 11,
- "./api/userNotification.js": 12,
- "babel-runtime/core-js/object/keys": 35,
- "babel-runtime/core-js/promise": 37,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/interop-require-default": 46,
- "babel-runtime/helpers/interop-require-wildcard": 47,
- url: 142
- }],
- 7: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"],
- s = e("babel-runtime/helpers/to-consumable-array")["default"],
- i = e("babel-runtime/core-js/object/assign")["default"],
- a = e("babel-runtime/core-js/get-iterator")["default"],
- u = e("babel-runtime/core-js/set")["default"],
- l = e("babel-runtime/core-js/object/keys")["default"],
- c = e("babel-runtime/helpers/interop-require-wildcard")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var f = e("uri-template"),
- h = c(f),
- p = e("../../util.js"),
- d = c(p),
- m = e("../../error.js"),
- b = function() {
- function e(t) {
- o(this, e), this.origin = t, this.templates = {}
- }
- return n(e, [{
- key: "create",
- value: function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0],
- t = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
- try {
- e = e || {};
- var r = this.getEndpointFragment("create"),
- n = this.expandUriTemplate(r, e),
- o = e.queryParams,
- s = this.getRestParams(r, e);
- this.request({
- method: "POST",
- path: n,
- query: o,
- body: s
- }, t)
- } catch (i) {
- t(i, null)
- }
- }
- }, {
- key: "get",
- value: function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0],
- t = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1],
- r = arguments.length <= 2 || void 0 === arguments[2] ? !1 : arguments[2];
- try {
- e = e || {};
- var n = this.getEndpointFragment("get"),
- o = this.expandUriTemplate(n, e),
- s = e.queryParams,
- i = this.extractAcceptableHeaders("get", e.headers);
- this.request({
- method: "GET",
- path: o,
- query: s,
- headers: i
- }, t, r)
- } catch (a) {
- t(a, null)
- }
- }
- }, {
- key: "getAll",
- value: function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0],
- t = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1],
- r = arguments.length <= 2 || void 0 === arguments[2] ? !1 : arguments[2];
- try {
- e = e || {};
- var n = this.getEndpointFragment("getAll"),
- o = this.expandUriTemplate(n, e),
- s = e.queryParams,
- i = this.extractAcceptableHeaders("getAll", e.headers);
- this.request({
- method: "GET",
- path: o,
- query: s,
- headers: i
- }, t, r)
- } catch (a) {
- t(a, null)
- }
- }
- }, {
- key: "update",
- value: function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0],
- t = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
- try {
- e = e || {};
- var r = this.getEndpointFragment("update"),
- n = this.expandUriTemplate(r, e),
- o = this.getRestParams(r, e),
- s = e.queryParams;
- this.request({
- method: "PUT",
- path: n,
- query: s,
- body: o
- }, t)
- } catch (i) {
- t(i, null)
- }
- }
- }, {
- key: "patch",
- value: function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0],
- t = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1],
- r = arguments.length <= 2 || void 0 === arguments[2] ? null : arguments[2];
- try {
- e = e || {}, t = t || [];
- var n = this.getEndpointFragment("patch"),
- o = this.expandUriTemplate(n, e),
- s = e.queryParams,
- a = this.extractAcceptableHeaders("getAll", e.headers);
- this.request({
- method: "PATCH",
- path: o,
- query: s,
- body: t,
- headers: i({
- "Content-Type": "application/json-patch+json"
- }, a)
- }, r)
- } catch (u) {
- r(u, null)
- }
- }
- }, {
- key: "delete",
- value: function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0],
- t = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
- try {
- e = e || {};
- var r = this.getEndpointFragment("delete"),
- n = this.expandUriTemplate(r, e),
- o = e.queryParams;
- this.request({
- method: "DELETE",
- path: n,
- query: o
- }, t)
- } catch (s) {
- t(s, null)
- }
- }
- }, {
- key: "getEndpointFragment",
- value: function(e) {
- return this.endpointFragments[e] || this.endpointFragments["default"]
- }
- }, {
- key: "expandUriTemplate",
- value: function(e, t) {
- var r = this.templates[e.template];
- r || (r = this.templates[e.template] = h.parse(e.template));
- var n = (e.parameters || []).filter(function(e) {
- return !(e in t)
- });
- if (n.length > 0) throw new m.APIError({
- status: 400,
- errorCode: "invalid_params",
- title: "Invalid Params",
- detail: "Missing required parameter(s): " + n,
- instance: "about:blank"
- });
- return r.expand(t)
- }
- }, {
- key: "getRestParams",
- value: function(e, t) {
- var r = i({}, t),
- n = !0,
- o = !1,
- s = void 0;
- try {
- for (var u, l = a(e.parameters || []); !(n = (u = l.next()).done); n = !0) {
- var c = u.value;
- delete r[c]
- }
- } catch (f) {
- o = !0, s = f
- } finally {
- try {
- !n && l["return"] && l["return"]()
- } finally {
- if (o) throw s
- }
- }
- var h = !0,
- p = !1,
- d = void 0;
- try {
- for (var m, b = a(e.optionalParameters || []); !(h = (m = b.next()).done); h = !0) {
- var c = m.value;
- delete r[c]
- }
- } catch (f) {
- p = !0, d = f
- } finally {
- try {
- !h && b["return"] && b["return"]()
- } finally {
- if (p) throw d
- }
- }
- return delete r.queryParams, r
- }
- }, {
- key: "getAcceptableHeaderKeySet",
- value: function(e) {
- var t = new u(this.acceptableHeaders["default"] || []);
- return (this.acceptableHeaders[e] || []).forEach(function(e) {
- return t.add(e)
- }), t
- }
- }, {
- key: "extractAcceptableHeaders",
- value: function(e, t) {
- if (!t) return {};
- var r = this.getAcceptableHeaderKeySet(e),
- n = new u,
- o = l(t).reduce(function(e, o) {
- return r.has(o) ? e[o] = t[o] : n.add(o), e
- }, {});
- return n.size > 0 && d.log.warn("ignore headers [ " + [].concat(s(n)) + " ]. the header white list is [ " + [].concat(s(r)) + " ]."), o
- }
- }, {
- key: "request",
- value: function(e, t) {
- var r = arguments.length <= 2 || void 0 === arguments[2] ? !1 : arguments[2],
- n = {
- origin: this.origin,
- method: e.method,
- path: e.path,
- query: e.query,
- headers: i({
- "Content-Type": "application/json"
- }, e.headers || {}),
- body: e.body,
- noAuth: r
- };
- ninAcc.api.sendRequest(n, t)
- }
- }, {
- key: "acceptableHeaders",
- get: function() {
- return {
- "default": []
- }
- }
- }, {
- key: "endpointFragments",
- get: function() {}
- }]), e
- }();
- r["default"] = b, t.exports = r["default"]
- }, {
- "../../error.js": 3,
- "../../util.js": 24,
- "babel-runtime/core-js/get-iterator": 28,
- "babel-runtime/core-js/object/assign": 30,
- "babel-runtime/core-js/object/keys": 35,
- "babel-runtime/core-js/set": 39,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/interop-require-wildcard": 47,
- "babel-runtime/helpers/to-consumable-array": 50,
- "uri-template": 143
- }],
- 8: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/get")["default"],
- o = e("babel-runtime/helpers/inherits")["default"],
- s = e("babel-runtime/helpers/create-class")["default"],
- i = e("babel-runtime/helpers/class-call-check")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var u = e("./base.js"),
- l = a(u),
- c = e("../../error.js"),
- f = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "get",
- value: function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0],
- r = arguments.length <= 1 || void 0 === arguments[1] ? function(e) {
- return e && console.warn(e)
- } : arguments[1];
- e = e || {};
- var o = e.personalized === !0 ? !1 : !0;
- return "undefined" != typeof e.country && "undefined" != typeof e.lang && e.ids instanceof Array ? void n(Object.getPrototypeOf(t.prototype), "get", this).call(this, {
- id: e.id,
- queryParams: {
- country: e.country,
- lang: e.lang,
- ids: e.ids.join(",")
- }
- }, r, o) : void r(new c.APIError({
- status: 400,
- errorCode: "invalid_params",
- title: "Invalid Params",
- detail: "Missing required parameter(s)",
- instance: "about:blank"
- }), null)
- }
- }, {
- key: "endpointFragments",
- get: function() {
- return {
- "default": {
- template: "/v1/price"
- }
- }
- }
- }]), t
- }(l["default"]);
- r["default"] = f, t.exports = r["default"]
- }, {
- "../../error.js": 3,
- "./base.js": 7,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-default": 46
- }],
- 9: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/get")["default"],
- o = e("babel-runtime/helpers/inherits")["default"],
- s = e("babel-runtime/helpers/create-class")["default"],
- i = e("babel-runtime/helpers/class-call-check")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var u = e("./base.js"),
- l = a(u),
- c = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "progress",
- value: function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0],
- t = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
- e = e || {};
- var r = this.getEndpointFragment("progress"),
- n = this.expandUriTemplate(r, e),
- o = e.queryParams,
- s = this.getRestParams(r, e);
- this.request({
- method: "POST",
- path: n,
- query: o,
- body: s
- }, t)
- }
- }, {
- key: "endpointFragments",
- get: function() {
- return {
- "default": {
- template: "/1.0.0/users/{userId}/mission_statuses/{missionId}",
- parameters: ["userId", "missionId"]
- },
- progress: {
- template: "/1.0.0/users/{userId}/mission_statuses/{missionId}/progress",
- parameters: ["userId", "missionId"]
- }
- }
- }
- }]), t
- }(l["default"]);
- r["default"] = c, t.exports = r["default"]
- }, {
- "./base.js": 7,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-default": 46
- }],
- 10: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/get")["default"],
- o = e("babel-runtime/helpers/inherits")["default"],
- s = e("babel-runtime/helpers/create-class")["default"],
- i = e("babel-runtime/helpers/class-call-check")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var u = e("./base.js"),
- l = a(u),
- c = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "endpointFragments",
- get: function() {
- return {
- "default": {
- template: "/1.0.0/users/{userId}/point_wallet",
- parameters: ["userId"]
- }
- }
- }
- }]), t
- }(l["default"]);
- r["default"] = c, t.exports = r["default"]
- }, {
- "./base.js": 7,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-default": 46
- }],
- 11: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/get")["default"],
- o = e("babel-runtime/helpers/inherits")["default"],
- s = e("babel-runtime/helpers/create-class")["default"],
- i = e("babel-runtime/helpers/class-call-check")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var u = e("./base.js"),
- l = a(u),
- c = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "endpointFragments",
- get: function() {
- return {
- "default": {
- template: "/2.0.0/users{/id}",
- parameters: ["id"]
- }
- }
- }
- }]), t
- }(l["default"]);
- r["default"] = c, t.exports = r["default"]
- }, {
- "./base.js": 7,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-default": 46
- }],
- 12: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/get")["default"],
- o = e("babel-runtime/helpers/inherits")["default"],
- s = e("babel-runtime/helpers/create-class")["default"],
- i = e("babel-runtime/helpers/class-call-check")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var u = e("./base.js"),
- l = a(u),
- c = (e("../../error.js"), function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "endpointFragments",
- get: function() {
- return {
- getAll: {
- template: "/1.0.0/users{/userId}/notifications",
- parameters: ["userId"]
- },
- "default": {
- template: "/1.0.0/users{/userId}/notifications{/notificationId}",
- parameters: ["userId", "notificationId"]
- }
- }
- }
- }, {
- key: "acceptableHeaders",
- get: function() {
- return {
- "default": ["If-Match", "If-None-Match"]
- }
- }
- }]), t
- }(l["default"]));
- r["default"] = c, t.exports = r["default"]
- }, {
- "../../error.js": 3,
- "./base.js": 7,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-default": 46
- }],
- 13: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"],
- s = e("babel-runtime/helpers/interop-require-wildcard")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var i = e("../util.js"),
- a = s(i),
- u = function() {
- function e(t) {
- o(this, e), this.ninAcc = t
- }
- return n(e, [{
- key: "init",
- value: function(e) {
- var t = e.connectOrigin,
- r = e.apiOrigin,
- n = e.eshopOrigin,
- o = e.clientId,
- s = e.clientOrigin,
- i = e.scope,
- u = e.responseType,
- l = e.webMessageTarget,
- c = e.webMessageUri;
- return "undefined" == typeof t || "string" != typeof t ? void a.log.error("connectOrigin should be string") : "undefined" == typeof r || "string" != typeof r ? void a.log.error("apiOrigin should be string") : "undefined" == typeof o || "string" != typeof o ? void a.log.error("clientId should be string") : "undefined" == typeof s || "string" != typeof s ? void a.log.error("clientOrigin should be string") : n && "string" != typeof n ? void a.log.error("eshopOrigin should be string") : i && !i instanceof Array ? void a.log.error("scope should be Array.<string>") : u && !u instanceof Array ? void a.log.error("responseType should be Array.<string>") : c && "string" != typeof c ? void a.log.errro("webMessageUri should be string") : l && "string" != typeof l ? void a.log.error("webMessageTarget should be string") : (this.clientId = o, this.clientOrigin = s, this.connectOrigin = t, this.apiOrigin = r, this.eshopOrigin = n, this.scope = i || ["openid"], this.responseType = u || ["code", "token", "id_token"], this.webMessageTarget = l || "op-frame", this.webMessageUri = c || "http://localhost:8080/cb", this)
- }
- }]), e
- }();
- r["default"] = u, t.exports = r["default"]
- }, {
- "../util.js": 24,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/interop-require-wildcard": 47
- }],
- 14: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/class-call-check")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var o = e("../error.js"),
- s = function i(e) {
- n(this, i), this.APIError = o.APIError
- };
- r["default"] = s, t.exports = r["default"]
- }, {
- "../error.js": 3,
- "babel-runtime/helpers/class-call-check": 41
- }],
- 15: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"],
- s = e("babel-runtime/helpers/sliced-to-array")["default"],
- i = e("babel-runtime/helpers/interop-require-wildcard")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var u = e("../util.js"),
- l = i(u),
- c = e("./event/oauth.js"),
- f = a(c),
- h = function() {
- function e(t) {
- o(this, e), this.ninAcc = t, this.sessionStateChangeCallbacks = {}, this.registeredEvents = {
- "oauth.sessionStateChange": new f["default"](t)
- }, this.listeners = {}
- }
- return n(e, [{
- key: "subscribe",
- value: function(e, t, r) {
- if (!this.registeredEvents[e]) return l.log.crit("topic " + e + " is not registered"), null;
- if (!t) return l.log.crit("params must be object"), null;
- this.listeners[e] = this.listeners[e] || [];
- var n = e + ":" + l.generateId(),
- o = {
- id: n,
- topic: e,
- params: t,
- callback: r,
- data: {}
- };
- return this.listeners[e].push(o), this.registeredEvents[e].start(o), n
- }
- }, {
- key: "unsubscribe",
- value: function(e) {
- var t = e.split(/:/, 2),
- r = s(t, 1),
- n = r[0],
- o = this.getListener(e);
- return o ? (this.registeredEvents[n].stop(o),
- this.listeners[n] = this.listeners[n].filter(function(t) {
- return t.id !== e
- }), !0) : !1
- }
- }, {
- key: "getListener",
- value: function(e) {
- var t = e.split(/:/, 2),
- r = s(t, 1),
- n = r[0];
- return (this.listeners[n] || []).filter(function(t) {
- return t.id === e
- })[0]
- }
- }, {
- key: "emit",
- value: function(e, t) {
- var r = arguments.length <= 2 || void 0 === arguments[2] ? null : arguments[2];
- (this.listeners[e] || []).forEach(function(e) {
- return e.callback.call(null, r, t)
- })
- }
- }, {
- key: "emitError",
- value: function(e, t) {
- this.emit(e, null, t)
- }
- }]), e
- }();
- r["default"] = h, t.exports = r["default"]
- }, {
- "../util.js": 24,
- "./event/oauth.js": 16,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/interop-require-default": 46,
- "babel-runtime/helpers/interop-require-wildcard": 47,
- "babel-runtime/helpers/sliced-to-array": 49
- }],
- 16: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var s = function() {
- function e(t) {
- o(this, e), this.ninAcc = t
- }
- return n(e, [{
- key: "start",
- value: function(e) {
- var t = this;
- e.data.timerId = setInterval(function() {
- t.ninAcc.oauth.checkSessionState(e.params.sessionState).then(function(r) {
- "changed" == r.status && (t.ninAcc.event.emit(e.topic, r), t.ninAcc.event.unsubscribe(e.id))
- })
- }, 1e3)
- }
- }, {
- key: "stop",
- value: function(e) {
- clearInterval(e.data.timerId)
- }
- }]), e
- }();
- r["default"] = s, t.exports = r["default"]
- }, {
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42
- }],
- 17: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"],
- s = e("babel-runtime/core-js/promise")["default"],
- i = e("babel-runtime/helpers/interop-require-wildcard")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var u = e("../util.js"),
- l = i(u),
- c = e("../storage.js"),
- f = i(c),
- h = e("../chrome.js"),
- p = a(h),
- d = e("../channel.js"),
- m = e("url"),
- b = a(m),
- g = {
- opframe: "/static/jssdk/opframe.2.0.0.html",
- authorize: "/connect/1.0.0/authorize",
- disconnect: "/connect/1.0.0/disconnect",
- endSession: "/connect/1.0.0/end_session"
- },
- y = "op-frame",
- v = "op-immediate-login-frame",
- j = {
- unauthenticatedWindow: "nintendo_account:unauthenticated_window",
- logoutWindow: "nintendo_account:logout_window"
- },
- $ = l.invertKeyValues(j),
- w = function() {
- function e(t) {
- o(this, e), this.ninAcc = t, this.authzListeners = {}
- }
- return n(e, [{
- key: "init",
- value: function(e) {
- var t = this,
- r = e.connectOrigin,
- n = e.apiOrigin,
- o = e.eshopOrigin;
- return $[window.name] && (window.name = ""), s.all([this.ninAcc._loadFrame(v, "about:blank"), this.ninAcc._loadFrame(y, r + b["default"].format({
- pathname: g.opframe,
- hash: l.encodeQuery({
- parent_origin: l.origin(),
- api_origin: n,
- eshop_origin: o
- })
- }))]).then(function(e) {
- return e.forEach(function(e) {
- var n = e.name,
- o = e.frame;
- switch (n) {
- case v:
- t.immediateLoginFrame = o.frameElement, t.immediateLoginChannel = new d.WindowChannel(o, r, window.self);
- break;
- case y:
- t.opFrameChannel = new d.WindowChannel(o, r, window.self)
- }
- l.log.debug("[ninAcc.oauth] " + n + " is loaded")
- }), s.resolve(e)
- }).then(function() {
- window.addEventListener("message", function(e) {
- e.data && "relay_request" === e.data.type && (l.log.debug("main frame receive 'relay_request'"), e.source.postMessage({
- type: "relay_response"
- }, r))
- }), t.opFrameChannel.addNotifyListener("proxy_authorization_response", function(e) {
- l.log.debug("main frame receive 'proxy_authorization_response'", e);
- var r = e.extra,
- n = t.authzListeners[r.state];
- n || l.log.warn("unregistered authorization process", r), n(r)
- })
- })
- }
- }, {
- key: "authorizationRequest",
- value: function(e, t) {
- var r = this;
- return new s(function(t) {
- r.authzListeners[e.state] = function(n) {
- delete r.authzListeners[e.state], t(r.processAuthorization(e, n))
- }
- })
- }
- }, {
- key: "processAuthorization",
- value: function(e, t) {
- var r = !1,
- n = !1,
- o = {};
- if (e.state !== t.state) l.log.warn("state is changed", e.state, t.state), o = {
- error: "invalid_state",
- error_description: "respond 'state' paramter does not match request"
- };
- else if (t.error) {
- switch (t.error) {
- case "consent_required":
- r = !0;
- break;
- case "access_denied":
- r = !0
- }
- o = {
- error: t.error,
- error_description: t.error_description
- }
- } else r = !0, n = !0, t.session_state !== e.sessionState && l.log.debug("session_state is changed"), f.authorizeRequest.set(e.clientId, t.session_state, e), f.sessionState.set(e.clientId, t.session_state), t.id_token && (o.idToken = t.id_token), t.code && (o.code = t.code), t.token_type && (o.tokenType = t.token_type), t.expires_in && (o.expiresIn = t.expires_in), t.scope && (o.scope = t.scope.split(" ").sort());
- return t.state && (o.state = t.state), t.session_state && (o.sessionState = t.session_state), {
- login: r,
- connected: n,
- response: o
- }
- }
- }, {
- key: "getConnectedStatus",
- value: function(e) {
- var t = this,
- r = arguments.length <= 1 || void 0 === arguments[1] ? function() {} : arguments[1];
- l.log.debug("[ninAcc.oauth.getConnectedStatus] start");
- var n = this.createRequest({
- responseType: e.responseType || this.ninAcc.client.responseType,
- scope: e.scope,
- state: e.state,
- prompt: "none",
- display: "touch"
- });
- l.log.debug("[ninAcc.oauth.getConnectedStatus] send request", n), window.setTimeout(function() {
- t.immediateLoginFrame.src = n.uri
- }, 1), this.authorizationRequest(n, this.immediateLoginChannel.targetWindow).then(function(e) {
- l.log.debug("[ninAcc.oauth.getConnectedStatus] done", e), e.response.error ? r(e) : r(null, e)
- }, function(e) {
- l.log.error("[ninAcc.oauth.getConnectedStatus] error", e)
- })
- }
- }, {
- key: "connect",
- value: function(e) {
- var t = arguments.length <= 1 || void 0 === arguments[1] ? function() {} : arguments[1];
- l.log.debug("[ninAcc.oauth.connect] start");
- var r = this.createRequest({
- responseType: e.responseType || this.ninAcc.client.responseType,
- scope: e.scope,
- state: e.state,
- prompt: "consent",
- display: "touch"
- });
- l.log.debug("[ninAcc.oauth.connect] send request", r);
- var n = p["default"].createWindow({
- url: r.uri,
- id: j.unauthenticatedWindow
- });
- this.authorizationRequest(r, n.window).then(function(e) {
- l.log.debug("[ninAcc.oauth.connect] done", e), e.response.error ? t(e) : t(null, e)
- }, function(e) {
- l.log.error("[ninAcc.oauth.connect] error", e)
- }).then(function() {
- n.dispose()
- })
- }
- }, {
- key: "retryAuthorization",
- value: function(e, t) {
- var r = e.sessionState;
- l.log.debug("[ninAcc.oauth.retryAuthorization] start");
- var n = f.authorizeRequest.get(this.ninAcc.client.clientId, r);
- n ? (l.log.debug("[ninAcc.oauth.retryAuthorization] reauthorize with last request params", n), this.getConnectedStatus({
- responseType: n.responseType,
- scope: n.scope
- }, t)) : (l.log.info("retry authorization failed because last login history does not exist"), t({
- response: {
- error: "unauthorized",
- error_description: "unauthorized"
- }
- }))
- }
- }, {
- key: "disconnect",
- value: function() {
- l.log.debug("[ninAcc.oauth.disconnect] start")
- }
- }, {
- key: "logout",
- value: function() {
- var e = this,
- t = arguments.length <= 0 || void 0 === arguments[0] ? function() {} : arguments[0];
- l.log.debug("[ninAcc.oauth.logout] start");
- var r = this.ninAcc.client;
- return new s(function(t) {
- var n = p["default"].createWindow({
- url: "" + r.connectOrigin + g.endSession + "?" + l.encodeQuery({
- sdk_version: e.ninAcc.version,
- client_id: r.clientId,
- post_logout_redirect_uri: r.clientOrigin,
- response_mode: "web_message"
- }),
- id: j.logoutWindow
- });
- e.logoutChannel && e.logoutChannel.dispose();
- var o = e.logoutChannel = new d.WindowChannel(n.window, r.connectOrigin, window.self);
- o.addNotifyListener("logout_response", function(e) {
- l.log.debug("main frame receive 'logout_response' notification", e), n.dispose(), o.dispose(), t(e.extra)
- })
- }).then(function(r) {
- r.error ? t(r) : (e.ninAcc.clearStorage(), t(null, r))
- })
- }
- }, {
- key: "checkSessionState",
- value: function(e) {
- var t = this;
- return new s(function(r) {
- t.opFrameChannel.request("session_state_change_request", {
- clientId: t.ninAcc.client.clientId,
- sessionState: e
- }, function(e) {
- var n = e.result;
- "changed" === n.status && t.ninAcc.clearStorage(), r(n)
- })
- })
- }
- }, {
- key: "clearSessionState",
- value: function() {
- f.sessionState.clear(this.ninAcc.client.clientId), f.authorizeRequest.clear(this.ninAcc.client.clientId)
- }
- }, {
- key: "createRequest",
- value: function(e) {
- var t = {
- clientId: e.clientId || this.ninAcc.client.clientId,
- state: e.state || l.generateId(),
- responseType: e.responseType || ["code", "token", "id_token"],
- scope: e.scope || ["openid", "user"],
- redirectUri: this.ninAcc.client.clientOrigin,
- webMessageUri: this.opFrameChannel.targetOrigin,
- webMessageTarget: y,
- responseMode: "web_message",
- prompt: e.prompt,
- display: e.display
- };
- return t.uri = this.opFrameChannel.targetOrigin + g.authorize + "?" + l.encodeQuery({
- client_id: t.clientId,
- state: t.state,
- response_type: t.responseType.sort().join(" "),
- scope: t.scope.sort().join(" "),
- redirect_uri: t.redirectUri,
- web_message_uri: t.webMessageUri,
- web_message_target: t.webMessageTarget,
- response_mode: t.responseMode,
- prompt: t.prompt,
- display: t.display
- }), t
- }
- }]), e
- }();
- r["default"] = w, t.exports = r["default"]
- }, {
- "../channel.js": 1,
- "../chrome.js": 2,
- "../storage.js": 19,
- "../util.js": 24,
- "babel-runtime/core-js/promise": 37,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/interop-require-default": 46,
- "babel-runtime/helpers/interop-require-wildcard": 47,
- url: 142
- }],
- 18: [function(e, t, r) {
- "use strict";
- function n() {
- if ("undefined" != typeof o && o.defer) return o.defer();
- if ("undefined" != typeof PromiseUtils && PromiseUtils.defer) return PromiseUtils.defer();
- try {
- this.resolve = null, this.reject = null, this.promise = new o(function(e, t) {
- this.resolve = e, this.reject = t
- }.bind(this)), s(this)
- } catch (e) {
- throw new Error("Promise/Deferred is not available")
- }
- }
- var o = e("babel-runtime/core-js/promise")["default"],
- s = e("babel-runtime/core-js/object/freeze")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- }), r["default"] = n, t.exports = r["default"]
- }, {
- "babel-runtime/core-js/object/freeze": 33,
- "babel-runtime/core-js/promise": 37
- }],
- 19: [function(e, t, r) {
- (function(t) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"],
- s = e("babel-runtime/helpers/interop-require-default")["default"],
- i = e("babel-runtime/helpers/interop-require-wildcard")["default"],
- a = e("babel-runtime/helpers/interop-require")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var u = e("babel-runtime/core-js/string/starts-with"),
- l = s(u),
- c = e("./util.js"),
- f = i(c),
- h = function() {
- function e() {
- o(this, e), this.store = t.localStorage
- }
- return n(e, [{
- key: "namespace",
- get: function() {
- throw Error("this is abstract method")
- }
- }]), n(e, [{
- key: "prefix",
- value: function() {
- return this.namespace ? this.namespace + ":" : ""
- }
- }, {
- key: "setItem",
- value: function(e, t, r) {
- var n = this.prefix() + e,
- o = {
- value: t
- };
- if (r) {
- var s = f.unixtime() + r;
- o.expire = s
- }
- try {
- this.store.setItem(n, JSON.stringify(o))
- } catch (i) {
- f.log.debug("Storage: setItem error = ", i)
- }
- }
- }, {
- key: "getItem",
- value: function(e) {
- var t = this.prefix() + e,
- r = void 0,
- n = this.store.getItem(t);
- if (null === n) return null;
- try {
- r = JSON.parse(n)
- } catch (o) {
- return f.log.debug("nintendo.storage: JSON parse error: jsonItem = ", n), null
- }
- return r && (!r.expire || r.expire > f.unixtime()) ? r.value : (f.log.debug("nintendo.storage: getItem not found with k =", t), null)
- }
- }, {
- key: "removeItem",
- value: function(e) {
- var t = this.prefix() + e;
- this.store.removeItem(t)
- }
- }, {
- key: "keys",
- value: function() {
- for (var e = [], t = this.prefix(), r = 0; r < this.store.length; r++) {
- var n = this.store.key(r);
- l["default"](n, t) && e.push(n.substring(t.length))
- }
- return e
- }
- }]), e
- }();
- r["default"] = h;
- var p = e("./storage/authorizeRequest.js");
- r.authorizeRequest = a(p);
- var d = e("./storage/sessionState.js");
- r.sessionState = a(d);
- var m = e("./storage/status.js");
- r.status = a(m);
- var b = e("./storage/token.js");
- r.token = a(b)
- }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
- }, {
- "./storage/authorizeRequest.js": 20,
- "./storage/sessionState.js": 21,
- "./storage/status.js": 22,
- "./storage/token.js": 23,
- "./util.js": 24,
- "babel-runtime/core-js/string/starts-with": 40,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/interop-require": 48,
- "babel-runtime/helpers/interop-require-default": 46,
- "babel-runtime/helpers/interop-require-wildcard": 47
- }],
- 20: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/get")["default"],
- o = e("babel-runtime/helpers/inherits")["default"],
- s = e("babel-runtime/helpers/create-class")["default"],
- i = e("babel-runtime/helpers/class-call-check")["default"],
- a = e("babel-runtime/core-js/get-iterator")["default"],
- u = e("babel-runtime/helpers/interop-require-default")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var l = e("../storage.js"),
- c = u(l),
- f = e("babel-runtime/core-js/string/starts-with"),
- h = u(f),
- p = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "key",
- value: function(e, t) {
- return "authorize_params:" + e + ":" + t
- }
- }, {
- key: "get",
- value: function(e, t) {
- return this.getItem(this.key(e, t))
- }
- }, {
- key: "set",
- value: function(e, t, r) {
- this.setItem(this.key(e, t), r)
- }
- }, {
- key: "clear",
- value: function(e) {
- var t = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
- if (t) this.removeItem(this.key(e, t));
- else {
- var r = this.keys(),
- n = this.key(e, ""),
- o = !0,
- s = !1,
- i = void 0;
- try {
- for (var u, l = a(r); !(o = (u = l.next()).done); o = !0) {
- var c = u.value;
- h["default"](c, n) && this.removeItem(c)
- }
- } catch (f) {
- s = !0, i = f
- } finally {
- try {
- !o && l["return"] && l["return"]()
- } finally {
- if (s) throw i
- }
- }
- }
- }
- }, {
- key: "namespace",
- get: function() {
- return "npf"
- }
- }]), t
- }(c["default"]);
- r["default"] = new p, t.exports = r["default"]
- }, {
- "../storage.js": 19,
- "babel-runtime/core-js/get-iterator": 28,
- "babel-runtime/core-js/string/starts-with": 40,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-default": 46
- }],
- 21: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/get")["default"],
- o = e("babel-runtime/helpers/inherits")["default"],
- s = e("babel-runtime/helpers/create-class")["default"],
- i = e("babel-runtime/helpers/class-call-check")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var u = e("../storage.js"),
- l = a(u),
- c = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "key",
- value: function(e) {
- return "session_state:" + e
- }
- }, {
- key: "get",
- value: function(e) {
- return this.getItem(this.key(e))
- }
- }, {
- key: "set",
- value: function(e, t) {
- this.setItem(this.key(e), t)
- }
- }, {
- key: "clear",
- value: function(e) {
- this.removeItem(this.key(e))
- }
- }, {
- key: "namespace",
- get: function() {
- return "npf"
- }
- }]), t
- }(l["default"]);
- r["default"] = new c, t.exports = r["default"]
- }, {
- "../storage.js": 19,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-default": 46
- }],
- 22: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/get")["default"],
- o = e("babel-runtime/helpers/inherits")["default"],
- s = e("babel-runtime/helpers/create-class")["default"],
- i = e("babel-runtime/helpers/class-call-check")["default"],
- a = e("babel-runtime/helpers/interop-require-default")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var u = e("../storage.js"),
- l = a(u),
- c = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "key",
- value: function(e) {
- return "status:" + e
- }
- }, {
- key: "set",
- value: function(e, t) {
- var r = t.accessToken,
- n = t.expiresIn,
- o = t.scope;
- this.setItem(this.key(e), {
- access_token: r,
- expires_in: n,
- scope: o
- })
- }
- }, {
- key: "get",
- value: function(e) {
- return this.getItem(this.key(e))
- }
- }, {
- key: "clear",
- value: function(e) {
- this.removeItem(this.key(e))
- }
- }, {
- key: "namespace",
- get: function() {
- return "opframe"
- }
- }, {
- key: "expire",
- get: function() {
- return 900
- }
- }]), t
- }(l["default"]);
- r["default"] = new c, t.exports = r["default"]
- }, {
- "../storage.js": 19,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-default": 46
- }],
- 23: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/get")["default"],
- o = e("babel-runtime/helpers/inherits")["default"],
- s = e("babel-runtime/helpers/create-class")["default"],
- i = e("babel-runtime/helpers/class-call-check")["default"],
- a = e("babel-runtime/core-js/object/keys")["default"],
- u = e("babel-runtime/helpers/interop-require-default")["default"],
- l = e("babel-runtime/helpers/interop-require-wildcard")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var c = e("../storage.js"),
- f = u(c),
- h = e("../util.js"),
- p = l(h),
- d = function(e) {
- function t() {
- i(this, t), n(Object.getPrototypeOf(t.prototype), "constructor", this).apply(this, arguments)
- }
- return o(t, e), s(t, [{
- key: "key",
- value: function(e) {
- var t = e.sessionState,
- r = e.clientOrigin;
- return "tokenData:" + r + ":" + t
- }
- }, {
- key: "setTokens",
- value: function(e) {
- var t = parseInt(e.expires_in),
- r = {};
- e.scope && e.scope.forEach(function(e) {
- r[e] = !0
- });
- var n = {
- access_token: e.access_token,
- scopes: r
- };
- p.log.debug("stored tokens to storage:", n), this.setItem(this.key(e.storage_suffix), n, t)
- }
- }, {
- key: "getTokens",
- value: function(e) {
- var t = this.getItem(this.key(e.storage_suffix));
- return t ? (p.log.debug("token not expired: tokenData = ", t), e.scope && e.scope.some(function(e) {
- return !t.scopes[e]
- }) ? (p.log.debug("claimed scopes are not fully authorized before: claimed =", e.scope, "authorized =", a(t.scopes)), null) : t) : (p.log.debug("token not found or expired: tokenData = ", t), null)
- }
- }, {
- key: "removeTokens",
- value: function(e) {
- this.removeItem(this.key(e.storage_suffix))
- }
- }, {
- key: "namespace",
- get: function() {
- return "xdframe"
- }
- }]), t
- }(f["default"]);
- r["default"] = new d, t.exports = r["default"]
- }, {
- "../storage.js": 19,
- "../util.js": 24,
- "babel-runtime/core-js/object/keys": 35,
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42,
- "babel-runtime/helpers/get": 44,
- "babel-runtime/helpers/inherits": 45,
- "babel-runtime/helpers/interop-require-default": 46,
- "babel-runtime/helpers/interop-require-wildcard": 47
- }],
- 24: [function(e, t, r) {
- "use strict";
- function n() {
- return Date.now() / 1e3 | 0
- }
- function o() {
- return Math.floor(n())
- }
- function s(e) {
- return a(document.cookie, "; ")[e]
- }
- function i() {
- return Array.apply(null, Array(32)).map(function() {
- return Math.floor(16 * Math.random()).toString(16)
- }).join("")
- }
- function a(e) {
- var t = arguments.length <= 1 || void 0 === arguments[1] ? "&" : arguments[1];
- return e.split(t).map(function(e) {
- return e.split("=", 2)
- }).reduce(function(e, t) {
- return t[0].length > 0 && (e[decodeURIComponent(t[0])] = decodeURIComponent(t[1])), e
- }, {})
- }
- function u(e) {
- var t = arguments.length <= 1 || void 0 === arguments[1] ? "&" : arguments[1];
- return v(e).map(function(t) {
- return encodeURIComponent(t) + "=" + encodeURIComponent(e[t] || "")
- }).join(t)
- }
- function l() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? "" : arguments[0];
- return c(e).replace(/[A-Z]/g, function(e) {
- return "_" + e.toLowerCase()
- })
- }
- function c(e) {
- return f(e).replace(/^./, function(e) {
- return e.toLowerCase()
- })
- }
- function f() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? "" : arguments[0];
- return e.split(/[-_\s]+/).map(function(e) {
- return e.slice(0, 1).toUpperCase() + e.slice(1)
- }).join("")
- }
- function h(e) {
- return e.split("\n").map(function(e) {
- return (e || "").trim().split(":", 2)
- }).reduce(function(e, t) {
- return t[0].length > 0 && (e[t[0]] = (t[1] || "").trim()), e
- }, {})
- }
- function p(e) {
- return new j(function(t) {
- return window.setTimeout(t, e)
- })
- }
- function d(e) {
- return p(e).then(function() {
- return j.reject()
- })
- }
- function m(e) {
- var t = document.createElement("a");
- return t.href = e, t.origin || t.protocol + "//" + t.hostname
- }
- function b() {
- var e = navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);
- return e ? parseInt(e[1]) : void 0
- }
- function g() {
- return window.location.origin || window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "")
- }
- function y(e) {
- var t = {};
- for (var r in e) e.hasOwnProperty(r) && (t[e[r]] = r);
- return t
- }
- var v = e("babel-runtime/core-js/object/keys")["default"],
- j = e("babel-runtime/core-js/promise")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- }), r.unixtime = n, r.unixtimeStamp = o, r.getCookie = s, r.generateId = i, r.decodeQuery = a, r.encodeQuery = u, r.decamelize = l, r.camelize = c, r.pascalize = f, r.parseHeaderText = h, r.delayPromise = p, r.timeoutPromise = d, r.parseOrigin = m, r.getIEVersion = b, r.origin = g, r.invertKeyValues = y;
- var $ = e("./util/log.js");
- Object.defineProperty(r, "log", {
- enumerable: !0,
- get: function() {
- return $.log
- }
- });
- var w = e("./util/sequence.js");
- Object.defineProperty(r, "sequence", {
- enumerable: !0,
- get: function() {
- return w.sequence
- }
- })
- }, {
- "./util/log.js": 25,
- "./util/sequence.js": 26,
- "babel-runtime/core-js/object/keys": 35,
- "babel-runtime/core-js/promise": 37
- }],
- 25: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var s = 1,
- i = 2,
- a = 3,
- u = 4,
- l = {
- debug: s,
- info: i,
- warn: a,
- crit: u
- },
- c = function() {},
- f = function() {
- function e(t) {
- o(this, e), t || (t = "debug"), this.setLogLevel(t)
- }
- return n(e, [{
- key: "setLogLevel",
- value: function(e) {
- this.logLevel = l[e], this.debug = this.logLevel <= s ? Function.prototype.bind.call(console.log, console) : c, this.info = this.logLevel <= i ? Function.prototype.bind.call(console.log, console) : c, this.warn = this.logLevel <= a ? Function.prototype.bind.call(console.warn, console) : c, this.crit = this.logLevel <= u ? Function.prototype.bind.call(console.error, console) : c, this.error = Function.prototype.bind.call(console.error, console)
- }
- }]), e
- }(),
- h = new f("warn");
- r.log = h
- }, {
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42
- }],
- 26: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/helpers/create-class")["default"],
- o = e("babel-runtime/helpers/class-call-check")["default"];
- Object.defineProperty(r, "__esModule", {
- value: !0
- });
- var s = Math.pow(2, 53),
- i = function() {
- function e() {
- o(this, e), this.sequences = {}
- }
- return n(e, [{
- key: "next",
- value: function(e) {
- return this.sequences[e] || (this.sequences[e] = 0), ++this.sequences[e] === s && (this.sequences[e] = 1), this.sequences[e]
- }
- }, {
- key: "reset",
- value: function(e) {
- this.sequences[e] = 0
- }
- }]), e
- }(),
- a = new i;
- r.sequence = a
- }, {
- "babel-runtime/helpers/class-call-check": 41,
- "babel-runtime/helpers/create-class": 42
- }],
- 27: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/array/from"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/array/from": 51
- }],
- 28: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/get-iterator"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/get-iterator": 52
- }],
- 29: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/is-iterable"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/is-iterable": 53
- }],
- 30: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/object/assign"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/object/assign": 54
- }],
- 31: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/object/create"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/object/create": 55
- }],
- 32: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/object/define-property"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/object/define-property": 56
- }],
- 33: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/object/freeze"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/object/freeze": 57
- }],
- 34: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/object/get-own-property-descriptor"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/object/get-own-property-descriptor": 58
- }],
- 35: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/object/keys"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/object/keys": 59
- }],
- 36: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/object/set-prototype-of"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/object/set-prototype-of": 60
- }],
- 37: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/promise"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/promise": 61
- }],
- 38: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/reflect/construct"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/reflect/construct": 62
- }],
- 39: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/set"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/set": 63
- }],
- 40: [function(e, t, r) {
- t.exports = {
- "default": e("core-js/library/fn/string/starts-with"),
- __esModule: !0
- }
- }, {
- "core-js/library/fn/string/starts-with": 64
- }],
- 41: [function(e, t, r) {
- "use strict";
- r["default"] = function(e, t) {
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
- }, r.__esModule = !0
- }, {}],
- 42: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/core-js/object/define-property")["default"];
- r["default"] = function() {
- function e(e, t) {
- for (var r = 0; r < t.length; r++) {
- var o = t[r];
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), n(e, o.key, o)
- }
- }
- return function(t, r, n) {
- return r && e(t.prototype, r), n && e(t, n), t
- }
- }(), r.__esModule = !0
- }, {
- "babel-runtime/core-js/object/define-property": 32
- }],
- 43: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/core-js/object/define-property")["default"];
- r["default"] = function(e, t, r) {
- return t in e ? n(e, t, {
- value: r,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = r, e
- }, r.__esModule = !0
- }, {
- "babel-runtime/core-js/object/define-property": 32
- }],
- 44: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/core-js/object/get-own-property-descriptor")["default"];
- r["default"] = function(e, t, r) {
- for (var o = !0; o;) {
- var s = e,
- i = t,
- a = r;
- u = c = l = void 0, o = !1, null === s && (s = Function.prototype);
- var u = n(s, i);
- if (void 0 !== u) {
- if ("value" in u) return u.value;
- var l = u.get;
- return void 0 === l ? void 0 : l.call(a)
- }
- var c = Object.getPrototypeOf(s);
- if (null === c) return void 0;
- e = c, t = i, r = a, o = !0
- }
- }, r.__esModule = !0
- }, {
- "babel-runtime/core-js/object/get-own-property-descriptor": 34
- }],
- 45: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/core-js/object/create")["default"],
- o = e("babel-runtime/core-js/object/set-prototype-of")["default"];
- r["default"] = function(e, t) {
- if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
- e.prototype = n(t && t.prototype, {
- constructor: {
- value: e,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), t && (o ? o(e, t) : e.__proto__ = t)
- }, r.__esModule = !0
- }, {
- "babel-runtime/core-js/object/create": 31,
- "babel-runtime/core-js/object/set-prototype-of": 36
- }],
- 46: [function(e, t, r) {
- "use strict";
- r["default"] = function(e) {
- return e && e.__esModule ? e : {
- "default": e
- }
- }, r.__esModule = !0
- }, {}],
- 47: [function(e, t, r) {
- "use strict";
- r["default"] = function(e) {
- if (e && e.__esModule) return e;
- var t = {};
- if (null != e)
- for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
- return t["default"] = e, t
- }, r.__esModule = !0
- }, {}],
- 48: [function(e, t, r) {
- "use strict";
- r["default"] = function(e) {
- return e && e.__esModule ? e["default"] : e
- }, r.__esModule = !0
- }, {}],
- 49: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/core-js/get-iterator")["default"],
- o = e("babel-runtime/core-js/is-iterable")["default"];
- r["default"] = function() {
- function e(e, t) {
- var r = [],
- o = !0,
- s = !1,
- i = void 0;
- try {
- for (var a, u = n(e); !(o = (a = u.next()).done) && (r.push(a.value), !t || r.length !== t); o = !0);
- } catch (l) {
- s = !0, i = l
- } finally {
- try {
- !o && u["return"] && u["return"]()
- } finally {
- if (s) throw i
- }
- }
- return r
- }
- return function(t, r) {
- if (Array.isArray(t)) return t;
- if (o(Object(t))) return e(t, r);
- throw new TypeError("Invalid attempt to destructure non-iterable instance")
- }
- }(), r.__esModule = !0
- }, {
- "babel-runtime/core-js/get-iterator": 28,
- "babel-runtime/core-js/is-iterable": 29
- }],
- 50: [function(e, t, r) {
- "use strict";
- var n = e("babel-runtime/core-js/array/from")["default"];
- r["default"] = function(e) {
- if (Array.isArray(e)) {
- for (var t = 0, r = Array(e.length); t < e.length; t++) r[t] = e[t];
- return r
- }
- return n(e)
- }, r.__esModule = !0
- }, {
- "babel-runtime/core-js/array/from": 27
- }],
- 51: [function(e, t, r) {
- e("../../modules/es6.string.iterator"), e("../../modules/es6.array.from"), t.exports = e("../../modules/$.core").Array.from
- }, {
- "../../modules/$.core": 73,
- "../../modules/es6.array.from": 123,
- "../../modules/es6.string.iterator": 134
- }],
- 52: [function(e, t, r) {
- e("../modules/web.dom.iterable"), e("../modules/es6.string.iterator"), t.exports = e("../modules/core.get-iterator")
- }, {
- "../modules/core.get-iterator": 121,
- "../modules/es6.string.iterator": 134,
- "../modules/web.dom.iterable": 137
- }],
- 53: [function(e, t, r) {
- e("../modules/web.dom.iterable"), e("../modules/es6.string.iterator"), t.exports = e("../modules/core.is-iterable")
- }, {
- "../modules/core.is-iterable": 122,
- "../modules/es6.string.iterator": 134,
- "../modules/web.dom.iterable": 137
- }],
- 54: [function(e, t, r) {
- e("../../modules/es6.object.assign"), t.exports = e("../../modules/$.core").Object.assign
- }, {
- "../../modules/$.core": 73,
- "../../modules/es6.object.assign": 125
- }],
- 55: [function(e, t, r) {
- var n = e("../../modules/$");
- t.exports = function(e, t) {
- return n.create(e, t)
- }
- }, {
- "../../modules/$": 96
- }],
- 56: [function(e, t, r) {
- var n = e("../../modules/$");
- t.exports = function(e, t, r) {
- return n.setDesc(e, t, r)
- }
- }, {
- "../../modules/$": 96
- }],
- 57: [function(e, t, r) {
- e("../../modules/es6.object.freeze"), t.exports = e("../../modules/$.core").Object.freeze
- }, {
- "../../modules/$.core": 73,
- "../../modules/es6.object.freeze": 126
- }],
- 58: [function(e, t, r) {
- var n = e("../../modules/$");
- e("../../modules/es6.object.get-own-property-descriptor"), t.exports = function(e, t) {
- return n.getDesc(e, t)
- }
- }, {
- "../../modules/$": 96,
- "../../modules/es6.object.get-own-property-descriptor": 127
- }],
- 59: [function(e, t, r) {
- e("../../modules/es6.object.keys"), t.exports = e("../../modules/$.core").Object.keys
- }, {
- "../../modules/$.core": 73,
- "../../modules/es6.object.keys": 128
- }],
- 60: [function(e, t, r) {
- e("../../modules/es6.object.set-prototype-of"), t.exports = e("../../modules/$.core").Object.setPrototypeOf
- }, {
- "../../modules/$.core": 73,
- "../../modules/es6.object.set-prototype-of": 129
- }],
- 61: [function(e, t, r) {
- e("../modules/es6.object.to-string"), e("../modules/es6.string.iterator"), e("../modules/web.dom.iterable"), e("../modules/es6.promise"), t.exports = e("../modules/$.core").Promise
- }, {
- "../modules/$.core": 73,
- "../modules/es6.object.to-string": 130,
- "../modules/es6.promise": 131,
- "../modules/es6.string.iterator": 134,
- "../modules/web.dom.iterable": 137
- }],
- 62: [function(e, t, r) {
- e("../../modules/es6.reflect.construct"), t.exports = e("../../modules/$.core").Reflect.construct
- }, {
- "../../modules/$.core": 73,
- "../../modules/es6.reflect.construct": 132
- }],
- 63: [function(e, t, r) {
- e("../modules/es6.object.to-string"), e("../modules/es6.string.iterator"), e("../modules/web.dom.iterable"), e("../modules/es6.set"), e("../modules/es7.set.to-json"), t.exports = e("../modules/$.core").Set
- }, {
- "../modules/$.core": 73,
- "../modules/es6.object.to-string": 130,
- "../modules/es6.set": 133,
- "../modules/es6.string.iterator": 134,
- "../modules/es7.set.to-json": 136,
- "../modules/web.dom.iterable": 137
- }],
- 64: [function(e, t, r) {
- e("../../modules/es6.string.starts-with"), t.exports = e("../../modules/$.core").String.startsWith
- }, {
- "../../modules/$.core": 73,
- "../../modules/es6.string.starts-with": 135
- }],
- 65: [function(e, t, r) {
- t.exports = function(e) {
- if ("function" != typeof e) throw TypeError(e + " is not a function!");
- return e
- }
- }, {}],
- 66: [function(e, t, r) {
- var n = e("./$.is-object");
- t.exports = function(e) {
- if (!n(e)) throw TypeError(e + " is not an object!");
- return e
- }
- }, {
- "./$.is-object": 88
- }],
- 67: [function(e, t, r) {
- var n = e("./$.to-object"),
- o = e("./$.iobject"),
- s = e("./$.enum-keys");
- t.exports = Object.assign || function(e, t) {
- for (var r = n(e), i = arguments.length, a = 1; i > a;)
- for (var u, l = o(arguments[a++]), c = s(l), f = c.length, h = 0; f > h;) r[u = c[h++]] = l[u];
- return r
- }
- }, {
- "./$.enum-keys": 78,
- "./$.iobject": 86,
- "./$.to-object": 116
- }],
- 68: [function(e, t, r) {
- var n = e("./$.cof"),
- o = e("./$.wks")("toStringTag"),
- s = "Arguments" == n(function() {
- return arguments
- }());
- t.exports = function(e) {
- var t, r, i;
- return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof(r = (t = Object(e))[o]) ? r : s ? n(t) : "Object" == (i = n(t)) && "function" == typeof t.callee ? "Arguments" : i
- }
- }, {
- "./$.cof": 69,
- "./$.wks": 119
- }],
- 69: [function(e, t, r) {
- var n = {}.toString;
- t.exports = function(e) {
- return n.call(e).slice(8, -1)
- }
- }, {}],
- 70: [function(e, t, r) {
- "use strict";
- var n = e("./$"),
- o = e("./$.hide"),
- s = e("./$.ctx"),
- i = e("./$.species"),
- a = e("./$.strict-new"),
- u = e("./$.defined"),
- l = e("./$.for-of"),
- c = e("./$.iter-step"),
- f = e("./$.uid")("id"),
- h = e("./$.has"),
- p = e("./$.is-object"),
- d = Object.isExtensible || p,
- m = e("./$.support-desc"),
- b = m ? "_s" : "size",
- g = 0,
- y = function(e, t) {
- if (!p(e)) return "symbol" == typeof e ? e : ("string" == typeof e ? "S" : "P") + e;
- if (!h(e, f)) {
- if (!d(e)) return "F";
- if (!t) return "E";
- o(e, f, ++g)
- }
- return "O" + e[f]
- },
- v = function(e, t) {
- var r, n = y(t);
- if ("F" !== n) return e._i[n];
- for (r = e._f; r; r = r.n)
- if (r.k == t) return r
- };
- t.exports = {
- getConstructor: function(t, r, o, i) {
- var c = t(function(e, t) {
- a(e, c, r), e._i = n.create(null), e._f = void 0, e._l = void 0, e[b] = 0, void 0 != t && l(t, o, e[i], e)
- });
- return e("./$.mix")(c.prototype, {
- clear: function() {
- for (var e = this, t = e._i, r = e._f; r; r = r.n) r.r = !0, r.p && (r.p = r.p.n = void 0), delete t[r.i];
- e._f = e._l = void 0, e[b] = 0
- },
- "delete": function(e) {
- var t = this,
- r = v(t, e);
- if (r) {
- var n = r.n,
- o = r.p;
- delete t._i[r.i], r.r = !0, o && (o.n = n), n && (n.p = o), t._f == r && (t._f = n), t._l == r && (t._l = o), t[b]--
- }
- return !!r
- },
- forEach: function(e) {
- for (var t, r = s(e, arguments[1], 3); t = t ? t.n : this._f;)
- for (r(t.v, t.k, this); t && t.r;) t = t.p
- },
- has: function(e) {
- return !!v(this, e)
- }
- }), m && n.setDesc(c.prototype, "size", {
- get: function() {
- return u(this[b])
- }
- }), c
- },
- def: function(e, t, r) {
- var n, o, s = v(e, t);
- return s ? s.v = r : (e._l = s = {
- i: o = y(t, !0),
- k: t,
- v: r,
- p: n = e._l,
- n: void 0,
- r: !1
- }, e._f || (e._f = s), n && (n.n = s), e[b]++, "F" !== o && (e._i[o] = s)), e
- },
- getEntry: v,
- setStrong: function(t, r, n) {
- e("./$.iter-define")(t, r, function(e, t) {
- this._t = e, this._k = t, this._l = void 0
- }, function() {
- for (var e = this, t = e._k, r = e._l; r && r.r;) r = r.p;
- return e._t && (e._l = r = r ? r.n : e._t._f) ? "keys" == t ? c(0, r.k) : "values" == t ? c(0, r.v) : c(0, [r.k, r.v]) : (e._t = void 0, c(1))
- }, n ? "entries" : "values", !n, !0), i(t), i(e("./$.core")[r])
- }
- }
- }, {
- "./$": 96,
- "./$.core": 73,
- "./$.ctx": 74,
- "./$.defined": 76,
- "./$.for-of": 80,
- "./$.has": 82,
- "./$.hide": 83,
- "./$.is-object": 88,
- "./$.iter-define": 92,
- "./$.iter-step": 94,
- "./$.mix": 99,
- "./$.species": 106,
- "./$.strict-new": 107,
- "./$.support-desc": 110,
- "./$.uid": 117
- }],
- 71: [function(e, t, r) {
- var n = e("./$.for-of"),
- o = e("./$.classof");
- t.exports = function(e) {
- return function() {
- if (o(this) != e) throw TypeError(e + "#toJSON isn't generic");
- var t = [];
- return n(this, !1, t.push, t), t
- }
- }
- }, {
- "./$.classof": 68,
- "./$.for-of": 80
- }],
- 72: [function(e, t, r) {
- "use strict";
- var n = e("./$"),
- o = e("./$.def"),
- s = e("./$.hide"),
- i = e("./$.iter-buggy"),
- a = e("./$.for-of"),
- u = e("./$.strict-new");
- t.exports = function(t, r, l, c, f, h) {
- var p = e("./$.global")[t],
- d = p,
- m = f ? "set" : "add",
- b = d && d.prototype,
- g = {};
- return e("./$.support-desc") && "function" == typeof d && (h || !i && b.forEach && b.entries) ? (d = r(function(e, r) {
- u(e, d, t), e._c = new p, void 0 != r && a(r, f, e[m], e)
- }), n.each.call("add,clear,delete,forEach,get,has,set,keys,values,entries".split(","), function(e) {
- var t = "add" == e || "set" == e;
- e in b && (!h || "clear" != e) && s(d.prototype, e, function(r, n) {
- var o = this._c[e](0 === r ? 0 : r, n);
- return t ? this : o
- })
- }), "size" in b && n.setDesc(d.prototype, "size", {
- get: function() {
- return this._c.size
- }
- })) : (d = c.getConstructor(r, t, f, m), e("./$.mix")(d.prototype, l)), e("./$.tag")(d, t), g[t] = d, o(o.G + o.W + o.F, g), h || c.setStrong(d, t, f), d
- }
- }, {
- "./$": 96,
- "./$.def": 75,
- "./$.for-of": 80,
- "./$.global": 81,
- "./$.hide": 83,
- "./$.iter-buggy": 89,
- "./$.mix": 99,
- "./$.strict-new": 107,
- "./$.support-desc": 110,
- "./$.tag": 111
- }],
- 73: [function(e, t, r) {
- var n = t.exports = {};
- "number" == typeof __e && (__e = n)
- }, {}],
- 74: [function(e, t, r) {
- var n = e("./$.a-function");
- t.exports = function(e, t, r) {
- if (n(e), void 0 === t) return e;
- switch (r) {
- case 1:
- return function(r) {
- return e.call(t, r)
- };
- case 2:
- return function(r, n) {
- return e.call(t, r, n)
- };
- case 3:
- return function(r, n, o) {
- return e.call(t, r, n, o)
- }
- }
- return function() {
- return e.apply(t, arguments)
- }
- }
- }, {
- "./$.a-function": 65
- }],
- 75: [function(e, t, r) {
- var n = e("./$.global"),
- o = e("./$.core"),
- s = "prototype",
- i = function(e, t) {
- return function() {
- return e.apply(t, arguments)
- }
- },
- a = function(e, t, r) {
- var u, l, c, f, h = e & a.G,
- p = e & a.P,
- d = h ? n : e & a.S ? n[t] : (n[t] || {})[s],
- m = h ? o : o[t] || (o[t] = {});
- h && (r = t);
- for (u in r) l = !(e & a.F) && d && u in d, l && u in m || (c = l ? d[u] : r[u], h && "function" != typeof d[u] ? f = r[u] : e & a.B && l ? f = i(c, n) : e & a.W && d[u] == c ? ! function(e) {
- f = function(t) {
- return this instanceof e ? new e(t) : e(t)
- }, f[s] = e[s]
- }(c) : f = p && "function" == typeof c ? i(Function.call, c) : c, m[u] = f, p && ((m[s] || (m[s] = {}))[u] = c))
- };
- a.F = 1, a.G = 2, a.S = 4, a.P = 8, a.B = 16, a.W = 32, t.exports = a
- }, {
- "./$.core": 73,
- "./$.global": 81
- }],
- 76: [function(e, t, r) {
- t.exports = function(e) {
- if (void 0 == e) throw TypeError("Can't call method on " + e);
- return e
- }
- }, {}],
- 77: [function(e, t, r) {
- var n = e("./$.is-object"),
- o = e("./$.global").document,
- s = n(o) && n(o.createElement);
- t.exports = function(e) {
- return s ? o.createElement(e) : {}
- }
- }, {
- "./$.global": 81,
- "./$.is-object": 88
- }],
- 78: [function(e, t, r) {
- var n = e("./$");
- t.exports = function(e) {
- var t = n.getKeys(e),
- r = n.getSymbols;
- if (r)
- for (var o, s = r(e), i = n.isEnum, a = 0; s.length > a;) i.call(e, o = s[a++]) && t.push(o);
- return t
- }
- }, {
- "./$": 96
- }],
- 79: [function(e, t, r) {
- t.exports = function(e) {
- try {
- return !!e()
- } catch (t) {
- return !0
- }
- }
- }, {}],
- 80: [function(e, t, r) {
- var n = e("./$.ctx"),
- o = e("./$.iter-call"),
- s = e("./$.is-array-iter"),
- i = e("./$.an-object"),
- a = e("./$.to-length"),
- u = e("./core.get-iterator-method");
- t.exports = function(e, t, r, l) {
- var c, f, h, p = u(e),
- d = n(r, l, t ? 2 : 1),
- m = 0;
- if ("function" != typeof p) throw TypeError(e + " is not iterable!");
- if (s(p))
- for (c = a(e.length); c > m; m++) t ? d(i(f = e[m])[0], f[1]) : d(e[m]);
- else
- for (h = p.call(e); !(f = h.next()).done;) o(h, d, f.value, t)
- }
- }, {
- "./$.an-object": 66,
- "./$.ctx": 74,
- "./$.is-array-iter": 87,
- "./$.iter-call": 90,
- "./$.to-length": 115,
- "./core.get-iterator-method": 120
- }],
- 81: [function(e, t, r) {
- var n = "undefined",
- o = t.exports = typeof window != n && window.Math == Math ? window : typeof self != n && self.Math == Math ? self : Function("return this")();
- "number" == typeof __g && (__g = o)
- }, {}],
- 82: [function(e, t, r) {
- var n = {}.hasOwnProperty;
- t.exports = function(e, t) {
- return n.call(e, t)
- }
- }, {}],
- 83: [function(e, t, r) {
- var n = e("./$"),
- o = e("./$.property-desc");
- t.exports = e("./$.support-desc") ? function(e, t, r) {
- return n.setDesc(e, t, o(1, r))
- } : function(e, t, r) {
- return e[t] = r, e
- }
- }, {
- "./$": 96,
- "./$.property-desc": 101,
- "./$.support-desc": 110
- }],
- 84: [function(e, t, r) {
- t.exports = e("./$.global").document && document.documentElement
- }, {
- "./$.global": 81
- }],
- 85: [function(e, t, r) {
- t.exports = function(e, t, r) {
- var n = void 0 === r;
- switch (t.length) {
- case 0:
- return n ? e() : e.call(r);
- case 1:
- return n ? e(t[0]) : e.call(r, t[0]);
- case 2:
- return n ? e(t[0], t[1]) : e.call(r, t[0], t[1]);
- case 3:
- return n ? e(t[0], t[1], t[2]) : e.call(r, t[0], t[1], t[2]);
- case 4:
- return n ? e(t[0], t[1], t[2], t[3]) : e.call(r, t[0], t[1], t[2], t[3])
- }
- return e.apply(r, t)
- }
- }, {}],
- 86: [function(e, t, r) {
- var n = e("./$.cof");
- t.exports = 0 in Object("z") ? Object : function(e) {
- return "String" == n(e) ? e.split("") : Object(e)
- }
- }, {
- "./$.cof": 69
- }],
- 87: [function(e, t, r) {
- var n = e("./$.iterators"),
- o = e("./$.wks")("iterator");
- t.exports = function(e) {
- return (n.Array || Array.prototype[o]) === e
- }
- }, {
- "./$.iterators": 95,
- "./$.wks": 119
- }],
- 88: [function(e, t, r) {
- t.exports = function(e) {
- return null !== e && ("object" == typeof e || "function" == typeof e)
- }
- }, {}],
- 89: [function(e, t, r) {
- t.exports = "keys" in [] && !("next" in [].keys())
- }, {}],
- 90: [function(e, t, r) {
- var n = e("./$.an-object");
- t.exports = function(e, t, r, o) {
- try {
- return o ? t(n(r)[0], r[1]) : t(r)
- } catch (s) {
- var i = e["return"];
- throw void 0 !== i && n(i.call(e)), s
- }
- }
- }, {
- "./$.an-object": 66
- }],
- 91: [function(e, t, r) {
- "use strict";
- var n = e("./$"),
- o = {};
- e("./$.hide")(o, e("./$.wks")("iterator"), function() {
- return this
- }), t.exports = function(t, r, s) {
- t.prototype = n.create(o, {
- next: e("./$.property-desc")(1, s)
- }), e("./$.tag")(t, r + " Iterator")
- }
- }, {
- "./$": 96,
- "./$.hide": 83,
- "./$.property-desc": 101,
- "./$.tag": 111,
- "./$.wks": 119
- }],
- 92: [function(e, t, r) {
- "use strict";
- var n = e("./$.library"),
- o = e("./$.def"),
- s = e("./$.redef"),
- i = e("./$.hide"),
- a = e("./$.has"),
- u = e("./$.wks")("iterator"),
- l = e("./$.iterators"),
- c = "@@iterator",
- f = "keys",
- h = "values",
- p = function() {
- return this
- };
- t.exports = function(t, r, d, m, b, g, y) {
- e("./$.iter-create")(d, r, m);
- var v, j, $ = function(e) {
- switch (e) {
- case f:
- return function() {
- return new d(this, e)
- };
- case h:
- return function() {
- return new d(this, e)
- }
- }
- return function() {
- return new d(this, e)
- }
- },
- w = r + " Iterator",
- k = t.prototype,
- _ = k[u] || k[c] || b && k[b],
- x = _ || $(b);
- if (_) {
- var A = e("./$").getProto(x.call(new t));
- e("./$.tag")(A, w, !0), !n && a(k, c) && i(A, u, p)
- }
- if ((!n || y) && i(k, u, x), l[r] = x, l[w] = p, b)
- if (v = {
- keys: g ? x : $(f),
- values: b == h ? x : $(h),
- entries: b != h ? x : $("entries")
- }, y)
- for (j in v) j in k || s(k, j, v[j]);
- else o(o.P + o.F * e("./$.iter-buggy"), r, v)
- }
- }, {
- "./$": 96,
- "./$.def": 75,
- "./$.has": 82,
- "./$.hide": 83,
- "./$.iter-buggy": 89,
- "./$.iter-create": 91,
- "./$.iterators": 95,
- "./$.library": 97,
- "./$.redef": 102,
- "./$.tag": 111,
- "./$.wks": 119
- }],
- 93: [function(e, t, r) {
- var n = e("./$.wks")("iterator"),
- o = !1;
- try {
- var s = [7][n]();
- s["return"] = function() {
- o = !0
- }, Array.from(s, function() {
- throw 2
- })
- } catch (i) {}
- t.exports = function(e) {
- if (!o) return !1;
- var t = !1;
- try {
- var r = [7],
- s = r[n]();
- s.next = function() {
- t = !0
- }, r[n] = function() {
- return s
- }, e(r)
- } catch (i) {}
- return t
- }
- }, {
- "./$.wks": 119
- }],
- 94: [function(e, t, r) {
- t.exports = function(e, t) {
- return {
- value: t,
- done: !!e
- }
- }
- }, {}],
- 95: [function(e, t, r) {
- t.exports = {}
- }, {}],
- 96: [function(e, t, r) {
- var n = Object;
- t.exports = {
- create: n.create,
- getProto: n.getPrototypeOf,
- isEnum: {}.propertyIsEnumerable,
- getDesc: n.getOwnPropertyDescriptor,
- setDesc: n.defineProperty,
- setDescs: n.defineProperties,
- getKeys: n.keys,
- getNames: n.getOwnPropertyNames,
- getSymbols: n.getOwnPropertySymbols,
- each: [].forEach
- }
- }, {}],
- 97: [function(e, t, r) {
- t.exports = !0
- }, {}],
- 98: [function(e, t, r) {
- var n, o, s, i = e("./$.global"),
- a = e("./$.task").set,
- u = i.MutationObserver || i.WebKitMutationObserver,
- l = i.process,
- c = "process" == e("./$.cof")(l),
- f = function() {
- var e, t;
- for (c && (e = l.domain) && (l.domain = null, e.exit()); n;) t = n.domain, t && t.enter(), n.fn.call(), t && t.exit(), n = n.next;
- o = void 0, e && e.enter()
- };
- if (c) s = function() {
- l.nextTick(f)
- };
- else if (u) {
- var h = 1,
- p = document.createTextNode("");
- new u(f).observe(p, {
- characterData: !0
- }), s = function() {
- p.data = h = -h
- }
- } else s = function() {
- a.call(i, f)
- };
- t.exports = function(e) {
- var t = {
- fn: e,
- next: void 0,
- domain: c && l.domain
- };
- o && (o.next = t), n || (n = t, s()), o = t
- }
- }, {
- "./$.cof": 69,
- "./$.global": 81,
- "./$.task": 112
- }],
- 99: [function(e, t, r) {
- var n = e("./$.redef");
- t.exports = function(e, t) {
- for (var r in t) n(e, r, t[r]);
- return e
- }
- }, {
- "./$.redef": 102
- }],
- 100: [function(e, t, r) {
- t.exports = function(t, r) {
- var n = e("./$.def"),
- o = (e("./$.core").Object || {})[t] || Object[t],
- s = {};
- s[t] = r(o), n(n.S + n.F * e("./$.fails")(function() {
- o(1)
- }), "Object", s)
- }
- }, {
- "./$.core": 73,
- "./$.def": 75,
- "./$.fails": 79
- }],
- 101: [function(e, t, r) {
- t.exports = function(e, t) {
- return {
- enumerable: !(1 & e),
- configurable: !(2 & e),
- writable: !(4 & e),
- value: t
- }
- }
- }, {}],
- 102: [function(e, t, r) {
- t.exports = e("./$.hide")
- }, {
- "./$.hide": 83
- }],
- 103: [function(e, t, r) {
- t.exports = Object.is || function(e, t) {
- return e === t ? 0 !== e || 1 / e === 1 / t : e != e && t != t
- }
- }, {}],
- 104: [function(e, t, r) {
- var n = e("./$").getDesc,
- o = e("./$.is-object"),
- s = e("./$.an-object"),
- i = function(e, t) {
- if (s(e), !o(t) && null !== t) throw TypeError(t + ": can't set as prototype!")
- };
- t.exports = {
- set: Object.setPrototypeOf || ("__proto__" in {} ? function(t, r) {
- try {
- r = e("./$.ctx")(Function.call, n(Object.prototype, "__proto__").set, 2), r({}, [])
- } catch (o) {
- t = !0
- }
- return function(e, n) {
- return i(e, n), t ? e.__proto__ = n : r(e, n), e
- }
- }() : void 0),
- check: i
- }
- }, {
- "./$": 96,
- "./$.an-object": 66,
- "./$.ctx": 74,
- "./$.is-object": 88
- }],
- 105: [function(e, t, r) {
- var n = e("./$.global"),
- o = "__core-js_shared__",
- s = n[o] || (n[o] = {});
- t.exports = function(e) {
- return s[e] || (s[e] = {})
- }
- }, {
- "./$.global": 81
- }],
- 106: [function(e, t, r) {
- "use strict";
- var n = e("./$"),
- o = e("./$.wks")("species");
- t.exports = function(t) {
- !e("./$.support-desc") || o in t || n.setDesc(t, o, {
- configurable: !0,
- get: function() {
- return this
- }
- })
- }
- }, {
- "./$": 96,
- "./$.support-desc": 110,
- "./$.wks": 119
- }],
- 107: [function(e, t, r) {
- t.exports = function(e, t, r) {
- if (!(e instanceof t)) throw TypeError(r + ": use the 'new' operator!");
- return e
- }
- }, {}],
- 108: [function(e, t, r) {
- var n = e("./$.to-integer"),
- o = e("./$.defined");
- t.exports = function(e) {
- return function(t, r) {
- var s, i, a = String(o(t)),
- u = n(r),
- l = a.length;
- return 0 > u || u >= l ? e ? "" : void 0 : (s = a.charCodeAt(u), 55296 > s || s > 56319 || u + 1 === l || (i = a.charCodeAt(u + 1)) < 56320 || i > 57343 ? e ? a.charAt(u) : s : e ? a.slice(u, u + 2) : (s - 55296 << 10) + (i - 56320) + 65536)
- }
- }
- }, {
- "./$.defined": 76,
- "./$.to-integer": 113
- }],
- 109: [function(e, t, r) {
- var n = e("./$.defined"),
- o = e("./$.cof");
- t.exports = function(e, t, r) {
- if ("RegExp" == o(t)) throw TypeError("String#" + r + " doesn't accept regex!");
- return String(n(e))
- }
- }, {
- "./$.cof": 69,
- "./$.defined": 76
- }],
- 110: [function(e, t, r) {
- t.exports = !e("./$.fails")(function() {
- return 7 != Object.defineProperty({}, "a", {
- get: function() {
- return 7
- }
- }).a
- })
- }, {
- "./$.fails": 79
- }],
- 111: [function(e, t, r) {
- var n = e("./$.has"),
- o = e("./$.hide"),
- s = e("./$.wks")("toStringTag");
- t.exports = function(e, t, r) {
- e && !n(e = r ? e : e.prototype, s) && o(e, s, t)
- }
- }, {
- "./$.has": 82,
- "./$.hide": 83,
- "./$.wks": 119
- }],
- 112: [function(e, t, r) {
- "use strict";
- var n, o, s, i = e("./$.ctx"),
- a = e("./$.invoke"),
- u = e("./$.html"),
- l = e("./$.dom-create"),
- c = e("./$.global"),
- f = c.process,
- h = c.setImmediate,
- p = c.clearImmediate,
- d = c.MessageChannel,
- m = 0,
- b = {},
- g = "onreadystatechange",
- y = function() {
- var e = +this;
- if (b.hasOwnProperty(e)) {
- var t = b[e];
- delete b[e], t()
- }
- },
- v = function(e) {
- y.call(e.data)
- };
- h && p || (h = function(e) {
- for (var t = [], r = 1; arguments.length > r;) t.push(arguments[r++]);
- return b[++m] = function() {
- a("function" == typeof e ? e : Function(e), t)
- }, n(m), m
- }, p = function(e) {
- delete b[e]
- }, "process" == e("./$.cof")(f) ? n = function(e) {
- f.nextTick(i(y, e, 1))
- } : d ? (o = new d, s = o.port2, o.port1.onmessage = v, n = i(s.postMessage, s, 1)) : c.addEventListener && "function" == typeof postMessage && !c.importScript ? (n = function(e) {
- c.postMessage(e + "", "*")
- }, c.addEventListener("message", v, !1)) : n = g in l("script") ? function(e) {
- u.appendChild(l("script"))[g] = function() {
- u.removeChild(this), y.call(e)
- }
- } : function(e) {
- setTimeout(i(y, e, 1), 0)
- }), t.exports = {
- set: h,
- clear: p
- }
- }, {
- "./$.cof": 69,
- "./$.ctx": 74,
- "./$.dom-create": 77,
- "./$.global": 81,
- "./$.html": 84,
- "./$.invoke": 85
- }],
- 113: [function(e, t, r) {
- var n = Math.ceil,
- o = Math.floor;
- t.exports = function(e) {
- return isNaN(e = +e) ? 0 : (e > 0 ? o : n)(e)
- }
- }, {}],
- 114: [function(e, t, r) {
- var n = e("./$.iobject"),
- o = e("./$.defined");
- t.exports = function(e) {
- return n(o(e))
- }
- }, {
- "./$.defined": 76,
- "./$.iobject": 86
- }],
- 115: [function(e, t, r) {
- var n = e("./$.to-integer"),
- o = Math.min;
- t.exports = function(e) {
- return e > 0 ? o(n(e), 9007199254740991) : 0
- }
- }, {
- "./$.to-integer": 113
- }],
- 116: [function(e, t, r) {
- var n = e("./$.defined");
- t.exports = function(e) {
- return Object(n(e))
- }
- }, {
- "./$.defined": 76
- }],
- 117: [function(e, t, r) {
- var n = 0,
- o = Math.random();
- t.exports = function(e) {
- return "Symbol(".concat(void 0 === e ? "" : e, ")_", (++n + o).toString(36))
- }
- }, {}],
- 118: [function(e, t, r) {
- t.exports = function() {}
- }, {}],
- 119: [function(e, t, r) {
- var n = e("./$.shared")("wks"),
- o = e("./$.global").Symbol;
- t.exports = function(t) {
- return n[t] || (n[t] = o && o[t] || (o || e("./$.uid"))("Symbol." + t))
- }
- }, {
- "./$.global": 81,
- "./$.shared": 105,
- "./$.uid": 117
- }],
- 120: [function(e, t, r) {
- var n = e("./$.classof"),
- o = e("./$.wks")("iterator"),
- s = e("./$.iterators");
- t.exports = e("./$.core").getIteratorMethod = function(e) {
- return void 0 != e ? e[o] || e["@@iterator"] || s[n(e)] : void 0
- }
- }, {
- "./$.classof": 68,
- "./$.core": 73,
- "./$.iterators": 95,
- "./$.wks": 119
- }],
- 121: [function(e, t, r) {
- var n = e("./$.an-object"),
- o = e("./core.get-iterator-method");
- t.exports = e("./$.core").getIterator = function(e) {
- var t = o(e);
- if ("function" != typeof t) throw TypeError(e + " is not iterable!");
- return n(t.call(e))
- }
- }, {
- "./$.an-object": 66,
- "./$.core": 73,
- "./core.get-iterator-method": 120
- }],
- 122: [function(e, t, r) {
- var n = e("./$.classof"),
- o = e("./$.wks")("iterator"),
- s = e("./$.iterators");
- t.exports = e("./$.core").isIterable = function(e) {
- var t = Object(e);
- return o in t || "@@iterator" in t || s.hasOwnProperty(n(t))
- }
- }, {
- "./$.classof": 68,
- "./$.core": 73,
- "./$.iterators": 95,
- "./$.wks": 119
- }],
- 123: [function(e, t, r) {
- "use strict";
- var n = e("./$.ctx"),
- o = e("./$.def"),
- s = e("./$.to-object"),
- i = e("./$.iter-call"),
- a = e("./$.is-array-iter"),
- u = e("./$.to-length"),
- l = e("./core.get-iterator-method");
- o(o.S + o.F * !e("./$.iter-detect")(function(e) {
- Array.from(e)
- }), "Array", {
- from: function(e) {
- var t, r, o, c, f = s(e),
- h = "function" == typeof this ? this : Array,
- p = arguments[1],
- d = void 0 !== p,
- m = 0,
- b = l(f);
- if (d && (p = n(p, arguments[2], 2)), void 0 == b || h == Array && a(b))
- for (r = new h(t = u(f.length)); t > m; m++) r[m] = d ? p(f[m], m) : f[m];
- else
- for (c = b.call(f), r = new h; !(o = c.next()).done; m++) r[m] = d ? i(c, p, [o.value, m], !0) : o.value;
- return r.length = m, r
- }
- })
- }, {
- "./$.ctx": 74,
- "./$.def": 75,
- "./$.is-array-iter": 87,
- "./$.iter-call": 90,
- "./$.iter-detect": 93,
- "./$.to-length": 115,
- "./$.to-object": 116,
- "./core.get-iterator-method": 120
- }],
- 124: [function(e, t, r) {
- "use strict";
- var n = e("./$.unscope"),
- o = e("./$.iter-step"),
- s = e("./$.iterators"),
- i = e("./$.to-iobject");
- e("./$.iter-define")(Array, "Array", function(e, t) {
- this._t = i(e), this._i = 0, this._k = t
- }, function() {
- var e = this._t,
- t = this._k,
- r = this._i++;
- return !e || r >= e.length ? (this._t = void 0, o(1)) : "keys" == t ? o(0, r) : "values" == t ? o(0, e[r]) : o(0, [r, e[r]])
- }, "values"), s.Arguments = s.Array, n("keys"), n("values"), n("entries")
- }, {
- "./$.iter-define": 92,
- "./$.iter-step": 94,
- "./$.iterators": 95,
- "./$.to-iobject": 114,
- "./$.unscope": 118
- }],
- 125: [function(e, t, r) {
- var n = e("./$.def");
- n(n.S, "Object", {
- assign: e("./$.assign")
- })
- }, {
- "./$.assign": 67,
- "./$.def": 75
- }],
- 126: [function(e, t, r) {
- var n = e("./$.is-object");
- e("./$.object-sap")("freeze", function(e) {
- return function(t) {
- return e && n(t) ? e(t) : t
- }
- })
- }, {
- "./$.is-object": 88,
- "./$.object-sap": 100
- }],
- 127: [function(e, t, r) {
- var n = e("./$.to-iobject");
- e("./$.object-sap")("getOwnPropertyDescriptor", function(e) {
- return function(t, r) {
- return e(n(t), r)
- }
- })
- }, {
- "./$.object-sap": 100,
- "./$.to-iobject": 114
- }],
- 128: [function(e, t, r) {
- var n = e("./$.to-object");
- e("./$.object-sap")("keys", function(e) {
- return function(t) {
- return e(n(t))
- }
- })
- }, {
- "./$.object-sap": 100,
- "./$.to-object": 116
- }],
- 129: [function(e, t, r) {
- var n = e("./$.def");
- n(n.S, "Object", {
- setPrototypeOf: e("./$.set-proto").set
- })
- }, {
- "./$.def": 75,
- "./$.set-proto": 104
- }],
- 130: [function(e, t, r) {}, {}],
- 131: [function(e, t, r) {
- "use strict";
- var n, o = e("./$"),
- s = e("./$.library"),
- i = e("./$.global"),
- a = e("./$.ctx"),
- u = e("./$.classof"),
- l = e("./$.def"),
- c = e("./$.is-object"),
- f = e("./$.an-object"),
- h = e("./$.a-function"),
- p = e("./$.strict-new"),
- d = e("./$.for-of"),
- m = e("./$.set-proto").set,
- b = e("./$.same"),
- g = e("./$.species"),
- y = e("./$.wks")("species"),
- v = e("./$.uid")("record"),
- j = e("./$.microtask"),
- $ = "Promise",
- w = i.process,
- k = "process" == u(w),
- _ = i[$],
- x = function(e) {
- var t = new _(function() {});
- return e && (t.constructor = Object), _.resolve(t) === t
- },
- A = function() {
- function t(e) {
- var r = new _(e);
- return m(r, t.prototype), r
- }
- var r = !1;
- try {
- if (r = _ && _.resolve && x(), m(t, _), t.prototype = o.create(_.prototype, {
- constructor: {
- value: t
- }
- }), t.resolve(5).then(function() {}) instanceof t || (r = !1), r && e("./$.support-desc")) {
- var n = !1;
- _.resolve(o.setDesc({}, "then", {
- get: function() {
- n = !0
- }
- })), r = n
- }
- } catch (s) {
- r = !1
- }
- return r
- }(),
- O = function(e) {
- return c(e) && (A ? "Promise" == u(e) : v in e)
- },
- q = function(e, t) {
- return s && e === _ && t === n ? !0 : b(e, t)
- },
- P = function(e) {
- var t = f(e)[y];
- return void 0 != t ? t : e
- },
- E = function(e) {
- var t;
- return c(e) && "function" == typeof(t = e.then) ? t : !1
- },
- S = function(e, t) {
- if (!e.n) {
- e.n = !0;
- var r = e.c;
- j(function() {
- for (var n = e.v, o = 1 == e.s, s = 0, a = function(t) {
- var r, s, i = o ? t.ok : t.fail;
- try {
- i ? (o || (e.h = !0), r = i === !0 ? n : i(n), r === t.P ? t.rej(TypeError("Promise-chain cycle")) : (s = E(r)) ? s.call(r, t.res, t.rej) : t.res(r)) : t.rej(n)
- } catch (a) {
- t.rej(a)
- }
- }; r.length > s;) a(r[s++]);
- r.length = 0, e.n = !1, t && setTimeout(function() {
- j(function() {
- I(e.p) && (k ? w.emit("unhandledRejection", n, e.p) : i.console && console.error && console.error("Unhandled promise rejection", n)), e.a = void 0
- })
- }, 1)
- })
- }
- },
- I = function(e) {
- var t, r = e[v],
- n = r.a || r.c,
- o = 0;
- if (r.h) return !1;
- for (; n.length > o;)
- if (t = n[o++], t.fail || !I(t.P)) return !1;
- return !0
- },
- M = function(e) {
- var t = this;
- t.d || (t.d = !0, t = t.r || t, t.v = e, t.s = 2, t.a = t.c.slice(), S(t, !0))
- },
- C = function(e) {
- var t, r = this;
- if (!r.d) {
- r.d = !0, r = r.r || r;
- try {
- (t = E(e)) ? j(function() {
- var n = {
- r: r,
- d: !1
- };
- try {
- t.call(e, a(C, n, 1), a(M, n, 1))
- } catch (o) {
- M.call(n, o)
- }
- }): (r.v = e, r.s = 1, S(r, !1))
- } catch (n) {
- M.call({
- r: r,
- d: !1
- }, n)
- }
- }
- };
- A || (_ = function(e) {
- h(e);
- var t = {
- p: p(this, _, $),
- c: [],
- a: void 0,
- s: 0,
- d: !1,
- v: void 0,
- h: !1,
- n: !1
- };
- this[v] = t;
- try {
- e(a(C, t, 1), a(M, t, 1))
- } catch (r) {
- M.call(t, r)
- }
- }, e("./$.mix")(_.prototype, {
- then: function(e, t) {
- var r = f(f(this).constructor)[y],
- n = {
- ok: "function" == typeof e ? e : !0,
- fail: "function" == typeof t ? t : !1
- },
- o = n.P = new(void 0 != r ? r : _)(function(e, t) {
- n.res = h(e), n.rej = h(t)
- }),
- s = this[v];
- return s.c.push(n), s.a && s.a.push(n), s.s && S(s, !1), o
- },
- "catch": function(e) {
- return this.then(void 0, e)
- }
- })), l(l.G + l.W + l.F * !A, {
- Promise: _
- }), e("./$.tag")(_, $), g(_), g(n = e("./$.core")[$]), l(l.S + l.F * !A, $, {
- reject: function(e) {
- return new this(function(t, r) {
- r(e)
- })
- }
- }), l(l.S + l.F * (!A || x(!0)), $, {
- resolve: function(e) {
- return O(e) && q(e.constructor, this) ? e : new this(function(t) {
- t(e)
- })
- }
- }), l(l.S + l.F * !(A && e("./$.iter-detect")(function(e) {
- _.all(e)["catch"](function() {})
- })), $, {
- all: function(e) {
- var t = P(this),
- r = [];
- return new t(function(n, s) {
- d(e, !1, r.push, r);
- var i = r.length,
- a = Array(i);
- i ? o.each.call(r, function(e, r) {
- t.resolve(e).then(function(e) {
- a[r] = e, --i || n(a)
- }, s)
- }) : n(a)
- })
- },
- race: function(e) {
- var t = P(this);
- return new t(function(r, n) {
- d(e, !1, function(e) {
- t.resolve(e).then(r, n)
- })
- })
- }
- })
- }, {
- "./$": 96,
- "./$.a-function": 65,
- "./$.an-object": 66,
- "./$.classof": 68,
- "./$.core": 73,
- "./$.ctx": 74,
- "./$.def": 75,
- "./$.for-of": 80,
- "./$.global": 81,
- "./$.is-object": 88,
- "./$.iter-detect": 93,
- "./$.library": 97,
- "./$.microtask": 98,
- "./$.mix": 99,
- "./$.same": 103,
- "./$.set-proto": 104,
- "./$.species": 106,
- "./$.strict-new": 107,
- "./$.support-desc": 110,
- "./$.tag": 111,
- "./$.uid": 117,
- "./$.wks": 119
- }],
- 132: [function(e, t, r) {
- var n = e("./$"),
- o = e("./$.def"),
- s = e("./$.a-function"),
- i = e("./$.an-object"),
- a = e("./$.is-object"),
- u = Function.bind || e("./$.core").Function.prototype.bind;
- o(o.S + o.F * e("./$.fails")(function() {
- function e() {}
- return !(Reflect.construct(function() {}, [], e) instanceof e)
- }), "Reflect", {
- construct: function(e, t) {
- if (s(e), arguments.length < 3) {
- if (void 0 != t) switch (i(t).length) {
- case 0:
- return new e;
- case 1:
- return new e(t[0]);
- case 2:
- return new e(t[0], t[1]);
- case 3:
- return new e(t[0], t[1], t[2]);
- case 4:
- return new e(t[0], t[1], t[2], t[3])
- }
- var r = [null];
- return r.push.apply(r, t), new(u.apply(e, r))
- }
- var o = s(arguments[2]).prototype,
- l = n.create(a(o) ? o : Object.prototype),
- c = Function.apply.call(e, l, t);
- return a(c) ? c : l
- }
- })
- }, {
- "./$": 96,
- "./$.a-function": 65,
- "./$.an-object": 66,
- "./$.core": 73,
- "./$.def": 75,
- "./$.fails": 79,
- "./$.is-object": 88
- }],
- 133: [function(e, t, r) {
- "use strict";
- var n = e("./$.collection-strong");
- e("./$.collection")("Set", function(e) {
- return function() {
- return e(this, arguments[0])
- }
- }, {
- add: function(e) {
- return n.def(this, e = 0 === e ? 0 : e, e)
- }
- }, n)
- }, {
- "./$.collection": 72,
- "./$.collection-strong": 70
- }],
- 134: [function(e, t, r) {
- "use strict";
- var n = e("./$.string-at")(!0);
- e("./$.iter-define")(String, "String", function(e) {
- this._t = String(e), this._i = 0
- }, function() {
- var e, t = this._t,
- r = this._i;
- return r >= t.length ? {
- value: void 0,
- done: !0
- } : (e = n(t, r), this._i += e.length, {
- value: e,
- done: !1
- })
- })
- }, {
- "./$.iter-define": 92,
- "./$.string-at": 108
- }],
- 135: [function(e, t, r) {
- "use strict";
- var n = e("./$.def"),
- o = e("./$.to-length"),
- s = e("./$.string-context");
- n(n.P + n.F * !e("./$.fails")(function() {
- "q".startsWith(/./)
- }), "String", {
- startsWith: function(e) {
- var t = s(this, e, "startsWith"),
- r = o(Math.min(arguments[1], t.length)),
- n = String(e);
- return t.slice(r, r + n.length) === n
- }
- })
- }, {
- "./$.def": 75,
- "./$.fails": 79,
- "./$.string-context": 109,
- "./$.to-length": 115
- }],
- 136: [function(e, t, r) {
- var n = e("./$.def");
- n(n.P, "Set", {
- toJSON: e("./$.collection-to-json")("Set")
- })
- }, {
- "./$.collection-to-json": 71,
- "./$.def": 75
- }],
- 137: [function(e, t, r) {
- e("./es6.array.iterator");
- var n = e("./$.iterators");
- n.NodeList = n.HTMLCollection = n.Array
- }, {
- "./$.iterators": 95,
- "./es6.array.iterator": 124
- }],
- 138: [function(e, t, r) {
- (function(e) {
- ! function(n) {
- function o(e) {
- throw RangeError(M[e])
- }
- function s(e, t) {
- for (var r = e.length, n = []; r--;) n[r] = t(e[r]);
- return n
- }
- function i(e, t) {
- var r = e.split("@"),
- n = "";
- r.length > 1 && (n = r[0] + "@", e = r[1]), e = e.replace(I, ".");
- var o = e.split("."),
- i = s(o, t).join(".");
- return n + i
- }
- function a(e) {
- for (var t, r, n = [], o = 0, s = e.length; s > o;) t = e.charCodeAt(o++), t >= 55296 && 56319 >= t && s > o ? (r = e.charCodeAt(o++), 56320 == (64512 & r) ? n.push(((1023 & t) << 10) + (1023 & r) + 65536) : (n.push(t), o--)) : n.push(t);
- return n
- }
- function u(e) {
- return s(e, function(e) {
- var t = "";
- return e > 65535 && (e -= 65536, t += F(e >>> 10 & 1023 | 55296), e = 56320 | 1023 & e), t += F(e)
- }).join("")
- }
- function l(e) {
- return 10 > e - 48 ? e - 22 : 26 > e - 65 ? e - 65 : 26 > e - 97 ? e - 97 : w
- }
- function c(e, t) {
- return e + 22 + 75 * (26 > e) - ((0 != t) << 5)
- }
- function f(e, t, r) {
- var n = 0;
- for (e = r ? T(e / A) : e >> 1, e += T(e / t); e > C * _ >> 1; n += w) e = T(e / C);
- return T(n + (C + 1) * e / (e + x))
- }
- function h(e) {
- var t, r, n, s, i, a, c, h, p, d, m = [],
- b = e.length,
- g = 0,
- y = q,
- v = O;
- for (r = e.lastIndexOf(P), 0 > r && (r = 0), n = 0; r > n; ++n) e.charCodeAt(n) >= 128 && o("not-basic"), m.push(e.charCodeAt(n));
- for (s = r > 0 ? r + 1 : 0; b > s;) {
- for (i = g, a = 1, c = w; s >= b && o("invalid-input"), h = l(e.charCodeAt(s++)), (h >= w || h > T(($ - g) / a)) && o("overflow"), g += h * a, p = v >= c ? k : c >= v + _ ? _ : c - v, !(p > h); c += w) d = w - p, a > T($ / d) && o("overflow"), a *= d;
- t = m.length + 1, v = f(g - i, t, 0 == i), T(g / t) > $ - y && o("overflow"), y += T(g / t), g %= t, m.splice(g++, 0, y)
- }
- return u(m)
- }
- function p(e) {
- var t, r, n, s, i, u, l, h, p, d, m, b, g, y, v, j = [];
- for (e = a(e), b = e.length, t = q, r = 0, i = O, u = 0; b > u; ++u) m = e[u], 128 > m && j.push(F(m));
- for (n = s = j.length, s && j.push(P); b > n;) {
- for (l = $, u = 0; b > u; ++u) m = e[u], m >= t && l > m && (l = m);
- for (g = n + 1, l - t > T(($ - r) / g) && o("overflow"), r += (l - t) * g, t = l, u = 0; b > u; ++u)
- if (m = e[u], t > m && ++r > $ && o("overflow"), m == t) {
- for (h = r, p = w; d = i >= p ? k : p >= i + _ ? _ : p - i, !(d > h); p += w) v = h - d, y = w - d, j.push(F(c(d + v % y, 0))), h = T(v / y);
- j.push(F(c(h, 0))), i = f(r, g, n == s), r = 0, ++n
- }++r, ++t
- }
- return j.join("")
- }
- function d(e) {
- return i(e, function(e) {
- return E.test(e) ? h(e.slice(4).toLowerCase()) : e
- })
- }
- function m(e) {
- return i(e, function(e) {
- return S.test(e) ? "xn--" + p(e) : e
- })
- }
- var b = "object" == typeof r && r && !r.nodeType && r,
- g = "object" == typeof t && t && !t.nodeType && t,
- y = "object" == typeof e && e;
- (y.global === y || y.window === y || y.self === y) && (n = y);
- var v, j, $ = 2147483647,
- w = 36,
- k = 1,
- _ = 26,
- x = 38,
- A = 700,
- O = 72,
- q = 128,
- P = "-",
- E = /^xn--/,
- S = /[^\x20-\x7E]/,
- I = /[\x2E\u3002\uFF0E\uFF61]/g,
- M = {
- overflow: "Overflow: input needs wider integers to process",
- "not-basic": "Illegal input >= 0x80 (not a basic code point)",
- "invalid-input": "Invalid input"
- },
- C = w - k,
- T = Math.floor,
- F = String.fromCharCode;
- if (v = {
- version: "1.3.2",
- ucs2: {
- decode: a,
- encode: u
- },
- decode: h,
- encode: p,
- toASCII: m,
- toUnicode: d
- }, "function" == typeof define && "object" == typeof define.amd && define.amd) define("punycode", function() {
- return v
- });
- else if (b && g)
- if (t.exports == b) g.exports = v;
- else
- for (j in v) v.hasOwnProperty(j) && (b[j] = v[j]);
- else n.punycode = v
- }(this)
- }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
- }, {}],
- 139: [function(e, t, r) {
- "use strict";
- function n(e, t) {
- return Object.prototype.hasOwnProperty.call(e, t)
- }
- t.exports = function(e, t, r, s) {
- t = t || "&", r = r || "=";
- var i = {};
- if ("string" != typeof e || 0 === e.length) return i;
- var a = /\+/g;
- e = e.split(t);
- var u = 1e3;
- s && "number" == typeof s.maxKeys && (u = s.maxKeys);
- var l = e.length;
- u > 0 && l > u && (l = u);
- for (var c = 0; l > c; ++c) {
- var f, h, p, d, m = e[c].replace(a, "%20"),
- b = m.indexOf(r);
- b >= 0 ? (f = m.substr(0, b), h = m.substr(b + 1)) : (f = m, h = ""), p = decodeURIComponent(f), d = decodeURIComponent(h), n(i, p) ? o(i[p]) ? i[p].push(d) : i[p] = [i[p], d] : i[p] = d
- }
- return i
- };
- var o = Array.isArray || function(e) {
- return "[object Array]" === Object.prototype.toString.call(e)
- }
- }, {}],
- 140: [function(e, t, r) {
- "use strict";
- function n(e, t) {
- if (e.map) return e.map(t);
- for (var r = [], n = 0; n < e.length; n++) r.push(t(e[n], n));
- return r
- }
- var o = function(e) {
- switch (typeof e) {
- case "string":
- return e;
- case "boolean":
- return e ? "true" : "false";
- case "number":
- return isFinite(e) ? e : "";
- default:
- return ""
- }
- };
- t.exports = function(e, t, r, a) {
- return t = t || "&", r = r || "=", null === e && (e = void 0), "object" == typeof e ? n(i(e), function(i) {
- var a = encodeURIComponent(o(i)) + r;
- return s(e[i]) ? n(e[i], function(e) {
- return a + encodeURIComponent(o(e))
- }).join(t) : a + encodeURIComponent(o(e[i]))
- }).join(t) : a ? encodeURIComponent(o(a)) + r + encodeURIComponent(o(e)) : ""
- };
- var s = Array.isArray || function(e) {
- return "[object Array]" === Object.prototype.toString.call(e)
- },
- i = Object.keys || function(e) {
- var t = [];
- for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.push(r);
- return t
- }
- }, {}],
- 141: [function(e, t, r) {
- "use strict";
- r.decode = r.parse = e("./decode"), r.encode = r.stringify = e("./encode")
- }, {
- "./decode": 139,
- "./encode": 140
- }],
- 142: [function(e, t, r) {
- function n() {
- this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null
- }
- function o(e, t, r) {
- if (e && l(e) && e instanceof n) return e;
- var o = new n;
- return o.parse(e, t, r), o
- }
- function s(e) {
- return u(e) && (e = o(e)), e instanceof n ? e.format() : n.prototype.format.call(e)
- }
- function i(e, t) {
- return o(e, !1, !0).resolve(t)
- }
- function a(e, t) {
- return e ? o(e, !1, !0).resolveObject(t) : t
- }
- function u(e) {
- return "string" == typeof e
- }
- function l(e) {
- return "object" == typeof e && null !== e
- }
- function c(e) {
- return null === e
- }
- function f(e) {
- return null == e
- }
- var h = e("punycode");
- r.parse = o, r.resolve = i, r.resolveObject = a, r.format = s, r.Url = n;
- var p = /^([a-z0-9.+-]+:)/i,
- d = /:[0-9]*$/,
- m = ["<", ">", '"', "`", " ", "\r", "\n", " "],
- b = ["{", "}", "|", "\\", "^", "`"].concat(m),
- g = ["'"].concat(b),
- y = ["%", "/", "?", ";", "#"].concat(g),
- v = ["/", "?", "#"],
- j = 255,
- $ = /^[a-z0-9A-Z_-]{0,63}$/,
- w = /^([a-z0-9A-Z_-]{0,63})(.*)$/,
- k = {
- javascript: !0,
- "javascript:": !0
- },
- _ = {
- javascript: !0,
- "javascript:": !0
- },
- x = {
- http: !0,
- https: !0,
- ftp: !0,
- gopher: !0,
- file: !0,
- "http:": !0,
- "https:": !0,
- "ftp:": !0,
- "gopher:": !0,
- "file:": !0
- },
- A = e("querystring");
- n.prototype.parse = function(e, t, r) {
- if (!u(e)) throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
- var n = e;
- n = n.trim();
- var o = p.exec(n);
- if (o) {
- o = o[0];
- var s = o.toLowerCase();
- this.protocol = s, n = n.substr(o.length)
- }
- if (r || o || n.match(/^\/\/[^@\/]+@[^@\/]+/)) {
- var i = "//" === n.substr(0, 2);
- !i || o && _[o] || (n = n.substr(2), this.slashes = !0)
- }
- if (!_[o] && (i || o && !x[o])) {
- for (var a = -1, l = 0; l < v.length; l++) {
- var c = n.indexOf(v[l]); - 1 !== c && (-1 === a || a > c) && (a = c)
- }
- var f, d;
- d = -1 === a ? n.lastIndexOf("@") : n.lastIndexOf("@", a), -1 !== d && (f = n.slice(0, d), n = n.slice(d + 1), this.auth = decodeURIComponent(f)), a = -1;
- for (var l = 0; l < y.length; l++) {
- var c = n.indexOf(y[l]); - 1 !== c && (-1 === a || a > c) && (a = c)
- } - 1 === a && (a = n.length), this.host = n.slice(0, a), n = n.slice(a), this.parseHost(), this.hostname = this.hostname || "";
- var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
- if (!m)
- for (var b = this.hostname.split(/\./), l = 0, O = b.length; O > l; l++) {
- var q = b[l];
- if (q && !q.match($)) {
- for (var P = "", E = 0, S = q.length; S > E; E++) P += q.charCodeAt(E) > 127 ? "x" : q[E];
- if (!P.match($)) {
- var I = b.slice(0, l),
- M = b.slice(l + 1),
- C = q.match(w);
- C && (I.push(C[1]), M.unshift(C[2])), M.length && (n = "/" + M.join(".") + n), this.hostname = I.join(".");
- break
- }
- }
- }
- if (this.hostname = this.hostname.length > j ? "" : this.hostname.toLowerCase(), !m) {
- for (var T = this.hostname.split("."), F = [], l = 0; l < T.length; ++l) {
- var R = T[l];
- F.push(R.match(/[^A-Za-z0-9_-]/) ? "xn--" + h.encode(R) : R)
- }
- this.hostname = F.join(".")
- }
- var z = this.port ? ":" + this.port : "",
- U = this.hostname || "";
- this.host = U + z, this.href += this.host, m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), "/" !== n[0] && (n = "/" + n))
- }
- if (!k[s])
- for (var l = 0, O = g.length; O > l; l++) {
- var N = g[l],
- L = encodeURIComponent(N);
- L === N && (L = escape(N)), n = n.split(N).join(L)
- }
- var W = n.indexOf("#"); - 1 !== W && (this.hash = n.substr(W), n = n.slice(0, W));
- var H = n.indexOf("?");
- if (-1 !== H ? (this.search = n.substr(H), this.query = n.substr(H + 1), t && (this.query = A.parse(this.query)), n = n.slice(0, H)) : t && (this.search = "", this.query = {}), n && (this.pathname = n), x[s] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
- var z = this.pathname || "",
- R = this.search || "";
- this.path = z + R
- }
- return this.href = this.format(), this
- }, n.prototype.format = function() {
- var e = this.auth || "";
- e && (e = encodeURIComponent(e), e = e.replace(/%3A/i, ":"), e += "@");
- var t = this.protocol || "",
- r = this.pathname || "",
- n = this.hash || "",
- o = !1,
- s = "";
- this.host ? o = e + this.host : this.hostname && (o = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"), this.port && (o += ":" + this.port)), this.query && l(this.query) && Object.keys(this.query).length && (s = A.stringify(this.query));
- var i = this.search || s && "?" + s || "";
- return t && ":" !== t.substr(-1) && (t += ":"), this.slashes || (!t || x[t]) && o !== !1 ? (o = "//" + (o || ""), r && "/" !== r.charAt(0) && (r = "/" + r)) : o || (o = ""), n && "#" !== n.charAt(0) && (n = "#" + n), i && "?" !== i.charAt(0) && (i = "?" + i), r = r.replace(/[?#]/g, function(e) {
- return encodeURIComponent(e)
- }), i = i.replace("#", "%23"), t + o + r + i + n
- }, n.prototype.resolve = function(e) {
- return this.resolveObject(o(e, !1, !0)).format()
- }, n.prototype.resolveObject = function(e) {
- if (u(e)) {
- var t = new n;
- t.parse(e, !1, !0), e = t
- }
- var r = new n;
- if (Object.keys(this).forEach(function(e) {
- r[e] = this[e]
- }, this), r.hash = e.hash, "" === e.href) return r.href = r.format(), r;
- if (e.slashes && !e.protocol) return Object.keys(e).forEach(function(t) {
- "protocol" !== t && (r[t] = e[t])
- }), x[r.protocol] && r.hostname && !r.pathname && (r.path = r.pathname = "/"), r.href = r.format(), r;
- if (e.protocol && e.protocol !== r.protocol) {
- if (!x[e.protocol]) return Object.keys(e).forEach(function(t) {
- r[t] = e[t]
- }), r.href = r.format(), r;
- if (r.protocol = e.protocol, e.host || _[e.protocol]) r.pathname = e.pathname;
- else {
- for (var o = (e.pathname || "").split("/"); o.length && !(e.host = o.shift()););
- e.host || (e.host = ""), e.hostname || (e.hostname = ""), "" !== o[0] && o.unshift(""), o.length < 2 && o.unshift(""), r.pathname = o.join("/")
- }
- if (r.search = e.search, r.query = e.query, r.host = e.host || "", r.auth = e.auth, r.hostname = e.hostname || e.host, r.port = e.port, r.pathname || r.search) {
- var s = r.pathname || "",
- i = r.search || "";
- r.path = s + i
- }
- return r.slashes = r.slashes || e.slashes, r.href = r.format(), r
- }
- var a = r.pathname && "/" === r.pathname.charAt(0),
- l = e.host || e.pathname && "/" === e.pathname.charAt(0),
- h = l || a || r.host && e.pathname,
- p = h,
- d = r.pathname && r.pathname.split("/") || [],
- o = e.pathname && e.pathname.split("/") || [],
- m = r.protocol && !x[r.protocol];
- if (m && (r.hostname = "", r.port = null, r.host && ("" === d[0] ? d[0] = r.host : d.unshift(r.host)), r.host = "", e.protocol && (e.hostname = null, e.port = null, e.host && ("" === o[0] ? o[0] = e.host : o.unshift(e.host)), e.host = null), h = h && ("" === o[0] || "" === d[0])), l) r.host = e.host || "" === e.host ? e.host : r.host, r.hostname = e.hostname || "" === e.hostname ? e.hostname : r.hostname, r.search = e.search, r.query = e.query, d = o;
- else if (o.length) d || (d = []), d.pop(), d = d.concat(o), r.search = e.search, r.query = e.query;
- else if (!f(e.search)) {
- if (m) {
- r.hostname = r.host = d.shift();
- var b = r.host && r.host.indexOf("@") > 0 ? r.host.split("@") : !1;
- b && (r.auth = b.shift(),
- r.host = r.hostname = b.shift())
- }
- return r.search = e.search, r.query = e.query, c(r.pathname) && c(r.search) || (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.href = r.format(), r
- }
- if (!d.length) return r.pathname = null, r.path = r.search ? "/" + r.search : null, r.href = r.format(), r;
- for (var g = d.slice(-1)[0], y = (r.host || e.host) && ("." === g || ".." === g) || "" === g, v = 0, j = d.length; j >= 0; j--) g = d[j], "." == g ? d.splice(j, 1) : ".." === g ? (d.splice(j, 1), v++) : v && (d.splice(j, 1), v--);
- if (!h && !p)
- for (; v--; v) d.unshift("..");
- !h || "" === d[0] || d[0] && "/" === d[0].charAt(0) || d.unshift(""), y && "/" !== d.join("/").substr(-1) && d.push("");
- var $ = "" === d[0] || d[0] && "/" === d[0].charAt(0);
- if (m) {
- r.hostname = r.host = $ ? "" : d.length ? d.shift() : "";
- var b = r.host && r.host.indexOf("@") > 0 ? r.host.split("@") : !1;
- b && (r.auth = b.shift(), r.host = r.hostname = b.shift())
- }
- return h = h || r.host && d.length, h && !$ && d.unshift(""), d.length ? r.pathname = d.join("/") : (r.pathname = null, r.path = null), c(r.pathname) && c(r.search) || (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.auth = e.auth || r.auth, r.slashes = r.slashes || e.slashes, r.href = r.format(), r
- }, n.prototype.parseHost = function() {
- var e = this.host,
- t = d.exec(e);
- t && (t = t[0], ":" !== t && (this.port = t.substr(1)), e = e.substr(0, e.length - t.length)), e && (this.hostname = e)
- }
- }, {
- punycode: 138,
- querystring: 141
- }],
- 143: [function(e, t, r) {
- t.exports = function() {
- function t(e) {
- return '"' + e.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\x08/g, "\\b").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\f/g, "\\f").replace(/\r/g, "\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g, escape) + '"'
- }
- var r = {
- parse: function(r, n) {
- function o(e) {
- $ > v || (v > $ && ($ = v, w = []), w.push(e))
- }
- function s() {
- var e, t, r;
- for (r = v, e = [], t = d(), null === t && (t = i()); null !== t;) e.push(t), t = d(), null === t && (t = i());
- return null !== e && (e = function(e, t) {
- return new _(t)
- }(r, e)), null === e && (v = r), e
- }
- function i() {
- var e, t, n, s, i, u;
- return i = v, u = v, 123 === r.charCodeAt(v) ? (e = "{", v++) : (e = null, 0 === j && o('"{"')), null !== e ? (t = a(), null !== t ? (n = l(), null !== n ? (125 === r.charCodeAt(v) ? (s = "}", v++) : (s = null, 0 === j && o('"}"')), null !== s ? e = [e, t, n, s] : (e = null, v = u)) : (e = null, v = u)) : (e = null, v = u)) : (e = null, v = u), null !== e && (e = function(e, t, r) {
- return x(t, r)
- }(i, e[1], e[2])), null === e && (v = i), e
- }
- function a() {
- var e;
- return /^[\/;:.?&+#]/.test(r.charAt(v)) ? (e = r.charAt(v), v++) : (e = null, 0 === j && o("[\\/;:.?&+#]")), null === e && (e = ""), e
- }
- function u() {
- var e;
- return "{/" === r.substr(v, 2) ? (e = "{/", v += 2) : (e = null, 0 === j && o('"{/"')), e
- }
- function l() {
- var e, t, n, s, i, a, u, l;
- if (i = v, a = v, e = c(), null !== e) {
- for (t = [], u = v, l = v, 44 === r.charCodeAt(v) ? (n = ",", v++) : (n = null, 0 === j && o('","')), null !== n ? (s = c(), null !== s ? n = [n, s] : (n = null, v = l)) : (n = null, v = l), null !== n && (n = function(e, t) {
- return t
- }(u, n[1])), null === n && (v = u); null !== n;) t.push(n), u = v, l = v, 44 === r.charCodeAt(v) ? (n = ",", v++) : (n = null, 0 === j && o('","')), null !== n ? (s = c(), null !== s ? n = [n, s] : (n = null, v = l)) : (n = null, v = l), null !== n && (n = function(e, t) {
- return t
- }(u, n[1])), null === n && (v = u);
- null !== t ? e = [e, t] : (e = null, v = a)
- } else e = null, v = a;
- return null !== e && (e = function(e, t, r) {
- return r.unshift(t), r
- }(i, e[0], e[1])), null === e && (v = i), e
- }
- function c() {
- var e, t, n, s, i;
- for (s = v, i = v, e = [], /^[a-zA-Z0-9_.%]/.test(r.charAt(v)) ? (t = r.charAt(v), v++) : (t = null, 0 === j && o("[a-zA-Z0-9_.%]")); null !== t;) e.push(t), /^[a-zA-Z0-9_.%]/.test(r.charAt(v)) ? (t = r.charAt(v), v++) : (t = null, 0 === j && o("[a-zA-Z0-9_.%]"));
- return null !== e ? (t = f(), null === t && (t = h()), t = null !== t ? t : "", null !== t ? (n = m(), n = null !== n ? n : "", null !== n ? e = [e, t, n] : (e = null, v = i)) : (e = null, v = i)) : (e = null, v = i), null !== e && (e = function(e, t, r, n) {
- return r = r || {}, {
- name: t.join(""),
- explode: r.listMarker,
- cut: r.cut,
- extended: n
- }
- }(s, e[0], e[1], e[2])), null === e && (v = s), e
- }
- function f() {
- var e, t;
- return t = v, e = p(), null !== e && (e = function(e, t) {
- return {
- cut: t
- }
- }(t, e)), null === e && (v = t), e
- }
- function h() {
- var e, t;
- return t = v, 42 === r.charCodeAt(v) ? (e = "*", v++) : (e = null, 0 === j && o('"*"')), null !== e && (e = function(e, t) {
- return {
- listMarker: t
- }
- }(t, e)), null === e && (v = t), e
- }
- function p() {
- var e, t, n, s, i;
- if (s = v, i = v, 58 === r.charCodeAt(v) ? (e = ":", v++) : (e = null, 0 === j && o('":"')), null !== e) {
- if (/^[0-9]/.test(r.charAt(v)) ? (n = r.charAt(v), v++) : (n = null, 0 === j && o("[0-9]")), null !== n)
- for (t = []; null !== n;) t.push(n), /^[0-9]/.test(r.charAt(v)) ? (n = r.charAt(v), v++) : (n = null, 0 === j && o("[0-9]"));
- else t = null;
- null !== t ? e = [e, t] : (e = null, v = i)
- } else e = null, v = i;
- return null !== e && (e = function(e, t) {
- return parseInt(t.join(""))
- }(s, e[1])), null === e && (v = s), e
- }
- function d() {
- var e, t, n;
- if (n = v, /^[^{]/.test(r.charAt(v)) ? (t = r.charAt(v), v++) : (t = null, 0 === j && o("[^{]")), null !== t)
- for (e = []; null !== t;) e.push(t), /^[^{]/.test(r.charAt(v)) ? (t = r.charAt(v), v++) : (t = null, 0 === j && o("[^{]"));
- else e = null;
- return null !== e && (e = function(e, t) {
- return t.join("")
- }(n, e)), null === e && (v = n), e
- }
- function m() {
- var e, t, n, s, i;
- if (s = v, i = v, 40 === r.charCodeAt(v) ? (e = "(", v++) : (e = null, 0 === j && o('"("')), null !== e) {
- if (/^[^)]/.test(r.charAt(v)) ? (n = r.charAt(v), v++) : (n = null, 0 === j && o("[^)]")), null !== n)
- for (t = []; null !== n;) t.push(n), /^[^)]/.test(r.charAt(v)) ? (n = r.charAt(v), v++) : (n = null, 0 === j && o("[^)]"));
- else t = null;
- null !== t ? (41 === r.charCodeAt(v) ? (n = ")", v++) : (n = null, 0 === j && o('")"')), null !== n ? e = [e, t, n] : (e = null, v = i)) : (e = null, v = i)
- } else e = null, v = i;
- return null !== e && (e = function(e, t) {
- return t.join("")
- }(s, e[1])), null === e && (v = s), e
- }
- function b(e) {
- e.sort();
- for (var t = null, r = [], n = 0; n < e.length; n++) e[n] !== t && (r.push(e[n]), t = e[n]);
- return r
- }
- function g() {
- for (var e = 1, t = 1, n = !1, o = 0; o < Math.max(v, $); o++) {
- var s = r.charAt(o);
- "\n" === s ? (n || e++, t = 1, n = !1) : "\r" === s || "\u2028" === s || "\u2029" === s ? (e++, t = 1, n = !0) : (t++, n = !1)
- }
- return {
- line: e,
- column: t
- }
- }
- var y = {
- uriTemplate: s,
- expression: i,
- op: a,
- pathExpression: u,
- paramList: l,
- param: c,
- cut: f,
- listMarker: h,
- substr: p,
- nonexpression: d,
- extension: m
- };
- if (void 0 !== n) {
- if (void 0 === y[n]) throw new Error("Invalid rule name: " + t(n) + ".")
- } else n = "uriTemplate";
- var v = 0,
- j = 0,
- $ = 0,
- w = [],
- k = e("./lib/classes"),
- _ = k.Template,
- x = k.expression,
- A = y[n]();
- if (null === A || v !== r.length) {
- var O = Math.max(v, $),
- q = O < r.length ? r.charAt(O) : null,
- P = g();
- throw new this.SyntaxError(b(w), q, O, P.line, P.column)
- }
- return A
- },
- toSource: function() {
- return this._source
- }
- };
- return r.SyntaxError = function(e, r, n, o, s) {
- function i(e, r) {
- var n, o;
- switch (e.length) {
- case 0:
- n = "end of input";
- break;
- case 1:
- n = e[0];
- break;
- default:
- n = e.slice(0, e.length - 1).join(", ") + " or " + e[e.length - 1]
- }
- return o = r ? t(r) : "end of input", "Expected " + n + " but " + o + " found."
- }
- this.name = "SyntaxError", this.expected = e, this.found = r, this.message = i(e, r), this.offset = n, this.line = o, this.column = s
- }, r.SyntaxError.prototype = Error.prototype, r
- }()
- }, {
- "./lib/classes": 144
- }],
- 144: [function(e, t, r) {
- (function() {
- var r, n, o, s, i, a, u, l, c, f, h, p, d, m, b, g, y, v, j, $ = function(e, t) {
- return function() {
- return e.apply(t, arguments)
- }
- },
- w = {}.hasOwnProperty,
- k = function(e, t) {
- function r() {
- this.constructor = e
- }
- for (var n in t) w.call(t, n) && (e[n] = t[n]);
- return r.prototype = t.prototype, e.prototype = new r, e.__super__ = t.prototype, e
- };
- h = e("./encoders"), f = f = function() {
- function e(e) {
- var t, r = this;
- this.expressions = [], this.prefix = "string" == typeof e[0] ? e.shift() : "", t = 0, e.forEach(function(e) {
- switch (typeof e) {
- case "object":
- return r.expressions[t++] = e;
- case "string":
- return r.expressions[t - 1].suffix = e
- }
- })
- }
- return e.prototype.expand = function(e) {
- return this.prefix + this.expressions.map(function(t) {
- return t.expand(e)
- }).join("")
- }, e.prototype.toString = function() {
- return this.prefix + this.expressions.join("")
- }, e.prototype.toJSON = function() {
- return this.toString()
- }, e
- }(), c = function() {
- function e(e) {
- this.params = e, this.explodeObject = $(this.explodeObject, this), this.explodeArray = $(this.explodeArray, this), this._expandPair = $(this._expandPair, this), this.stringifySingle = $(this.stringifySingle, this), this.encode = $(this.encode, this), null == this.params && (this.params = []), this.suffix = ""
- }
- var t;
- return e.prototype.first = "", e.prototype.sep = ",", e.prototype.named = !1, e.prototype.empty = "", e.prototype.allow = "U", e.prototype.encode = function(e) {
- return h[this.allow](e)
- }, e.prototype.stringifySingle = function(e, t) {
- var r, n, o;
- if (n = typeof t, "string" === n || "boolean" === n || "number" === n) return t = t.toString(), this.encode(t.substring(0, e.cut || t.length));
- if (Array.isArray(t)) {
- if (e.cut) throw new Error("Prefixed Values do not support lists. Check " + e.name);
- return t.map(this.encode).join(",")
- }
- if (e.cut) throw new Error("Prefixed Values do not support maps. Check " + e.name);
- return function() {
- var e;
- e = [];
- for (r in t) o = t[r], e.push([r, o].map(this.encode).join(","));
- return e
- }.call(this).join(",")
- }, e.prototype.expand = function(e) {
- var r, n, o = this;
- return r = t(this.params, e), n = r.map(function(e) {
- return o._expandPair.apply(o, e)
- }).join(this.sep), n ? this.first + n + this.suffix : this.empty && r.length ? this.empty + this.suffix : this.suffix
- }, t = function(e, t) {
- return e.map(function(e) {
- return [e, t[e.name]]
- }).filter(function(e) {
- var t, r, n;
- switch (r = e[1], typeof r) {
- case "undefined":
- return !1;
- case "object":
- Array.isArray(r) && r.length > 0;
- for (t in r)
- if (n = r[t]) return !0;
- return !1;
- default:
- return !0
- }
- })
- }, e.prototype._expandPair = function(e, t) {
- var r;
- return r = e.name, e.explode ? Array.isArray(t) ? this.explodeArray(e, t) : "string" == typeof t ? this.stringifySingle(e, t) : this.explodeObject(t) : this.stringifySingle(e, t)
- }, e.prototype.explodeArray = function(e, t) {
- return t.map(this.encode).join(this.sep)
- }, e.prototype.explodeObject = function(e) {
- var t, r, n, o, s, i;
- r = [];
- for (t in e)
- if (n = e[t], t = this.encode(t), Array.isArray(n))
- for (s = 0, i = n.length; i > s; s++) o = n[s], r.push([t, this.encode(o)]);
- else r.push([t, this.encode(n)]);
- return r.map(function(e) {
- return e.join("=")
- }).join(this.sep)
- }, e.prototype.toString = function() {
- var e;
- return e = this.params.map(function(e) {
- return e.name + e.explode
- }).join(","), "{" + this.first + e + "}" + this.suffix
- }, e.prototype.toJSON = function() {
- return this.toString()
- }, e
- }(), i = function(e) {
- function t() {
- return this.explodeArray = $(this.explodeArray, this), this.stringifySingle = $(this.stringifySingle, this), p = t.__super__.constructor.apply(this, arguments)
- }
- return k(t, e), t.prototype.stringifySingle = function(e, r) {
- return r = (r = t.__super__.stringifySingle.apply(this, arguments)) ? "=" + r : this.empty, "" + e.name + r
- }, t.prototype.explodeArray = function(e, t) {
- var r = this;
- return t.map(function(t) {
- return "" + e.name + "=" + r.encode(t)
- }).join(this.sep)
- }, t
- }(c), l = function(e) {
- function t() {
- return d = t.__super__.constructor.apply(this, arguments)
- }
- return k(t, e), t.prototype.encode = function(e) {
- return h["U+R"](e)
- }, t.prototype.toString = function() {
- return "{+" + t.__super__.toString.apply(this, arguments).substring(1)
- }, t
- }(c), o = function(e) {
- function t() {
- return m = t.__super__.constructor.apply(this, arguments)
- }
- return k(t, e), t.prototype.first = "#", t.prototype.empty = "#", t.prototype.encode = function(e) {
- return h["U+R"](e)
- }, t
- }(c), s = function(e) {
- function t() {
- return b = t.__super__.constructor.apply(this, arguments)
- }
- return k(t, e), t.prototype.first = ".", t.prototype.sep = ".", t.prototype.empty = ".", t
- }(c), u = function(e) {
- function t() {
- return g = t.__super__.constructor.apply(this, arguments)
- }
- return k(t, e), t.prototype.first = "/", t.prototype.sep = "/", t
- }(c), a = function(e) {
- function t() {
- return y = t.__super__.constructor.apply(this, arguments)
- }
- return k(t, e), t.prototype.first = ";", t.prototype.sep = ";", t
- }(i), n = function(e) {
- function t() {
- return v = t.__super__.constructor.apply(this, arguments)
- }
- return k(t, e), t.prototype.first = "?", t.prototype.sep = "&", t.prototype.empty = "=", t
- }(i), r = function(e) {
- function t() {
- return j = t.__super__.constructor.apply(this, arguments)
- }
- return k(t, e), t.prototype.first = "&", t
- }(n), t.exports = {
- Template: f,
- SimpleExpression: c,
- NamedExpression: i,
- ReservedExpression: l,
- FragmentExpression: o,
- LabelExpression: s,
- PathSegmentExpression: u,
- PathParamExpression: a,
- FormStartExpression: n,
- FormContinuationExpression: r,
- expression: function(e, t) {
- var i;
- return new(i = function() {
- switch (e) {
- case "":
- return c;
- case "+":
- return l;
- case "#":
- return o;
- case ".":
- return s;
- case "/":
- return u;
- case ";":
- return a;
- case "?":
- return n;
- case "&":
- return r
- }
- }())(t)
- }
- }
- }).call(this)
- }, {
- "./encoders": 145
- }],
- 145: [function(e, t, r) {
- (function() {
- var t;
- t = e("pct-encode"), r.U = t(/[^\w~.-]/g), r["U+R"] = t(/[^\w.~:\/\?#\[\]@!\$&'()*+,;=-]/g)
- }).call(this)
- }, {
- "pct-encode": 146
- }],
- 146: [function(e, t, r) {
- t.exports = function(e) {
- return e = e || /\W/g,
- function(t) {
- return t = String(t), t.replace(e, function(e) {
- var t = e[0].charCodeAt(0),
- r = [];
- return 128 > t ? r.push(t) : t >= 128 && 2048 > t ? (r.push(t >> 6 | 192), r.push(63 & t | 128)) : (r.push(t >> 12 | 224), r.push(t >> 6 & 63 | 128), r.push(63 & t | 128)), r.map(function(e) {
- return "%" + e.toString(16).toUpperCase()
- }).join("")
- })
- }
- }
- }, {}]
- }, {}, [4]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement