/******/ (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 = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__i18n_js__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__i18n_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__i18n_js__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__icons__ = __webpack_require__(2);\n// Locale\n\n\n\n/**\n * Internal block libraries\n */\nvar __ = wp.i18n.__;\nvar registerBlockType = wp.blocks.registerBlockType;\nvar SelectControl = wp.components.SelectControl;\n\n/**\n * Register block\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (registerBlockType('godaddy-email-marketing-sign-up-forms/gem-block', {\n  title: __('GoDaddy Email Marketing', 'godaddy-email-marketing-sign-up-forms'),\n  description: __('Display a GoDaddy email marketing form.', 'godaddy-email-marketing-sign-up-forms'),\n  category: 'widgets',\n  icon: __WEBPACK_IMPORTED_MODULE_1__icons__[\"a\" /* default */].mail,\n  keywords: [__('GoDaddy', 'godaddy-email-marketing-sign-up-forms'), __('Email', 'godaddy-email-marketing-sign-up-forms'), __('Form', 'godaddy-email-marketing-sign-up-forms')],\n\n  attributes: {\n    form: {\n      type: 'string',\n      sourece: 'text',\n      default: gem.isConnected ? gem.forms[0].value : undefined\n    }\n  },\n\n  edit: function edit(props) {\n    var form = props.attributes.form,\n        isSelected = props.isSelected,\n        className = props.className,\n        setAttributes = props.setAttributes;\n\n\n    return [\n\n    // Admin Block Markup\n    wp.element.createElement(\n      'div',\n      { className: className, key: className },\n      wp.element.createElement(\n        'div',\n        { className: 'gem-forms' },\n        isSelected ? getFormSelect(form, setAttributes) : wp.element.createElement(\n          'div',\n          { className: 'gem-form' },\n          wp.element.createElement('img', { src: gem.preloaderUrl, className: 'preloader' }),\n          renderGemForm(form)\n        )\n      )\n    )];\n  },\n\n  save: function save(props) {\n    var form = props.attributes.form,\n        className = props.className;\n\n\n    if (!gem.isConnected) {\n\n      return;\n    }\n\n    return '[gem id=' + form + ']';\n  }\n}));\n\n/**\n * Generate the GoDaddy Email Marketing form select field.\n *\n * @param  {integer}  form          Form ID\n * @param  {function} setAttributes Set attributes method.\n */\nfunction getFormSelect(form, setAttributes) {\n\n  if (!gem.isConnected) {\n\n    return notConnectedError();\n  }\n\n  return wp.element.createElement(SelectControl, {\n    className: 'form',\n    label: __('GoDaddy Email Marketing Form', 'godaddy-email-marketing-sign-up-forms'),\n    value: form,\n    options: gem.forms,\n    onChange: function onChange(form) {\n      setAttributes({ form: form });\n    }\n  });\n}\n\n/**\n * Render the GoDaddy Email Marketing form markup\n *\n * @param {integer} formID Form ID\n */\nfunction renderGemForm(formID) {\n\n  if (!gem.isConnected) {\n\n    return notConnectedError();\n  }\n\n  var data = {\n    'action': 'get_gem_form',\n    'formID': formID\n  };\n\n  $.post(ajaxurl, data, function (response) {\n\n    if (!response.success) {\n\n      $('.gem-form').html(gem.getFormError);\n\n      return;\n    }\n\n    $('.gem-form').html(response.data);\n  });\n}\n\n/**\n * Render the error message when not connected to the GoDaddy Email Marketing API\n *\n * @return {mixed} Markup for the Not connected error notice.\n */\nfunction notConnectedError() {\n\n  return wp.element.createElement(\n    'div',\n    null,\n    __('GoDaddy Email Marketing is not connected.', 'godaddy-email-marketing-sign-up-forms'),\n    ' ',\n    wp.element.createElement(\n      'p',\n      null,\n      wp.element.createElement(\n        'a',\n        { 'class': 'button button-secondary', href: gem.settingsURL },\n        ' ',\n        __('Connect Now', 'godaddy-email-marketing-sign-up-forms')\n      )\n    )\n  );\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///0\n");

/***/ }),
/* 1 */
/***/ (function(module, exports) {

eval("/*\n * Set Locale\n */\nwp.i18n.setLocaleData({ '': {} }, 'godaddy-email-marketing-sign-up-forms');//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2luY2x1ZGVzL2Jsb2Nrcy9pMThuLmpzP2YyMDIiXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFNldCBMb2NhbGVcbiAqL1xud3AuaTE4bi5zZXRMb2NhbGVEYXRhKHsgJyc6IHt9IH0sICdnb2RhZGR5LWVtYWlsLW1hcmtldGluZy1zaWduLXVwLWZvcm1zJyk7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9pbmNsdWRlcy9ibG9ja3MvaTE4bi5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n");

/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("var gemIcons = {};\n\ngemIcons.mail = wp.element.createElement(\n  \"svg\",\n  {\n    xmlns: \"http://www.w3.org/2000/svg\",\n    width: \"20pt\",\n    height: \"22pt\",\n    viewBox: \"0 0 20 22\",\n    version: \"1.1\"\n  },\n  wp.element.createElement(\n    \"g\",\n    { id: \"surface1\" },\n    wp.element.createElement(\"path\", { style: { stroke: 'none', fillRule: 'nonzero', fill: 'rgb(23.137255%,76.078431%,18.039216%)', fillOpacity: '1' }, d: \"M 0.0390625, 11.097656 L 1.925781, 22 L 19.960938, 18.109375, L 19.960938, 6.890625, L 11.371094, 15.828125, Z M 0.0390625, 11.097656 \" }),\n    wp.element.createElement(\"path\", { style: { stroke: 'none', fillRule: 'nonzero', fill: 'rgb(23.137255%,76.078431%,18.039216%)', fillOpacity: '1' }, d: \"M 9.882812, 6.632812 C 6.785156, 7.230469, 0.164062, 9.597656, 0.164062, 9.597656, L 11.171875, 14.9375, L 19.289062, 5.828125, C 19.289062, 5.816406, 13.042969, 6.011719, 9.882812, 6.632812, Z M 9.882812, 6.632812 \" }),\n    wp.element.createElement(\"path\", { style: { stroke: 'none', fillRule: 'nonzero', fill: 'rgb(23.137255%,66.27451%,16.470588%)', fillOpacity: '1' }, d: \"M 0.164062, 9.597656 C 0.164062, 9.597656, 6.472656, 8.304688, 9.484375, 7.71875, L 19.277344, 5.816406, L 8.628906, 0 Z M 0.164062, 9.597656 \" })\n  )\n);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (gemIcons);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2luY2x1ZGVzL2Jsb2Nrcy9pY29ucy5qcz9hZjhkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnZW1JY29ucyA9IHt9O1xuXG5nZW1JY29ucy5tYWlsID0gd3AuZWxlbWVudC5jcmVhdGVFbGVtZW50KFxuICBcInN2Z1wiLFxuICB7XG4gICAgeG1sbnM6IFwiaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmdcIixcbiAgICB3aWR0aDogXCIyMHB0XCIsXG4gICAgaGVpZ2h0OiBcIjIycHRcIixcbiAgICB2aWV3Qm94OiBcIjAgMCAyMCAyMlwiLFxuICAgIHZlcnNpb246IFwiMS4xXCJcbiAgfSxcbiAgd3AuZWxlbWVudC5jcmVhdGVFbGVtZW50KFxuICAgIFwiZ1wiLFxuICAgIHsgaWQ6IFwic3VyZmFjZTFcIiB9LFxuICAgIHdwLmVsZW1lbnQuY3JlYXRlRWxlbWVudChcInBhdGhcIiwgeyBzdHlsZTogeyBzdHJva2U6ICdub25lJywgZmlsbFJ1bGU6ICdub256ZXJvJywgZmlsbDogJ3JnYigyMy4xMzcyNTUlLDc2LjA3ODQzMSUsMTguMDM5MjE2JSknLCBmaWxsT3BhY2l0eTogJzEnIH0sIGQ6IFwiTSAwLjAzOTA2MjUsIDExLjA5NzY1Ni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