1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1522],{93813:(n,e,t)=>{"use strict";t.d(e,{K:()=>O});var o=t(96540),r=t(5556),i=function(){return(i=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var r in e=arguments[t])Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}).apply(this,arguments)},a={onActivate:r.func,onAddUndo:r.func,onBeforeAddUndo:r.func,onBeforeExecCommand:r.func,onBeforeGetContent:r.func,onBeforeRenderUI:r.func,onBeforeSetContent:r.func,onBeforePaste:r.func,onBlur:r.func,onChange:r.func,onClearUndos:r.func,onClick:r.func,onContextMenu:r.func,onCommentChange:r.func,onCompositionEnd:r.func,onCompositionStart:r.func,onCompositionUpdate:r.func,onCopy:r.func,onCut:r.func,onDblclick:r.func,onDeactivate:r.func,onDirty:r.func,onDrag:r.func,onDragDrop:r.func,onDragEnd:r.func,onDragGesture:r.func,onDragOver:r.func,onDrop:r.func,onExecCommand:r.func,onFocus:r.func,onFocusIn:r.func,onFocusOut:r.func,onGetContent:r.func,onHide:r.func,onInit:r.func,onInput:r.func,onKeyDown:r.func,onKeyPress:r.func,onKeyUp:r.func,onLoadContent:r.func,onMouseDown:r.func,onMouseEnter:r.func,onMouseLeave:r.func,onMouseMove:r.func,onMouseOut:r.func,onMouseOver:r.func,onMouseUp:r.func,onNodeChange:r.func,onObjectResizeStart:r.func,onObjectResized:r.func,onObjectSelected:r.func,onPaste:r.func,onPostProcess:r.func,onPostRender:r.func,onPreProcess:r.func,onProgressState:r.func,onRedo:r.func,onRemove:r.func,onReset:r.func,onSaveContent:r.func,onSelectionChange:r.func,onSetAttrib:r.func,onSetContent:r.func,onShow:r.func,onSubmit:r.func,onUndo:r.func,onVisualAid:r.func,onSkinLoadError:r.func,onThemeLoadError:r.func,onModelLoadError:r.func,onPluginLoadError:r.func,onIconsLoadError:r.func,onLanguageLoadError:r.func,onScriptsLoad:r.func,onScriptsLoadError:r.func},s=i({apiKey:r.string,licenseKey:r.string,id:r.string,inline:r.bool,init:r.object,initialValue:r.string,onEditorChange:r.func,value:r.string,tagName:r.string,tabIndex:r.number,cloudChannel:r.string,plugins:r.oneOfType([r.string,r.array]),toolbar:r.oneOfType([r.string,r.array]),disabled:r.bool,textareaName:r.string,tinymceScriptSrc:r.oneOfType([r.string,r.arrayOf(r.string),r.arrayOf(r.shape({src:r.string,async:r.bool,defer:r.bool}))]),rollback:r.oneOfType([r.number,r.oneOf([!1])]),scriptLoading:r.shape({async:r.bool,defer:r.bool,delay:r.number})},a),c=function(n){return"function"==typeof n},u=function(n){return n in a},l=function(n){return n.substr(2)},p=function(n,e,t,o,r,i,a){var s=Object.keys(r).filter(u),c=Object.keys(i).filter(u),p=s.filter(function(n){return void 0===i[n]}),d=c.filter(function(n){return void 0===r[n]});p.forEach(function(n){var e=l(n),o=a[e];t(e,o),delete a[e]}),d.forEach(function(t){var r=o(n,t),i=l(t);a[i]=r,e(i,r)})},d=0,f=function(n){var e=Date.now();return n+"_"+Math.floor(1e9*Math.random())+ ++d+String(e)},h=function(n){return null!==n&&("textarea"===n.tagName.toLowerCase()||"input"===n.tagName.toLowerCase())},v=function(n){return void 0===n||""===n?[]:Array.isArray(n)?n:n.split(" ")},y=function(n){if(!("isConnected"in Node.prototype)){for(var e=n,t=n.parentNode;null!=t;)t=(e=t).parentNode;return e===n.ownerDocument}return n.isConnected},g=function(n,e){void 0!==n&&(null!=n.mode&&"object"==typeof n.mode&&"function"==typeof n.mode.set?n.mode.set(e):n.setMode(e))},m=function(){return(m=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var r in e=arguments[t])Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}).apply(this,arguments)},b=function(n,e,t){var o,r,i=n.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=e.id,i.src=e.src,i.async=null!==(o=e.async)&&void 0!==o&&o,i.defer=null!==(r=e.defer)&&void 0!==r&&r;var a=function(){i.removeEventListener("load",a),i.removeEventListener("error",s),t(e.src)},s=function(n){i.removeEventListener("load",a),i.removeEventListener("error",s),t(e.src,n)};i.addEventListener("load",a),i.addEventListener("error",s),n.head&&n.head.appendChild(i)},C=function(n){var e={},t=function(n,t){var o=e[n];o.done=!0,o.error=t;for(var r=0,i=o.handlers;r<i.length;r++)(0,i[r])(n,t);o.handlers=[]};return{loadScripts:function(o,r,i){var a=function(n){return void 0!==i?i(n):console.error(n)};if(0===o.length){a(Error("At least one script must be provided"));return}for(var s=0,c=!1,u=function(n,e){c||(e?(c=!0,a(e)):++s===o.length&&r())},l=0;l<o.length;l++){var p=o[l],d=e[p.src];if(d)d.done?u(p.src,d.error):d.handlers.push(u);else{var h=f("tiny-");e[p.src]={id:h,src:p.src,done:!1,error:null,handlers:[u]},b(n,m({id:h},p),t)}}},deleteScripts:function(){for(var t,o=0,r=Object.values(e);o<r.length;o++){var i=r[o],a=n.getElementById(i.id);null!=a&&"SCRIPT"===a.tagName&&(null===(t=a.parentNode)||void 0===t||t.removeChild(a))}e={}},getDocument:function(){return n}}},E=function(){var n=[],e=function(e){var t=n.find(function(n){return n.getDocument()===e});return void 0===t&&(t=C(e),n.push(t)),t};return{loadList:function(n,t,o,r,i){var a=function(){return e(n).loadScripts(t,r,i)};o>0?setTimeout(a,o):a()},reinitialize:function(){for(var e=n.pop();null!=e;e=n.pop())e.deleteScripts()}}}(),k=function(n){return n&&n.tinymce?n.tinymce:null},S=function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),w=function(){return(w=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var r in e=arguments[t])Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}).apply(this,arguments)},O=function(n){function e(e){var t,r,i,a=n.call(this,e)||this;return a.rollbackTimer=void 0,a.valueCursor=void 0,a.rollbackChange=function(){var n=a.editor,e=a.props.value;n&&e&&e!==a.currentContent&&n.undoManager.ignore(function(){if(n.setContent(e),a.valueCursor&&(!a.inline||n.hasFocus()))try{n.selection.moveToBookmark(a.valueCursor)}catch(n){}}),a.rollbackTimer=void 0},a.handleBeforeInput=function(n){if(void 0!==a.props.value&&a.props.value===a.currentContent&&a.editor&&(!a.inline||a.editor.hasFocus()))try{a.valueCursor=a.editor.selection.getBookmark(3)}catch(n){}},a.handleBeforeInputSpecial=function(n){("Enter"===n.key||"Backspace"===n.key||"Delete"===n.key)&&a.handleBeforeInput(n)},a.handleEditorChange=function(n){var e=a.editor;if(e&&e.initialized){var t=e.getContent();void 0===a.props.value||a.props.value===t||!1===a.props.rollback||a.rollbackTimer||(a.rollbackTimer=window.setTimeout(a.rollbackChange,"number"==typeof a.props.rollback?a.props.rollback:200)),t!==a.currentContent&&(a.currentContent=t,c(a.props.onEditorChange)&&a.props.onEditorChange(t,e))}},a.handleEditorChangeSpecial=function(n){("Backspace"===n.key||"Delete"===n.key)&&a.handleEditorChange(n)},a.initialise=function(n){void 0===n&&(n=0);var e,t,o,r,i,s=a.elementRef.current;if(s){if(!y(s)){if(0===n)setTimeout(function(){return a.initialise(1)},1);else if(n<100)setTimeout(function(){return a.initialise(n+1)},100);else throw Error("tinymce can only be initialised when in a document");return}var u=k(a.view);if(!u)throw Error("tinymce should have been loaded into global scope");var l=w(w(w(w({},a.props.init),{selector:void 0,target:s,readonly:a.props.disabled,inline:a.inline,plugins:(e=null===(o=a.props.init)||void 0===o?void 0:o.plugins,t=a.props.plugins,v(e).concat(v(t))),toolbar:null!==(r=a.props.toolbar)&&void 0!==r?r:null===(i=a.props.init)||void 0===i?void 0:i.toolbar}),a.props.licenseKey?{license_key:a.props.licenseKey}:{}),{setup:function(n){a.editor=n,a.bindHandlers({}),a.inline&&!h(s)&&n.once("PostRender",function(e){n.setContent(a.getInitialValue(),{no_events:!0})}),a.props.init&&c(a.props.init.setup)&&a.props.init.setup(n)},init_instance_callback:function(n){var e,t,o=a.getInitialValue();a.currentContent=null!==(e=a.currentContent)&&void 0!==e?e:n.getContent(),a.currentContent!==o&&(a.currentContent=o,n.setContent(o),n.undoManager.clear(),n.undoManager.add(),n.setDirty(!1));var r=null!==(t=a.props.disabled)&&void 0!==t&&t;g(a.editor,r?"readonly":"design"),a.props.init&&c(a.props.init.init_instance_callback)&&a.props.init.init_instance_callback(n)}});a.inline||(s.style.visibility=""),h(s)&&(s.value=a.getInitialValue()),u.init(l)}},a.id=a.props.id||f("tiny-react"),a.elementRef=o.createRef(),a.inline=null!==(i=null!==(t=a.props.inline)&&void 0!==t?t:null===(r=a.props.init)||void 0===r?void 0:r.inline)&&void 0!==i&&i,a.boundHandlers={},a}return S(e,n),Object.defineProperty(e.prototype,"view",{get:function(){var n,e;return null!==(e=null===(n=this.elementRef.current)||void 0===n?void 0:n.ownerDocument.defaultView)&&void 0!==e?e:window},enumerable:!1,configurable:!0}),e.prototype.componentDidUpdate=function(n){var e,t,o=this;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(n),this.editor.initialized)){if(this.currentContent=null!==(e=this.currentContent)&&void 0!==e?e:this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==n.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){var r=this.editor;r.undoManager.transact(function(){if(!o.inline||r.hasFocus())try{n=r.selection.getBookmark(3)}catch(n){}var n,e=o.valueCursor;if(r.setContent(o.props.value),!o.inline||r.hasFocus())for(var t=0,i=[n,e];t<i.length;t++){var a=i[t];if(a)try{r.selection.moveToBookmark(a),o.valueCursor=a;break}catch(n){}}})}if(this.props.disabled!==n.disabled){var i=null!==(t=this.props.disabled)&&void 0!==t&&t;g(this.editor,i?"readonly":"design")}}},e.prototype.componentDidMount=function(){var n,e,t,o,r,i=this;null!==k(this.view)?this.initialise():Array.isArray(this.props.tinymceScriptSrc)&&0===this.props.tinymceScriptSrc.length?null===(e=(n=this.props).onScriptsLoadError)||void 0===e||e.call(n,Error("No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array.")):(null===(t=this.elementRef.current)||void 0===t?void 0:t.ownerDocument)&&E.loadList(this.elementRef.current.ownerDocument,this.getScriptSources(),null!==(r=null===(o=this.props.scriptLoading)||void 0===o?void 0:o.delay)&&void 0!==r?r:0,function(){var n,e;null===(e=(n=i.props).onScriptsLoad)||void 0===e||e.call(n),i.initialise()},function(n){var e,t;null===(t=(e=i.props).onScriptsLoadError)||void 0===t||t.call(e,n)})},e.prototype.componentWillUnmount=function(){var n=this,e=this.editor;e&&(e.off(this.changeEvents(),this.handleEditorChange),e.off(this.beforeInputEvent(),this.handleBeforeInput),e.off("keypress",this.handleEditorChangeSpecial),e.off("keydown",this.handleBeforeInputSpecial),e.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach(function(t){e.off(t,n.boundHandlers[t])}),this.boundHandlers={},e.remove(),this.editor=void 0)},e.prototype.render=function(){return this.inline?this.renderInline():this.renderIframe()},e.prototype.changeEvents=function(){var n,e,t;return(null===(t=null===(e=null===(n=k(this.view))||void 0===n?void 0:n.Env)||void 0===e?void 0:e.browser)||void 0===t?void 0:t.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"},e.prototype.beforeInputEvent=function(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"},e.prototype.renderInline=function(){var n=this.props.tagName;return o.createElement(void 0===n?"div":n,{ref:this.elementRef,id:this.id,tabIndex:this.props.tabIndex})},e.prototype.renderIframe=function(){return o.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id,tabIndex:this.props.tabIndex})},e.prototype.getScriptSources=function(){var n,e,t=null===(n=this.props.scriptLoading)||void 0===n?void 0:n.async,o=null===(e=this.props.scriptLoading)||void 0===e?void 0:e.defer;if(void 0!==this.props.tinymceScriptSrc)return"string"==typeof this.props.tinymceScriptSrc?[{src:this.props.tinymceScriptSrc,async:t,defer:o}]:this.props.tinymceScriptSrc.map(function(n){return"string"==typeof n?{src:n,async:t,defer:o}:n});var r=this.props.cloudChannel,i=this.props.apiKey?this.props.apiKey:"no-api-key";return[{src:"https://cdn.tiny.cloud/1/".concat(i,"/tinymce/").concat(r,"/tinymce.min.js"),async:t,defer:o}]},e.prototype.getInitialValue=function(){return"string"==typeof this.props.initialValue?this.props.initialValue:"string"==typeof this.props.value?this.props.value:""},e.prototype.bindHandlers=function(n){var e=this;if(void 0!==this.editor){t=this.editor,o=this.props,r=this.boundHandlers,p(function(n){return e.props[n]},t.on.bind(t),t.off.bind(t),function(n,e){return function(o){var r;return null===(r=n(e))||void 0===r?void 0:r(o,t)}},n,o,r);var t,o,r,i=function(n){return void 0!==n.onEditorChange||void 0!==n.value},a=i(n),s=i(this.props);!a&&s?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):a&&!s&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}},e.propTypes=s,e.defaultProps={cloudChannel:"7"},e}(o.Component)},86625:(n,e,t)=>{"use strict";var o=t(24994);e.A=void 0;var r=o(t(44888)),i=t(74848);e.A=(0,r.default)((0,i.jsx)("path",{d:"M16.62 2.99c-.49-.49-1.28-.49-1.77 0L6.54 11.3c-.39.39-.39 1.02 0 1.41l8.31 8.31c.49.49 1.28.49 1.77 0s.49-1.28 0-1.77L9.38 12l7.25-7.25c.48-.48.48-1.28-.01-1.76"}),"ArrowBackIosRounded")},75238:(n,e,t)=>{"use strict";var o=t(24994);e.A=void 0;var r=o(t(44888)),i=t(74848);e.A=(0,r.default)([(0,i.jsx)("path",{d:"M14.17 3H8v14h11V7.83zm2.33 12h-6v-2h6zm0-6h-2v2h-2V9h-2V7h2V5h2v2h2z",opacity:".3"},"0"),(0,i.jsx)("path",{d:"M18 23H4c-1.1 0-2-.9-2-2V7h2v14h14zM14.5 7V5h-2v2h-2v2h2v2h2V9h2V7zm2 6h-6v2h6zM15 1H8c-1.1 0-1.99.9-1.99 2L6 17c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V7zm4 16H8V3h6.17L19 7.83z"},"1")],"DifferenceTwoTone")},2694:(n,e,t)=>{"use strict";var o=t(6925);function r(){}function i(){}i.resetWarningCache=r,n.exports=function(){function n(n,e,t,r,i,a){if(a!==o){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return n}n.isRequired=n;var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:r};return t.PropTypes=t,t}},5556:(n,e,t)=>{n.exports=t(2694)()},6925:n=>{"use strict";n.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}}]); |