/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(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 */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ tinymce; }
});

;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/tinymce/src/main.vue?vue&type=template&id=c942bd1c&
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c("div", {
    directives: [{
      name: "loading",
      rawName: "v-loading",
      value: _vm.editorLoading,
      expression: "editorLoading"
    }],
    staticClass: "jdf-tinymce"
  }, [_c("Editor", {
    attrs: {
      id: _vm.id,
      init: _vm.init,
      disabled: _vm.disabled
    },
    model: {
      value: _vm.editorVal,
      callback: function callback($$v) {
        _vm.editorVal = $$v;
      },
      expression: "editorVal"
    }
  })], 1);
};
var staticRenderFns = [];
render._withStripped = true;

;// CONCATENATED MODULE: ./packages/tinymce/src/main.vue?vue&type=template&id=c942bd1c&

;// CONCATENATED MODULE: external "@babel/runtime/helpers/asyncToGenerator"
var asyncToGenerator_namespaceObject = require("@babel/runtime/helpers/asyncToGenerator");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator_namespaceObject);
;// CONCATENATED MODULE: external "@babel/runtime/regenerator"
var regenerator_namespaceObject = require("@babel/runtime/regenerator");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_namespaceObject);
;// CONCATENATED MODULE: external "jdf-jssdk"
var external_jdf_jssdk_namespaceObject = require("jdf-jssdk");
;// CONCATENATED MODULE: external "tinymce/tinymce"
var tinymce_namespaceObject = require("tinymce/tinymce");
var tinymce_default = /*#__PURE__*/__webpack_require__.n(tinymce_namespaceObject);
;// CONCATENATED MODULE: external "@tinymce/tinymce-vue"
var tinymce_vue_namespaceObject = require("@tinymce/tinymce-vue");
var tinymce_vue_default = /*#__PURE__*/__webpack_require__.n(tinymce_vue_namespaceObject);
;// CONCATENATED MODULE: external "tinymce/themes/silver/theme"
var theme_namespaceObject = require("tinymce/themes/silver/theme");
;// CONCATENATED MODULE: external "tinymce/icons/default"
var default_namespaceObject = require("tinymce/icons/default");
;// CONCATENATED MODULE: external "tinymce/plugins/advlist"
var advlist_namespaceObject = require("tinymce/plugins/advlist");
;// CONCATENATED MODULE: external "tinymce/plugins/autolink"
var autolink_namespaceObject = require("tinymce/plugins/autolink");
;// CONCATENATED MODULE: external "tinymce/plugins/link"
var link_namespaceObject = require("tinymce/plugins/link");
;// CONCATENATED MODULE: external "tinymce/plugins/image"
var image_namespaceObject = require("tinymce/plugins/image");
;// CONCATENATED MODULE: external "tinymce/plugins/lists"
var lists_namespaceObject = require("tinymce/plugins/lists");
;// CONCATENATED MODULE: external "tinymce/plugins/charmap"
var charmap_namespaceObject = require("tinymce/plugins/charmap");
;// CONCATENATED MODULE: external "tinymce/plugins/media"
var media_namespaceObject = require("tinymce/plugins/media");
;// CONCATENATED MODULE: external "tinymce/plugins/wordcount"
var wordcount_namespaceObject = require("tinymce/plugins/wordcount");
;// CONCATENATED MODULE: external "tinymce/plugins/table"
var table_namespaceObject = require("tinymce/plugins/table");
;// CONCATENATED MODULE: external "tinymce/plugins/fullscreen"
var fullscreen_namespaceObject = require("tinymce/plugins/fullscreen");
;// CONCATENATED MODULE: external "tinymce/plugins/preview"
var preview_namespaceObject = require("tinymce/plugins/preview");
;// CONCATENATED MODULE: external "tinymce/plugins/code"
var code_namespaceObject = require("tinymce/plugins/code");
;// CONCATENATED MODULE: external "tinymce/models/dom"
var dom_namespaceObject = require("tinymce/models/dom");
;// CONCATENATED MODULE: external "tinymce/plugins/anchor"
var anchor_namespaceObject = require("tinymce/plugins/anchor");
;// CONCATENATED MODULE: external "tinymce/plugins/autosave"
var autosave_namespaceObject = require("tinymce/plugins/autosave");
;// CONCATENATED MODULE: external "tinymce/plugins/codesample"
var codesample_namespaceObject = require("tinymce/plugins/codesample");
;// CONCATENATED MODULE: external "tinymce/plugins/insertdatetime"
var insertdatetime_namespaceObject = require("tinymce/plugins/insertdatetime");
;// CONCATENATED MODULE: external "tinymce/plugins/pagebreak"
var pagebreak_namespaceObject = require("tinymce/plugins/pagebreak");
;// CONCATENATED MODULE: external "tinymce/plugins/template"
var template_namespaceObject = require("tinymce/plugins/template");
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/tinymce/src/main.vue?vue&type=script&lang=js&



 // tinymce默认hidden，
 // 编辑器引入
 // 编辑器主题
 // 引入编辑器图标icon
 // 高级列表
 // 自动链接
 // 超链接
 // 插入编辑图片
 // 列表插件
 // 特殊字符
 // 插入编辑媒体
 // 字数统计
 // 表格
 // 全屏
 // 预览
 // 源代码

 // 锚点

 // 示例代码
 // 日期时间
 // 分页符
 // 模板

