mirror of
https://github.com/lubuntu-team/lubuntu.me.git
synced 2025-02-23 16:21:07 +00:00
3727 lines
109 KiB
JavaScript
3727 lines
109 KiB
JavaScript
|
/******/ (function(modules) { // webpackBootstrap
|
||
|
/******/ // The module cache
|
||
|
/******/ var installedModules = {};
|
||
|
/******/
|
||
|
/******/ // The require function
|
||
|
/******/ function __webpack_require__(moduleId) {
|
||
|
/******/
|
||
|
/******/ // Check if module is in cache
|
||
|
/******/ if(installedModules[moduleId]) {
|
||
|
/******/ return installedModules[moduleId].exports;
|
||
|
/******/ }
|
||
|
/******/ // Create a new module (and put it into the cache)
|
||
|
/******/ var module = installedModules[moduleId] = {
|
||
|
/******/ i: moduleId,
|
||
|
/******/ l: false,
|
||
|
/******/ exports: {}
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // Execute the module function
|
||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
|
/******/
|
||
|
/******/ // Flag the module as loaded
|
||
|
/******/ module.l = true;
|
||
|
/******/
|
||
|
/******/ // Return the exports of the module
|
||
|
/******/ return module.exports;
|
||
|
/******/ }
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/ // expose the modules object (__webpack_modules__)
|
||
|
/******/ __webpack_require__.m = modules;
|
||
|
/******/
|
||
|
/******/ // expose the module cache
|
||
|
/******/ __webpack_require__.c = installedModules;
|
||
|
/******/
|
||
|
/******/ // define getter function for harmony exports
|
||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||
|
/******/ Object.defineProperty(exports, name, {
|
||
|
/******/ configurable: false,
|
||
|
/******/ enumerable: true,
|
||
|
/******/ get: getter
|
||
|
/******/ });
|
||
|
/******/ }
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||
|
/******/ __webpack_require__.n = function(module) {
|
||
|
/******/ var getter = module && module.__esModule ?
|
||
|
/******/ function getDefault() { return module['default']; } :
|
||
|
/******/ function getModuleExports() { return module; };
|
||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||
|
/******/ return getter;
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||
|
/******/
|
||
|
/******/ // __webpack_public_path__
|
||
|
/******/ __webpack_require__.p = "";
|
||
|
/******/
|
||
|
/******/ // Load entry module and return exports
|
||
|
/******/ return __webpack_require__(__webpack_require__.s = 48);
|
||
|
/******/ })
|
||
|
/************************************************************************/
|
||
|
/******/ ([
|
||
|
/* 0 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Copyright (C) 2014-2017 ServMask Inc.
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||
|
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||
|
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||
|
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||
|
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||
|
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||
|
*/
|
||
|
|
||
|
var $ = jQuery;
|
||
|
|
||
|
module.exports = {
|
||
|
random: function random(len) {
|
||
|
var text = '';
|
||
|
var possible = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||
|
|
||
|
for (var i = 0; i < len; i++) {
|
||
|
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||
|
}
|
||
|
|
||
|
return text;
|
||
|
},
|
||
|
form: function form(id) {
|
||
|
return $(id).serializeArray();
|
||
|
},
|
||
|
ucfirst: function ucfirst(text) {
|
||
|
return text.charAt(0).toUpperCase() + text.slice(1);
|
||
|
},
|
||
|
list: function list(input) {
|
||
|
// Convert object to list
|
||
|
if ($.isPlainObject(input)) {
|
||
|
var result = [];
|
||
|
var params = decodeURIComponent($.param(input)).split('&');
|
||
|
|
||
|
// Loop over params
|
||
|
$.each(params, function (index, item) {
|
||
|
var value = item.split('=');
|
||
|
|
||
|
// Add item
|
||
|
result.push({ name: value[0], value: value[1] });
|
||
|
});
|
||
|
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
return input;
|
||
|
},
|
||
|
json: function json(input) {
|
||
|
if ($.type(input) === 'string') {
|
||
|
var result = input.match(/{[\s\S]+}/);
|
||
|
if (result !== null) {
|
||
|
return result[0];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
/***/ }),
|
||
|
/* 1 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var store = __webpack_require__(30)('wks');
|
||
|
var uid = __webpack_require__(23);
|
||
|
var Symbol = __webpack_require__(2).Symbol;
|
||
|
var USE_SYMBOL = typeof Symbol == 'function';
|
||
|
|
||
|
var $exports = module.exports = function (name) {
|
||
|
return store[name] || (store[name] =
|
||
|
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
|
||
|
};
|
||
|
|
||
|
$exports.store = store;
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 2 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
||
|
var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
||
|
? window : typeof self != 'undefined' && self.Math == Math ? self
|
||
|
// eslint-disable-next-line no-new-func
|
||
|
: Function('return this')();
|
||
|
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 3 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var isObject = __webpack_require__(9);
|
||
|
module.exports = function (it) {
|
||
|
if (!isObject(it)) throw TypeError(it + ' is not an object!');
|
||
|
return it;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 4 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var dP = __webpack_require__(15);
|
||
|
var createDesc = __webpack_require__(32);
|
||
|
module.exports = __webpack_require__(10) ? function (object, key, value) {
|
||
|
return dP.f(object, key, createDesc(1, value));
|
||
|
} : function (object, key, value) {
|
||
|
object[key] = value;
|
||
|
return object;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 5 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Copyright (C) 2014-2017 ServMask Inc.
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||
|
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||
|
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||
|
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||
|
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||
|
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||
|
*/
|
||
|
|
||
|
var Util = __webpack_require__(0);
|
||
|
|
||
|
jQuery(document).ready(function ($) {
|
||
|
'use strict';
|
||
|
|
||
|
$('#ai1wm-report-problem-button').click(function (e) {
|
||
|
$(this).next('.ai1wm-report-problem-dialog').toggleClass('ai1wm-report-active');
|
||
|
|
||
|
e.preventDefault();
|
||
|
});
|
||
|
|
||
|
$('#ai1wm-report-cancel').click(function (e) {
|
||
|
$(this).closest('.ai1wm-report-problem-dialog').removeClass('ai1wm-report-active');
|
||
|
|
||
|
e.preventDefault();
|
||
|
});
|
||
|
|
||
|
$('#ai1wm-report-submit').click(function (event) {
|
||
|
event.preventDefault();
|
||
|
|
||
|
var submit_button = $(this);
|
||
|
var spinner = $(submit_button).next();
|
||
|
var email = $('.ai1wm-report-email').val();
|
||
|
var message = $('.ai1wm-report-message').val();
|
||
|
var terms = $('.ai1wm-report-terms').is(':checked');
|
||
|
|
||
|
$(submit_button).attr('disabled', true);
|
||
|
$(spinner).css('visibility', 'visible');
|
||
|
|
||
|
$.ajax({
|
||
|
url: ai1wm_report.ajax.url,
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
async: true,
|
||
|
data: {
|
||
|
'secret_key': ai1wm_report.secret_key,
|
||
|
'ai1wm_email': email,
|
||
|
'ai1wm_message': message,
|
||
|
'ai1wm_terms': +terms
|
||
|
},
|
||
|
dataFilter: function dataFilter(data, type) {
|
||
|
return Util.json(data);
|
||
|
},
|
||
|
success: function success(data) {
|
||
|
$(submit_button).attr('disabled', false);
|
||
|
$(spinner).css('visibility', 'hidden');
|
||
|
|
||
|
if (data.errors.length > 0) {
|
||
|
// Reset previous messages
|
||
|
$('.ai1wm-report-problem-dialog .ai1wm-message').remove();
|
||
|
|
||
|
var errorMessage = $('<div />').addClass('ai1wm-message ai1wm-error-message');
|
||
|
$.each(data.errors, function (key, value) {
|
||
|
errorMessage.append('<p>' + value + '</p>');
|
||
|
});
|
||
|
|
||
|
$('.ai1wm-report-problem-dialog').prepend(errorMessage);
|
||
|
} else {
|
||
|
var successMessage = $('<div />').addClass('ai1wm-message ai1wm-success-message').append('<p>Thanks for submitting your request!</p>');
|
||
|
$('.ai1wm-report-problem-dialog').html(successMessage);
|
||
|
|
||
|
// Hide message
|
||
|
setTimeout(function () {
|
||
|
$('.ai1wm-report-problem-dialog').removeClass('ai1wm-report-active');
|
||
|
}, 2000);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
|
||
|
/***/ }),
|
||
|
/* 6 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Copyright (C) 2014-2017 ServMask Inc.
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||
|
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||
|
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||
|
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||
|
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||
|
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||
|
*/
|
||
|
|
||
|
var Util = __webpack_require__(0);
|
||
|
|
||
|
jQuery(document).ready(function ($) {
|
||
|
'use strict';
|
||
|
|
||
|
// Reset feedback form
|
||
|
|
||
|
$('.ai1wm-feedback-type').attr('checked', false);
|
||
|
|
||
|
// Review
|
||
|
$('#ai1wm-feedback-type-link-1').click(function (e) {
|
||
|
var radio = $('#ai1wm-feedback-type-1');
|
||
|
if (radio.is(':checked')) {
|
||
|
radio.attr('checked', false);
|
||
|
e.preventDefault();
|
||
|
} else {
|
||
|
radio.attr('checked', true);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
// Improvement
|
||
|
$('#ai1wm-feedback-type-2').click(function () {
|
||
|
// Hide other options
|
||
|
$('#ai1wm-feedback-type-1, #ai1wm-feedback-type-3').closest('li').hide();
|
||
|
|
||
|
// change placeholder message
|
||
|
$('.ai1wm-feedback-form').find('.ai1wm-feedback-message').attr('placeholder', 'Leave plugin developers any feedback here');
|
||
|
|
||
|
// Show feedback form
|
||
|
$('.ai1wm-feedback-form').fadeIn();
|
||
|
});
|
||
|
|
||
|
// Help
|
||
|
$('#ai1wm-feedback-type-3').click(function () {
|
||
|
// Hide other options
|
||
|
$('#ai1wm-feedback-type-1, #ai1wm-feedback-type-2').closest('li').hide();
|
||
|
|
||
|
// change placeholder message
|
||
|
$('.ai1wm-feedback-form').find('.ai1wm-feedback-message').attr('placeholder', 'How may we help you?');
|
||
|
|
||
|
// Show feedback form
|
||
|
$('.ai1wm-feedback-form').fadeIn();
|
||
|
});
|
||
|
|
||
|
// Cancel feedback form
|
||
|
$('#ai1wm-feedback-cancel').click(function (e) {
|
||
|
$('.ai1wm-feedback-form').fadeOut(function () {
|
||
|
$('.ai1wm-feedback-type').attr('checked', false).closest('li').show();
|
||
|
});
|
||
|
e.preventDefault();
|
||
|
});
|
||
|
|
||
|
// Send feedback form
|
||
|
$('#ai1wm-feedback-submit').click(function (event) {
|
||
|
event.preventDefault();
|
||
|
|
||
|
var submit_button = $(this);
|
||
|
var spinner = $(submit_button).next();
|
||
|
var type = $('.ai1wm-feedback-type:checked').val();
|
||
|
var email = $('.ai1wm-feedback-email').val();
|
||
|
var message = $('.ai1wm-feedback-message').val();
|
||
|
var terms = $('.ai1wm-feedback-terms').is(':checked');
|
||
|
|
||
|
$(submit_button).attr('disabled', true);
|
||
|
$(spinner).css('visibility', 'visible');
|
||
|
|
||
|
$.ajax({
|
||
|
url: ai1wm_feedback.ajax.url,
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
async: true,
|
||
|
data: {
|
||
|
'secret_key': ai1wm_feedback.secret_key,
|
||
|
'ai1wm_type': type,
|
||
|
'ai1wm_email': email,
|
||
|
'ai1wm_message': message,
|
||
|
'ai1wm_terms': +terms
|
||
|
},
|
||
|
dataFilter: function dataFilter(data, type) {
|
||
|
return Util.json(data);
|
||
|
},
|
||
|
success: function success(data) {
|
||
|
$(submit_button).attr('disabled', false);
|
||
|
$(spinner).css('visibility', 'hidden');
|
||
|
|
||
|
if (data.errors.length > 0) {
|
||
|
// Reset previous messages
|
||
|
$('.ai1wm-feedback .ai1wm-message').remove();
|
||
|
|
||
|
var errorMessage = $('<div />').addClass('ai1wm-message ai1wm-error-message');
|
||
|
$.each(data.errors, function (key, value) {
|
||
|
errorMessage.append('<p>' + value + '</p>');
|
||
|
});
|
||
|
|
||
|
$('.ai1wm-feedback').prepend(errorMessage);
|
||
|
} else {
|
||
|
var successMessage = $('<div />').addClass('ai1wm-message ai1wm-success-message').append('<p>Thanks for submitting your feedback!</p>');
|
||
|
$('.ai1wm-feedback').html(successMessage);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
|
||
|
/***/ }),
|
||
|
/* 7 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
var g;
|
||
|
|
||
|
// This works in non-strict mode
|
||
|
g = (function() {
|
||
|
return this;
|
||
|
})();
|
||
|
|
||
|
try {
|
||
|
// This works if eval is allowed (see CSP)
|
||
|
g = g || Function("return this")() || (1,eval)("this");
|
||
|
} catch(e) {
|
||
|
// This works if the window reference is available
|
||
|
if(typeof window === "object")
|
||
|
g = window;
|
||
|
}
|
||
|
|
||
|
// g can still be undefined, but nothing to do about it...
|
||
|
// We return undefined, instead of nothing here, so it's
|
||
|
// easier to handle this case. if(!global) { ...}
|
||
|
|
||
|
module.exports = g;
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 8 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var global = __webpack_require__(2);
|
||
|
var hide = __webpack_require__(4);
|
||
|
var has = __webpack_require__(11);
|
||
|
var SRC = __webpack_require__(23)('src');
|
||
|
var TO_STRING = 'toString';
|
||
|
var $toString = Function[TO_STRING];
|
||
|
var TPL = ('' + $toString).split(TO_STRING);
|
||
|
|
||
|
__webpack_require__(12).inspectSource = function (it) {
|
||
|
return $toString.call(it);
|
||
|
};
|
||
|
|
||
|
(module.exports = function (O, key, val, safe) {
|
||
|
var isFunction = typeof val == 'function';
|
||
|
if (isFunction) has(val, 'name') || hide(val, 'name', key);
|
||
|
if (O[key] === val) return;
|
||
|
if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
|
||
|
if (O === global) {
|
||
|
O[key] = val;
|
||
|
} else if (!safe) {
|
||
|
delete O[key];
|
||
|
hide(O, key, val);
|
||
|
} else if (O[key]) {
|
||
|
O[key] = val;
|
||
|
} else {
|
||
|
hide(O, key, val);
|
||
|
}
|
||
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
||
|
})(Function.prototype, TO_STRING, function toString() {
|
||
|
return typeof this == 'function' && this[SRC] || $toString.call(this);
|
||
|
});
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 9 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
module.exports = function (it) {
|
||
|
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 10 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// Thank's IE8 for his funny defineProperty
|
||
|
module.exports = !__webpack_require__(31)(function () {
|
||
|
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
||
|
});
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 11 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
var hasOwnProperty = {}.hasOwnProperty;
|
||
|
module.exports = function (it, key) {
|
||
|
return hasOwnProperty.call(it, key);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 12 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
var core = module.exports = { version: '2.5.1' };
|
||
|
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 13 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
module.exports = {};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 14 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
var toString = {}.toString;
|
||
|
|
||
|
module.exports = function (it) {
|
||
|
return toString.call(it).slice(8, -1);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 15 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var anObject = __webpack_require__(3);
|
||
|
var IE8_DOM_DEFINE = __webpack_require__(53);
|
||
|
var toPrimitive = __webpack_require__(54);
|
||
|
var dP = Object.defineProperty;
|
||
|
|
||
|
exports.f = __webpack_require__(10) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
|
||
|
anObject(O);
|
||
|
P = toPrimitive(P, true);
|
||
|
anObject(Attributes);
|
||
|
if (IE8_DOM_DEFINE) try {
|
||
|
return dP(O, P, Attributes);
|
||
|
} catch (e) { /* empty */ }
|
||
|
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
|
||
|
if ('value' in Attributes) O[P] = Attributes.value;
|
||
|
return O;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 16 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// optional / simple context binding
|
||
|
var aFunction = __webpack_require__(17);
|
||
|
module.exports = function (fn, that, length) {
|
||
|
aFunction(fn);
|
||
|
if (that === undefined) return fn;
|
||
|
switch (length) {
|
||
|
case 1: return function (a) {
|
||
|
return fn.call(that, a);
|
||
|
};
|
||
|
case 2: return function (a, b) {
|
||
|
return fn.call(that, a, b);
|
||
|
};
|
||
|
case 3: return function (a, b, c) {
|
||
|
return fn.call(that, a, b, c);
|
||
|
};
|
||
|
}
|
||
|
return function (/* ...args */) {
|
||
|
return fn.apply(that, arguments);
|
||
|
};
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 17 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
module.exports = function (it) {
|
||
|
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
||
|
return it;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 18 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Copyright (C) 2014-2017 ServMask Inc.
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||
|
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||
|
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||
|
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||
|
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||
|
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||
|
*/
|
||
|
|
||
|
var Util = __webpack_require__(0),
|
||
|
Modal = __webpack_require__(19),
|
||
|
$ = jQuery;
|
||
|
|
||
|
var Import = function Import() {
|
||
|
var self = this;
|
||
|
|
||
|
// Set params
|
||
|
this.params = [];
|
||
|
|
||
|
// Set stop flag
|
||
|
this.stopImport = false;
|
||
|
|
||
|
// Set modal
|
||
|
this.modal = new Modal();
|
||
|
|
||
|
// Set confirm listener
|
||
|
this.modal.onConfirm = function (options) {
|
||
|
self.onConfirm(options);
|
||
|
};
|
||
|
|
||
|
// Set blogs listener
|
||
|
this.modal.onBlogs = function (options) {
|
||
|
self.onBlogs(options);
|
||
|
};
|
||
|
|
||
|
// Set stop listener
|
||
|
this.modal.onStop = function (options) {
|
||
|
self.onStop(options);
|
||
|
};
|
||
|
};
|
||
|
|
||
|
Import.prototype.setParams = function (params) {
|
||
|
this.params = Util.list(params);
|
||
|
};
|
||
|
|
||
|
Import.prototype.start = function (options, retries) {
|
||
|
var self = this;
|
||
|
var retries = retries || 0;
|
||
|
|
||
|
// Set stop flag
|
||
|
if (retries === 0) {
|
||
|
this.stopImport = false;
|
||
|
}
|
||
|
|
||
|
// Stop running import
|
||
|
if (this.stopImport) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// Initializing beforeunload event
|
||
|
$(window).bind('beforeunload', function () {
|
||
|
return 'You are about to stop importing your website, are you sure?';
|
||
|
});
|
||
|
|
||
|
// Set initial status
|
||
|
this.setStatus({ type: 'info', message: 'Preparing to import...' });
|
||
|
|
||
|
// Set params
|
||
|
var params = this.params.concat({ name: 'secret_key', value: ai1wm_import.secret_key });
|
||
|
|
||
|
// Set additional params
|
||
|
if (options) {
|
||
|
params = params.concat(Util.list(options));
|
||
|
}
|
||
|
|
||
|
// Import
|
||
|
$.ajax({
|
||
|
url: ai1wm_import.ajax.url,
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
data: params,
|
||
|
dataFilter: function dataFilter(data, type) {
|
||
|
return Util.json(data);
|
||
|
}
|
||
|
}).done(function () {
|
||
|
self.getStatus();
|
||
|
}).done(function (params) {
|
||
|
if (params) {
|
||
|
self.run(params);
|
||
|
}
|
||
|
}).fail(function () {
|
||
|
var timeout = retries * 1000;
|
||
|
if (retries >= 5) {
|
||
|
return self.setStatus({
|
||
|
type: 'error',
|
||
|
message: 'Unable to start the import. Refresh the page and try again'
|
||
|
});
|
||
|
}
|
||
|
|
||
|
retries++;
|
||
|
|
||
|
setTimeout(self.start.bind(self, options, retries), timeout);
|
||
|
});
|
||
|
};
|
||
|
|
||
|
Import.prototype.run = function (params, retries) {
|
||
|
var self = this;
|
||
|
var retries = retries || 0;
|
||
|
|
||
|
// Stop running import
|
||
|
if (this.stopImport) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// Import
|
||
|
$.ajax({
|
||
|
url: ai1wm_import.ajax.url,
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
data: params,
|
||
|
dataFilter: function dataFilter(data, type) {
|
||
|
return Util.json(data);
|
||
|
}
|
||
|
}).done(function (params) {
|
||
|
if (params) {
|
||
|
self.run(params);
|
||
|
}
|
||
|
}).fail(function () {
|
||
|
var timeout = retries * 1000;
|
||
|
|
||
|
retries++;
|
||
|
|
||
|
setTimeout(self.run.bind(self, params, retries), timeout);
|
||
|
});
|
||
|
};
|
||
|
|
||
|
Import.prototype.confirm = function (options, retries) {
|
||
|
var self = this;
|
||
|
var retries = retries || 0;
|
||
|
|
||
|
// Stop running import
|
||
|
if (this.stopImport) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// Set params
|
||
|
var params = this.params.concat({ name: 'secret_key', value: ai1wm_import.secret_key }).concat({ name: 'priority', value: 150 });
|
||
|
|
||
|
// Set additional params
|
||
|
if (options) {
|
||
|
params = params.concat(Util.list(options));
|
||
|
}
|
||
|
|
||
|
// Confirm
|
||
|
$.ajax({
|
||
|
url: ai1wm_import.ajax.url,
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
data: params,
|
||
|
dataFilter: function dataFilter(data, type) {
|
||
|
return Util.json(data);
|
||
|
}
|
||
|
}).done(function () {
|
||
|
self.getStatus();
|
||
|
}).done(function (params) {
|
||
|
if (params) {
|
||
|
self.run(params);
|
||
|
}
|
||
|
}).fail(function () {
|
||
|
var timeout = retries * 1000;
|
||
|
if (retries >= 5) {
|
||
|
return self.setStatus({
|
||
|
type: 'error',
|
||
|
message: 'Unable to confirm the import. Refresh the page and try again'
|
||
|
});
|
||
|
}
|
||
|
|
||
|
retries++;
|
||
|
|
||
|
setTimeout(self.confirm.bind(self, options, retries), timeout);
|
||
|
});
|
||
|
};
|
||
|
|
||
|
Import.prototype.blogs = function (options, retries) {
|
||
|
var self = this;
|
||
|
var retries = retries || 0;
|
||
|
|
||
|
// Stop running import
|
||
|
if (this.stopImport) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// Set params
|
||
|
var params = this.params.concat({ name: 'secret_key', value: ai1wm_import.secret_key }).concat({ name: 'priority', value: 150 });
|
||
|
|
||
|
// Set additional params
|
||
|
if (options) {
|
||
|
params = params.concat(Util.list(options));
|
||
|
}
|
||
|
|
||
|
// Blogs
|
||
|
$.ajax({
|
||
|
url: ai1wm_import.ajax.url,
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
data: params,
|
||
|
dataFilter: function dataFilter(data, type) {
|
||
|
return Util.json(data);
|
||
|
}
|
||
|
}).done(function () {
|
||
|
self.getStatus();
|
||
|
}).done(function (params) {
|
||
|
if (params) {
|
||
|
self.run(params);
|
||
|
}
|
||
|
}).fail(function () {
|
||
|
var timeout = retries * 1000;
|
||
|
if (retries >= 5) {
|
||
|
return self.setStatus({
|
||
|
type: 'error',
|
||
|
message: 'Unable to prepare blogs the import. Refresh the page and try again'
|
||
|
});
|
||
|
}
|
||
|
|
||
|
retries++;
|
||
|
|
||
|
setTimeout(self.blogs.bind(self, options, retries), timeout);
|
||
|
});
|
||
|
};
|
||
|
|
||
|
Import.prototype.clean = function (options, retries) {
|
||
|
var self = this;
|
||
|
var retries = retries || 0;
|
||
|
|
||
|
// Set stop flag
|
||
|
this.stopImport = true;
|
||
|
|
||
|
// Set initial status
|
||
|
this.setStatus({ type: 'info', message: 'Please wait, stopping the import...' });
|
||
|
|
||
|
// Set params
|
||
|
var params = this.params.concat({ name: 'secret_key', value: ai1wm_import.secret_key }).concat({ name: 'priority', value: 400 });
|
||
|
|
||
|
// Set additional params
|
||
|
if (options) {
|
||
|
params = params.concat(Util.list(options));
|
||
|
}
|
||
|
|
||
|
// Clean
|
||
|
$.ajax({
|
||
|
url: ai1wm_import.ajax.url,
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
data: params,
|
||
|
dataFilter: function dataFilter(data, type) {
|
||
|
return Util.json(data);
|
||
|
}
|
||
|
}).done(function () {
|
||
|
// Unbinding the beforeunload event when we stop importing
|
||
|
$(window).unbind('beforeunload');
|
||
|
|
||
|
// Destroy modal
|
||
|
self.modal.destroy();
|
||
|
}).fail(function () {
|
||
|
var timeout = retries * 1000;
|
||
|
if (retries >= 5) {
|
||
|
return self.setStatus({
|
||
|
type: 'error',
|
||
|
message: 'Unable to stop the import. Refresh the page and try again'
|
||
|
});
|
||
|
}
|
||
|
|
||
|
retries++;
|
||
|
|
||
|
setTimeout(self.clean.bind(self, options, retries), timeout);
|
||
|
});
|
||
|
};
|
||
|
|
||
|
Import.prototype.getStatus = function () {
|
||
|
var self = this;
|
||
|
|
||
|
// Stop getting status
|
||
|
if (this.stopImport) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
$.ajax({
|
||
|
url: ai1wm_import.status.url,
|
||
|
type: 'GET',
|
||
|
dataType: 'json',
|
||
|
cache: false,
|
||
|
dataFilter: function dataFilter(data, type) {
|
||
|
return Util.json(data);
|
||
|
}
|
||
|
}).done(function (params) {
|
||
|
if (params) {
|
||
|
self.setStatus(params);
|
||
|
|
||
|
// Next status
|
||
|
switch (params.type) {
|
||
|
case 'done':
|
||
|
case 'error':
|
||
|
// Unbinding the beforeunload event when any case is performed
|
||
|
$(window).unbind('beforeunload');
|
||
|
return;
|
||
|
|
||
|
case 'confirm':
|
||
|
case 'blogs':
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Import is not done yet, let's check status in 3 seconds
|
||
|
setTimeout(self.getStatus.bind(self), 3000);
|
||
|
}).fail(function () {
|
||
|
// Import is not done yet, let's check status in 3 seconds
|
||
|
setTimeout(self.getStatus.bind(self), 3000);
|
||
|
});;
|
||
|
};
|
||
|
|
||
|
Import.prototype.setStatus = function (params) {
|
||
|
this.modal.render(params);
|
||
|
};
|
||
|
|
||
|
Import.prototype.onConfirm = function (options) {
|
||
|
this.confirm(options);
|
||
|
};
|
||
|
|
||
|
Import.prototype.onBlogs = function (options) {
|
||
|
this.blogs(options);
|
||
|
};
|
||
|
|
||
|
Import.prototype.onStop = function (options) {
|
||
|
this.clean(options);
|
||
|
};
|
||
|
|
||
|
module.exports = Import;
|
||
|
|
||
|
/***/ }),
|
||
|
/* 19 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Copyright (C) 2014-2017 ServMask Inc.
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||
|
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||
|
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||
|
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||
|
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||
|
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||
|
*/
|
||
|
|
||
|
var $ = jQuery;
|
||
|
|
||
|
var Modal = function Modal() {
|
||
|
var self = this;
|
||
|
this.view = null;
|
||
|
|
||
|
// Error Modal
|
||
|
this.error = function (params) {
|
||
|
|
||
|
// Create the modal container
|
||
|
var container = $('<div></div>');
|
||
|
|
||
|
// Create section to hold title, message and action
|
||
|
var section = $('<section></section>');
|
||
|
|
||
|
// Create header to hold title
|
||
|
var header = $('<h1></h1>');
|
||
|
|
||
|
// Create paragraph to hold mesage
|
||
|
var message = $('<p></p>').html(params.message);
|
||
|
|
||
|
// Create action section
|
||
|
var action = $('<div></div>');
|
||
|
|
||
|
// Create title
|
||
|
var title = $('<span></span>').addClass('ai1wm-title-red').text('Unable to import');
|
||
|
|
||
|
// Create close button
|
||
|
var closeButton = $('<button type="button" class="ai1wm-button-red">Close</button>').on('click', function () {
|
||
|
self.destroy();
|
||
|
});
|
||
|
|
||
|
// Append close button
|
||
|
action.append(closeButton);
|
||
|
|
||
|
// Append title to section
|
||
|
header.append(title);
|
||
|
|
||
|
// Append header and message to section
|
||
|
section.append(header).append(message);
|
||
|
|
||
|
// Append section and action to container
|
||
|
container.append(section).append(action);
|
||
|
|
||
|
// Render modal
|
||
|
self.modal.html(container).show();
|
||
|
self.overlay.show();
|
||
|
};
|
||
|
|
||
|
// Progress Modal
|
||
|
this.progress = function (params) {
|
||
|
if (this.view === 'progress') {
|
||
|
|
||
|
// Update progressBarMeter
|
||
|
this.progress.progressBarMeter.width(params.percent + '%');
|
||
|
|
||
|
// Update progressBarPercent
|
||
|
this.progress.progressBarPercent.text(params.percent + '%');
|
||
|
} else {
|
||
|
|
||
|
// Create the modal container
|
||
|
var container = $('<div></div>');
|
||
|
|
||
|
// Create section to hold title, message and action
|
||
|
var section = $('<section></section>');
|
||
|
|
||
|
// Create header to hold progress bar
|
||
|
var header = $('<h1></h1>');
|
||
|
|
||
|
// Create paragraph to hold mesage
|
||
|
var message = $('<p></p>');
|
||
|
|
||
|
// Create action section
|
||
|
var action = $('<div></div>');
|
||
|
|
||
|
// Create progressBar
|
||
|
var progressBar = $('<span class="ai1wm-progress-bar"></span>');
|
||
|
|
||
|
// Create progressBarMeter
|
||
|
this.progress.progressBarMeter = $('<span class="ai1wm-progress-bar-meter"></span>').width(params.percent + '%');
|
||
|
|
||
|
// Create progressBarPercent
|
||
|
this.progress.progressBarPercent = $('<span class="ai1wm-progress-bar-percent">0%</span>').text(params.percent + '%');
|
||
|
|
||
|
// Create stop import
|
||
|
var stopButton = $('<button type="button" class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop import</button>').on('click', function () {
|
||
|
$(this).attr('disabled', 'disabled');
|
||
|
self.onStop();
|
||
|
});
|
||
|
|
||
|
// Append progress meter and progress percent
|
||
|
progressBar.append(this.progress.progressBarMeter).append(this.progress.progressBarPercent);
|
||
|
|
||
|
// Append stop button
|
||
|
action.append(stopButton);
|
||
|
|
||
|
// Append progress bar to section
|
||
|
header.append(progressBar);
|
||
|
|
||
|
// Append header to section
|
||
|
section.append(header);
|
||
|
|
||
|
// Append section and action to container
|
||
|
container.append(section).append(action);
|
||
|
|
||
|
// Render modal
|
||
|
self.modal.html(container).show();
|
||
|
self.overlay.show();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// Confirm Modal
|
||
|
this.confirm = function (params) {
|
||
|
|
||
|
// Create the modal container
|
||
|
var container = $('<div></div>');
|
||
|
|
||
|
// Create section to hold title, message and action
|
||
|
var section = $('<section></section>');
|
||
|
|
||
|
// Create header to hold warning
|
||
|
var header = $('<h1></h1>');
|
||
|
|
||
|
// Create paragraph to hold mesage
|
||
|
var message = $('<p class="ai1wm-import-modal-content"></p>').html(params.message);
|
||
|
|
||
|
// Create action section
|
||
|
var action = $('<div class="ai1wm-import-modal-actions"></div>');
|
||
|
|
||
|
// Create warning
|
||
|
var warning = $('<span class="ai1wm-icon-notification"></span>');
|
||
|
|
||
|
// Create cancel button
|
||
|
var cancelButton = $('<button type="button" class="ai1wm-button-gray">Cancel</button>').on('click', function () {
|
||
|
$(this).attr('disabled', 'disabled');
|
||
|
self.onStop();
|
||
|
});
|
||
|
|
||
|
// Create confirm button
|
||
|
var confirmButton = $('<button type="button" class="ai1wm-button-green">Proceed ></button>').on('click', function () {
|
||
|
$(this).attr('disabled', 'disabled');
|
||
|
self.onConfirm();
|
||
|
});
|
||
|
|
||
|
// Append cancel button
|
||
|
action.append(cancelButton);
|
||
|
|
||
|
// Append confirm button
|
||
|
action.append(confirmButton);
|
||
|
|
||
|
// Append warning to section
|
||
|
header.append(warning);
|
||
|
|
||
|
// Append header and message to section
|
||
|
section.append(header).append(message);
|
||
|
|
||
|
// Append section and action to container
|
||
|
container.append(section).append(action);
|
||
|
|
||
|
// Render modal
|
||
|
self.modal.html(container).show();
|
||
|
self.overlay.show();
|
||
|
};
|
||
|
|
||
|
// Blogs Modal
|
||
|
this.blogs = function (params) {
|
||
|
|
||
|
// Create the modal container
|
||
|
var container = $('<form></form>');
|
||
|
|
||
|
// Create section to hold title, message and action
|
||
|
var section = $('<section></section>');
|
||
|
|
||
|
// Create header to hold title
|
||
|
var header = $('<h1></h1>');
|
||
|
|
||
|
// Create paragraph to hold mesage
|
||
|
var message = $('<p></p>').html(params.message);
|
||
|
|
||
|
// Create action section
|
||
|
var action = $('<div></div>');
|
||
|
|
||
|
// Create title
|
||
|
var title = $('<span></span>').addClass('ai1wm-title-grey').text(params.title);
|
||
|
|
||
|
// Create continue button
|
||
|
var continueButton = $('<button type="button" class="ai1wm-button-green">Continue</button>').on('click', function () {
|
||
|
$(this).attr('disabled', 'disabled');
|
||
|
self.onBlogs($(this).closest('form').serializeArray());
|
||
|
});
|
||
|
|
||
|
// Append continue button
|
||
|
action.append(continueButton);
|
||
|
|
||
|
// Append title to section
|
||
|
header.append(title);
|
||
|
|
||
|
// Append header and message to section
|
||
|
section.append(header).append(message);
|
||
|
|
||
|
// Append section and action to container
|
||
|
container.append(section).append(action);
|
||
|
|
||
|
// Render modal
|
||
|
self.modal.html(container).show();
|
||
|
self.overlay.show();
|
||
|
};
|
||
|
|
||
|
// Info Modal
|
||
|
this.info = function (params) {
|
||
|
|
||
|
// Create the modal container
|
||
|
var container = $('<div></div>');
|
||
|
|
||
|
// Create section to hold title, message and action
|
||
|
var section = $('<section></section>');
|
||
|
|
||
|
// Create header to hold loader
|
||
|
var header = $('<h1></h1>');
|
||
|
|
||
|
// Create paragraph to hold mesage
|
||
|
var message = $('<p></p>').html(params.message);
|
||
|
|
||
|
// Create action section
|
||
|
var action = $('<div></div>');
|
||
|
|
||
|
// Create loader
|
||
|
var loader = $('<span class="ai1wm-loader"></span>');
|
||
|
|
||
|
// Create stop import
|
||
|
var stopButton = $('<button type="button" class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop import</button>').attr('disabled', 'disabled');
|
||
|
|
||
|
// Append stop button
|
||
|
action.append(stopButton);
|
||
|
|
||
|
// Append loader to header
|
||
|
header.append(loader);
|
||
|
|
||
|
// Append header and message to section
|
||
|
section.append(header).append(message);
|
||
|
|
||
|
// Append section and action to container
|
||
|
container.append(section).append(action);
|
||
|
|
||
|
// Render modal
|
||
|
self.modal.html(container).show();
|
||
|
self.overlay.show();
|
||
|
};
|
||
|
|
||
|
// Done Modal
|
||
|
this.done = function (params) {
|
||
|
|
||
|
// Create the modal container
|
||
|
var container = $('<div></div>');
|
||
|
|
||
|
// Create section to hold title, message and action
|
||
|
var section = $('<section></section>');
|
||
|
|
||
|
// Create header to hold title
|
||
|
var header = $('<h1></h1>');
|
||
|
|
||
|
// Create paragraph to hold mesage
|
||
|
var message = $('<p></p>').html(params.message);
|
||
|
|
||
|
// Create action section
|
||
|
var action = $('<div></div>');
|
||
|
|
||
|
// Create title
|
||
|
var title = $('<span></span>').addClass('ai1wm-title-green').text(params.title);
|
||
|
|
||
|
// Create close button
|
||
|
var closeButton = $('<button type="button" class="ai1wm-button-red">Close</button>').on('click', function () {
|
||
|
self.destroy();
|
||
|
});
|
||
|
|
||
|
// Append close button
|
||
|
action.append(closeButton);
|
||
|
|
||
|
// Append title to section
|
||
|
header.append(title);
|
||
|
|
||
|
// Append header and message to section
|
||
|
section.append(header).append(message);
|
||
|
|
||
|
// Append section and action to container
|
||
|
container.append(section).append(action);
|
||
|
|
||
|
// Render modal
|
||
|
self.modal.html(container).show();
|
||
|
self.overlay.show();
|
||
|
};
|
||
|
|
||
|
// Create the overlay
|
||
|
this.overlay = $('<div class="ai1wm-overlay"></div>');
|
||
|
|
||
|
// Create the modal container
|
||
|
this.modal = $('<div class="ai1wm-modal-container"></div>');
|
||
|
|
||
|
$('body').append(this.overlay) // Append overlay to body
|
||
|
.append(this.modal); // Append modal to body
|
||
|
};
|
||
|
|
||
|
Modal.prototype.render = function (params) {
|
||
|
|
||
|
// Show modal
|
||
|
switch (params.type) {
|
||
|
case 'error':
|
||
|
this.error(params);
|
||
|
break;
|
||
|
|
||
|
case 'confirm':
|
||
|
this.confirm(params);
|
||
|
break;
|
||
|
|
||
|
case 'blogs':
|
||
|
this.blogs(params);
|
||
|
break;
|
||
|
|
||
|
case 'progress':
|
||
|
this.progress(params);
|
||
|
break;
|
||
|
|
||
|
case 'info':
|
||
|
this.info(params);
|
||
|
break;
|
||
|
|
||
|
case 'done':
|
||
|
this.done(params);
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
this.view = params.type;
|
||
|
};
|
||
|
|
||
|
Modal.prototype.destroy = function () {
|
||
|
this.modal.hide();
|
||
|
this.overlay.hide();
|
||
|
};
|
||
|
|
||
|
module.exports = Modal;
|
||
|
|
||
|
/***/ }),
|
||
|
/* 20 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Copyright (C) 2014-2017 ServMask Inc.
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||
|
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||
|
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||
|
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||
|
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||
|
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||
|
*/
|
||
|
|
||
|
var Util = __webpack_require__(0),
|
||
|
Dialog = __webpack_require__(21);
|
||
|
|
||
|
var Extensions = {
|
||
|
's3': 'Amazon S3 Extension',
|
||
|
'url': 'URL Extension',
|
||
|
'ftp': 'FTP Extension',
|
||
|
'gdrive': 'Google Drive Extension',
|
||
|
'dropbox': 'Dropbox Extension'
|
||
|
};
|
||
|
|
||
|
window.Ai1wmExportController = function (provider) {
|
||
|
this._export = {};
|
||
|
this._provider = provider;
|
||
|
};
|
||
|
|
||
|
window.Ai1wmExportController.prototype.start = function () {
|
||
|
new Dialog('<strong>All in One WP Migration</strong> is not compatible with current version of ' + '<strong>' + Extensions[this._provider] + '</strong>. Please contact ' + '<a href="mailto:support@servmask.com">support@servmask.com</a> for more details.');
|
||
|
};
|
||
|
|
||
|
window.Ai1wmImportController = function (provider) {
|
||
|
this._import = {};
|
||
|
this._provider = provider;
|
||
|
};
|
||
|
|
||
|
window.Ai1wmImportController.prototype.init = function () {};
|
||
|
|
||
|
window.Ai1wmImportController.prototype.download = function () {
|
||
|
new Dialog('<strong>All in One WP Migration</strong> is not compatible with current version of ' + '<strong>' + Extensions[this._provider] + '</strong>. Please contact ' + '<a href="mailto:support@servmask.com">support@servmask.com</a> for more details.');
|
||
|
};
|
||
|
|
||
|
jQuery(document).ready(function ($) {
|
||
|
'use strict';
|
||
|
|
||
|
// Box extension
|
||
|
|
||
|
$('#ai1wmbe-import-file-cancel').attr('type', 'button');
|
||
|
$('#ai1wmbe-import-file').attr('type', 'button');
|
||
|
|
||
|
// Dropbox extension
|
||
|
$('#ai1wmde-import-file-cancel').attr('type', 'button');
|
||
|
$('#ai1wmde-import-file').attr('type', 'button');
|
||
|
|
||
|
// FTP extension
|
||
|
$('#ai1wmfe-import-file-cancel').attr('type', 'button');
|
||
|
$('#ai1wmfe-import-file').attr('type', 'button');
|
||
|
|
||
|
// Google Drive extension
|
||
|
$('#ai1wmge-import-file-cancel').attr('type', 'button');
|
||
|
$('#ai1wmge-import-file').attr('type', 'button');
|
||
|
|
||
|
// OneDrive extension
|
||
|
$('#ai1wmoe-import-file-cancel').attr('type', 'button');
|
||
|
$('#ai1wmoe-import-file').attr('type', 'button');
|
||
|
|
||
|
// Amazon S3 extension
|
||
|
$('#ai1wmse-import-file-cancel').attr('type', 'button');
|
||
|
$('#ai1wmse-import-file').attr('type', 'button');
|
||
|
|
||
|
// URL extension
|
||
|
$('#ai1wmle-import-file-cancel').attr('type', 'button');
|
||
|
$('#ai1wmle-import-file').attr('type', 'button');
|
||
|
});
|
||
|
|
||
|
/***/ }),
|
||
|
/* 21 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Copyright (C) 2014-2017 ServMask Inc.
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||
|
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||
|
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||
|
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||
|
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||
|
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||
|
*/
|
||
|
|
||
|
var $ = jQuery;
|
||
|
|
||
|
var Dialog = function Dialog(text) {
|
||
|
var self = this;
|
||
|
|
||
|
// Create the overlay
|
||
|
this.overlay = $('<div class="ai1wm-overlay"></div>');
|
||
|
|
||
|
// Create the modal container
|
||
|
this.container = $('<div></div>');
|
||
|
|
||
|
// Create the modal container
|
||
|
this.modal = $('<div class="ai1wm-modal-container"></div>');
|
||
|
|
||
|
// Create section to hold title, message and action
|
||
|
this.section = $('<section></section>');
|
||
|
|
||
|
// Create paragraph to hold mesage
|
||
|
this.message = $('<p></p>').addClass('ai1wm-dialog-message').html(text);
|
||
|
|
||
|
// Create action section
|
||
|
this.action = $('<div></div>');
|
||
|
|
||
|
// Create close button
|
||
|
this.closeButton = $('<button type="button" class="ai1wm-button-red">Close</button>').on('click', function () {
|
||
|
self.modal.hide();
|
||
|
self.overlay.hide();
|
||
|
});
|
||
|
|
||
|
// Append close button
|
||
|
this.action.append(this.closeButton);
|
||
|
|
||
|
// Append message to section
|
||
|
this.section.append(this.message);
|
||
|
|
||
|
// Append section and action to container
|
||
|
this.container.append(this.section).append(this.action);
|
||
|
|
||
|
// Render modal
|
||
|
this.modal.html(this.container).show();
|
||
|
this.overlay.show();
|
||
|
|
||
|
$('body').append(this.overlay).append(this.modal);
|
||
|
};
|
||
|
|
||
|
module.exports = Dialog;
|
||
|
|
||
|
/***/ }),
|
||
|
/* 22 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// getting tag from 19.1.3.6 Object.prototype.toString()
|
||
|
var cof = __webpack_require__(14);
|
||
|
var TAG = __webpack_require__(1)('toStringTag');
|
||
|
// ES3 wrong here
|
||
|
var ARG = cof(function () { return arguments; }()) == 'Arguments';
|
||
|
|
||
|
// fallback for IE11 Script Access Denied error
|
||
|
var tryGet = function (it, key) {
|
||
|
try {
|
||
|
return it[key];
|
||
|
} catch (e) { /* empty */ }
|
||
|
};
|
||
|
|
||
|
module.exports = function (it) {
|
||
|
var O, T, B;
|
||
|
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
||
|
// @@toStringTag case
|
||
|
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
|
||
|
// builtinTag case
|
||
|
: ARG ? cof(O)
|
||
|
// ES3 arguments fallback
|
||
|
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 23 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
var id = 0;
|
||
|
var px = Math.random();
|
||
|
module.exports = function (key) {
|
||
|
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 24 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var isObject = __webpack_require__(9);
|
||
|
var document = __webpack_require__(2).document;
|
||
|
// typeof document.createElement is 'object' in old IE
|
||
|
var is = isObject(document) && isObject(document.createElement);
|
||
|
module.exports = function (it) {
|
||
|
return is ? document.createElement(it) : {};
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 25 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
// 7.1.4 ToInteger
|
||
|
var ceil = Math.ceil;
|
||
|
var floor = Math.floor;
|
||
|
module.exports = function (it) {
|
||
|
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 26 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
// 7.2.1 RequireObjectCoercible(argument)
|
||
|
module.exports = function (it) {
|
||
|
if (it == undefined) throw TypeError("Can't call method on " + it);
|
||
|
return it;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 27 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// to indexed object, toObject with fallback for non-array-like ES3 strings
|
||
|
var IObject = __webpack_require__(61);
|
||
|
var defined = __webpack_require__(26);
|
||
|
module.exports = function (it) {
|
||
|
return IObject(defined(it));
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 28 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var shared = __webpack_require__(30)('keys');
|
||
|
var uid = __webpack_require__(23);
|
||
|
module.exports = function (key) {
|
||
|
return shared[key] || (shared[key] = uid(key));
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 29 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var def = __webpack_require__(15).f;
|
||
|
var has = __webpack_require__(11);
|
||
|
var TAG = __webpack_require__(1)('toStringTag');
|
||
|
|
||
|
module.exports = function (it, tag, stat) {
|
||
|
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 30 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var global = __webpack_require__(2);
|
||
|
var SHARED = '__core-js_shared__';
|
||
|
var store = global[SHARED] || (global[SHARED] = {});
|
||
|
module.exports = function (key) {
|
||
|
return store[key] || (store[key] = {});
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 31 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
module.exports = function (exec) {
|
||
|
try {
|
||
|
return !!exec();
|
||
|
} catch (e) {
|
||
|
return true;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 32 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
module.exports = function (bitmap, value) {
|
||
|
return {
|
||
|
enumerable: !(bitmap & 1),
|
||
|
configurable: !(bitmap & 2),
|
||
|
writable: !(bitmap & 4),
|
||
|
value: value
|
||
|
};
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 33 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
var LIBRARY = __webpack_require__(34);
|
||
|
var $export = __webpack_require__(35);
|
||
|
var redefine = __webpack_require__(8);
|
||
|
var hide = __webpack_require__(4);
|
||
|
var has = __webpack_require__(11);
|
||
|
var Iterators = __webpack_require__(13);
|
||
|
var $iterCreate = __webpack_require__(57);
|
||
|
var setToStringTag = __webpack_require__(29);
|
||
|
var getPrototypeOf = __webpack_require__(64);
|
||
|
var ITERATOR = __webpack_require__(1)('iterator');
|
||
|
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
|
||
|
var FF_ITERATOR = '@@iterator';
|
||
|
var KEYS = 'keys';
|
||
|
var VALUES = 'values';
|
||
|
|
||
|
var returnThis = function () { return this; };
|
||
|
|
||
|
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
|
||
|
$iterCreate(Constructor, NAME, next);
|
||
|
var getMethod = function (kind) {
|
||
|
if (!BUGGY && kind in proto) return proto[kind];
|
||
|
switch (kind) {
|
||
|
case KEYS: return function keys() { return new Constructor(this, kind); };
|
||
|
case VALUES: return function values() { return new Constructor(this, kind); };
|
||
|
} return function entries() { return new Constructor(this, kind); };
|
||
|
};
|
||
|
var TAG = NAME + ' Iterator';
|
||
|
var DEF_VALUES = DEFAULT == VALUES;
|
||
|
var VALUES_BUG = false;
|
||
|
var proto = Base.prototype;
|
||
|
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
|
||
|
var $default = $native || getMethod(DEFAULT);
|
||
|
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
|
||
|
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
|
||
|
var methods, key, IteratorPrototype;
|
||
|
// Fix native
|
||
|
if ($anyNative) {
|
||
|
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
|
||
|
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
|
||
|
// Set @@toStringTag to native iterators
|
||
|
setToStringTag(IteratorPrototype, TAG, true);
|
||
|
// fix for some old engines
|
||
|
if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
|
||
|
}
|
||
|
}
|
||
|
// fix Array#{values, @@iterator}.name in V8 / FF
|
||
|
if (DEF_VALUES && $native && $native.name !== VALUES) {
|
||
|
VALUES_BUG = true;
|
||
|
$default = function values() { return $native.call(this); };
|
||
|
}
|
||
|
// Define iterator
|
||
|
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
|
||
|
hide(proto, ITERATOR, $default);
|
||
|
}
|
||
|
// Plug for library
|
||
|
Iterators[NAME] = $default;
|
||
|
Iterators[TAG] = returnThis;
|
||
|
if (DEFAULT) {
|
||
|
methods = {
|
||
|
values: DEF_VALUES ? $default : getMethod(VALUES),
|
||
|
keys: IS_SET ? $default : getMethod(KEYS),
|
||
|
entries: $entries
|
||
|
};
|
||
|
if (FORCED) for (key in methods) {
|
||
|
if (!(key in proto)) redefine(proto, key, methods[key]);
|
||
|
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
|
||
|
}
|
||
|
return methods;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 34 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
module.exports = false;
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 35 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var global = __webpack_require__(2);
|
||
|
var core = __webpack_require__(12);
|
||
|
var hide = __webpack_require__(4);
|
||
|
var redefine = __webpack_require__(8);
|
||
|
var ctx = __webpack_require__(16);
|
||
|
var PROTOTYPE = 'prototype';
|
||
|
|
||
|
var $export = function (type, name, source) {
|
||
|
var IS_FORCED = type & $export.F;
|
||
|
var IS_GLOBAL = type & $export.G;
|
||
|
var IS_STATIC = type & $export.S;
|
||
|
var IS_PROTO = type & $export.P;
|
||
|
var IS_BIND = type & $export.B;
|
||
|
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
|
||
|
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
|
||
|
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
|
||
|
var key, own, out, exp;
|
||
|
if (IS_GLOBAL) source = name;
|
||
|
for (key in source) {
|
||
|
// contains in native
|
||
|
own = !IS_FORCED && target && target[key] !== undefined;
|
||
|
// export native or passed
|
||
|
out = (own ? target : source)[key];
|
||
|
// bind timers to global for call from export context
|
||
|
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
|
||
|
// extend global
|
||
|
if (target) redefine(target, key, out, type & $export.U);
|
||
|
// export
|
||
|
if (exports[key] != out) hide(exports, key, exp);
|
||
|
if (IS_PROTO && expProto[key] != out) expProto[key] = out;
|
||
|
}
|
||
|
};
|
||
|
global.core = core;
|
||
|
// type bitmap
|
||
|
$export.F = 1; // forced
|
||
|
$export.G = 2; // global
|
||
|
$export.S = 4; // static
|
||
|
$export.P = 8; // proto
|
||
|
$export.B = 16; // bind
|
||
|
$export.W = 32; // wrap
|
||
|
$export.U = 64; // safe
|
||
|
$export.R = 128; // real proto method for `library`
|
||
|
module.exports = $export;
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 36 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
|
||
|
var $keys = __webpack_require__(60);
|
||
|
var enumBugKeys = __webpack_require__(38);
|
||
|
|
||
|
module.exports = Object.keys || function keys(O) {
|
||
|
return $keys(O, enumBugKeys);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 37 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// 7.1.15 ToLength
|
||
|
var toInteger = __webpack_require__(25);
|
||
|
var min = Math.min;
|
||
|
module.exports = function (it) {
|
||
|
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 38 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
// IE 8- don't enum bug keys
|
||
|
module.exports = (
|
||
|
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
||
|
).split(',');
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 39 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var document = __webpack_require__(2).document;
|
||
|
module.exports = document && document.documentElement;
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 40 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var ctx = __webpack_require__(16);
|
||
|
var invoke = __webpack_require__(77);
|
||
|
var html = __webpack_require__(39);
|
||
|
var cel = __webpack_require__(24);
|
||
|
var global = __webpack_require__(2);
|
||
|
var process = global.process;
|
||
|
var setTask = global.setImmediate;
|
||
|
var clearTask = global.clearImmediate;
|
||
|
var MessageChannel = global.MessageChannel;
|
||
|
var Dispatch = global.Dispatch;
|
||
|
var counter = 0;
|
||
|
var queue = {};
|
||
|
var ONREADYSTATECHANGE = 'onreadystatechange';
|
||
|
var defer, channel, port;
|
||
|
var run = function () {
|
||
|
var id = +this;
|
||
|
// eslint-disable-next-line no-prototype-builtins
|
||
|
if (queue.hasOwnProperty(id)) {
|
||
|
var fn = queue[id];
|
||
|
delete queue[id];
|
||
|
fn();
|
||
|
}
|
||
|
};
|
||
|
var listener = function (event) {
|
||
|
run.call(event.data);
|
||
|
};
|
||
|
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
||
|
if (!setTask || !clearTask) {
|
||
|
setTask = function setImmediate(fn) {
|
||
|
var args = [];
|
||
|
var i = 1;
|
||
|
while (arguments.length > i) args.push(arguments[i++]);
|
||
|
queue[++counter] = function () {
|
||
|
// eslint-disable-next-line no-new-func
|
||
|
invoke(typeof fn == 'function' ? fn : Function(fn), args);
|
||
|
};
|
||
|
defer(counter);
|
||
|
return counter;
|
||
|
};
|
||
|
clearTask = function clearImmediate(id) {
|
||
|
delete queue[id];
|
||
|
};
|
||
|
// Node.js 0.8-
|
||
|
if (__webpack_require__(14)(process) == 'process') {
|
||
|
defer = function (id) {
|
||
|
process.nextTick(ctx(run, id, 1));
|
||
|
};
|
||
|
// Sphere (JS game engine) Dispatch API
|
||
|
} else if (Dispatch && Dispatch.now) {
|
||
|
defer = function (id) {
|
||
|
Dispatch.now(ctx(run, id, 1));
|
||
|
};
|
||
|
// Browsers with MessageChannel, includes WebWorkers
|
||
|
} else if (MessageChannel) {
|
||
|
channel = new MessageChannel();
|
||
|
port = channel.port2;
|
||
|
channel.port1.onmessage = listener;
|
||
|
defer = ctx(port.postMessage, port, 1);
|
||
|
// Browsers with postMessage, skip WebWorkers
|
||
|
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
|
||
|
} else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
|
||
|
defer = function (id) {
|
||
|
global.postMessage(id + '', '*');
|
||
|
};
|
||
|
global.addEventListener('message', listener, false);
|
||
|
// IE8-
|
||
|
} else if (ONREADYSTATECHANGE in cel('script')) {
|
||
|
defer = function (id) {
|
||
|
html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
|
||
|
html.removeChild(this);
|
||
|
run.call(id);
|
||
|
};
|
||
|
};
|
||
|
// Rest old browsers
|
||
|
} else {
|
||
|
defer = function (id) {
|
||
|
setTimeout(ctx(run, id, 1), 0);
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
module.exports = {
|
||
|
set: setTask,
|
||
|
clear: clearTask
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 41 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
// 25.4.1.5 NewPromiseCapability(C)
|
||
|
var aFunction = __webpack_require__(17);
|
||
|
|
||
|
function PromiseCapability(C) {
|
||
|
var resolve, reject;
|
||
|
this.promise = new C(function ($$resolve, $$reject) {
|
||
|
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
||
|
resolve = $$resolve;
|
||
|
reject = $$reject;
|
||
|
});
|
||
|
this.resolve = aFunction(resolve);
|
||
|
this.reject = aFunction(reject);
|
||
|
}
|
||
|
|
||
|
module.exports.f = function (C) {
|
||
|
return new PromiseCapability(C);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 42 */,
|
||
|
/* 43 */,
|
||
|
/* 44 */,
|
||
|
/* 45 */,
|
||
|
/* 46 */,
|
||
|
/* 47 */,
|
||
|
/* 48 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Copyright (C) 2014-2017 ServMask Inc.
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||
|
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||
|
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||
|
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||
|
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||
|
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||
|
*/
|
||
|
|
||
|
var Report = __webpack_require__(5),
|
||
|
Feedback = __webpack_require__(6),
|
||
|
Deprecated = __webpack_require__(20),
|
||
|
FileUploader = __webpack_require__(49);
|
||
|
|
||
|
jQuery(document).ready(function ($) {
|
||
|
'use strict';
|
||
|
|
||
|
var uploader = new FileUploader();
|
||
|
uploader.init();
|
||
|
|
||
|
// Expands/Collapses Import from
|
||
|
$('.ai1wm-expandable > div.ai1wm-button-main').on('click', function () {
|
||
|
$(this).parent().toggleClass('ai1wm-open');
|
||
|
});
|
||
|
});
|
||
|
|
||
|
/***/ }),
|
||
|
/* 49 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
/* WEBPACK VAR INJECTION */(function(fetch, global) {
|
||
|
|
||
|
/**
|
||
|
* Copyright (C) 2014-2017 ServMask Inc.
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||
|
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||
|
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||
|
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||
|
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||
|
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||
|
*/
|
||
|
|
||
|
var Util = __webpack_require__(0),
|
||
|
Import = __webpack_require__(18),
|
||
|
$ = jQuery;
|
||
|
|
||
|
var FileUploader = function FileUploader() {};
|
||
|
|
||
|
FileUploader.prototype.setDefaultValues = function () {
|
||
|
this.model = new Import();
|
||
|
this.stopUpload = false;
|
||
|
};
|
||
|
|
||
|
FileUploader.prototype.init = function () {
|
||
|
var _this = this;
|
||
|
|
||
|
var selectElement = $('#ai1wm-import-file');
|
||
|
var dropElement = $('#ai1wm-drag-drop-area');
|
||
|
|
||
|
selectElement.on('change', function (event) {
|
||
|
event.preventDefault();
|
||
|
_this.setDefaultValues();
|
||
|
var file = event.target.files.item(0);
|
||
|
_this.setDefaultValues();
|
||
|
_this.fileSize = file.size;
|
||
|
try {
|
||
|
_this.onFilesAdded(file);
|
||
|
_this.onBeforeUpload(file);
|
||
|
_this.upload(file);
|
||
|
} catch (exception) {
|
||
|
_this.onError(exception);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
dropElement.on('dragenter', function (event) {
|
||
|
event.preventDefault();
|
||
|
dropElement.addClass('ai1wm-drag-over');
|
||
|
});
|
||
|
dropElement.on('dragover', function (event) {
|
||
|
event.preventDefault();
|
||
|
dropElement.addClass('ai1wm-drag-over');
|
||
|
});
|
||
|
dropElement.on('dragleave', function (event) {
|
||
|
event.preventDefault();
|
||
|
dropElement.removeClass('ai1wm-drag-over');
|
||
|
});
|
||
|
dropElement.on('drop', function (event) {
|
||
|
event.preventDefault();
|
||
|
_this.setDefaultValues();
|
||
|
dropElement.removeClass('ai1wm-drag-over');
|
||
|
var file = event.originalEvent.dataTransfer.files.item(0);
|
||
|
_this.fileSize = file.size;
|
||
|
try {
|
||
|
_this.onFilesAdded(file);
|
||
|
_this.onBeforeUpload(file);
|
||
|
_this.upload(file);
|
||
|
} catch (exception) {
|
||
|
_this.onError(exception);
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
|
||
|
FileUploader.prototype.upload = function (file, retries) {
|
||
|
var _this2 = this;
|
||
|
|
||
|
var retries = retries || 0;
|
||
|
|
||
|
var chunkSize = file.size > ai1wm_uploader.chunk_size ? ai1wm_uploader.chunk_size : file.size;
|
||
|
var formData = this.getFormData(file, chunkSize);
|
||
|
|
||
|
fetch(ai1wm_uploader.url, {
|
||
|
method: 'POST',
|
||
|
credentials: 'include',
|
||
|
body: formData
|
||
|
}).then(function (response) {
|
||
|
if (_this2.stopUpload) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
switch (response.status) {
|
||
|
case 413:
|
||
|
ai1wm_uploader.chunk_size = chunkSize / 2;
|
||
|
return _this2.upload(file);
|
||
|
case 200:
|
||
|
return response.text().then(function (text) {
|
||
|
var extractedJsonText = Util.json(text);
|
||
|
if (extractedJsonText) {
|
||
|
var json = JSON.parse(extractedJsonText);
|
||
|
if (json.errors.length === 0) {
|
||
|
file = file.slice(chunkSize, file.size, 'application/octet-binary');
|
||
|
var uploadedBytes = _this2.fileSize - file.size;
|
||
|
var progress = uploadedBytes / _this2.fileSize * 100;
|
||
|
_this2.onUploadProgress(progress.toFixed(2));
|
||
|
return progress === 100 ? _this2.onFileUploaded() : _this2.upload(file);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
throw new Error(text);
|
||
|
});
|
||
|
default:
|
||
|
throw new Error(response.status);
|
||
|
}
|
||
|
}).catch(function (error) {
|
||
|
var timeout = retries * 1000;
|
||
|
if (retries >= 30) {
|
||
|
return _this2.onError(new Error('We are sorry, there seems to be a problem while uploading your file. Follow <a href="https://www.youtube.com/watch?v=mRp7qTFYKgs" target="_blank">this guide</a> to resolve it.'));
|
||
|
}
|
||
|
|
||
|
retries++;
|
||
|
|
||
|
setTimeout(_this2.upload.bind(_this2, file, retries), timeout);
|
||
|
});
|
||
|
};
|
||
|
|
||
|
FileUploader.prototype.getFormData = function (file, chunkSize) {
|
||
|
var params = ai1wm_uploader.params;
|
||
|
var formData = new FormData();
|
||
|
formData.append('upload-file', file.slice(0, chunkSize, 'application/octet-binary'));
|
||
|
|
||
|
for (var name in params) {
|
||
|
formData.append(name, params[name]);
|
||
|
}
|
||
|
|
||
|
return formData;
|
||
|
};
|
||
|
|
||
|
FileUploader.prototype.checkSize = function (file) {
|
||
|
var size = parseInt(ai1wm_uploader.filters.ai1wm_archive_size, 10);
|
||
|
|
||
|
if (file.size > size && size !== 0) {
|
||
|
throw new Error(ai1wm_import.oversize);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
FileUploader.prototype.checkExtension = function (file) {
|
||
|
var extensions = ai1wm_uploader.filters.ai1wm_archive_extension;
|
||
|
|
||
|
var matchExtension = extensions.some(function (extension) {
|
||
|
return file.name.substr(-extension.length) === extension;
|
||
|
});
|
||
|
|
||
|
if (!matchExtension) {
|
||
|
throw new Error(ai1wm_import.invalid_extension);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
FileUploader.prototype.onFilesAdded = function (file) {
|
||
|
this.checkExtension(file);
|
||
|
this.checkSize(file);
|
||
|
|
||
|
// Initializing beforeunload event
|
||
|
$(window).bind('beforeunload', function () {
|
||
|
return 'You are about to stop importing your website, are you sure?';
|
||
|
});
|
||
|
};
|
||
|
|
||
|
FileUploader.prototype.onBeforeUpload = function (file) {
|
||
|
var self = this;
|
||
|
|
||
|
var storage = Util.random(12);
|
||
|
var options = Util.form('#ai1wm-import-form').concat({ name: 'storage', value: storage }).concat({ name: 'archive', value: file.name });
|
||
|
|
||
|
// Set global params
|
||
|
this.model.setParams(options);
|
||
|
|
||
|
// Set multipart params
|
||
|
$.extend(ai1wm_uploader.params, {
|
||
|
storage: storage,
|
||
|
archive: file.name
|
||
|
});
|
||
|
|
||
|
// Set stop
|
||
|
this.model.onStop = function () {
|
||
|
self.stopUpload = true;
|
||
|
|
||
|
// Clean storage
|
||
|
self.model.clean();
|
||
|
};
|
||
|
|
||
|
// Set status
|
||
|
this.model.setStatus({ type: 'progress', percent: '0.00' });
|
||
|
};
|
||
|
|
||
|
FileUploader.prototype.onUploadProgress = function (percent) {
|
||
|
this.model.setStatus({ type: 'progress', percent: percent });
|
||
|
};
|
||
|
|
||
|
FileUploader.prototype.onFileUploaded = function () {
|
||
|
this.model.start();
|
||
|
};
|
||
|
|
||
|
FileUploader.prototype.onError = function (error) {
|
||
|
this.model.setStatus({ type: 'error', message: error.message });
|
||
|
};
|
||
|
|
||
|
module.exports = FileUploader;
|
||
|
|
||
|
global.Ai1wm = { Util: Util, Import: Import };
|
||
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(50), __webpack_require__(7)))
|
||
|
|
||
|
/***/ }),
|
||
|
/* 50 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
/* WEBPACK VAR INJECTION */(function(global, Promise) {/*** IMPORTS FROM imports-loader ***/
|
||
|
(function() {
|
||
|
|
||
|
(function(self) {
|
||
|
'use strict';
|
||
|
|
||
|
if (self.fetch) {
|
||
|
return
|
||
|
}
|
||
|
|
||
|
var support = {
|
||
|
searchParams: 'URLSearchParams' in self,
|
||
|
iterable: 'Symbol' in self && 'iterator' in Symbol,
|
||
|
blob: 'FileReader' in self && 'Blob' in self && (function() {
|
||
|
try {
|
||
|
new Blob()
|
||
|
return true
|
||
|
} catch(e) {
|
||
|
return false
|
||
|
}
|
||
|
})(),
|
||
|
formData: 'FormData' in self,
|
||
|
arrayBuffer: 'ArrayBuffer' in self
|
||
|
}
|
||
|
|
||
|
if (support.arrayBuffer) {
|
||
|
var viewClasses = [
|
||
|
'[object Int8Array]',
|
||
|
'[object Uint8Array]',
|
||
|
'[object Uint8ClampedArray]',
|
||
|
'[object Int16Array]',
|
||
|
'[object Uint16Array]',
|
||
|
'[object Int32Array]',
|
||
|
'[object Uint32Array]',
|
||
|
'[object Float32Array]',
|
||
|
'[object Float64Array]'
|
||
|
]
|
||
|
|
||
|
var isDataView = function(obj) {
|
||
|
return obj && DataView.prototype.isPrototypeOf(obj)
|
||
|
}
|
||
|
|
||
|
var isArrayBufferView = ArrayBuffer.isView || function(obj) {
|
||
|
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function normalizeName(name) {
|
||
|
if (typeof name !== 'string') {
|
||
|
name = String(name)
|
||
|
}
|
||
|
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
|
||
|
throw new TypeError('Invalid character in header field name')
|
||
|
}
|
||
|
return name.toLowerCase()
|
||
|
}
|
||
|
|
||
|
function normalizeValue(value) {
|
||
|
if (typeof value !== 'string') {
|
||
|
value = String(value)
|
||
|
}
|
||
|
return value
|
||
|
}
|
||
|
|
||
|
// Build a destructive iterator for the value list
|
||
|
function iteratorFor(items) {
|
||
|
var iterator = {
|
||
|
next: function() {
|
||
|
var value = items.shift()
|
||
|
return {done: value === undefined, value: value}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (support.iterable) {
|
||
|
iterator[Symbol.iterator] = function() {
|
||
|
return iterator
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return iterator
|
||
|
}
|
||
|
|
||
|
function Headers(headers) {
|
||
|
this.map = {}
|
||
|
|
||
|
if (headers instanceof Headers) {
|
||
|
headers.forEach(function(value, name) {
|
||
|
this.append(name, value)
|
||
|
}, this)
|
||
|
} else if (Array.isArray(headers)) {
|
||
|
headers.forEach(function(header) {
|
||
|
this.append(header[0], header[1])
|
||
|
}, this)
|
||
|
} else if (headers) {
|
||
|
Object.getOwnPropertyNames(headers).forEach(function(name) {
|
||
|
this.append(name, headers[name])
|
||
|
}, this)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Headers.prototype.append = function(name, value) {
|
||
|
name = normalizeName(name)
|
||
|
value = normalizeValue(value)
|
||
|
var oldValue = this.map[name]
|
||
|
this.map[name] = oldValue ? oldValue+','+value : value
|
||
|
}
|
||
|
|
||
|
Headers.prototype['delete'] = function(name) {
|
||
|
delete this.map[normalizeName(name)]
|
||
|
}
|
||
|
|
||
|
Headers.prototype.get = function(name) {
|
||
|
name = normalizeName(name)
|
||
|
return this.has(name) ? this.map[name] : null
|
||
|
}
|
||
|
|
||
|
Headers.prototype.has = function(name) {
|
||
|
return this.map.hasOwnProperty(normalizeName(name))
|
||
|
}
|
||
|
|
||
|
Headers.prototype.set = function(name, value) {
|
||
|
this.map[normalizeName(name)] = normalizeValue(value)
|
||
|
}
|
||
|
|
||
|
Headers.prototype.forEach = function(callback, thisArg) {
|
||
|
for (var name in this.map) {
|
||
|
if (this.map.hasOwnProperty(name)) {
|
||
|
callback.call(thisArg, this.map[name], name, this)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Headers.prototype.keys = function() {
|
||
|
var items = []
|
||
|
this.forEach(function(value, name) { items.push(name) })
|
||
|
return iteratorFor(items)
|
||
|
}
|
||
|
|
||
|
Headers.prototype.values = function() {
|
||
|
var items = []
|
||
|
this.forEach(function(value) { items.push(value) })
|
||
|
return iteratorFor(items)
|
||
|
}
|
||
|
|
||
|
Headers.prototype.entries = function() {
|
||
|
var items = []
|
||
|
this.forEach(function(value, name) { items.push([name, value]) })
|
||
|
return iteratorFor(items)
|
||
|
}
|
||
|
|
||
|
if (support.iterable) {
|
||
|
Headers.prototype[Symbol.iterator] = Headers.prototype.entries
|
||
|
}
|
||
|
|
||
|
function consumed(body) {
|
||
|
if (body.bodyUsed) {
|
||
|
return Promise.reject(new TypeError('Already read'))
|
||
|
}
|
||
|
body.bodyUsed = true
|
||
|
}
|
||
|
|
||
|
function fileReaderReady(reader) {
|
||
|
return new Promise(function(resolve, reject) {
|
||
|
reader.onload = function() {
|
||
|
resolve(reader.result)
|
||
|
}
|
||
|
reader.onerror = function() {
|
||
|
reject(reader.error)
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
|
||
|
function readBlobAsArrayBuffer(blob) {
|
||
|
var reader = new FileReader()
|
||
|
var promise = fileReaderReady(reader)
|
||
|
reader.readAsArrayBuffer(blob)
|
||
|
return promise
|
||
|
}
|
||
|
|
||
|
function readBlobAsText(blob) {
|
||
|
var reader = new FileReader()
|
||
|
var promise = fileReaderReady(reader)
|
||
|
reader.readAsText(blob)
|
||
|
return promise
|
||
|
}
|
||
|
|
||
|
function readArrayBufferAsText(buf) {
|
||
|
var view = new Uint8Array(buf)
|
||
|
var chars = new Array(view.length)
|
||
|
|
||
|
for (var i = 0; i < view.length; i++) {
|
||
|
chars[i] = String.fromCharCode(view[i])
|
||
|
}
|
||
|
return chars.join('')
|
||
|
}
|
||
|
|
||
|
function bufferClone(buf) {
|
||
|
if (buf.slice) {
|
||
|
return buf.slice(0)
|
||
|
} else {
|
||
|
var view = new Uint8Array(buf.byteLength)
|
||
|
view.set(new Uint8Array(buf))
|
||
|
return view.buffer
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function Body() {
|
||
|
this.bodyUsed = false
|
||
|
|
||
|
this._initBody = function(body) {
|
||
|
this._bodyInit = body
|
||
|
if (!body) {
|
||
|
this._bodyText = ''
|
||
|
} else if (typeof body === 'string') {
|
||
|
this._bodyText = body
|
||
|
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
||
|
this._bodyBlob = body
|
||
|
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
||
|
this._bodyFormData = body
|
||
|
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
||
|
this._bodyText = body.toString()
|
||
|
} else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
||
|
this._bodyArrayBuffer = bufferClone(body.buffer)
|
||
|
// IE 10-11 can't handle a DataView body.
|
||
|
this._bodyInit = new Blob([this._bodyArrayBuffer])
|
||
|
} else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
|
||
|
this._bodyArrayBuffer = bufferClone(body)
|
||
|
} else {
|
||
|
throw new Error('unsupported BodyInit type')
|
||
|
}
|
||
|
|
||
|
if (!this.headers.get('content-type')) {
|
||
|
if (typeof body === 'string') {
|
||
|
this.headers.set('content-type', 'text/plain;charset=UTF-8')
|
||
|
} else if (this._bodyBlob && this._bodyBlob.type) {
|
||
|
this.headers.set('content-type', this._bodyBlob.type)
|
||
|
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
||
|
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (support.blob) {
|
||
|
this.blob = function() {
|
||
|
var rejected = consumed(this)
|
||
|
if (rejected) {
|
||
|
return rejected
|
||
|
}
|
||
|
|
||
|
if (this._bodyBlob) {
|
||
|
return Promise.resolve(this._bodyBlob)
|
||
|
} else if (this._bodyArrayBuffer) {
|
||
|
return Promise.resolve(new Blob([this._bodyArrayBuffer]))
|
||
|
} else if (this._bodyFormData) {
|
||
|
throw new Error('could not read FormData body as blob')
|
||
|
} else {
|
||
|
return Promise.resolve(new Blob([this._bodyText]))
|
||
|
}
|
||
|
}
|
||
|
|
||
|
this.arrayBuffer = function() {
|
||
|
if (this._bodyArrayBuffer) {
|
||
|
return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
|
||
|
} else {
|
||
|
return this.blob().then(readBlobAsArrayBuffer)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
this.text = function() {
|
||
|
var rejected = consumed(this)
|
||
|
if (rejected) {
|
||
|
return rejected
|
||
|
}
|
||
|
|
||
|
if (this._bodyBlob) {
|
||
|
return readBlobAsText(this._bodyBlob)
|
||
|
} else if (this._bodyArrayBuffer) {
|
||
|
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
|
||
|
} else if (this._bodyFormData) {
|
||
|
throw new Error('could not read FormData body as text')
|
||
|
} else {
|
||
|
return Promise.resolve(this._bodyText)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (support.formData) {
|
||
|
this.formData = function() {
|
||
|
return this.text().then(decode)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
this.json = function() {
|
||
|
return this.text().then(JSON.parse)
|
||
|
}
|
||
|
|
||
|
return this
|
||
|
}
|
||
|
|
||
|
// HTTP methods whose capitalization should be normalized
|
||
|
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
|
||
|
|
||
|
function normalizeMethod(method) {
|
||
|
var upcased = method.toUpperCase()
|
||
|
return (methods.indexOf(upcased) > -1) ? upcased : method
|
||
|
}
|
||
|
|
||
|
function Request(input, options) {
|
||
|
options = options || {}
|
||
|
var body = options.body
|
||
|
|
||
|
if (input instanceof Request) {
|
||
|
if (input.bodyUsed) {
|
||
|
throw new TypeError('Already read')
|
||
|
}
|
||
|
this.url = input.url
|
||
|
this.credentials = input.credentials
|
||
|
if (!options.headers) {
|
||
|
this.headers = new Headers(input.headers)
|
||
|
}
|
||
|
this.method = input.method
|
||
|
this.mode = input.mode
|
||
|
if (!body && input._bodyInit != null) {
|
||
|
body = input._bodyInit
|
||
|
input.bodyUsed = true
|
||
|
}
|
||
|
} else {
|
||
|
this.url = String(input)
|
||
|
}
|
||
|
|
||
|
this.credentials = options.credentials || this.credentials || 'omit'
|
||
|
if (options.headers || !this.headers) {
|
||
|
this.headers = new Headers(options.headers)
|
||
|
}
|
||
|
this.method = normalizeMethod(options.method || this.method || 'GET')
|
||
|
this.mode = options.mode || this.mode || null
|
||
|
this.referrer = null
|
||
|
|
||
|
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
||
|
throw new TypeError('Body not allowed for GET or HEAD requests')
|
||
|
}
|
||
|
this._initBody(body)
|
||
|
}
|
||
|
|
||
|
Request.prototype.clone = function() {
|
||
|
return new Request(this, { body: this._bodyInit })
|
||
|
}
|
||
|
|
||
|
function decode(body) {
|
||
|
var form = new FormData()
|
||
|
body.trim().split('&').forEach(function(bytes) {
|
||
|
if (bytes) {
|
||
|
var split = bytes.split('=')
|
||
|
var name = split.shift().replace(/\+/g, ' ')
|
||
|
var value = split.join('=').replace(/\+/g, ' ')
|
||
|
form.append(decodeURIComponent(name), decodeURIComponent(value))
|
||
|
}
|
||
|
})
|
||
|
return form
|
||
|
}
|
||
|
|
||
|
function parseHeaders(rawHeaders) {
|
||
|
var headers = new Headers()
|
||
|
rawHeaders.split(/\r?\n/).forEach(function(line) {
|
||
|
var parts = line.split(':')
|
||
|
var key = parts.shift().trim()
|
||
|
if (key) {
|
||
|
var value = parts.join(':').trim()
|
||
|
headers.append(key, value)
|
||
|
}
|
||
|
})
|
||
|
return headers
|
||
|
}
|
||
|
|
||
|
Body.call(Request.prototype)
|
||
|
|
||
|
function Response(bodyInit, options) {
|
||
|
if (!options) {
|
||
|
options = {}
|
||
|
}
|
||
|
|
||
|
this.type = 'default'
|
||
|
this.status = 'status' in options ? options.status : 200
|
||
|
this.ok = this.status >= 200 && this.status < 300
|
||
|
this.statusText = 'statusText' in options ? options.statusText : 'OK'
|
||
|
this.headers = new Headers(options.headers)
|
||
|
this.url = options.url || ''
|
||
|
this._initBody(bodyInit)
|
||
|
}
|
||
|
|
||
|
Body.call(Response.prototype)
|
||
|
|
||
|
Response.prototype.clone = function() {
|
||
|
return new Response(this._bodyInit, {
|
||
|
status: this.status,
|
||
|
statusText: this.statusText,
|
||
|
headers: new Headers(this.headers),
|
||
|
url: this.url
|
||
|
})
|
||
|
}
|
||
|
|
||
|
Response.error = function() {
|
||
|
var response = new Response(null, {status: 0, statusText: ''})
|
||
|
response.type = 'error'
|
||
|
return response
|
||
|
}
|
||
|
|
||
|
var redirectStatuses = [301, 302, 303, 307, 308]
|
||
|
|
||
|
Response.redirect = function(url, status) {
|
||
|
if (redirectStatuses.indexOf(status) === -1) {
|
||
|
throw new RangeError('Invalid status code')
|
||
|
}
|
||
|
|
||
|
return new Response(null, {status: status, headers: {location: url}})
|
||
|
}
|
||
|
|
||
|
self.Headers = Headers
|
||
|
self.Request = Request
|
||
|
self.Response = Response
|
||
|
|
||
|
self.fetch = function(input, init) {
|
||
|
return new Promise(function(resolve, reject) {
|
||
|
var request = new Request(input, init)
|
||
|
var xhr = new XMLHttpRequest()
|
||
|
|
||
|
xhr.onload = function() {
|
||
|
var options = {
|
||
|
status: xhr.status,
|
||
|
statusText: xhr.statusText,
|
||
|
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
||
|
}
|
||
|
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
|
||
|
var body = 'response' in xhr ? xhr.response : xhr.responseText
|
||
|
resolve(new Response(body, options))
|
||
|
}
|
||
|
|
||
|
xhr.onerror = function() {
|
||
|
reject(new TypeError('Network request failed'))
|
||
|
}
|
||
|
|
||
|
xhr.ontimeout = function() {
|
||
|
reject(new TypeError('Network request failed'))
|
||
|
}
|
||
|
|
||
|
xhr.open(request.method, request.url, true)
|
||
|
|
||
|
if (request.credentials === 'include') {
|
||
|
xhr.withCredentials = true
|
||
|
}
|
||
|
|
||
|
if ('responseType' in xhr && support.blob) {
|
||
|
xhr.responseType = 'blob'
|
||
|
}
|
||
|
|
||
|
request.headers.forEach(function(value, name) {
|
||
|
xhr.setRequestHeader(name, value)
|
||
|
})
|
||
|
|
||
|
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
|
||
|
})
|
||
|
}
|
||
|
self.fetch.polyfill = true
|
||
|
})(typeof self !== 'undefined' ? self : this);
|
||
|
|
||
|
|
||
|
/*** EXPORTS FROM exports-loader ***/
|
||
|
module.exports = global.fetch;
|
||
|
}.call(global));
|
||
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7), __webpack_require__(51)))
|
||
|
|
||
|
/***/ }),
|
||
|
/* 51 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
/* WEBPACK VAR INJECTION */(function(global) {/*** IMPORTS FROM imports-loader ***/
|
||
|
(function() {
|
||
|
|
||
|
__webpack_require__(52);
|
||
|
__webpack_require__(55);
|
||
|
__webpack_require__(66);
|
||
|
__webpack_require__(70);
|
||
|
module.exports = __webpack_require__(12).Promise;
|
||
|
|
||
|
|
||
|
/*** EXPORTS FROM exports-loader ***/
|
||
|
module.exports = global.Promise;
|
||
|
}.call(global));
|
||
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
|
||
|
|
||
|
/***/ }),
|
||
|
/* 52 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
// 19.1.3.6 Object.prototype.toString()
|
||
|
var classof = __webpack_require__(22);
|
||
|
var test = {};
|
||
|
test[__webpack_require__(1)('toStringTag')] = 'z';
|
||
|
if (test + '' != '[object z]') {
|
||
|
__webpack_require__(8)(Object.prototype, 'toString', function toString() {
|
||
|
return '[object ' + classof(this) + ']';
|
||
|
}, true);
|
||
|
}
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 53 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
module.exports = !__webpack_require__(10) && !__webpack_require__(31)(function () {
|
||
|
return Object.defineProperty(__webpack_require__(24)('div'), 'a', { get: function () { return 7; } }).a != 7;
|
||
|
});
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 54 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// 7.1.1 ToPrimitive(input [, PreferredType])
|
||
|
var isObject = __webpack_require__(9);
|
||
|
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
|
||
|
// and the second argument - flag - preferred type is a string
|
||
|
module.exports = function (it, S) {
|
||
|
if (!isObject(it)) return it;
|
||
|
var fn, val;
|
||
|
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
||
|
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
|
||
|
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
|
||
|
throw TypeError("Can't convert object to primitive value");
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 55 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
var $at = __webpack_require__(56)(true);
|
||
|
|
||
|
// 21.1.3.27 String.prototype[@@iterator]()
|
||
|
__webpack_require__(33)(String, 'String', function (iterated) {
|
||
|
this._t = String(iterated); // target
|
||
|
this._i = 0; // next index
|
||
|
// 21.1.5.2.1 %StringIteratorPrototype%.next()
|
||
|
}, function () {
|
||
|
var O = this._t;
|
||
|
var index = this._i;
|
||
|
var point;
|
||
|
if (index >= O.length) return { value: undefined, done: true };
|
||
|
point = $at(O, index);
|
||
|
this._i += point.length;
|
||
|
return { value: point, done: false };
|
||
|
});
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 56 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var toInteger = __webpack_require__(25);
|
||
|
var defined = __webpack_require__(26);
|
||
|
// true -> String#at
|
||
|
// false -> String#codePointAt
|
||
|
module.exports = function (TO_STRING) {
|
||
|
return function (that, pos) {
|
||
|
var s = String(defined(that));
|
||
|
var i = toInteger(pos);
|
||
|
var l = s.length;
|
||
|
var a, b;
|
||
|
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
|
||
|
a = s.charCodeAt(i);
|
||
|
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
|
||
|
? TO_STRING ? s.charAt(i) : a
|
||
|
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 57 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
var create = __webpack_require__(58);
|
||
|
var descriptor = __webpack_require__(32);
|
||
|
var setToStringTag = __webpack_require__(29);
|
||
|
var IteratorPrototype = {};
|
||
|
|
||
|
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
|
||
|
__webpack_require__(4)(IteratorPrototype, __webpack_require__(1)('iterator'), function () { return this; });
|
||
|
|
||
|
module.exports = function (Constructor, NAME, next) {
|
||
|
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
|
||
|
setToStringTag(Constructor, NAME + ' Iterator');
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 58 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
||
|
var anObject = __webpack_require__(3);
|
||
|
var dPs = __webpack_require__(59);
|
||
|
var enumBugKeys = __webpack_require__(38);
|
||
|
var IE_PROTO = __webpack_require__(28)('IE_PROTO');
|
||
|
var Empty = function () { /* empty */ };
|
||
|
var PROTOTYPE = 'prototype';
|
||
|
|
||
|
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
||
|
var createDict = function () {
|
||
|
// Thrash, waste and sodomy: IE GC bug
|
||
|
var iframe = __webpack_require__(24)('iframe');
|
||
|
var i = enumBugKeys.length;
|
||
|
var lt = '<';
|
||
|
var gt = '>';
|
||
|
var iframeDocument;
|
||
|
iframe.style.display = 'none';
|
||
|
__webpack_require__(39).appendChild(iframe);
|
||
|
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
|
||
|
// createDict = iframe.contentWindow.Object;
|
||
|
// html.removeChild(iframe);
|
||
|
iframeDocument = iframe.contentWindow.document;
|
||
|
iframeDocument.open();
|
||
|
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
||
|
iframeDocument.close();
|
||
|
createDict = iframeDocument.F;
|
||
|
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
|
||
|
return createDict();
|
||
|
};
|
||
|
|
||
|
module.exports = Object.create || function create(O, Properties) {
|
||
|
var result;
|
||
|
if (O !== null) {
|
||
|
Empty[PROTOTYPE] = anObject(O);
|
||
|
result = new Empty();
|
||
|
Empty[PROTOTYPE] = null;
|
||
|
// add "__proto__" for Object.getPrototypeOf polyfill
|
||
|
result[IE_PROTO] = O;
|
||
|
} else result = createDict();
|
||
|
return Properties === undefined ? result : dPs(result, Properties);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 59 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var dP = __webpack_require__(15);
|
||
|
var anObject = __webpack_require__(3);
|
||
|
var getKeys = __webpack_require__(36);
|
||
|
|
||
|
module.exports = __webpack_require__(10) ? Object.defineProperties : function defineProperties(O, Properties) {
|
||
|
anObject(O);
|
||
|
var keys = getKeys(Properties);
|
||
|
var length = keys.length;
|
||
|
var i = 0;
|
||
|
var P;
|
||
|
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
|
||
|
return O;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 60 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var has = __webpack_require__(11);
|
||
|
var toIObject = __webpack_require__(27);
|
||
|
var arrayIndexOf = __webpack_require__(62)(false);
|
||
|
var IE_PROTO = __webpack_require__(28)('IE_PROTO');
|
||
|
|
||
|
module.exports = function (object, names) {
|
||
|
var O = toIObject(object);
|
||
|
var i = 0;
|
||
|
var result = [];
|
||
|
var key;
|
||
|
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
|
||
|
// Don't enum bug & hidden keys
|
||
|
while (names.length > i) if (has(O, key = names[i++])) {
|
||
|
~arrayIndexOf(result, key) || result.push(key);
|
||
|
}
|
||
|
return result;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 61 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
||
|
var cof = __webpack_require__(14);
|
||
|
// eslint-disable-next-line no-prototype-builtins
|
||
|
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
||
|
return cof(it) == 'String' ? it.split('') : Object(it);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 62 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// false -> Array#indexOf
|
||
|
// true -> Array#includes
|
||
|
var toIObject = __webpack_require__(27);
|
||
|
var toLength = __webpack_require__(37);
|
||
|
var toAbsoluteIndex = __webpack_require__(63);
|
||
|
module.exports = function (IS_INCLUDES) {
|
||
|
return function ($this, el, fromIndex) {
|
||
|
var O = toIObject($this);
|
||
|
var length = toLength(O.length);
|
||
|
var index = toAbsoluteIndex(fromIndex, length);
|
||
|
var value;
|
||
|
// Array#includes uses SameValueZero equality algorithm
|
||
|
// eslint-disable-next-line no-self-compare
|
||
|
if (IS_INCLUDES && el != el) while (length > index) {
|
||
|
value = O[index++];
|
||
|
// eslint-disable-next-line no-self-compare
|
||
|
if (value != value) return true;
|
||
|
// Array#indexOf ignores holes, Array#includes - not
|
||
|
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
||
|
if (O[index] === el) return IS_INCLUDES || index || 0;
|
||
|
} return !IS_INCLUDES && -1;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 63 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var toInteger = __webpack_require__(25);
|
||
|
var max = Math.max;
|
||
|
var min = Math.min;
|
||
|
module.exports = function (index, length) {
|
||
|
index = toInteger(index);
|
||
|
return index < 0 ? max(index + length, 0) : min(index, length);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 64 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
|
||
|
var has = __webpack_require__(11);
|
||
|
var toObject = __webpack_require__(65);
|
||
|
var IE_PROTO = __webpack_require__(28)('IE_PROTO');
|
||
|
var ObjectProto = Object.prototype;
|
||
|
|
||
|
module.exports = Object.getPrototypeOf || function (O) {
|
||
|
O = toObject(O);
|
||
|
if (has(O, IE_PROTO)) return O[IE_PROTO];
|
||
|
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
||
|
return O.constructor.prototype;
|
||
|
} return O instanceof Object ? ObjectProto : null;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 65 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// 7.1.13 ToObject(argument)
|
||
|
var defined = __webpack_require__(26);
|
||
|
module.exports = function (it) {
|
||
|
return Object(defined(it));
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 66 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var $iterators = __webpack_require__(67);
|
||
|
var getKeys = __webpack_require__(36);
|
||
|
var redefine = __webpack_require__(8);
|
||
|
var global = __webpack_require__(2);
|
||
|
var hide = __webpack_require__(4);
|
||
|
var Iterators = __webpack_require__(13);
|
||
|
var wks = __webpack_require__(1);
|
||
|
var ITERATOR = wks('iterator');
|
||
|
var TO_STRING_TAG = wks('toStringTag');
|
||
|
var ArrayValues = Iterators.Array;
|
||
|
|
||
|
var DOMIterables = {
|
||
|
CSSRuleList: true, // TODO: Not spec compliant, should be false.
|
||
|
CSSStyleDeclaration: false,
|
||
|
CSSValueList: false,
|
||
|
ClientRectList: false,
|
||
|
DOMRectList: false,
|
||
|
DOMStringList: false,
|
||
|
DOMTokenList: true,
|
||
|
DataTransferItemList: false,
|
||
|
FileList: false,
|
||
|
HTMLAllCollection: false,
|
||
|
HTMLCollection: false,
|
||
|
HTMLFormElement: false,
|
||
|
HTMLSelectElement: false,
|
||
|
MediaList: true, // TODO: Not spec compliant, should be false.
|
||
|
MimeTypeArray: false,
|
||
|
NamedNodeMap: false,
|
||
|
NodeList: true,
|
||
|
PaintRequestList: false,
|
||
|
Plugin: false,
|
||
|
PluginArray: false,
|
||
|
SVGLengthList: false,
|
||
|
SVGNumberList: false,
|
||
|
SVGPathSegList: false,
|
||
|
SVGPointList: false,
|
||
|
SVGStringList: false,
|
||
|
SVGTransformList: false,
|
||
|
SourceBufferList: false,
|
||
|
StyleSheetList: true, // TODO: Not spec compliant, should be false.
|
||
|
TextTrackCueList: false,
|
||
|
TextTrackList: false,
|
||
|
TouchList: false
|
||
|
};
|
||
|
|
||
|
for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
|
||
|
var NAME = collections[i];
|
||
|
var explicit = DOMIterables[NAME];
|
||
|
var Collection = global[NAME];
|
||
|
var proto = Collection && Collection.prototype;
|
||
|
var key;
|
||
|
if (proto) {
|
||
|
if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
|
||
|
if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
|
||
|
Iterators[NAME] = ArrayValues;
|
||
|
if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 67 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
var addToUnscopables = __webpack_require__(68);
|
||
|
var step = __webpack_require__(69);
|
||
|
var Iterators = __webpack_require__(13);
|
||
|
var toIObject = __webpack_require__(27);
|
||
|
|
||
|
// 22.1.3.4 Array.prototype.entries()
|
||
|
// 22.1.3.13 Array.prototype.keys()
|
||
|
// 22.1.3.29 Array.prototype.values()
|
||
|
// 22.1.3.30 Array.prototype[@@iterator]()
|
||
|
module.exports = __webpack_require__(33)(Array, 'Array', function (iterated, kind) {
|
||
|
this._t = toIObject(iterated); // target
|
||
|
this._i = 0; // next index
|
||
|
this._k = kind; // kind
|
||
|
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
|
||
|
}, function () {
|
||
|
var O = this._t;
|
||
|
var kind = this._k;
|
||
|
var index = this._i++;
|
||
|
if (!O || index >= O.length) {
|
||
|
this._t = undefined;
|
||
|
return step(1);
|
||
|
}
|
||
|
if (kind == 'keys') return step(0, index);
|
||
|
if (kind == 'values') return step(0, O[index]);
|
||
|
return step(0, [index, O[index]]);
|
||
|
}, 'values');
|
||
|
|
||
|
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
|
||
|
Iterators.Arguments = Iterators.Array;
|
||
|
|
||
|
addToUnscopables('keys');
|
||
|
addToUnscopables('values');
|
||
|
addToUnscopables('entries');
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 68 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// 22.1.3.31 Array.prototype[@@unscopables]
|
||
|
var UNSCOPABLES = __webpack_require__(1)('unscopables');
|
||
|
var ArrayProto = Array.prototype;
|
||
|
if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(4)(ArrayProto, UNSCOPABLES, {});
|
||
|
module.exports = function (key) {
|
||
|
ArrayProto[UNSCOPABLES][key] = true;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 69 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
module.exports = function (done, value) {
|
||
|
return { value: value, done: !!done };
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 70 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
var LIBRARY = __webpack_require__(34);
|
||
|
var global = __webpack_require__(2);
|
||
|
var ctx = __webpack_require__(16);
|
||
|
var classof = __webpack_require__(22);
|
||
|
var $export = __webpack_require__(35);
|
||
|
var isObject = __webpack_require__(9);
|
||
|
var aFunction = __webpack_require__(17);
|
||
|
var anInstance = __webpack_require__(71);
|
||
|
var forOf = __webpack_require__(72);
|
||
|
var speciesConstructor = __webpack_require__(76);
|
||
|
var task = __webpack_require__(40).set;
|
||
|
var microtask = __webpack_require__(78)();
|
||
|
var newPromiseCapabilityModule = __webpack_require__(41);
|
||
|
var perform = __webpack_require__(79);
|
||
|
var promiseResolve = __webpack_require__(80);
|
||
|
var PROMISE = 'Promise';
|
||
|
var TypeError = global.TypeError;
|
||
|
var process = global.process;
|
||
|
var $Promise = global[PROMISE];
|
||
|
var isNode = classof(process) == 'process';
|
||
|
var empty = function () { /* empty */ };
|
||
|
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
|
||
|
var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
|
||
|
|
||
|
var USE_NATIVE = !!function () {
|
||
|
try {
|
||
|
// correct subclassing with @@species support
|
||
|
var promise = $Promise.resolve(1);
|
||
|
var FakePromise = (promise.constructor = {})[__webpack_require__(1)('species')] = function (exec) {
|
||
|
exec(empty, empty);
|
||
|
};
|
||
|
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
||
|
return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
|
||
|
} catch (e) { /* empty */ }
|
||
|
}();
|
||
|
|
||
|
// helpers
|
||
|
var isThenable = function (it) {
|
||
|
var then;
|
||
|
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
||
|
};
|
||
|
var notify = function (promise, isReject) {
|
||
|
if (promise._n) return;
|
||
|
promise._n = true;
|
||
|
var chain = promise._c;
|
||
|
microtask(function () {
|
||
|
var value = promise._v;
|
||
|
var ok = promise._s == 1;
|
||
|
var i = 0;
|
||
|
var run = function (reaction) {
|
||
|
var handler = ok ? reaction.ok : reaction.fail;
|
||
|
var resolve = reaction.resolve;
|
||
|
var reject = reaction.reject;
|
||
|
var domain = reaction.domain;
|
||
|
var result, then;
|
||
|
try {
|
||
|
if (handler) {
|
||
|
if (!ok) {
|
||
|
if (promise._h == 2) onHandleUnhandled(promise);
|
||
|
promise._h = 1;
|
||
|
}
|
||
|
if (handler === true) result = value;
|
||
|
else {
|
||
|
if (domain) domain.enter();
|
||
|
result = handler(value);
|
||
|
if (domain) domain.exit();
|
||
|
}
|
||
|
if (result === reaction.promise) {
|
||
|
reject(TypeError('Promise-chain cycle'));
|
||
|
} else if (then = isThenable(result)) {
|
||
|
then.call(result, resolve, reject);
|
||
|
} else resolve(result);
|
||
|
} else reject(value);
|
||
|
} catch (e) {
|
||
|
reject(e);
|
||
|
}
|
||
|
};
|
||
|
while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
|
||
|
promise._c = [];
|
||
|
promise._n = false;
|
||
|
if (isReject && !promise._h) onUnhandled(promise);
|
||
|
});
|
||
|
};
|
||
|
var onUnhandled = function (promise) {
|
||
|
task.call(global, function () {
|
||
|
var value = promise._v;
|
||
|
var unhandled = isUnhandled(promise);
|
||
|
var result, handler, console;
|
||
|
if (unhandled) {
|
||
|
result = perform(function () {
|
||
|
if (isNode) {
|
||
|
process.emit('unhandledRejection', value, promise);
|
||
|
} else if (handler = global.onunhandledrejection) {
|
||
|
handler({ promise: promise, reason: value });
|
||
|
} else if ((console = global.console) && console.error) {
|
||
|
console.error('Unhandled promise rejection', value);
|
||
|
}
|
||
|
});
|
||
|
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
||
|
promise._h = isNode || isUnhandled(promise) ? 2 : 1;
|
||
|
} promise._a = undefined;
|
||
|
if (unhandled && result.e) throw result.v;
|
||
|
});
|
||
|
};
|
||
|
var isUnhandled = function (promise) {
|
||
|
if (promise._h == 1) return false;
|
||
|
var chain = promise._a || promise._c;
|
||
|
var i = 0;
|
||
|
var reaction;
|
||
|
while (chain.length > i) {
|
||
|
reaction = chain[i++];
|
||
|
if (reaction.fail || !isUnhandled(reaction.promise)) return false;
|
||
|
} return true;
|
||
|
};
|
||
|
var onHandleUnhandled = function (promise) {
|
||
|
task.call(global, function () {
|
||
|
var handler;
|
||
|
if (isNode) {
|
||
|
process.emit('rejectionHandled', promise);
|
||
|
} else if (handler = global.onrejectionhandled) {
|
||
|
handler({ promise: promise, reason: promise._v });
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
var $reject = function (value) {
|
||
|
var promise = this;
|
||
|
if (promise._d) return;
|
||
|
promise._d = true;
|
||
|
promise = promise._w || promise; // unwrap
|
||
|
promise._v = value;
|
||
|
promise._s = 2;
|
||
|
if (!promise._a) promise._a = promise._c.slice();
|
||
|
notify(promise, true);
|
||
|
};
|
||
|
var $resolve = function (value) {
|
||
|
var promise = this;
|
||
|
var then;
|
||
|
if (promise._d) return;
|
||
|
promise._d = true;
|
||
|
promise = promise._w || promise; // unwrap
|
||
|
try {
|
||
|
if (promise === value) throw TypeError("Promise can't be resolved itself");
|
||
|
if (then = isThenable(value)) {
|
||
|
microtask(function () {
|
||
|
var wrapper = { _w: promise, _d: false }; // wrap
|
||
|
try {
|
||
|
then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
|
||
|
} catch (e) {
|
||
|
$reject.call(wrapper, e);
|
||
|
}
|
||
|
});
|
||
|
} else {
|
||
|
promise._v = value;
|
||
|
promise._s = 1;
|
||
|
notify(promise, false);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
$reject.call({ _w: promise, _d: false }, e); // wrap
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// constructor polyfill
|
||
|
if (!USE_NATIVE) {
|
||
|
// 25.4.3.1 Promise(executor)
|
||
|
$Promise = function Promise(executor) {
|
||
|
anInstance(this, $Promise, PROMISE, '_h');
|
||
|
aFunction(executor);
|
||
|
Internal.call(this);
|
||
|
try {
|
||
|
executor(ctx($resolve, this, 1), ctx($reject, this, 1));
|
||
|
} catch (err) {
|
||
|
$reject.call(this, err);
|
||
|
}
|
||
|
};
|
||
|
// eslint-disable-next-line no-unused-vars
|
||
|
Internal = function Promise(executor) {
|
||
|
this._c = []; // <- awaiting reactions
|
||
|
this._a = undefined; // <- checked in isUnhandled reactions
|
||
|
this._s = 0; // <- state
|
||
|
this._d = false; // <- done
|
||
|
this._v = undefined; // <- value
|
||
|
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
|
||
|
this._n = false; // <- notify
|
||
|
};
|
||
|
Internal.prototype = __webpack_require__(81)($Promise.prototype, {
|
||
|
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
|
||
|
then: function then(onFulfilled, onRejected) {
|
||
|
var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
|
||
|
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
||
|
reaction.fail = typeof onRejected == 'function' && onRejected;
|
||
|
reaction.domain = isNode ? process.domain : undefined;
|
||
|
this._c.push(reaction);
|
||
|
if (this._a) this._a.push(reaction);
|
||
|
if (this._s) notify(this, false);
|
||
|
return reaction.promise;
|
||
|
},
|
||
|
// 25.4.5.1 Promise.prototype.catch(onRejected)
|
||
|
'catch': function (onRejected) {
|
||
|
return this.then(undefined, onRejected);
|
||
|
}
|
||
|
});
|
||
|
OwnPromiseCapability = function () {
|
||
|
var promise = new Internal();
|
||
|
this.promise = promise;
|
||
|
this.resolve = ctx($resolve, promise, 1);
|
||
|
this.reject = ctx($reject, promise, 1);
|
||
|
};
|
||
|
newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
||
|
return C === $Promise || C === Wrapper
|
||
|
? new OwnPromiseCapability(C)
|
||
|
: newGenericPromiseCapability(C);
|
||
|
};
|
||
|
}
|
||
|
|
||
|
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
|
||
|
__webpack_require__(29)($Promise, PROMISE);
|
||
|
__webpack_require__(82)(PROMISE);
|
||
|
Wrapper = __webpack_require__(12)[PROMISE];
|
||
|
|
||
|
// statics
|
||
|
$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
|
||
|
// 25.4.4.5 Promise.reject(r)
|
||
|
reject: function reject(r) {
|
||
|
var capability = newPromiseCapability(this);
|
||
|
var $$reject = capability.reject;
|
||
|
$$reject(r);
|
||
|
return capability.promise;
|
||
|
}
|
||
|
});
|
||
|
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
|
||
|
// 25.4.4.6 Promise.resolve(x)
|
||
|
resolve: function resolve(x) {
|
||
|
return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
|
||
|
}
|
||
|
});
|
||
|
$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(83)(function (iter) {
|
||
|
$Promise.all(iter)['catch'](empty);
|
||
|
})), PROMISE, {
|
||
|
// 25.4.4.1 Promise.all(iterable)
|
||
|
all: function all(iterable) {
|
||
|
var C = this;
|
||
|
var capability = newPromiseCapability(C);
|
||
|
var resolve = capability.resolve;
|
||
|
var reject = capability.reject;
|
||
|
var result = perform(function () {
|
||
|
var values = [];
|
||
|
var index = 0;
|
||
|
var remaining = 1;
|
||
|
forOf(iterable, false, function (promise) {
|
||
|
var $index = index++;
|
||
|
var alreadyCalled = false;
|
||
|
values.push(undefined);
|
||
|
remaining++;
|
||
|
C.resolve(promise).then(function (value) {
|
||
|
if (alreadyCalled) return;
|
||
|
alreadyCalled = true;
|
||
|
values[$index] = value;
|
||
|
--remaining || resolve(values);
|
||
|
}, reject);
|
||
|
});
|
||
|
--remaining || resolve(values);
|
||
|
});
|
||
|
if (result.e) reject(result.v);
|
||
|
return capability.promise;
|
||
|
},
|
||
|
// 25.4.4.4 Promise.race(iterable)
|
||
|
race: function race(iterable) {
|
||
|
var C = this;
|
||
|
var capability = newPromiseCapability(C);
|
||
|
var reject = capability.reject;
|
||
|
var result = perform(function () {
|
||
|
forOf(iterable, false, function (promise) {
|
||
|
C.resolve(promise).then(capability.resolve, reject);
|
||
|
});
|
||
|
});
|
||
|
if (result.e) reject(result.v);
|
||
|
return capability.promise;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 71 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
module.exports = function (it, Constructor, name, forbiddenField) {
|
||
|
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
|
||
|
throw TypeError(name + ': incorrect invocation!');
|
||
|
} return it;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 72 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var ctx = __webpack_require__(16);
|
||
|
var call = __webpack_require__(73);
|
||
|
var isArrayIter = __webpack_require__(74);
|
||
|
var anObject = __webpack_require__(3);
|
||
|
var toLength = __webpack_require__(37);
|
||
|
var getIterFn = __webpack_require__(75);
|
||
|
var BREAK = {};
|
||
|
var RETURN = {};
|
||
|
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
|
||
|
var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
|
||
|
var f = ctx(fn, that, entries ? 2 : 1);
|
||
|
var index = 0;
|
||
|
var length, step, iterator, result;
|
||
|
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
|
||
|
// fast case for arrays with default iterator
|
||
|
if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
|
||
|
result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
|
||
|
if (result === BREAK || result === RETURN) return result;
|
||
|
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
|
||
|
result = call(iterator, f, step.value, entries);
|
||
|
if (result === BREAK || result === RETURN) return result;
|
||
|
}
|
||
|
};
|
||
|
exports.BREAK = BREAK;
|
||
|
exports.RETURN = RETURN;
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 73 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// call something on iterator step with safe closing on error
|
||
|
var anObject = __webpack_require__(3);
|
||
|
module.exports = function (iterator, fn, value, entries) {
|
||
|
try {
|
||
|
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
|
||
|
// 7.4.6 IteratorClose(iterator, completion)
|
||
|
} catch (e) {
|
||
|
var ret = iterator['return'];
|
||
|
if (ret !== undefined) anObject(ret.call(iterator));
|
||
|
throw e;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 74 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// check on default Array iterator
|
||
|
var Iterators = __webpack_require__(13);
|
||
|
var ITERATOR = __webpack_require__(1)('iterator');
|
||
|
var ArrayProto = Array.prototype;
|
||
|
|
||
|
module.exports = function (it) {
|
||
|
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 75 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var classof = __webpack_require__(22);
|
||
|
var ITERATOR = __webpack_require__(1)('iterator');
|
||
|
var Iterators = __webpack_require__(13);
|
||
|
module.exports = __webpack_require__(12).getIteratorMethod = function (it) {
|
||
|
if (it != undefined) return it[ITERATOR]
|
||
|
|| it['@@iterator']
|
||
|
|| Iterators[classof(it)];
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 76 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
// 7.3.20 SpeciesConstructor(O, defaultConstructor)
|
||
|
var anObject = __webpack_require__(3);
|
||
|
var aFunction = __webpack_require__(17);
|
||
|
var SPECIES = __webpack_require__(1)('species');
|
||
|
module.exports = function (O, D) {
|
||
|
var C = anObject(O).constructor;
|
||
|
var S;
|
||
|
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 77 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
// fast apply, http://jsperf.lnkit.com/fast-apply/5
|
||
|
module.exports = function (fn, args, that) {
|
||
|
var un = that === undefined;
|
||
|
switch (args.length) {
|
||
|
case 0: return un ? fn()
|
||
|
: fn.call(that);
|
||
|
case 1: return un ? fn(args[0])
|
||
|
: fn.call(that, args[0]);
|
||
|
case 2: return un ? fn(args[0], args[1])
|
||
|
: fn.call(that, args[0], args[1]);
|
||
|
case 3: return un ? fn(args[0], args[1], args[2])
|
||
|
: fn.call(that, args[0], args[1], args[2]);
|
||
|
case 4: return un ? fn(args[0], args[1], args[2], args[3])
|
||
|
: fn.call(that, args[0], args[1], args[2], args[3]);
|
||
|
} return fn.apply(that, args);
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 78 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var global = __webpack_require__(2);
|
||
|
var macrotask = __webpack_require__(40).set;
|
||
|
var Observer = global.MutationObserver || global.WebKitMutationObserver;
|
||
|
var process = global.process;
|
||
|
var Promise = global.Promise;
|
||
|
var isNode = __webpack_require__(14)(process) == 'process';
|
||
|
|
||
|
module.exports = function () {
|
||
|
var head, last, notify;
|
||
|
|
||
|
var flush = function () {
|
||
|
var parent, fn;
|
||
|
if (isNode && (parent = process.domain)) parent.exit();
|
||
|
while (head) {
|
||
|
fn = head.fn;
|
||
|
head = head.next;
|
||
|
try {
|
||
|
fn();
|
||
|
} catch (e) {
|
||
|
if (head) notify();
|
||
|
else last = undefined;
|
||
|
throw e;
|
||
|
}
|
||
|
} last = undefined;
|
||
|
if (parent) parent.enter();
|
||
|
};
|
||
|
|
||
|
// Node.js
|
||
|
if (isNode) {
|
||
|
notify = function () {
|
||
|
process.nextTick(flush);
|
||
|
};
|
||
|
// browsers with MutationObserver
|
||
|
} else if (Observer) {
|
||
|
var toggle = true;
|
||
|
var node = document.createTextNode('');
|
||
|
new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
|
||
|
notify = function () {
|
||
|
node.data = toggle = !toggle;
|
||
|
};
|
||
|
// environments with maybe non-completely correct, but existent Promise
|
||
|
} else if (Promise && Promise.resolve) {
|
||
|
var promise = Promise.resolve();
|
||
|
notify = function () {
|
||
|
promise.then(flush);
|
||
|
};
|
||
|
// for other environments - macrotask based on:
|
||
|
// - setImmediate
|
||
|
// - MessageChannel
|
||
|
// - window.postMessag
|
||
|
// - onreadystatechange
|
||
|
// - setTimeout
|
||
|
} else {
|
||
|
notify = function () {
|
||
|
// strange IE + webpack dev server bug - use .call(global)
|
||
|
macrotask.call(global, flush);
|
||
|
};
|
||
|
}
|
||
|
|
||
|
return function (fn) {
|
||
|
var task = { fn: fn, next: undefined };
|
||
|
if (last) last.next = task;
|
||
|
if (!head) {
|
||
|
head = task;
|
||
|
notify();
|
||
|
} last = task;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 79 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
module.exports = function (exec) {
|
||
|
try {
|
||
|
return { e: false, v: exec() };
|
||
|
} catch (e) {
|
||
|
return { e: true, v: e };
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 80 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var anObject = __webpack_require__(3);
|
||
|
var isObject = __webpack_require__(9);
|
||
|
var newPromiseCapability = __webpack_require__(41);
|
||
|
|
||
|
module.exports = function (C, x) {
|
||
|
anObject(C);
|
||
|
if (isObject(x) && x.constructor === C) return x;
|
||
|
var promiseCapability = newPromiseCapability.f(C);
|
||
|
var resolve = promiseCapability.resolve;
|
||
|
resolve(x);
|
||
|
return promiseCapability.promise;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 81 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var redefine = __webpack_require__(8);
|
||
|
module.exports = function (target, src, safe) {
|
||
|
for (var key in src) redefine(target, key, src[key], safe);
|
||
|
return target;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 82 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
var global = __webpack_require__(2);
|
||
|
var dP = __webpack_require__(15);
|
||
|
var DESCRIPTORS = __webpack_require__(10);
|
||
|
var SPECIES = __webpack_require__(1)('species');
|
||
|
|
||
|
module.exports = function (KEY) {
|
||
|
var C = global[KEY];
|
||
|
if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
|
||
|
configurable: true,
|
||
|
get: function () { return this; }
|
||
|
});
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
/* 83 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var ITERATOR = __webpack_require__(1)('iterator');
|
||
|
var SAFE_CLOSING = false;
|
||
|
|
||
|
try {
|
||
|
var riter = [7][ITERATOR]();
|
||
|
riter['return'] = function () { SAFE_CLOSING = true; };
|
||
|
// eslint-disable-next-line no-throw-literal
|
||
|
Array.from(riter, function () { throw 2; });
|
||
|
} catch (e) { /* empty */ }
|
||
|
|
||
|
module.exports = function (exec, skipClosing) {
|
||
|
if (!skipClosing && !SAFE_CLOSING) return false;
|
||
|
var safe = false;
|
||
|
try {
|
||
|
var arr = [7];
|
||
|
var iter = arr[ITERATOR]();
|
||
|
iter.next = function () { return { done: safe = true }; };
|
||
|
arr[ITERATOR] = function () { return iter; };
|
||
|
exec(arr);
|
||
|
} catch (e) { /* empty */ }
|
||
|
return safe;
|
||
|
};
|
||
|
|
||
|
|
||
|
/***/ })
|
||
|
/******/ ]);
|