{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./_dev/js/admin/account-settings.js","webpack:///./_dev/js/admin/global.js"],"names":["settings","MONDIALRELAY_ACCOUNTSETTINGS","$","document","on","button","form","params","ajax","action","checkConnectionFields","forEach","field","find","val","MR","disabled","url","accountSettingsUrl","method","data","dataType","success","response","error","MONDIALRELAY_MESSAGES","unknown_error","complete","clearAjaxMessages","box","fadeOut","empty","displayAjaxMessages","fadeIn","addAjaxConfirmation","content","queue","append","clone","attr","removeClass","html","dequeue","addAjaxError","addClass","addAjaxMessages","confirmations","confirmation"],"mappings":";;;;;;;;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;;;;;;;AAQA;AACA;AAEA,IAAMA,QAAQ,GAAGC,4BAAjB;AAEAC,CAAC,CAACC,QAAD,CAAD,CAAYC,EAAZ,CAAe,OAAf,EAAwB,gCAAxB,EAA0D,YAAY;AACpE,MAAMC,MAAM,GAAG,IAAf;AACA,MAAMC,IAAI,GAAGD,MAAM,CAACC,IAApB;AAEA,MAAIC,MAAM,GAAG;AACbC,QAAI,EAAE,IADO;AAEbC,UAAM,EAAE;AAFK,GAAb;AAKAT,UAAQ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AAD,CAAqBO,KAArB,CAA2B,YAAY;AACrClC,KAAC,CAAC,IAAD,CAAD,CAAQmC,MAAR,CACEnC,CAAC,CAAC,oBAAD,CAAD,CACGoC,KADH,GAEGC,IAFH,CAEQ,IAFR,EAEc,IAFd,EAGGC,WAHH,CAGe,MAHf,EAIGC,IAJH,CAIQN,OAJR,CADF;AAOAjC,KAAC,CAAC,IAAD,CAAD,CAAQwC,OAAR;AACD,GATD;AAUD,CAXD;;AAaA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACR,OAAD,EAAUN,GAAV,EAAkB;AACrC3B,GAAC,CAAC2B,GAAG,IAAI,UAAR,CAAD,CAAqBO,KAArB,CAA2B,YAAY;AACrClC,KAAC,CAAC,IAAD,CAAD,CAAQmC,MAAR,CACEnC,CAAC,CAAC,oBAAD,CAAD,CACGoC,KADH,GAEGC,IAFH,CAEQ,IAFR,EAEc,IAFd,EAGGC,WAHH,CAGe,oBAHf,EAIGI,QAJH,CAIY,cAJZ,EAKGH,IALH,CAKQN,OALR,CADF;AAQAjC,KAAC,CAAC,IAAD,CAAD,CAAQwC,OAAR;AACD,GAVD;AAWD,CAZD;;AAcA,IAAMG,eAAe,GAAG,SAAlBA,eAAkB,CAACzB,IAAD,EAAOS,GAAP,EAAe;AACrCT,MAAI,CAAC0B,aAAL,CAAmBnC,OAAnB,CAA2B,UAAAoC,YAAY,EAAI;AACzCb,uBAAmB,CAACa,YAAD,EAAelB,GAAf,CAAnB;AACD,GAFD;AAIAT,MAAI,CAACI,KAAL,CAAWb,OAAX,CAAmB,UAAAa,KAAK,EAAI;AAC1BmB,gBAAY,CAACnB,KAAD,EAAQK,GAAR,CAAZ;AACD,GAFD;AAGD,CARD","file":"js/admin/account-settings.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./_dev/js/admin/account-settings.js\");\n","/**\n * NOTICE OF LICENSE\n *\n * @author 202 ecommerce \n * @author Mondial Relay\n * @copyright Copyright (c) Mondial Relay\n */\n\n// modules ES6\nimport * as MR from './global';\n\nconst settings = MONDIALRELAY_ACCOUNTSETTINGS;\n\n$(document).on('click', '#mondialrelay_check-connection', function () {\n const button = this;\n const form = button.form;\n\n let params = {\n ajax: true,\n action: 'checkConnection'\n };\n\n settings.checkConnectionFields.forEach(field => {\n params[field] = $(form).find(`[name=\"${field}\"]`).val();\n });\n\n MR.clearAjaxMessages();\n button.disabled = true;\n\n $.ajax({\n url: settings.accountSettingsUrl,\n method: 'POST',\n data: params,\n dataType: 'json',\n\n success: response => {\n MR.addAjaxMessages(response);\n MR.displayAjaxMessages();\n },\n\n error: response => {\n MR.addAjaxError(MONDIALRELAY_MESSAGES.unknown_error);\n MR.displayAjaxMessages();\n },\n\n complete: () => {\n button.disabled = false\n }\n });\n});\n\n","/**\n * NOTICE OF LICENSE\n *\n * @author 202 ecommerce \n * @author Mondial Relay\n * @copyright Copyright (c) Mondial Relay\n */\n\n/**\n * IMPORTANT NOTE : since the #ajaxBox is animated and its content modified\n * using callbacks on the animations, every function using that box should\n * probably use JQuery's .queue() method for synchronization\n */\n\nconst clearAjaxMessages = (box) => {\n $(box || '#ajaxBox').fadeOut(function () {\n $(this).empty();\n });\n};\n\nconst displayAjaxMessages = (box) => {\n $(box || '#ajaxBox').fadeIn();\n};\n\nconst addAjaxConfirmation = (content, box) => {\n $(box || '#ajaxBox').queue(function () {\n $(this).append(\n $('#ajax_confirmation')\n .clone()\n .attr('id', null)\n .removeClass('hide')\n .html(content)\n );\n $(this).dequeue();\n });\n};\n\nconst addAjaxError = (content, box) => {\n $(box || '#ajaxBox').queue(function () {\n $(this).append(\n $('#ajax_confirmation')\n .clone()\n .attr('id', null)\n .removeClass('hide alert-success')\n .addClass('alert-danger')\n .html(content)\n );\n $(this).dequeue();\n });\n};\n\nconst addAjaxMessages = (data, box) => {\n data.confirmations.forEach(confirmation => {\n addAjaxConfirmation(confirmation, box);\n });\n\n data.error.forEach(error => {\n addAjaxError(error, box);\n });\n};\n\nexport {\n clearAjaxMessages,\n displayAjaxMessages,\n addAjaxConfirmation,\n addAjaxError,\n addAjaxMessages\n};\n"],"sourceRoot":""}