/* harmony default export */ var mainvue_type_script_lang_js_ = ({
  name: 'JdfTinymce',
  components: {
    Editor: (tinymce_vue_default())
  },
  model: {
    prop: 'value',
    event: 'change'
  },
  props: {
    // 内容
    value: String,
    /**
     * 上传的图片绑定的业务id
     */
    bizId: {
      type: String
    },
    /**
     * 图片存储的附件空间
     */
    spaceCode: {
      type: String
    },
    // tinymce的id
    id: {
      type: String,
      default: 'tinymceEditor'
    },
    // 高度
    height: {
      type: [Number, String],
      required: false,
      default: 500
    },
    // 是否禁用
    disabled: {
      type: Boolean,
      default: false
    },
    // 插件
    plugins: {
      type: [String, Boolean],
      default: "advlist autolink link image lists charmap table fullscreen preview code media anchor codesample insertdatetime \n      pagebreak template wordcount"
    },
    // 菜单栏
    menubar: {
      type: [String, Boolean],
      default: 'file edit insert view format table'
    },
    // 工具栏
    toolbar: {
      type: [String, Boolean],
      default: "fontsize fontfamily lineheight | forecolor backcolor bold italic image | alignleft aligncenter alignright \n      alignjustify | bullist numlist outdent indent lists link | code fullscreen preview"
    },
    fontSize: {
      type: String,
      default: "12px 14px 16px 18px 20px 22px 24px 26px 28px 30px 32px 34px 36px 38px 40px 42px 44px 46px 48px 50px 52px 56px \n      58px 60px 62px 64px 66px 68px 70px 72px"
    },
    fonts: {
      type: Array,
      default: function _default() {
        return ['微软雅黑=微软雅黑', '宋体=宋体', '黑体=黑体', '仿宋=仿宋', '新宋体=新宋体', '楷体=楷体', '隶书=隶书', '幼圆=幼圆', '苹果苹方=PingFang SC', 'Andale Mono=andale mono,times', 'Arial=arial,helvetica,sans-serif', 'Arial Black=arial black,avant garde', 'Book Antiqua=book antiqua,palatino', 'Comic Sans MS=comic sans ms,sans-serif', 'Courier New=courier new,courier', 'Georgia=georgia,palatino', 'Helvetica=helvetica', 'Impact=impact,chicago', 'Symbol=symbol', 'Tahoma=tahoma,arial,helvetica,sans-serif', 'Terminal=terminal,monaco', 'Times New Roman=times new roman,times', 'Trebuchet MS=trebuchet ms,geneva', 'Verdana=verdana,geneva', 'Webdings=webdings', 'Wingdings=wingdings'];
      }
    },
    /**
     * 图片是否以base64存储
     */
    imageSavedBase64: {
      type: Boolean,
      default: false
    },
    /**
     * 允许上传的类型
     */
    filePickerTypes: {
      type: String,
      default: 'file image media'
    },
    /**
     * 包含待替换内容的对象，当模板被插入到编辑器中时，待替换项目将被替换为他们各自的字符串值，
     * 如模板为： <p>Name: {$username}, StaffID: {$staffid}</p>
     * 则该内容可传： templateReplaceValues: {
     *    username: 'Jack Black',
     *    staffid: '991234'
     * }
     */
    templateReplaceValues: {
      type: Object,
      default: function _default() {}
    },
    /**
     * 这是一个包含项目的对象，这些项目将在模板对话框中显示的模板预览中替换为它们各自的字符串值；但在将模板插入编辑器内容时不会被替换。
     * 如模板为： <p>Name: {$username}, StaffID: {$staffid}</p>
     * 则该内容可传： templateReplaceValues: {
     *    username: 'Jack Black',
     *    staffid: '991234'
     * }
     */
    templatePreviewReplaceValues: {
      type: Object,
      default: function _default() {}
    },
    // // 语言文件地址
    // languageUrl: String,
    // 皮肤文件地址
    skinUrl: {
      type: String,
      default: 'tinymce/skins/ui/oxide'
    }
    // // 样式文件地址
    // contentCssUrl: String,
  },
  data: function data() {
    return {
      editorLoading: false,
      init: {
        selector: "#".concat(this.id),
        // 汉化路径，放在public里面
        language_url: "".concat(this.$JDF.publicPath, "tinymce/language/zh-Hans.js"),
        language: 'zh-Hans',
        // 皮肤
        skin_url: "".concat(this.$JDF.publicPath).concat(this.skinUrl),
        content_css: "".concat(this.$JDF.publicPath, "tinymce/skins/content/default/content.css"),
        // 菜单栏
        menubar: this.menubar,
        // 插件
        plugins: this.plugins,
        // 工具栏
        toolbar: this.toolbar,
        toolbar_location: '/',
        // 字体大小
        // eslint-disable-next-line max-len
        font_size_formats: this.fontSize,
        // 引入字体如['宋体=宋体','微软雅黑=微软雅黑'],
        font_family_formats: this.fonts.join(';'),
        // 高度
        height: this.height,
        // 自动转换URL
        convert_urls: false,
        // 占位符
        placeholder: '请输入',
        // 隐藏右下角技术支持
        branding: false,
        // 隐藏底栏的元素路径
        elementpath: false,
        paste_data_images: true,
        images_upload_handler: this.handleImgUpload,
        file_picker_types: this.filePickerTypes,
        /**
         *  请求后台获取模板，格式为
         * { title: 'Some title 1', description: 'Some desc 1', content: 'My content' },
         * { title: 'Some title 2', description: 'Some desc 2', url: 'development.html' }
         */
        templates: [],
        // 这是一个包含项目的对象，当模板插入到编辑器内容中时，这些项目将被替换为它们各自的字符串值。
        template_replace_values: this.templateReplaceValues,
        template_preview_replace_values: this.templatePreviewReplaceValues
      }
    };
  },
  computed: {
    editorVal: {
      get: function get() {
        return this.value;
      },
      set: function set(val) {
        this.$emit('change', val);
      }
    }
  },
  mounted: function mounted() {
    tinymce_default().init({});
  },
  methods: {
    /**
     * 图片上传处理函数
     */
    handleImgUpload: function handleImgUpload(blobInfo, progress) {
      return this.imageSavedBase64 ? this.handleImgUploadBase64(blobInfo) : this.uploadImage(blobInfo, progress);
    },
    /**
     * 将图片转为base64进行展示
     */
    handleImgUploadBase64: function handleImgUploadBase64(blobInfo) {
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee() {
        return regenerator_default().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              return _context.abrupt("return", new Promise(function (resolve) {
                resolve("data:".concat(blobInfo.blob().type, ";base64,").concat(blobInfo.base64()));
              }));
            case 1:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    },
    /**
     * 上传图片
     */
    uploadImage: function uploadImage(blobInfo, progress) {
      var _this = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee2() {
        return regenerator_default().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              return _context2.abrupt("return", new Promise(function (resolve, reject) {
                var file = blobInfo.blob();
                new external_jdf_jssdk_namespaceObject.FileService(_this.$JDF.baseUrl).upload({
                  owner: _this.bizId,
                  spaceCode: _this.spaceCode,
                  file: file
                }, function (e) {
                  progress(e.loaded / e.total * 100);
                }).then(function (res) {
                  resolve(new external_jdf_jssdk_namespaceObject.FileService(_this.$JDF.baseUrl).downloadFile(res.id));
                }).catch(function (err) {
                  return reject(err);
                });
              }));
            case 1:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    }
  }
});
;// CONCATENATED MODULE: ./packages/tinymce/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
;// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent(
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */,
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options =
    typeof scriptExports === 'function' ? scriptExports.options : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
          injectStyles.call(
            this,
            (options.functional ? this.parent : this).$root.$options.shadowRoot
          )
        }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}

;// CONCATENATED MODULE: ./packages/tinymce/src/main.vue





/* normalize component */
;
var component = normalizeComponent(
  src_mainvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var main = (component.exports);
;// CONCATENATED MODULE: ./packages/tinymce/index.js

main.install = function (Vue) {
  Vue.component(main.name, main);
};
/* harmony default export */ var tinymce = (main);
module.exports = __webpack_exports__;
/******/ })()
;