hotime/example/tpt/js/chunk-856f3c38.29c2fcc0.js

2 lines
10 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-856f3c38","chunk-e624c1ca"],{"1da1":function(t,e,r){"use strict";r.d(e,"a",function(){return n});r("d3b7");function c(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function n(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){c(n,e,r,o,i,"next",t)}function i(t){c(n,e,r,o,i,"throw",t)}o(void 0)})}}},"4de4":function(t,e,r){"use strict";var n=r("23e7"),o=r("b727").filter;n({target:"Array",proto:!0,forced:!r("1dde")("filter")},{filter:function(t){return o(this,t,1<arguments.length?arguments[1]:void 0)}})},"4e15":function(t,e,r){"use strict";r.d(e,"a",function(){return o}),r.d(e,"b",function(){return i});var c=r("f2bf"),l=r("cb23"),n=Object.defineProperty,f=Object.defineProperties,s=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,y=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;function g(t){var e=`请使用 '@${t}' 事件,不要放在 props 中`;return e+=`
Please use '@${t}' event instead of props`}e=(t,e)=>{for(var[r,n]of e)t[r]=n;return t},r=Object(c.t)({props:{mode:{type:String,default:"default"},defaultContent:{type:Array,default:[]},defaultHtml:{type:String,default:""},defaultConfig:{type:Object,default:{}},modelValue:{type:String,default:""}},setup(o,i){const e=Object(c.Q)(null),a=Object(c.X)(null),u=Object(c.Q)(""),t=()=>{var t;e.value&&(t=Object(c.ab)(o.defaultContent),Object(l.createEditor)({selector:e.value,mode:o.mode,content:t||[],html:o.defaultHtml||o.modelValue||"",config:(t=((t,e)=>{for(var r in e=e||{})d.call(e,r)&&y(t,r,e[r]);if(h)for(var r of h(e))p.call(e,r)&&y(t,r,e[r]);return t})({},o.defaultConfig),f(t,s({onCreated(t){if(a.value=t,i.emit("onCreated",t),o.defaultConfig.onCreated)throw t=g("onCreated"),new Error(t)},onChange(t){var e=t.getHtml();if(u.value=e,i.emit("update:modelValue",e),i.emit("onChange",t),o.defaultConfig.onChange)throw e=g("onChange"),new Error(e)},onDestroyed(t){if(i.emit("onDestroyed",t),o.defaultConfig.onDestroyed)throw t=g("onDestroyed"),new Error(t)},onMaxLength(t){if(i.emit("onMaxLength",t),o.defaultConfig.onMaxLength)throw t=g("onMaxLength"),new Error(t)},onFocus(t){if(i.emit("onFocus",t),o.defaultConfig.onFocus)throw t=g("onFocus"),new Error(t)},onBlur(t){if(i.emit("onBlur",t),o.defaultConfig.onBlur)throw t=g("onBlur"),new Error(t)},customAlert(t,e){if(i.emit("customAlert",t,e),o.defaultConfig.customAlert)throw t=g("customAlert"),new Error(t)},customPaste:(t,e)=>{var r;if(o.defaultConfig.customPaste)throw r=g("customPaste"),new Error(r);let n;return i.emit("customPaste",t,e,t=>{n=t}),n}})))}))};return Object(c.I)(()=>{t()}),Object(c.ib)(()=>o.modelValue,t=>{if(t!==u.value){const o=a.value;if(null!=o){var e=o.isDisabled(),r=o.isFocused(),n=JSON.stringify(o.selection);if(o.enable(),o.focus(),o.select([]),o.deleteFragment(),l.SlateTransforms.setNodes(o,{type:"paragraph"},{mode:"highest"}),o.dangerouslyInsertHtml(t),!r)return void(o.deselect(),o.blur());if(e)return void(o.deselect(),o.disable());try{o.select(JSON.parse(n))}catch(t){o.select(l.SlateEditor.start(o,[]))}}}}),{box:e}}});const a={ref:"box",style:{height:"100%"}};var o=e(r,[["render",function(t,e,r,n,o,i){return Object(c.L)(),Object(c.n)("div",a,null,512)}]]),r=Object(c.t)({props:{editor:{type:Object},mode:{type:String,default:"default"},defaultConfig:{type:Object,default:{}}},setup(e){const r=Object(c.Q)(null);return Object(c.jb)(()=>{var t=e["editor"];if(null!=t)if(r.value){if(null==t)throw new Error("Not found instance of Editor when create <Toolbar/> component");l.DomEditor.getToolbar(t)||Object(l.createToolbar)({editor:t,selector:r.value||"<div></div>",mode:e.mode,config:e.defaultConfig})}}),{selector:r}}});const u={ref:"selector"};var i=e(r,[["render",function(t,e,r,n,o,i){return Object(c.L)(),Object(c.n)("div",u,null,512)}]])},"560e":function(t,e,r){},"96cf":function(e,t,r){e=function(a){"use strict";var c,t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof g?e:g,e=Object.create(e.prototype),n=new L(n||[]);return e._invoke=(o=t,i=r,a=n,u=s,function(t,e){if(u===d)throw new Error("Generator is already running");if(u===p){if("throw"===t)throw e;return P()}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=e.iterator[r.method];if(n===c){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=c,t(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}n=f(n,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,y;n=n.arg;if(!n)return r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y;{if(!n.done)return n;r[e.resultName]=n.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=c)}r.delegate=null;return y}(r,a);if(r){if(r===y)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(u===s)throw u=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=d;r=f(o,i,a);if("normal"===r.type){if(u=a.done?p:h,r.arg!==y)return{value:r.arg,done:a.done}}else"throw"===r.type&&(u=p,a.method="throw",a.arg=r.arg)}}),e}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var s="suspendedStart",h="suspendedYield",d="executing",p="completed",y={};function g(){}function v(){}function m(){}var e={},w=(i(e,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(C([]))),b=(w&&w!==t&&l.call(w,n)&&(e=w),m.prototype=g.prototype=Object.create(e));function O(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function j(a,u){var e;this._invoke=function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=f(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==typeof r&&l.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(e){if(e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(l.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=c,t.done=!0,t}).next=t}return{next:P}}function P(){return{value:c,done:!0}}return i(b,"constructor",v.prototype=m),i(m,"constructor",v),v.displayName=i(m,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,i(t,o,"GeneratorFunction")),t.prototype=Object.create(b),t},a.awrap=function(t){return{__await:t}},O(j.prototype),i(j.prototype,r,function(){return this}),a.AsyncIterator=j,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new j(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},O(b),i(b,o,"Generator"),i(b,n,function(){return this}),i(b,"toString",function(){return"[object Generator]"}),a.keys=function(r){var t,n=[];for(t in r)n.push(t);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=c)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=c),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),u=l.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&l.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,x(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=c),y}},a}(e.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},a640:function(t,e,r){"use strict";var n=r("d039");t.exports=function(t,e){var r=[][t];return!!r&&n(function(){r.call(null,e||function(){throw 1},1)})}}}]);