exports.ids = [42];
exports.modules = {

/***/ 255:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(303);
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add CSS to SSR context
var add = __webpack_require__(4).default
module.exports.__inject__ = function (context) {
  add("066eceea", content, true, context)
};

/***/ }),

/***/ 302:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_import_export_vue_vue_type_style_index_0_id_7fe85845_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(255);
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_import_export_vue_vue_type_style_index_0_id_7fe85845_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_import_export_vue_vue_type_style_index_0_id_7fe85845_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_import_export_vue_vue_type_style_index_0_id_7fe85845_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_3_node_modules_sass_resources_loader_lib_loader_js_ref_7_oneOf_1_4_node_modules_nuxt_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_import_export_vue_vue_type_style_index_0_id_7fe85845_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 303:
/***/ (function(module, exports, __webpack_require__) {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(3);
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false);
// Module
___CSS_LOADER_EXPORT___.push([module.i, ".project-import__subtitle[data-v-7fe85845]{font-weight:600}.project-import__subtitle[data-v-7fe85845]:not(:first-child){margin-top:1rem;margin-bottom:.25rem}.project-import__switches[data-v-7fe85845]{margin-top:1.5rem;margin-bottom:1.5rem;display:grid;grid-auto-flow:column;grid-auto-columns:1fr}.project-import__switches>div[data-v-7fe85845]{display:flex;flex-direction:column;grid-gap:1rem;gap:1rem}.project-import__switches-icon[data-v-7fe85845]{margin-top:-.25rem}", ""]);
// Exports
module.exports = ___CSS_LOADER_EXPORT___;


/***/ }),

/***/ 335:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: D:/Development/StarlaneStudios/vindigo/node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!D:/Development/StarlaneStudios/vindigo/node_modules/nuxt/node_modules/@nuxt/components/dist/loader.js??ref--0-0!D:/Development/StarlaneStudios/vindigo/node_modules/vue-loader/lib??vue-loader-options!./pages/project/_pid/settings/import-export.vue?vue&type=template&id=7fe85845&scoped=true&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"project-import"},[_vm._ssrNode("<div class=\"project-import__subtitle\" data-v-7fe85845>\n\t\tExport project\n\t</div>\n\n\tHier exporteren we naar een json template. <br data-v-7fe85845> "),_vm._ssrNode("<div class=\"project-import__switches\" data-v-7fe85845>","</div>",_vm._l((_vm.exportOptions),function(options,index){return _vm._ssrNode("<div data-v-7fe85845>","</div>",_vm._l((options),function(option){return _c('w-switch',{key:option.id,staticClass:"project-import__switches-switch",model:{value:(option.enabled),callback:function ($$v) {_vm.$set(option, "enabled", $$v)},expression:"option.enabled"}},[_vm._v("\n\t\t\t\t"+_vm._s(option.text)+"\n\t\t\t\t"),_c('w-tooltip',{attrs:{"right":""},scopedSlots:_vm._u([{key:"activator",fn:function(ref){
var on = ref.on;
return [_c('w-icon',_vm._g({staticClass:"right project-import__switch-icon"},on),[_vm._v("\n\t\t\t\t\t\t\tmdi mdi-information-outline\n\t\t\t\t\t\t")])]}}],null,true)},[_vm._v("\n\t\t\t\t\t"+_vm._s(option.description || '...')+"\n\t\t\t\t")])],1)}),1)}),0),_vm._ssrNode(" "),_c('w-button',{attrs:{"outline":"","color":"warning"},on:{"click":function($event){return _vm.exportProject()}}},[_vm._v("\n\t\tExport as JSON\n\t\t"),_c('w-icon',{staticClass:"right"},[_vm._v("\n\t\t\tmdi mdi-database-export\n\t\t")])],1),_vm._ssrNode(" "),_c('w-divider'),_vm._ssrNode(" <div class=\"project-import__subtitle\" data-v-7fe85845>\n\t\tImport project\n\t</div> <article class=\"mb3\" data-v-7fe85845>\n\t\tHier kunnen we importeren van json.\n\t</article> "),_c('w-flex',[_c('w-button',{staticClass:"mr3",attrs:{"color":"warning","outline":""},on:{"click":function($event){return _vm.importProject('JSON')}}},[_vm._v("\n\t\t\tImport JSON\n\t\t\t"),_c('w-icon',{staticClass:"right"},[_vm._v("\n\t\t\t\tmdi mdi-database-import\n\t\t\t")])],1),_vm._v(" "),_c('w-button',{attrs:{"color":"success","outline":""}},[_vm._v("\n\t\t\tImport CSV\n\t\t\t"),_c('w-icon',{staticClass:"right"},[_vm._v("\n\t\t\t\tmdi mdi-database-import\n\t\t\t")])],1)],1),_vm._ssrNode(" "),_c('w-divider'),_vm._ssrNode(" <div class=\"project-import__subtitle\" data-v-7fe85845>\n\t\tExport tasks to CSV\n\t</div>\n\n\tHier exportern we naar csv.\n\n\t"),_c('w-flex',{staticClass:"mt2"},[_c('w-select',{staticClass:"mr2",attrs:{"items":_vm.delimiters},model:{value:(_vm.delimiter),callback:function ($$v) {_vm.delimiter=$$v},expression:"delimiter"}}),_vm._v(" "),_c('w-button',{attrs:{"outline":"","color":"success"},on:{"click":_vm.exportTasks}},[_vm._v("\n\t\t\tExport tasks as CSV\n\t\t\t"),_c('w-icon',{staticClass:"right"},[_vm._v("\n\t\t\t\tmdi mdi-database-export\n\t\t\t")])],1)],1)],2)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/project/_pid/settings/import-export.vue?vue&type=template&id=7fe85845&scoped=true&

