From 8b001c1f27aad4240d381b0a488f561bef9fdde3 Mon Sep 17 00:00:00 2001 From: Jaap Oostinjen Date: Mon, 6 Mar 2023 09:46:30 +0100 Subject: [PATCH 1/3] Fix for fields trough relationships Resolves #92 --- resources/js/components/FormField.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/js/components/FormField.vue b/resources/js/components/FormField.vue index 86cc725..7191ef8 100644 --- a/resources/js/components/FormField.vue +++ b/resources/js/components/FormField.vue @@ -93,7 +93,12 @@ export default { data[locale.key] = value; } } else { - formData.append(key, value); + // Fix for when the field is coming from a relationship + if (formData.formData) { + formData.formData.append(key, value); + } else { + formData.append(key, value); + } } } } From d835dfabfd7a07c7844f69b219489107ea7a0203 Mon Sep 17 00:00:00 2001 From: Jaap Oostinjen Date: Mon, 6 Mar 2023 11:25:18 +0100 Subject: [PATCH 2/3] Commit compiled assets --- dist/nova-translatable-select-field.js | 697 ++++++++++- dist/nova-translatable.js | 1537 +++++++++++++++++++++++- 2 files changed, 2232 insertions(+), 2 deletions(-) diff --git a/dist/nova-translatable-select-field.js b/dist/nova-translatable-select-field.js index 774eff9..1d4a4f5 100644 --- a/dist/nova-translatable-select-field.js +++ b/dist/nova-translatable-select-field.js @@ -1 +1,696 @@ -(()=>{"use strict";var e={744:(e,t)=>{t.Z=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}(()=>{const e=Vue;const t=LaravelNova;function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:void 0,t=null!=e?e:void 0;return void 0!==t?"nova-translatable-".concat(t,"@setAllLocale"):"nova-translatable@setAllLocale"}}};const s={props:["activeLocale","locales","displayType","detail","resourceName","resourceId","field"],computed:{localesOptions:function(){return this.locales.map((function(e){return{label:e.name,value:e.key}}))},selectStyles:function(){var e={};switch(e.padding=this.detail?"1rem 0 1rem 0":"1rem",this.displayType){case"left-static":return e.marginRight="auto",e;case"right-static":return e.marginRight="0",e.marginLeft="auto",e;case"left-absolute":return e.position="absolute",e.left="0",e;default:return e.position="absolute",e.right="0",e}}}};var u=n(744);const f=(0,u.Z)(s,[["render",function(t,n,r,o,l,a){var i=(0,e.resolveComponent)("SelectControl");return(0,e.openBlock)(),(0,e.createElementBlock)("div",{class:"locale-select-field w-1/6 z-10",style:(0,e.normalizeStyle)(a.selectStyles)},[(0,e.createVNode)(i,{onChange:n[0]||(n[0]=function(e){return t.$emit("localeChanged",e)}),selected:r.activeLocale,class:"w-full form-control form-select",options:a.localesOptions},null,8,["selected","options"])],4)}]]),d={components:{LocaleSelect:f},mixins:[t.FormField,c],props:["resourceName","resourceId","resource","field"],methods:{fill:function(e){}}},p=(0,u.Z)(d,[["render",function(t,n,r,o,l,a){var i=(0,e.resolveComponent)("LocaleSelect");return(0,e.openBlock)(),(0,e.createBlock)(i,{detail:!1,"active-locale":t.activeLocale,locales:t.locales,"display-type":r.field.translatable.display_type,onLocaleChanged:t.setAllLocale},null,8,["active-locale","locales","display-type","onLocaleChanged"])}]]);const v={components:{LocaleSelect:f},mixins:[c],props:["resourceName","resourceId","resource","field"]},h=(0,u.Z)(v,[["render",function(t,n,r,o,l,a){var i=(0,e.resolveComponent)("LocaleSelect");return(0,e.openBlock)(),(0,e.createBlock)(i,{detail:!0,"active-locale":t.activeLocale,locales:t.locales,"display-type":r.field.translatable.display_type,onLocaleChanged:t.setAllLocale},null,8,["active-locale","locales","display-type","onLocaleChanged"])}]]);Nova.booting((function(e,t,n){e.component("form-locale-select-field",p),e.component("detail-locale-select-field",h),e.component("nova-translatable-locale-select",f)}))})()})(); \ No newline at end of file +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/DetailField.vue?vue&type=script&lang=js": +/*!*******************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/DetailField.vue?vue&type=script&lang=js ***! + \*******************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _mixins_TranslatableField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/TranslatableField */ "./resources/js/mixins/TranslatableField.js"); +/* harmony import */ var _LocaleSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LocaleSelect */ "./resources/js/components/locale-select/LocaleSelect.vue"); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + components: { + LocaleSelect: _LocaleSelect__WEBPACK_IMPORTED_MODULE_1__["default"] + }, + mixins: [_mixins_TranslatableField__WEBPACK_IMPORTED_MODULE_0__["default"]], + props: ['resourceName', 'resourceId', 'resource', 'field'] +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/FormField.vue?vue&type=script&lang=js": +/*!*****************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/FormField.vue?vue&type=script&lang=js ***! + \*****************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var laravel_nova__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! laravel-nova */ "laravel-nova"); +/* harmony import */ var laravel_nova__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(laravel_nova__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _mixins_TranslatableField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/TranslatableField */ "./resources/js/mixins/TranslatableField.js"); +/* harmony import */ var _LocaleSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LocaleSelect */ "./resources/js/components/locale-select/LocaleSelect.vue"); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + components: { + LocaleSelect: _LocaleSelect__WEBPACK_IMPORTED_MODULE_2__["default"] + }, + mixins: [laravel_nova__WEBPACK_IMPORTED_MODULE_0__.FormField, _mixins_TranslatableField__WEBPACK_IMPORTED_MODULE_1__["default"]], + props: ['resourceName', 'resourceId', 'resource', 'field'], + methods: { + fill: function fill(formData) { + return; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/LocaleSelect.vue?vue&type=script&lang=js": +/*!********************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/LocaleSelect.vue?vue&type=script&lang=js ***! + \********************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + props: ['activeLocale', 'locales', 'displayType', 'detail', 'resourceName', 'resourceId', 'field'], + computed: { + localesOptions: function localesOptions() { + return this.locales.map(function (locale) { + return { + label: locale.name, + value: locale.key + }; + }); + }, + selectStyles: function selectStyles() { + var styles = {}; + styles.padding = this.detail ? '1rem 0 1rem 0' : '1rem'; + + switch (this.displayType) { + case 'left-static': + styles.marginRight = 'auto'; + return styles; + + case 'right-static': + styles.marginRight = '0'; + styles.marginLeft = 'auto'; + return styles; + + case 'left-absolute': + styles.position = 'absolute'; + styles.left = '0'; + return styles; + + case 'right-absolute': + default: + styles.position = 'absolute'; + styles.right = '0'; + return styles; + } + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/DetailField.vue?vue&type=template&id=7f2f16e4": +/*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/DetailField.vue?vue&type=template&id=7f2f16e4 ***! + \***********************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* binding */ render) +/* harmony export */ }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue"); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); + +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_LocaleSelect = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("LocaleSelect"); + + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_LocaleSelect, { + detail: true, + "active-locale": _ctx.activeLocale, + locales: _ctx.locales, + "display-type": $props.field.translatable.display_type, + onLocaleChanged: _ctx.setAllLocale + }, null, 8 + /* PROPS */ + , ["active-locale", "locales", "display-type", "onLocaleChanged"]); +} + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/FormField.vue?vue&type=template&id=361b40bb": +/*!*********************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/FormField.vue?vue&type=template&id=361b40bb ***! + \*********************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* binding */ render) +/* harmony export */ }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue"); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); + +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_LocaleSelect = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("LocaleSelect"); + + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_LocaleSelect, { + detail: false, + "active-locale": _ctx.activeLocale, + locales: _ctx.locales, + "display-type": $props.field.translatable.display_type, + onLocaleChanged: _ctx.setAllLocale + }, null, 8 + /* PROPS */ + , ["active-locale", "locales", "display-type", "onLocaleChanged"]); +} + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/LocaleSelect.vue?vue&type=template&id=5e6b59e1": +/*!************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/LocaleSelect.vue?vue&type=template&id=5e6b59e1 ***! + \************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* binding */ render) +/* harmony export */ }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue"); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); + +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_SelectControl = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("SelectControl"); + + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", { + "class": "locale-select-field w-1/6 z-10", + style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)($options.selectStyles) + }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" Select Input Field "), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SelectControl, { + onChange: _cache[0] || (_cache[0] = function (value) { + return _ctx.$emit('localeChanged', value); + }), + selected: $props.activeLocale, + "class": "w-full form-control form-select", + options: $options.localesOptions + }, null, 8 + /* PROPS */ + , ["selected", "options"])], 4 + /* STYLE */ + ); +} + +/***/ }), + +/***/ "./resources/js/mixins/TranslatableField.js": +/*!**************************************************!*\ + !*** ./resources/js/mixins/TranslatableField.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + props: ['uniqueId'], + data: function data() { + return { + activeLocale: void 0, + originalFieldName: void 0, + fields: this.getInitialFields(), + isMounted: false + }; + }, + beforeMount: function beforeMount() { + this.init(); + }, + mounted: function mounted() { + this.isMounted = true; // Listen to setAllLocale event + + if (this.uniqueId) Nova.$on(this.getAllLocalesEventName(this.uniqueId), this.setActiveLocale); + Nova.$on(this.getAllLocalesEventName(), this.setActiveLocale); + }, + beforeDestroy: function beforeDestroy() { + if (this.uniqueId) Nova.$off(this.getAllLocalesEventName(this.uniqueId)); + Nova.$off(this.getAllLocalesEventName()); + }, + computed: { + locales: function locales() { + var _this = this; + + var localeKeys = Object.keys(this.currentField.translatable.locales); + + if (this.currentField.translatable.prioritize_nova_locale) { + localeKeys = localeKeys.sort(function (a, b) { + if (a === Nova.config('locale') && b !== Nova.config('locale')) return -1; + if (a !== Nova.config('locale') && b === Nova.config('locale')) return 1; + return 0; + }); + } + + return localeKeys.map(function (key) { + return { + key: key, + name: _this.currentField.translatable.locales[key] + }; + }); + }, + fieldValueMustBeAnObject: function fieldValueMustBeAnObject() { + return ['key-value-field'].includes(this.currentField.translatable.original_component); + }, + isFlexible: function isFlexible() { + return this.$parent && this.$parent.field && this.$parent.field.component === 'nova-flexible-content'; + }, + isSimpleRepeatable: function isSimpleRepeatable() { + return this.$parent && this.$parent.$parent && this.$parent.$parent.field && this.$parent.$parent.field.component === 'simple-repeatable'; + }, + isFile: function isFile() { + return ['file-field'].includes(this.currentField.translatable.original_component); + }, + currentField: function currentField() { + return this.syncedField || this.field; + } + }, + methods: { + init: function init() { + var _this2 = this; + + this.originalFieldName = this.currentField.name; + this.activeLocale = this.locales[0].key; // Get starting values + + var initialValues = this.getInitialValues(); // Create fields + + this.locales.forEach(function (locale) { + return Object.assign(_this2.fields[locale.key], _objectSpread(_objectSpread({}, _this2.currentField), {}, { + dependsOn: null, + extraAttributes: _objectSpread({}, _this2.currentField.extraAttributes || {}), + value: initialValues[locale.key] || '', + displayedAs: initialValues[locale.key] || '', + attribute: "".concat(_this2.currentField.attribute, ".").concat(locale.key), + // Append '.en' to avoid duplicate ID-s in DOM + validationKey: "".concat(_this2.currentField.attribute, ".").concat(locale.key) // Append locale to validationKey + + })); + }); + }, + onSyncedField: function onSyncedField() { + this.init(); + }, + getInitialValues: function getInitialValues() { + var initialValue = {}; + + var _iterator = _createForOfIteratorHelper(this.locales), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var locale = _step.value; + var localeValue = this.currentField.translatable.value && this.currentField.translatable.value[locale.key] || ''; + initialValue[locale.key] = this.formatValue(localeValue); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + + return initialValue; + }, + getInitialFields: function getInitialFields() { + var field = this.currentField || this.field; + var locales = Object.keys(field.translatable.locales); + var fields = {}; + locales.forEach(function (locale) { + fields[locale] = { + value: '', + readonly: '', + extraAttributes: {}, + attribute: '', + component: '', + name: '', + nullable: '', + textAlign: '' + }; + }); + return fields; + }, + setActiveLocale: function setActiveLocale(newLocale) { + this.activeLocale = newLocale; + this.refreshCodeMirror(); + }, + refreshCodeMirror: function refreshCodeMirror() { + var _this3 = this; + + setTimeout(function () { + if (!_this3.$refs.main) return; + + var cmList = _this3.$refs.main.querySelectorAll('.CodeMirror'); + + if (!cmList.length) return; + cmList.forEach(function (cm) { + return cm.CodeMirror.refresh(); + }); + }, 1); + }, + setAllLocale: function setAllLocale(newLocale) { + Nova.$emit(this.getAllLocalesEventName(), newLocale); + }, + formatValue: function formatValue(value) { + var formattedValue = value || ''; + + if (this.fieldValueMustBeAnObject && typeof formattedValue === 'string') { + try { + formattedValue = JSON.parse(formattedValue || '{}'); + } catch (e) { + formattedValue = {}; + } + } + + return formattedValue; + }, + getAllLocalesEventName: function getAllLocalesEventName() { + var uniqueId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : void 0; + var id = uniqueId !== null && uniqueId !== void 0 ? uniqueId : void 0; + return id !== void 0 ? "nova-translatable-".concat(id, "@setAllLocale") : 'nova-translatable@setAllLocale'; + } + } +}); + +/***/ }), + +/***/ "./node_modules/vue-loader/dist/exportHelper.js": +/*!******************************************************!*\ + !*** ./node_modules/vue-loader/dist/exportHelper.js ***! + \******************************************************/ +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +// runtime helper for setting properties on components +// in a tree-shakable way +exports["default"] = (sfc, props) => { + const target = sfc.__vccOpts || sfc; + for (const [key, val] of props) { + target[key] = val; + } + return target; +}; + + +/***/ }), + +/***/ "./resources/js/components/locale-select/DetailField.vue": +/*!***************************************************************!*\ + !*** ./resources/js/components/locale-select/DetailField.vue ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _DetailField_vue_vue_type_template_id_7f2f16e4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DetailField.vue?vue&type=template&id=7f2f16e4 */ "./resources/js/components/locale-select/DetailField.vue?vue&type=template&id=7f2f16e4"); +/* harmony import */ var _DetailField_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DetailField.vue?vue&type=script&lang=js */ "./resources/js/components/locale-select/DetailField.vue?vue&type=script&lang=js"); +/* harmony import */ var _Users_jaapoostinjen_Development_Web_nova_translatable_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); + + + + +; +const __exports__ = /*#__PURE__*/(0,_Users_jaapoostinjen_Development_Web_nova_translatable_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_DetailField_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DetailField_vue_vue_type_template_id_7f2f16e4__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/locale-select/DetailField.vue"]]) +/* hot reload */ +if (false) {} + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); + +/***/ }), + +/***/ "./resources/js/components/locale-select/FormField.vue": +/*!*************************************************************!*\ + !*** ./resources/js/components/locale-select/FormField.vue ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _FormField_vue_vue_type_template_id_361b40bb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./FormField.vue?vue&type=template&id=361b40bb */ "./resources/js/components/locale-select/FormField.vue?vue&type=template&id=361b40bb"); +/* harmony import */ var _FormField_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FormField.vue?vue&type=script&lang=js */ "./resources/js/components/locale-select/FormField.vue?vue&type=script&lang=js"); +/* harmony import */ var _Users_jaapoostinjen_Development_Web_nova_translatable_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); + + + + +; +const __exports__ = /*#__PURE__*/(0,_Users_jaapoostinjen_Development_Web_nova_translatable_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_FormField_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_FormField_vue_vue_type_template_id_361b40bb__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/locale-select/FormField.vue"]]) +/* hot reload */ +if (false) {} + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); + +/***/ }), + +/***/ "./resources/js/components/locale-select/LocaleSelect.vue": +/*!****************************************************************!*\ + !*** ./resources/js/components/locale-select/LocaleSelect.vue ***! + \****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _LocaleSelect_vue_vue_type_template_id_5e6b59e1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./LocaleSelect.vue?vue&type=template&id=5e6b59e1 */ "./resources/js/components/locale-select/LocaleSelect.vue?vue&type=template&id=5e6b59e1"); +/* harmony import */ var _LocaleSelect_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LocaleSelect.vue?vue&type=script&lang=js */ "./resources/js/components/locale-select/LocaleSelect.vue?vue&type=script&lang=js"); +/* harmony import */ var _Users_jaapoostinjen_Development_Web_nova_translatable_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); + + + + +; +const __exports__ = /*#__PURE__*/(0,_Users_jaapoostinjen_Development_Web_nova_translatable_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_LocaleSelect_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_LocaleSelect_vue_vue_type_template_id_5e6b59e1__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/locale-select/LocaleSelect.vue"]]) +/* hot reload */ +if (false) {} + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); + +/***/ }), + +/***/ "./resources/js/components/locale-select/DetailField.vue?vue&type=script&lang=js": +/*!***************************************************************************************!*\ + !*** ./resources/js/components/locale-select/DetailField.vue?vue&type=script&lang=js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DetailField_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]) +/* harmony export */ }); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DetailField_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DetailField.vue?vue&type=script&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/DetailField.vue?vue&type=script&lang=js"); + + +/***/ }), + +/***/ "./resources/js/components/locale-select/FormField.vue?vue&type=script&lang=js": +/*!*************************************************************************************!*\ + !*** ./resources/js/components/locale-select/FormField.vue?vue&type=script&lang=js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_FormField_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]) +/* harmony export */ }); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_FormField_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./FormField.vue?vue&type=script&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/FormField.vue?vue&type=script&lang=js"); + + +/***/ }), + +/***/ "./resources/js/components/locale-select/LocaleSelect.vue?vue&type=script&lang=js": +/*!****************************************************************************************!*\ + !*** ./resources/js/components/locale-select/LocaleSelect.vue?vue&type=script&lang=js ***! + \****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_LocaleSelect_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]) +/* harmony export */ }); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_LocaleSelect_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./LocaleSelect.vue?vue&type=script&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/LocaleSelect.vue?vue&type=script&lang=js"); + + +/***/ }), + +/***/ "./resources/js/components/locale-select/DetailField.vue?vue&type=template&id=7f2f16e4": +/*!*********************************************************************************************!*\ + !*** ./resources/js/components/locale-select/DetailField.vue?vue&type=template&id=7f2f16e4 ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DetailField_vue_vue_type_template_id_7f2f16e4__WEBPACK_IMPORTED_MODULE_0__.render) +/* harmony export */ }); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DetailField_vue_vue_type_template_id_7f2f16e4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DetailField.vue?vue&type=template&id=7f2f16e4 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/DetailField.vue?vue&type=template&id=7f2f16e4"); + + +/***/ }), + +/***/ "./resources/js/components/locale-select/FormField.vue?vue&type=template&id=361b40bb": +/*!*******************************************************************************************!*\ + !*** ./resources/js/components/locale-select/FormField.vue?vue&type=template&id=361b40bb ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_FormField_vue_vue_type_template_id_361b40bb__WEBPACK_IMPORTED_MODULE_0__.render) +/* harmony export */ }); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_FormField_vue_vue_type_template_id_361b40bb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./FormField.vue?vue&type=template&id=361b40bb */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/FormField.vue?vue&type=template&id=361b40bb"); + + +/***/ }), + +/***/ "./resources/js/components/locale-select/LocaleSelect.vue?vue&type=template&id=5e6b59e1": +/*!**********************************************************************************************!*\ + !*** ./resources/js/components/locale-select/LocaleSelect.vue?vue&type=template&id=5e6b59e1 ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_LocaleSelect_vue_vue_type_template_id_5e6b59e1__WEBPACK_IMPORTED_MODULE_0__.render) +/* harmony export */ }); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_LocaleSelect_vue_vue_type_template_id_5e6b59e1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./LocaleSelect.vue?vue&type=template&id=5e6b59e1 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/locale-select/LocaleSelect.vue?vue&type=template&id=5e6b59e1"); + + +/***/ }), + +/***/ "laravel-nova": +/*!******************************!*\ + !*** external "LaravelNova" ***! + \******************************/ +/***/ ((module) => { + +module.exports = LaravelNova; + +/***/ }), + +/***/ "vue": +/*!**********************!*\ + !*** external "Vue" ***! + \**********************/ +/***/ ((module) => { + +module.exports = Vue; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +/*!*********************************************!*\ + !*** ./resources/js/locale-select-field.js ***! + \*********************************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _components_locale_select_FormField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/locale-select/FormField */ "./resources/js/components/locale-select/FormField.vue"); +/* harmony import */ var _components_locale_select_DetailField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/locale-select/DetailField */ "./resources/js/components/locale-select/DetailField.vue"); +/* harmony import */ var _components_locale_select_LocaleSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/locale-select/LocaleSelect */ "./resources/js/components/locale-select/LocaleSelect.vue"); + + + +Nova.booting(function (Vue, router, store) { + Vue.component('form-locale-select-field', _components_locale_select_FormField__WEBPACK_IMPORTED_MODULE_0__["default"]); + Vue.component('detail-locale-select-field', _components_locale_select_DetailField__WEBPACK_IMPORTED_MODULE_1__["default"]); + Vue.component('nova-translatable-locale-select', _components_locale_select_LocaleSelect__WEBPACK_IMPORTED_MODULE_2__["default"]); +}); +})(); + +/******/ })() +; \ No newline at end of file diff --git a/dist/nova-translatable.js b/dist/nova-translatable.js index bd837fd..42aaecc 100644 --- a/dist/nova-translatable.js +++ b/dist/nova-translatable.js @@ -1 +1,1536 @@ -(()=>{"use strict";var e={533:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,".translatable-field .flex.border-t[data-v-60cefbbd]{border-style:none!important}",""]);const o=a},81:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,".translatable-field:not(:last-child) .field-wrapper[data-v-4d4c0050]{border-style:solid!important}",""]);const o=a},656:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,".nova-translatable-locale-tabs{padding-top:.25rem;position:relative;z-index:2}.nova-translatable-locale-tabs .locale-tag{border-bottom:2px solid transparent}.nova-translatable-locale-tabs .locale-tag.-active{border-color:rgba(var(--colors-primary-500));color:rgba(var(--colors-primary-500))}.nova-translatable-locale-tabs .locale-tag.-error{border-color:rgba(var(--colors-red-500));color:rgba(var(--colors-red-500))}.nova-translatable-locale-tabs .locale-tag.-error.-active{color:rgba(var(--colors-primary-500))}",""]);const o=a},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var a={};if(n)for(var o=0;o{var n,a=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},o=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),l=[];function i(e){for(var t=-1,r=0;r{t.Z=(e,t)=>{const r=e.__vccOpts||e;for(const[e,n]of t)r[e]=n;return r}}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={id:n,exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nc=void 0,(()=>{const e=Vue;var t={key:0,class:"translatable-field pt-2",ref:"main"};const n=LaravelNova;function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,i=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,l=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw l}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:void 0,t=null!=e?e:void 0;return void 0!==t?"nova-translatable-".concat(t,"@setAllLocale"):"nova-translatable@setAllLocale"}}};var u=["dusk","onClick","onDblclick"];const d={props:["attribute","locales","activeLocale","displayType","detail","errors","errorAttributes","localesWithErrors"],computed:{listClasses:function(){return"column"===this.displayType?["flex","flex-col"]:[]}},methods:{hasError:function(e){if(Array.isArray(this.localesWithErrors)&&this.localesWithErrors.includes(e))return!0;if(!this.errors||!this.errorAttributes)return!1;var t=this.errorAttributes[e];return this.errors.has(t)},getDuskKey:function(e){return this.attribute?"".concat(this.attribute,".").concat(e,".locale.tab"):this.errorAttributes&&this.errorAttributes[e]?"".concat(this.errorAttributes[e],".locale.tab"):e+".locale.tab"}}};var f=r(379),v=r.n(f),p=r(656),b={insert:"head",singleton:!1};v()(p.Z,b);p.Z.locals;var h=r(744);const y=(0,h.Z)(d,[["render",function(t,r,n,a,o,l){return(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)("div",{class:(0,e.normalizeClass)(["nova-translatable-locale-tabs flex select-none",{"px-8":!this.detail}])},["none"!=n.displayType?((0,e.openBlock)(),(0,e.createElementBlock)("div",{key:0,class:(0,e.normalizeClass)(["ml-auto",l.listClasses])},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(n.locales,(function(r){return(0,e.openBlock)(),(0,e.createElementBlock)("a",{key:r.key,dusk:l.getDuskKey(r.key),class:(0,e.normalizeClass)(["locale-tag ml-3 cursor-pointer font-bold text-80 text-sm",{"-active":r.key===n.activeLocale,"-error":l.hasError(r.key)}]),onClick:function(){return t.$emit("tabClick",r.key)},onDblclick:function(){return t.$emit("doubleClick",r.key)}},(0,e.toDisplayString)(r.name),43,u)})),128))],2)):(0,e.createCommentVNode)("",!0)],2)),[[e.vShow,n.locales.length>1]])}]]);function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,o=[],l=!0,i=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==r.return||r.return()}finally{if(i)throw a}}return o}(e,t)||k(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=k(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return l=e.done,e},e:function(e){i=!0,o=e},f:function(){try{l||null==r.return||r.return()}finally{if(i)throw o}}}}function k(e,t){if(e){if("string"==typeof e)return A(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/DetailField.vue?vue&type=script&lang=js": +/*!*****************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/DetailField.vue?vue&type=script&lang=js ***! + \*****************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _mixins_TranslatableField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mixins/TranslatableField */ "./resources/js/mixins/TranslatableField.js"); +/* harmony import */ var _LocaleTabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LocaleTabs */ "./resources/js/components/LocaleTabs.vue"); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + components: { + LocaleTabs: _LocaleTabs__WEBPACK_IMPORTED_MODULE_1__["default"] + }, + mixins: [_mixins_TranslatableField__WEBPACK_IMPORTED_MODULE_0__["default"]], + props: ['resourceName', 'resourceId', 'resource', 'field'] +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/FormField.vue?vue&type=script&lang=js": +/*!***************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/FormField.vue?vue&type=script&lang=js ***! + \***************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var laravel_nova__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! laravel-nova */ "laravel-nova"); +/* harmony import */ var laravel_nova__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(laravel_nova__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _mixins_TranslatableField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mixins/TranslatableField */ "./resources/js/mixins/TranslatableField.js"); +/* harmony import */ var _LocaleTabs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LocaleTabs */ "./resources/js/components/LocaleTabs.vue"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + components: { + LocaleTabs: _LocaleTabs__WEBPACK_IMPORTED_MODULE_2__["default"] + }, + mixins: [laravel_nova__WEBPACK_IMPORTED_MODULE_0__.HandlesValidationErrors, laravel_nova__WEBPACK_IMPORTED_MODULE_0__.DependentFormField, _mixins_TranslatableField__WEBPACK_IMPORTED_MODULE_1__["default"]], + props: ['field', 'resourceId', 'resourceName'], + methods: { + setInitialValue: function setInitialValue() {// Do nothing + }, + isKeyAnArray: function isKeyAnArray(key) { + var ARR_REGEX = function ARR_REGEX() { + return /\[\d+\]$/g; + }; + + return !!key.match(ARR_REGEX()); + }, + getKeyAndValue: function getKeyAndValue(rawKey, locale, formData) { + var ARR_REGEX = function ARR_REGEX() { + return /\[\d+\]$/g; + }; + + var LOC_LEN = locale.key.length + 1; + var key = rawKey; // Remove '.en' ending from key + + if (key.slice(-LOC_LEN) === ".".concat(locale.key)) key = key.slice(0, -LOC_LEN); // Is key is an array, we need to remove the '.en' part from '.en[0]' + + var isArray = !!key.match(ARR_REGEX()); + + if (isArray) { + var result = ARR_REGEX().exec(key); + key = "".concat(key.slice(0, result.index - LOC_LEN)).concat(key.slice(result.index)); + } + + if (isArray) { + var _result = ARR_REGEX().exec(key); + + return ["".concat(key.slice(0, _result.index), "[").concat(locale.key, "]").concat(key.slice(_result.index)), formData.get(rawKey)]; + } else { + return ["".concat(key, "[").concat(locale.key, "]"), formData.get(rawKey)]; + } + }, + fill: function fill(formData) { + try { + if (this.isFlexible && this.isFile) return alert('Sorry, nova-translatable File and Image fields inside Flexible currently do not work.'); + var data = {}; + var originalAttribute = this.currentField.translatable.original_attribute; + + var _iterator = _createForOfIteratorHelper(this.locales), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var locale = _step.value; + var tempFormData = new FormData(); + var field = this.fields[locale.key]; + if (field.fill) field.fill(tempFormData); + var formDataKeys = Array.from(tempFormData.keys()); + + for (var _i = 0, _formDataKeys = formDataKeys; _i < _formDataKeys.length; _i++) { + var rawKey = _formDataKeys[_i]; + + var _this$getKeyAndValue = this.getKeyAndValue(rawKey, locale, tempFormData), + _this$getKeyAndValue2 = _slicedToArray(_this$getKeyAndValue, 2), + key = _this$getKeyAndValue2[0], + value = _this$getKeyAndValue2[1]; + + if (this.isFlexible && key.endsWith(originalAttribute + "[".concat(locale.key, "]")) || this.isSimpleRepeatable) { + if (this.isKeyAnArray(rawKey)) { + if (!data[locale.key]) data[locale.key] = []; + data[locale.key].push(value); + } else { + data[locale.key] = value; + } + } else { + console.log(formData); + formData.append(key, value); + } + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + + if (this.isFlexible || this.isSimpleRepeatable) formData.append(originalAttribute, JSON.stringify(data)); + return; + } catch (e) { + console.error(e); + } + } + }, + computed: { + errorAttributes: function errorAttributes() { + var locales = this.locales; + var errorAttributes = {}; + + var _iterator2 = _createForOfIteratorHelper(locales), + _step2; + + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var locale = _step2.value; + errorAttributes[locale.key] = "".concat(this.currentField.attribute, ".").concat(locale.key); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + + return errorAttributes; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/IndexField.vue?vue&type=script&lang=js": +/*!****************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/IndexField.vue?vue&type=script&lang=js ***! + \****************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _mixins_TranslatableField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mixins/TranslatableField */ "./resources/js/mixins/TranslatableField.js"); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + mixins: [_mixins_TranslatableField__WEBPACK_IMPORTED_MODULE_0__["default"]], + props: ['resourceName', 'resourceId', 'resource', 'field'] +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/LocaleTabs.vue?vue&type=script&lang=js": +/*!****************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/LocaleTabs.vue?vue&type=script&lang=js ***! + \****************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + props: ['attribute', 'locales', 'activeLocale', 'displayType', 'detail', 'errors', 'errorAttributes', 'localesWithErrors'], + computed: { + listClasses: function listClasses() { + if (this.displayType === 'column') return ['flex', 'flex-col']; + return []; + } + }, + methods: { + hasError: function hasError(locale) { + if (Array.isArray(this.localesWithErrors) && this.localesWithErrors.includes(locale)) return true; + if (!this.errors || !this.errorAttributes) return false; + var errorAttribute = this.errorAttributes[locale]; + return this.errors.has(errorAttribute); + }, + getDuskKey: function getDuskKey(locale) { + if (this.attribute) { + return "".concat(this.attribute, ".").concat(locale, ".locale.tab"); + } + + if (this.errorAttributes && this.errorAttributes[locale]) { + return "".concat(this.errorAttributes[locale], ".locale.tab"); + } + + return locale + '.locale.tab'; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/DetailField.vue?vue&type=template&id=0224618e&scoped=true": +/*!*********************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/DetailField.vue?vue&type=template&id=0224618e&scoped=true ***! + \*********************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* binding */ render) +/* harmony export */ }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue"); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); + + +var _withScopeId = function _withScopeId(n) { + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0224618e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n; +}; + +var _hoisted_1 = { + "class": "translatable-field pt-2 border-t border-gray-100 dark:border-gray-700 -mx-6 px-6", + ref: "main" +}; +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_LocaleTabs = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("LocaleTabs"); + + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_LocaleTabs, { + detail: true, + attribute: $props.field.attribute, + locales: _ctx.locales, + "active-locale": _ctx.activeLocale, + "display-type": $props.field.translatable.display_type, + onTabClick: _cache[0] || (_cache[0] = function (locale) { + return _ctx.activeLocale = locale; + }), + onDoubleClick: _ctx.setAllLocale + }, null, 8 + /* PROPS */ + , ["attribute", "locales", "active-locale", "display-type", "onDoubleClick"]), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.locales, function (locale) { + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", { + key: locale.key + }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)((0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent)('detail-' + $props.field.translatable.original_component), { + field: _ctx.fields[locale.key], + "translatable-locale": locale.key, + "resource-name": $props.resourceName + }, null, 8 + /* PROPS */ + , ["field", "translatable-locale", "resource-name"])), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, locale.key === _ctx.activeLocale]])]); + }), 128 + /* KEYED_FRAGMENT */ + ))], 512 + /* NEED_PATCH */ + ); +} + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/FormField.vue?vue&type=template&id=c023248a&scoped=true": +/*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/FormField.vue?vue&type=template&id=c023248a&scoped=true ***! + \*******************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* binding */ render) +/* harmony export */ }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue"); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); + + +var _withScopeId = function _withScopeId(n) { + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-c023248a"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n; +}; + +var _hoisted_1 = { + key: 0, + "class": "translatable-field pt-2", + ref: "main" +}; +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_LocaleTabs = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("LocaleTabs"); + + return _ctx.currentField.visible ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_LocaleTabs, { + locales: _ctx.locales, + attribute: $props.field.attribute, + "active-locale": _ctx.activeLocale, + "display-type": _ctx.currentField.translatable.display_type, + errors: _ctx.errors, + "error-attributes": $options.errorAttributes, + onTabClick: _ctx.setActiveLocale, + onDoubleClick: _ctx.setAllLocale + }, null, 8 + /* PROPS */ + , ["locales", "attribute", "active-locale", "display-type", "errors", "error-attributes", "onTabClick", "onDoubleClick"]), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.locales, function (locale) { + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", { + key: locale.key + }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)((0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent)('form-' + _ctx.currentField.translatable.original_component), { + field: _ctx.fields[locale.key], + "resource-name": $props.resourceName, + errors: _ctx.errors, + "translatable-locale": locale.key, + "show-help-text": _ctx.showHelpText + }, null, 8 + /* PROPS */ + , ["field", "resource-name", "errors", "translatable-locale", "show-help-text"])), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, locale.key === _ctx.activeLocale]])]); + }), 128 + /* KEYED_FRAGMENT */ + ))], 512 + /* NEED_PATCH */ + )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true); +} + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/IndexField.vue?vue&type=template&id=9e63f81a": +/*!********************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/IndexField.vue?vue&type=template&id=9e63f81a ***! + \********************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* binding */ render) +/* harmony export */ }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue"); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); + +function render(_ctx, _cache, $props, $setup, $data, $options) { + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)((0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDynamicComponent)('index-' + $props.field.translatable.original_component), { + field: _ctx.fields[_ctx.activeLocale], + "translatable-locale": _ctx.activeLocale, + "resource-name": $props.resourceName + }, null, 8 + /* PROPS */ + , ["field", "translatable-locale", "resource-name"]); +} + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/LocaleTabs.vue?vue&type=template&id=012f69a3": +/*!********************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/LocaleTabs.vue?vue&type=template&id=012f69a3 ***! + \********************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* binding */ render) +/* harmony export */ }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue"); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); + +var _hoisted_1 = ["dusk", "onClick", "onDblclick"]; +function render(_ctx, _cache, $props, $setup, $data, $options) { + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", { + "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["nova-translatable-locale-tabs flex select-none", { + 'px-8': !this.detail + }]) + }, [$props.displayType != 'none' ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", { + key: 0, + "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["ml-auto", $options.listClasses]) + }, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.locales, function (locale) { + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", { + key: locale.key, + dusk: $options.getDuskKey(locale.key), + "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["locale-tag ml-3 cursor-pointer font-bold text-80 text-sm", { + '-active': locale.key === $props.activeLocale, + '-error': $options.hasError(locale.key) + }]), + onClick: function onClick() { + return _ctx.$emit('tabClick', locale.key); + }, + onDblclick: function onDblclick() { + return _ctx.$emit('doubleClick', locale.key); + } + }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(locale.name), 43 + /* TEXT, CLASS, PROPS, HYDRATE_EVENTS */ + , _hoisted_1); + }), 128 + /* KEYED_FRAGMENT */ + ))], 2 + /* CLASS */ + )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2 + /* CLASS */ + )), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $props.locales.length > 1]]); +} + +/***/ }), + +/***/ "./resources/js/mixins/TranslatableField.js": +/*!**************************************************!*\ + !*** ./resources/js/mixins/TranslatableField.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + props: ['uniqueId'], + data: function data() { + return { + activeLocale: void 0, + originalFieldName: void 0, + fields: this.getInitialFields(), + isMounted: false + }; + }, + beforeMount: function beforeMount() { + this.init(); + }, + mounted: function mounted() { + this.isMounted = true; // Listen to setAllLocale event + + if (this.uniqueId) Nova.$on(this.getAllLocalesEventName(this.uniqueId), this.setActiveLocale); + Nova.$on(this.getAllLocalesEventName(), this.setActiveLocale); + }, + beforeDestroy: function beforeDestroy() { + if (this.uniqueId) Nova.$off(this.getAllLocalesEventName(this.uniqueId)); + Nova.$off(this.getAllLocalesEventName()); + }, + computed: { + locales: function locales() { + var _this = this; + + var localeKeys = Object.keys(this.currentField.translatable.locales); + + if (this.currentField.translatable.prioritize_nova_locale) { + localeKeys = localeKeys.sort(function (a, b) { + if (a === Nova.config('locale') && b !== Nova.config('locale')) return -1; + if (a !== Nova.config('locale') && b === Nova.config('locale')) return 1; + return 0; + }); + } + + return localeKeys.map(function (key) { + return { + key: key, + name: _this.currentField.translatable.locales[key] + }; + }); + }, + fieldValueMustBeAnObject: function fieldValueMustBeAnObject() { + return ['key-value-field'].includes(this.currentField.translatable.original_component); + }, + isFlexible: function isFlexible() { + return this.$parent && this.$parent.field && this.$parent.field.component === 'nova-flexible-content'; + }, + isSimpleRepeatable: function isSimpleRepeatable() { + return this.$parent && this.$parent.$parent && this.$parent.$parent.field && this.$parent.$parent.field.component === 'simple-repeatable'; + }, + isFile: function isFile() { + return ['file-field'].includes(this.currentField.translatable.original_component); + }, + currentField: function currentField() { + return this.syncedField || this.field; + } + }, + methods: { + init: function init() { + var _this2 = this; + + this.originalFieldName = this.currentField.name; + this.activeLocale = this.locales[0].key; // Get starting values + + var initialValues = this.getInitialValues(); // Create fields + + this.locales.forEach(function (locale) { + return Object.assign(_this2.fields[locale.key], _objectSpread(_objectSpread({}, _this2.currentField), {}, { + dependsOn: null, + extraAttributes: _objectSpread({}, _this2.currentField.extraAttributes || {}), + value: initialValues[locale.key] || '', + displayedAs: initialValues[locale.key] || '', + attribute: "".concat(_this2.currentField.attribute, ".").concat(locale.key), + // Append '.en' to avoid duplicate ID-s in DOM + validationKey: "".concat(_this2.currentField.attribute, ".").concat(locale.key) // Append locale to validationKey + + })); + }); + }, + onSyncedField: function onSyncedField() { + this.init(); + }, + getInitialValues: function getInitialValues() { + var initialValue = {}; + + var _iterator = _createForOfIteratorHelper(this.locales), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var locale = _step.value; + var localeValue = this.currentField.translatable.value && this.currentField.translatable.value[locale.key] || ''; + initialValue[locale.key] = this.formatValue(localeValue); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + + return initialValue; + }, + getInitialFields: function getInitialFields() { + var field = this.currentField || this.field; + var locales = Object.keys(field.translatable.locales); + var fields = {}; + locales.forEach(function (locale) { + fields[locale] = { + value: '', + readonly: '', + extraAttributes: {}, + attribute: '', + component: '', + name: '', + nullable: '', + textAlign: '' + }; + }); + return fields; + }, + setActiveLocale: function setActiveLocale(newLocale) { + this.activeLocale = newLocale; + this.refreshCodeMirror(); + }, + refreshCodeMirror: function refreshCodeMirror() { + var _this3 = this; + + setTimeout(function () { + if (!_this3.$refs.main) return; + + var cmList = _this3.$refs.main.querySelectorAll('.CodeMirror'); + + if (!cmList.length) return; + cmList.forEach(function (cm) { + return cm.CodeMirror.refresh(); + }); + }, 1); + }, + setAllLocale: function setAllLocale(newLocale) { + Nova.$emit(this.getAllLocalesEventName(), newLocale); + }, + formatValue: function formatValue(value) { + var formattedValue = value || ''; + + if (this.fieldValueMustBeAnObject && typeof formattedValue === 'string') { + try { + formattedValue = JSON.parse(formattedValue || '{}'); + } catch (e) { + formattedValue = {}; + } + } + + return formattedValue; + }, + getAllLocalesEventName: function getAllLocalesEventName() { + var uniqueId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : void 0; + var id = uniqueId !== null && uniqueId !== void 0 ? uniqueId : void 0; + return id !== void 0 ? "nova-translatable-".concat(id, "@setAllLocale") : 'nova-translatable@setAllLocale'; + } + } +}); + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/DetailField.vue?vue&type=style&index=0&id=0224618e&lang=scss&scoped=true": +/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/DetailField.vue?vue&type=style&index=0&id=0224618e&lang=scss&scoped=true ***! + \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__); +// Imports + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]}); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ".translatable-field .flex.border-t[data-v-0224618e] {\n border-style: none !important;\n}", ""]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/FormField.vue?vue&type=style&index=0&id=c023248a&lang=scss&scoped=true": +/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/FormField.vue?vue&type=style&index=0&id=c023248a&lang=scss&scoped=true ***! + \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__); +// Imports + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]}); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ".translatable-field:not(:last-child) .field-wrapper[data-v-c023248a] {\n border-style: solid !important;\n}", ""]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/LocaleTabs.vue?vue&type=style&index=0&id=012f69a3&lang=scss": +/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/LocaleTabs.vue?vue&type=style&index=0&id=012f69a3&lang=scss ***! + \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__); +// Imports + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]}); +// Module +___CSS_LOADER_EXPORT___.push([module.id, ".nova-translatable-locale-tabs {\n position: relative;\n z-index: 2;\n padding-top: 0.25rem;\n}\n.nova-translatable-locale-tabs .locale-tag {\n border-bottom: 2px solid transparent;\n}\n.nova-translatable-locale-tabs .locale-tag.-active {\n color: rgba(var(--colors-primary-500));\n border-color: rgba(var(--colors-primary-500));\n}\n.nova-translatable-locale-tabs .locale-tag.-error {\n color: rgba(var(--colors-red-500));\n border-color: rgba(var(--colors-red-500));\n}\n.nova-translatable-locale-tabs .locale-tag.-error.-active {\n color: rgba(var(--colors-primary-500));\n}", ""]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/runtime/api.js": +/*!*****************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/api.js ***! + \*****************************************************/ +/***/ ((module) => { + + + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +// eslint-disable-next-line func-names +module.exports = function (cssWithMappingToString) { + var list = []; // return the list of modules as css string + + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item); + + if (item[2]) { + return "@media ".concat(item[2], " {").concat(content, "}"); + } + + return content; + }).join(""); + }; // import a list of modules into the list + // eslint-disable-next-line func-names + + + list.i = function (modules, mediaQuery, dedupe) { + if (typeof modules === "string") { + // eslint-disable-next-line no-param-reassign + modules = [[null, modules, ""]]; + } + + var alreadyImportedModules = {}; + + if (dedupe) { + for (var i = 0; i < this.length; i++) { + // eslint-disable-next-line prefer-destructuring + var id = this[i][0]; + + if (id != null) { + alreadyImportedModules[id] = true; + } + } + } + + for (var _i = 0; _i < modules.length; _i++) { + var item = [].concat(modules[_i]); + + if (dedupe && alreadyImportedModules[item[0]]) { + // eslint-disable-next-line no-continue + continue; + } + + if (mediaQuery) { + if (!item[2]) { + item[2] = mediaQuery; + } else { + item[2] = "".concat(mediaQuery, " and ").concat(item[2]); + } + } + + list.push(item); + } + }; + + return list; +}; + +/***/ }), + +/***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/DetailField.vue?vue&type=style&index=0&id=0224618e&lang=scss&scoped=true": +/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/DetailField.vue?vue&type=style&index=0&id=0224618e&lang=scss&scoped=true ***! + \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); +/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DetailField_vue_vue_type_style_index_0_id_0224618e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DetailField.vue?vue&type=style&index=0&id=0224618e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/DetailField.vue?vue&type=style&index=0&id=0224618e&lang=scss&scoped=true"); + + + +var options = {}; + +options.insert = "head"; +options.singleton = false; + +var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DetailField_vue_vue_type_style_index_0_id_0224618e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DetailField_vue_vue_type_style_index_0_id_0224618e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {}); + +/***/ }), + +/***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/FormField.vue?vue&type=style&index=0&id=c023248a&lang=scss&scoped=true": +/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/FormField.vue?vue&type=style&index=0&id=c023248a&lang=scss&scoped=true ***! + \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); +/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_FormField_vue_vue_type_style_index_0_id_c023248a_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./FormField.vue?vue&type=style&index=0&id=c023248a&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/FormField.vue?vue&type=style&index=0&id=c023248a&lang=scss&scoped=true"); + + + +var options = {}; + +options.insert = "head"; +options.singleton = false; + +var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_FormField_vue_vue_type_style_index_0_id_c023248a_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_FormField_vue_vue_type_style_index_0_id_c023248a_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {}); + +/***/ }), + +/***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/LocaleTabs.vue?vue&type=style&index=0&id=012f69a3&lang=scss": +/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/LocaleTabs.vue?vue&type=style&index=0&id=012f69a3&lang=scss ***! + \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); +/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_LocaleTabs_vue_vue_type_style_index_0_id_012f69a3_lang_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./LocaleTabs.vue?vue&type=style&index=0&id=012f69a3&lang=scss */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/LocaleTabs.vue?vue&type=style&index=0&id=012f69a3&lang=scss"); + + + +var options = {}; + +options.insert = "head"; +options.singleton = false; + +var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_LocaleTabs_vue_vue_type_style_index_0_id_012f69a3_lang_scss__WEBPACK_IMPORTED_MODULE_1__["default"], options); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_LocaleTabs_vue_vue_type_style_index_0_id_012f69a3_lang_scss__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {}); + +/***/ }), + +/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": +/*!****************************************************************************!*\ + !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***! + \****************************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + + + +var isOldIE = function isOldIE() { + var memo; + return function memorize() { + if (typeof memo === 'undefined') { + // Test for IE <= 9 as proposed by Browserhacks + // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 + // Tests for existence of standard globals is to allow style-loader + // to operate correctly into non-standard environments + // @see https://github.com/webpack-contrib/style-loader/issues/177 + memo = Boolean(window && document && document.all && !window.atob); + } + + return memo; + }; +}(); + +var getTarget = function getTarget() { + var memo = {}; + return function memorize(target) { + if (typeof memo[target] === 'undefined') { + var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself + + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { + try { + // This will throw an exception if access to iframe is blocked + // due to cross-origin restrictions + styleTarget = styleTarget.contentDocument.head; + } catch (e) { + // istanbul ignore next + styleTarget = null; + } + } + + memo[target] = styleTarget; + } + + return memo[target]; + }; +}(); + +var stylesInDom = []; + +function getIndexByIdentifier(identifier) { + var result = -1; + + for (var i = 0; i < stylesInDom.length; i++) { + if (stylesInDom[i].identifier === identifier) { + result = i; + break; + } + } + + return result; +} + +function modulesToDom(list, options) { + var idCountMap = {}; + var identifiers = []; + + for (var i = 0; i < list.length; i++) { + var item = list[i]; + var id = options.base ? item[0] + options.base : item[0]; + var count = idCountMap[id] || 0; + var identifier = "".concat(id, " ").concat(count); + idCountMap[id] = count + 1; + var index = getIndexByIdentifier(identifier); + var obj = { + css: item[1], + media: item[2], + sourceMap: item[3] + }; + + if (index !== -1) { + stylesInDom[index].references++; + stylesInDom[index].updater(obj); + } else { + stylesInDom.push({ + identifier: identifier, + updater: addStyle(obj, options), + references: 1 + }); + } + + identifiers.push(identifier); + } + + return identifiers; +} + +function insertStyleElement(options) { + var style = document.createElement('style'); + var attributes = options.attributes || {}; + + if (typeof attributes.nonce === 'undefined') { + var nonce = true ? __webpack_require__.nc : 0; + + if (nonce) { + attributes.nonce = nonce; + } + } + + Object.keys(attributes).forEach(function (key) { + style.setAttribute(key, attributes[key]); + }); + + if (typeof options.insert === 'function') { + options.insert(style); + } else { + var target = getTarget(options.insert || 'head'); + + if (!target) { + throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); + } + + target.appendChild(style); + } + + return style; +} + +function removeStyleElement(style) { + // istanbul ignore if + if (style.parentNode === null) { + return false; + } + + style.parentNode.removeChild(style); +} +/* istanbul ignore next */ + + +var replaceText = function replaceText() { + var textStore = []; + return function replace(index, replacement) { + textStore[index] = replacement; + return textStore.filter(Boolean).join('\n'); + }; +}(); + +function applyToSingletonTag(style, index, remove, obj) { + var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE + + /* istanbul ignore if */ + + if (style.styleSheet) { + style.styleSheet.cssText = replaceText(index, css); + } else { + var cssNode = document.createTextNode(css); + var childNodes = style.childNodes; + + if (childNodes[index]) { + style.removeChild(childNodes[index]); + } + + if (childNodes.length) { + style.insertBefore(cssNode, childNodes[index]); + } else { + style.appendChild(cssNode); + } + } +} + +function applyToTag(style, options, obj) { + var css = obj.css; + var media = obj.media; + var sourceMap = obj.sourceMap; + + if (media) { + style.setAttribute('media', media); + } else { + style.removeAttribute('media'); + } + + if (sourceMap && typeof btoa !== 'undefined') { + css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */"); + } // For old IE + + /* istanbul ignore if */ + + + if (style.styleSheet) { + style.styleSheet.cssText = css; + } else { + while (style.firstChild) { + style.removeChild(style.firstChild); + } + + style.appendChild(document.createTextNode(css)); + } +} + +var singleton = null; +var singletonCounter = 0; + +function addStyle(obj, options) { + var style; + var update; + var remove; + + if (options.singleton) { + var styleIndex = singletonCounter++; + style = singleton || (singleton = insertStyleElement(options)); + update = applyToSingletonTag.bind(null, style, styleIndex, false); + remove = applyToSingletonTag.bind(null, style, styleIndex, true); + } else { + style = insertStyleElement(options); + update = applyToTag.bind(null, style, options); + + remove = function remove() { + removeStyleElement(style); + }; + } + + update(obj); + return function updateStyle(newObj) { + if (newObj) { + if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) { + return; + } + + update(obj = newObj); + } else { + remove(); + } + }; +} + +module.exports = function (list, options) { + options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of