// EXTERNAL MODULE: external "vue"
var external_vue_ = __webpack_require__(0);
var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);

// CONCATENATED MODULE: ./assets/query/project/exportTasks.gql
/* harmony default export */ var exportTasks = ("query exportProjectTasks($projectId: Int!, $delimiter: TaskExportDelimiter!) {\r\n\texportTasks(projectId: $projectId, delimiter: $delimiter)\r\n}");
// CONCATENATED MODULE: ./assets/query/project/exportProject.gql
/* harmony default export */ var exportProject = ("query exportProject($projectId: Int!, $options: [ProjectExportOption!]!) {\r\n\texportProject(projectId: $projectId, options: $options)\r\n}");
// EXTERNAL MODULE: ./src/helpers.ts + 1 modules
var helpers = __webpack_require__(5);

// CONCATENATED MODULE: D:/Development/StarlaneStudios/vindigo/node_modules/babel-loader/lib??ref--13-0!D:/Development/StarlaneStudios/vindigo/node_modules/ts-loader??ref--13-1!D:/Development/StarlaneStudios/vindigo/node_modules/nuxt/node_modules/@nuxt/components/dist/loader.js??ref--0-0!D:/Development/StarlaneStudios/vindigo/node_modules/vue-loader/lib??vue-loader-options!./pages/project/_pid/settings/import-export.vue?vue&type=script&lang=ts&
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
  function adopt(value) {
    return value instanceof P ? value : new P(function (resolve) {
      resolve(value);
    });
  }

  return new (P || (P = Promise))(function (resolve, reject) {
    function fulfilled(value) {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    }

    function rejected(value) {
      try {
        step(generator["throw"](value));
      } catch (e) {
        reject(e);
      }
    }

    function step(result) {
      result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
    }

    step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
};





/* harmony default export */ var import_exportvue_type_script_lang_ts_ = (external_vue_default.a.extend({
  props: {
    project: Object
  },
  data: () => ({
    delimiter: 'SEMICOLON',
    delimiters: [{
      label: 'Semicolumn seperated',
      value: 'SEMICOLON'
    }, {
      label: 'Komma seperated',
      value: 'COMMA'
    }],
    exportOptions: [[{
      id: 'tasks',
      text: 'Tasks',
      description: '',
      enabled: false
    }, {
      id: 'readme',
      text: 'Readme',
      description: '',
      enabled: false
    }, {
      id: 'lists',
      text: 'Lists',
      description: '',
      enabled: false
    }, {
      id: 'settings',
      text: 'Settings',
      description: '',
      enabled: false
    }], [{
      id: 'components',
      text: 'Components',
      description: '',
      enabled: false
    }, {
      id: 'labels',
      text: 'Labels',
      description: '',
      enabled: false
    }, {
      id: 'automation_rules',
      text: 'Automation Rules',
      description: '',
      enabled: false
    }]]
  }),
  computed: {
    selectedExportOptions() {
      return this.exportOptions.flat(Infinity).filter(option => option.enabled).map(option => option.id.toUpperCase());
    }

  },
  methods: {
    exportProject() {
      return __awaiter(this, void 0, void 0, function* () {
        const json = yield this.$api.query(exportProject, {
          projectId: this.project.id,
          options: this.selectedExportOptions
        });
        Object(helpers["c" /* downloadText */])(json.exportProject, `export-${this.project.slug}.json`);
      });
    },

    // Export tasks to a csv file
    exportTasks() {
      return __awaiter(this, void 0, void 0, function* () {
        const csv = yield this.$api.query(exportTasks, {
          projectId: this.project.id,
          delimiter: this.delimiter
        });
        Object(helpers["c" /* downloadText */])(csv.exportTasks, `export-tasks-${this.project.slug}.csv`);
      });
    },

    importProject(extension) {
      return __awaiter(this, void 0, void 0, function* () {
        const filter = `.${extension.toLowerCase()}`;
        Object(helpers["j" /* selectFileFromExplorer */])(filter, file => {
          // reading out the contents
          file.text().then(content => {
            const importContents = JSON.parse(content); // notify user if the selected file is invalid.

            if (Object.values(importContents).length <= 1) {
              this.$waveui.notify({
                message: 'Invalid import file...',
                error: true
              });
              return;
            } // send the imported / parsed data to the server to handle the import

          });
        });
      });
    }

  }
}));
// CONCATENATED MODULE: ./pages/project/_pid/settings/import-export.vue?vue&type=script&lang=ts&
 /* harmony default export */ var settings_import_exportvue_type_script_lang_ts_ = (import_exportvue_type_script_lang_ts_); 
// EXTERNAL MODULE: D:/Development/StarlaneStudios/vindigo/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(2);

// CONCATENATED MODULE: ./pages/project/_pid/settings/import-export.vue



function injectStyles (context) {
  
  var style0 = __webpack_require__(302)
if (style0.__inject__) style0.__inject__(context)

}

/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  settings_import_exportvue_type_script_lang_ts_,
  render,
  staticRenderFns,
  false,
  injectStyles,
  "7fe85845",
  "4445127c"
  
)

/* harmony default export */ var import_export = __webpack_exports__["default"] = (component.exports);

/***/ })

};;
//# sourceMappingURL=import-export.js.map