diff --git a/static/admin/404/index.html b/static/admin/404/index.html index 3ae44e814..8b600b8be 100644 --- a/static/admin/404/index.html +++ b/static/admin/404/index.html @@ -1 +1 @@ -404: This page could not be found

What is your stream about today?

What is your stream about today?
Offline

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

What is your stream about today?

What is your stream about today?
Offline

404

This page could not be found.

\ No newline at end of file diff --git a/static/admin/_next/static/2XfvdVGDewoLWo29Vwq6t/_buildManifest.js b/static/admin/_next/static/-KWbajZ4YtMqu7YUjC-WB/_buildManifest.js similarity index 73% rename from static/admin/_next/static/2XfvdVGDewoLWo29Vwq6t/_buildManifest.js rename to static/admin/_next/static/-KWbajZ4YtMqu7YUjC-WB/_buildManifest.js index 424b724f6..b474c830d 100644 --- a/static/admin/_next/static/2XfvdVGDewoLWo29Vwq6t/_buildManifest.js +++ b/static/admin/_next/static/-KWbajZ4YtMqu7YUjC-WB/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(s,c,e,a,t,i,n,f,d,h,o,b,g,u){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,e,a,t,i,f,"static/chunks/59-bb3486f7473684cf.js","static/chunks/pages/index-4d5ca370f5d2e820.js"],"/_error":["static/chunks/pages/_error-a3f18418a2205cb8.js"],"/access-tokens":[s,c,e,"static/chunks/pages/access-tokens-8ab04343bdf73124.js"],"/actions":[s,c,"static/chunks/pages/actions-4e648761889c23e5.js"],"/chat/messages":[d,s,c,e,i,h,"static/chunks/pages/chat/messages-945377167eed396f.js"],"/chat/users":[d,s,c,e,a,i,h,"static/chunks/pages/chat/users-3fafc5c5ca06039f.js"],"/config-chat":["static/chunks/pages/config-chat-00377015dc5f7622.js"],"/config-public-details":[s,c,n,"static/css/325160c29fde2de0.css","static/chunks/142-428a66fa3368b6f8.js",o,"static/chunks/pages/config-public-details-2e34343b51b52e4f.js"],"/config-server-details":[b,"static/chunks/pages/config-server-details-bf4e05a70deedfae.js"],"/config-social-items":[s,c,o,"static/chunks/pages/config-social-items-20e5d437c6559a00.js"],"/config-storage":["static/chunks/473-2f8a49a631089460.js","static/chunks/pages/config-storage-7ff1038872a3ca18.js"],"/config-video":[s,c,b,"static/chunks/556-bbfb134a84808c78.js","static/chunks/pages/config-video-32b520dff5444303.js"],"/hardware-info":[g,e,a,t,n,u,"static/chunks/pages/hardware-info-5c7933a2fc8e439b.js"],"/help":[a,"static/chunks/92-ce0f40b0cff56101.js","static/chunks/pages/help-c7fc342e125a5d6b.js"],"/logs":[s,e,f,"static/chunks/pages/logs-992bb93ef15eb1c3.js"],"/upgrade":[s,"static/chunks/275-35d1a6aef8ecf26a.js","static/chunks/pages/upgrade-455b3ea722ce4dd6.js"],"/viewer-info":[g,e,a,t,n,u,"static/chunks/pages/viewer-info-2fd6ee53e3a146a5.js"],"/webhooks":[s,c,"static/chunks/pages/webhooks-347989374968ddba.js"],sortedPages:["/","/_app","/_error","/access-tokens","/actions","/chat/messages","/chat/users","/config-chat","/config-public-details","/config-server-details","/config-social-items","/config-storage","/config-video","/hardware-info","/help","/logs","/upgrade","/viewer-info","/webhooks"]}}("static/chunks/355-ee12fd455f95ac1f.js","static/chunks/516-7e3214ec30e2dcd2.js","static/chunks/91-af53fa87313ffd15.js","static/chunks/903-44fc07da62e11585.js","static/chunks/102-3bc0d7c9186e3845.js","static/chunks/533-2f63c37b8986cca1.js","static/chunks/8-c94a1d68c52ddd4a.js","static/chunks/429-613793ce22468b22.js","static/chunks/29107295-2c3ce868677a27a4.js","static/chunks/371-814cf16bf0e11916.js","static/chunks/17-a17fee5c4b40129f.js","static/chunks/578-243e65c094c02e3b.js","static/chunks/36bcf0ca-b2199dd596aa4b16.js","static/chunks/958-7b78919540497aff.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(s,c,a,e,t,i,n,f,d,h,o,g,u,b){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,a,e,t,i,f,"static/chunks/59-bb3486f7473684cf.js","static/chunks/pages/index-4d5ca370f5d2e820.js"],"/_error":["static/chunks/pages/_error-a3f18418a2205cb8.js"],"/access-tokens":[s,c,a,"static/chunks/pages/access-tokens-8ab04343bdf73124.js"],"/actions":[s,c,"static/chunks/pages/actions-4e648761889c23e5.js"],"/chat/messages":[d,s,c,a,i,h,"static/chunks/pages/chat/messages-945377167eed396f.js"],"/chat/users":[d,s,c,a,e,i,h,"static/chunks/pages/chat/users-3fafc5c5ca06039f.js"],"/config-chat":["static/chunks/pages/config-chat-00377015dc5f7622.js"],"/config-public-details":[s,c,n,"static/css/325160c29fde2de0.css","static/chunks/142-428a66fa3368b6f8.js",o,"static/chunks/pages/config-public-details-2e34343b51b52e4f.js"],"/config-server-details":[g,"static/chunks/pages/config-server-details-bf4e05a70deedfae.js"],"/config-social-items":[s,c,o,"static/chunks/pages/config-social-items-20e5d437c6559a00.js"],"/config-storage":["static/chunks/473-2f8a49a631089460.js","static/chunks/pages/config-storage-7ff1038872a3ca18.js"],"/config-video":[s,c,g,"static/chunks/556-bbfb134a84808c78.js","static/chunks/pages/config-video-32b520dff5444303.js"],"/hardware-info":[u,a,e,t,n,b,"static/chunks/pages/hardware-info-5c7933a2fc8e439b.js"],"/help":[e,"static/chunks/92-ce0f40b0cff56101.js","static/chunks/pages/help-c7fc342e125a5d6b.js"],"/logs":[s,a,f,"static/chunks/pages/logs-992bb93ef15eb1c3.js"],"/upgrade":[s,"static/chunks/275-35d1a6aef8ecf26a.js","static/chunks/pages/upgrade-455b3ea722ce4dd6.js"],"/viewer-info":[u,a,e,t,n,b,"static/chunks/pages/viewer-info-2fd6ee53e3a146a5.js"],"/webhooks":[s,c,"static/chunks/pages/webhooks-347989374968ddba.js"],sortedPages:["/","/_app","/_error","/access-tokens","/actions","/chat/messages","/chat/users","/config-chat","/config-public-details","/config-server-details","/config-social-items","/config-storage","/config-video","/hardware-info","/help","/logs","/upgrade","/viewer-info","/webhooks"]}}("static/chunks/355-ee12fd455f95ac1f.js","static/chunks/516-7e3214ec30e2dcd2.js","static/chunks/91-af53fa87313ffd15.js","static/chunks/903-44fc07da62e11585.js","static/chunks/102-3bc0d7c9186e3845.js","static/chunks/533-2f63c37b8986cca1.js","static/chunks/8-c94a1d68c52ddd4a.js","static/chunks/429-613793ce22468b22.js","static/chunks/29107295-2c3ce868677a27a4.js","static/chunks/371-814cf16bf0e11916.js","static/chunks/17-a17fee5c4b40129f.js","static/chunks/578-243e65c094c02e3b.js","static/chunks/36bcf0ca-b2199dd596aa4b16.js","static/chunks/958-7b78919540497aff.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/static/admin/_next/static/2XfvdVGDewoLWo29Vwq6t/_middlewareManifest.js b/static/admin/_next/static/-KWbajZ4YtMqu7YUjC-WB/_middlewareManifest.js similarity index 100% rename from static/admin/_next/static/2XfvdVGDewoLWo29Vwq6t/_middlewareManifest.js rename to static/admin/_next/static/-KWbajZ4YtMqu7YUjC-WB/_middlewareManifest.js diff --git a/static/admin/_next/static/2XfvdVGDewoLWo29Vwq6t/_ssgManifest.js b/static/admin/_next/static/-KWbajZ4YtMqu7YUjC-WB/_ssgManifest.js similarity index 100% rename from static/admin/_next/static/2XfvdVGDewoLWo29Vwq6t/_ssgManifest.js rename to static/admin/_next/static/-KWbajZ4YtMqu7YUjC-WB/_ssgManifest.js diff --git a/static/admin/_next/static/chunks/912.6e0d7eb5a76a471d.js b/static/admin/_next/static/chunks/912.6e0d7eb5a76a471d.js new file mode 100644 index 000000000..9ed213aed --- /dev/null +++ b/static/admin/_next/static/chunks/912.6e0d7eb5a76a471d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[912],{26729:function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!==typeof r)throw new TypeError("The listener must be a function");var l=new i(r,o||e,a),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],l]:e._events[s].push(l):(e._events[s]=l,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),l.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},l.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)for(var l,s=C(n);!(l=s()).done;){var c=l.value;if("undefined"!==typeof a[c]&&!a[c])return!1}else if(a.metaKey||a.ctrlKey||a.shiftKey||a.altKey)return!1;return a.key?a.key===i:a.keyCode===r}function T(e,t){var n=e.split("\n"),r=e.substr(0,t).split("\n"),i=r.length,o=r[r.length-1].length,a=n[r.length-1],l=r.length>1?r[r.length-2]:null,s=n.length>r.length?n[r.length]:null;return{line:i,col:o,beforeText:e.substr(0,t),afterText:e.substr(t),curLine:a,prevLine:l,nextLine:s}}for(var N={bold:["**","**"],italic:["*","*"],underline:["++","++"],strikethrough:["~~","~~"],quote:["\n> ","\n"],inlinecode:["`","`"],code:["\n```\n","\n```\n"]},x=1;x<=6;x++)N["h"+x]=["\n"+S("#",x)+" ","\n"];function L(e){for(var t=e.row,n=void 0===t?2:t,r=e.col,i=void 0===r?2:r,o=["|"],a=["|"],l=["|"],s="",c=1;c<=i;c++)o.push(" Head |"),l.push(" --- |"),a.push(" Data |");for(var u=1;u<=n;u++)s+="\n"+a.join("");return o.join("")+"\n"+l.join("")+s}function K(e,t){var n=t;if("\n"!==n.substr(0,1)&&(n="\n"+n),"unordered"===e)return n.length>1?n.replace(/\n/g,"\n* ").trim():"* ";var r=1;return n.length>1?n.replace(/\n/g,(function(){return"\n"+r+++". "})).trim():"1. "}function U(e,t){return{text:e,newBlock:t,selection:{start:e.length,end:e.length}}}var _,V=function(e,t,n){if("undefined"!==typeof N[t])return{text:""+N[t][0]+e+N[t][1],selection:{start:N[t][0].length,end:N[t][0].length+e.length}};switch(t){case"tab":var r=1===n.tabMapValue?"\t":" ".repeat(n.tabMapValue),i=r+e.replace(/\n/g,"\n"+r),o=e.includes("\n")?e.match(/\n/g).length:0;return{text:i,selection:{start:n.tabMapValue,end:n.tabMapValue*(o+1)+e.length}};case"unordered":return U(K("unordered",e),!0);case"order":return U(K("order",e),!0);case"hr":return U("---",!0);case"table":return{text:L(n),newBlock:!0};case"image":return{text:"!["+(e||n.target)+"]("+(n.imageUrl||"")+")",selection:{start:2,end:e.length+2}};case"link":return{text:"["+e+"]("+(n.linkUrl||"")+")",selection:{start:1,end:e.length+1}}}return{text:e,selection:{start:0,end:e.length}}};function H(e,t){var n={};return Object.keys(e).forEach((function(r){"undefined"!==typeof t[r]?"object"!==typeof t[r]?n[r]=t[r]:Array.isArray(t[r])?n[r]=[].concat(t[r]):n[r]=H(e[r],t[r]):n[r]=e[r]})),n}var I=new Uint8Array(16);function A(){if(!_&&!(_="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _(I)}var O=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var D=function(e){return"string"===typeof e&&O.test(e)},R=[],W=0;W<256;++W)R.push((W+256).toString(16).substr(1));var P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(R[e[t+0]]+R[e[t+1]]+R[e[t+2]]+R[e[t+3]]+"-"+R[e[t+4]]+R[e[t+5]]+"-"+R[e[t+6]]+R[e[t+7]]+"-"+R[e[t+8]]+R[e[t+9]]+"-"+R[e[t+10]]+R[e[t+11]]+R[e[t+12]]+R[e[t+13]]+R[e[t+14]]+R[e[t+15]]).toLowerCase();if(!D(n))throw TypeError("Stringified UUID is invalid");return n};var Z=function(e,t,n){var r=(e=e||{}).random||(e.rng||A)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return P(r)};var F=function(e,t){return{placeholder:V("","image",{target:"Uploading_"+Z(),imageUrl:""}).text,uploaded:new Promise((function(n){var r=!0,i=function(t){r&&console.warn("Deprecated: onImageUpload should return a Promise, callback will be removed in future"),n(V("","image",{target:e.name,imageUrl:t}).text)},o=t(e,i);k(o)&&(r=!1,o.then(i))}))}},B={theme:"default",view:{menu:!0,md:!0,html:!0},canView:{menu:!0,md:!0,html:!0,both:!0,fullScreen:!0,hideMenu:!0},htmlClass:"",markdownClass:"",syncScrollMode:["rightFollowLeft","leftFollowRight"],imageUrl:"",imageAccept:"",linkUrl:"",table:{maxRow:4,maxCol:6},allowPasteImage:!0,onImageUpload:void 0,onCustomImageUpload:void 0,shortcuts:!0},j=function(e){function t(){return e.apply(this,arguments)||this}a(t,e);var n=t.prototype;return n.getHtml=function(){return"string"===typeof this.props.html?this.props.html:this.el.current?this.el.current.innerHTML:""},n.render=function(){return"string"===typeof this.props.html?l.createElement("div",{ref:this.el,dangerouslySetInnerHTML:{__html:this.props.html},className:this.props.className||"custom-html-style"}):l.createElement("div",{ref:this.el,className:this.props.className||"custom-html-style"},this.props.html)},t}(function(e){function t(t){var n;return(n=e.call(this,t)||this).el=l.createRef(),n}a(t,e);var n=t.prototype;return n.getElement=function(){return this.el.current},n.getHeight=function(){return this.el.current?this.el.current.offsetHeight:0},t}(l.Component));function G(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return z(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 z(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),o=1;o0&&h.length>0&&(l="\n"+l,s&&(s.start++,s.end++));var d=c.afterText;n.start!==n.end&&(d=T(this.getMdValue(),n.end).afterText),""!==d.trim()&&"\n\n"!==d.substr(0,2)&&("\n"!==d.substr(0,1)&&(l+="\n"),l+="\n")}this.insertText(l,!0,s)},n.insertPlaceholder=function(e,t){var n=this;this.insertText(e,!0),t.then((function(t){var r=n.getMdValue().replace(e,t);n.setText(r)}))},n.insertText=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=!1);var r=this.state.text,i=this.getSelection(),o=r.slice(0,i.start),a=r.slice(t?i.end:i.start,r.length);this.setText(o+e+a,void 0,n?{start:n.start+o.length,end:n.end+o.length}:{start:i.start,end:i.start})},n.setText=function(e,t,n){var r=this;void 0===e&&(e="");var i=this.config.onChangeTrigger,o=void 0===i?"both":i,a=e.replace(/\u21b5/g,"\n");if(this.state.text!==e){this.setState({text:a}),!this.props.onChange||"both"!==o&&"beforeRender"!==o||this.props.onChange({text:a,html:this.getHtmlValue()},t),this.emitter.emit(this.emitter.EVENT_CHANGE,e,t,"undefined"===typeof t),n&&setTimeout((function(){return r.setSelection(n)})),this.hasContentChanged||(this.hasContentChanged=!0);var l=this.renderHTML(a);"both"!==o&&"afterRender"!==o||l.then((function(){r.props.onChange&&r.props.onChange({text:r.state.text,html:r.getHtmlValue()},t)}))}},n.getMdValue=function(){return this.state.text},n.getHtmlValue=function(){return"string"===typeof this.state.html?this.state.html:this.nodeMdPreview.current?this.nodeMdPreview.current.getHtml():""},n.onKeyboard=function(e){var t=this;Array.isArray(e)?e.forEach((function(e){return t.onKeyboard(e)})):this.keyboardListeners.includes(e)||this.keyboardListeners.push(e)},n.offKeyboard=function(e){var t=this;if(Array.isArray(e))e.forEach((function(e){return t.offKeyboard(e)}));else{var n=this.keyboardListeners.indexOf(e);n>=0&&this.keyboardListeners.splice(n,1)}},n.handleKeyDown=function(e){for(var t,n=G(this.keyboardListeners);!(t=n()).done;){var r=t.value;if(M(e,r))return e.preventDefault(),void r.callback(e)}this.emitter.emit(this.emitter.EVENT_KEY_DOWN,e)},n.getEventType=function(e){switch(e){case"change":return this.emitter.EVENT_CHANGE;case"fullscreen":return this.emitter.EVENT_FULL_SCREEN;case"viewchange":return this.emitter.EVENT_VIEW_CHANGE;case"keydown":return this.emitter.EVENT_KEY_DOWN;case"blur":return this.emitter.EVENT_BLUR;case"focus":return this.emitter.EVENT_FOCUS;case"scroll":return this.emitter.EVENT_SCROLL}},n.on=function(e,t){var n=this.getEventType(e);n&&this.emitter.on(n,t)},n.off=function(e,t){var n=this.getEventType(e);n&&this.emitter.off(n,t)},n.setView=function(e){var t=this,n=(0,r.Z)({},this.state.view,e);this.setState({view:n},(function(){t.emitter.emit(t.emitter.EVENT_VIEW_CHANGE,n)}))},n.getView=function(){return(0,r.Z)({},this.state.view)},n.fullScreen=function(e){var t=this;this.state.fullScreen!==e&&this.setState({fullScreen:e},(function(){t.emitter.emit(t.emitter.EVENT_FULL_SCREEN,e)}))},n.isFullScreen=function(){return this.state.fullScreen},n.uploadWithDataTransfer=function(e){var t=this,n=this.config.onImageUpload;if(n){var r=[];Array.prototype.forEach.call(e,(function(e){if("file"===e.kind&&e.type.includes("image")){var i=e.getAsFile();if(i){var o=F(i,n);r.push(Promise.resolve(o.placeholder)),o.uploaded.then((function(e){var n=t.getMdValue().replace(o.placeholder,e),r=e.length-o.placeholder.length,i=t.getSelection();t.setText(n,void 0,{start:i.start+r,end:i.start+r})}))}}else"string"===e.kind&&"text/plain"===e.type&&r.push(new Promise((function(t){return e.getAsString(t)})))})),Promise.all(r).then((function(e){var n=e.join(""),r=t.getSelection();t.insertText(n,!0,{start:r.start===r.end?n.length:0,end:n.length})}))}},n.render=function(){var e=this,t=this.state,n=t.view,r=t.fullScreen,i=t.text,o=t.html,a=this.props,h=a.id,d=a.className,f=void 0===d?"":d,p=a.style,m=a.name,g=void 0===m?"textarea":m,v=a.autoFocus,y=a.placeholder,b=a.readOnly,w=this.config.canView&&this.config.canView.hideMenu&&!this.config.canView.menu,C=function(t){return e.state.plugins[t]||[]},E=!!n.menu,k=h?h+"_md":void 0,S=h?h+"_html":void 0;return l.createElement("div",{id:h,className:"rc-md-editor "+(r?"full":"")+" "+f,style:p,onKeyDown:this.handleKeyDown,onDrop:this.handleDrop},l.createElement(c,{visible:E,left:C("left"),right:C("right")}),l.createElement("div",{className:"editor-container"},w&&l.createElement(u,null,l.createElement("span",{className:"button button-type-menu",title:E?"hidden menu":"show menu",onClick:this.handleToggleMenu},l.createElement(s,{type:"expand-"+(E?"less":"more")}))),l.createElement("section",{className:"section sec-md "+(n.md?"visible":"in-visible")},l.createElement("textarea",{id:k,ref:this.nodeMdText,name:g,autoFocus:v,placeholder:y,readOnly:b,value:i,className:"section-container input "+(this.config.markdownClass||""),wrap:"hard",onChange:this.handleChange,onScroll:this.handleInputScroll,onMouseOver:function(){return e.shouldSyncScroll="md"},onKeyDown:this.handleEditorKeyDown,onCompositionStart:function(){return e.composing=!0},onCompositionEnd:function(){return e.composing=!1},onPaste:this.handlePaste,onFocus:this.handleFocus,onBlur:this.handleBlur})),l.createElement("section",{className:"section sec-html "+(n.html?"visible":"in-visible")},l.createElement("div",{id:S,className:"section-container html-wrap",ref:this.nodeMdPreviewWrapper,onMouseOver:function(){return e.shouldSyncScroll="html"},onScroll:this.handlePreviewScroll},l.createElement(j,{html:o,className:this.config.htmlClass,ref:this.nodeMdPreview})))))},t}(l.Component);q.plugins=[],q.addLocale=g.add.bind(g),q.useLocale=g.setCurrent.bind(g),q.getLocale=g.getCurrent.bind(g);var Q=q,$=function(e){function t(t){var n;return(n=e.call(this,t)||this).timer=null,n.useTimer=n.getConfig("useTimer")||"undefined"===typeof requestAnimationFrame,n.handleChange=n.handleChange.bind((0,i.Z)(n)),n.doResize=n.doResize.bind((0,i.Z)(n)),n}a(t,e);var n=t.prototype;return n.doResize=function(){var e=this,t=function(t){t.style.height="auto";var n=Math.min(Math.max(e.getConfig("min"),t.scrollHeight),e.getConfig("max"));return t.style.height=n+"px",n};this.timer=null;var n=this.editor.getView(),r=this.editor.getMdElement(),i=this.editor.getHtmlElement();if(r&&n.md){var o=t(r);i&&(i.style.height=o+"px")}else i&&n.html&&t(i)},n.handleChange=function(){null===this.timer&&(this.useTimer?this.timer=window.setTimeout(this.doResize):this.timer=requestAnimationFrame(this.doResize))},n.componentDidMount=function(){this.editor.on("change",this.handleChange),this.editor.on("viewchange",this.handleChange),this.handleChange()},n.componentWillUnmount=function(){this.editor.off("change",this.handleChange),this.editor.off("viewchange",this.handleChange),null!==this.timer&&this.useTimer&&(window.clearTimeout(this.timer),this.timer=null)},n.render=function(){return l.createElement("span",null)},t}(y);$.pluginName="auto-resize",$.align="left",$.defaultConfig={min:200,max:1/0,useTimer:!1};var Y=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t.prototype.render=function(){var e=this;return l.createElement("span",{className:"button button-type-code-block",title:g.get("btnCode"),onClick:function(){return e.editor.insertMarkdown("code")}},l.createElement(s,{type:"code-block"}))},t}(y);Y.pluginName="block-code-block";var J=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t.prototype.render=function(){var e=this;return l.createElement("span",{className:"button button-type-code-inline",title:g.get("btnInlineCode"),onClick:function(){return e.editor.insertMarkdown("inlinecode")}},l.createElement(s,{type:"code"}))},t}(y);J.pluginName="block-code-inline";var X=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t.prototype.render=function(){var e=this;return l.createElement("span",{className:"button button-type-quote",title:g.get("btnQuote"),onClick:function(){return e.editor.insertMarkdown("quote")}},l.createElement(s,{type:"quote"}))},t}(y);X.pluginName="block-quote";var ee=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t.prototype.render=function(){var e=this;return l.createElement("span",{className:"button button-type-wrap",title:g.get("btnLineBreak"),onClick:function(){return e.editor.insertMarkdown("hr")}},l.createElement(s,{type:"wrap"}))},t}(y);ee.pluginName="block-wrap";var te=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleClick=n.handleClick.bind((0,i.Z)(n)),n}a(t,e);var n=t.prototype;return n.handleClick=function(){""!==this.editor.getMdValue()&&(window.confirm&&"function"===typeof window.confirm&&window.confirm(g.get("clearTip"))&&this.editor.setText(""))},n.render=function(){return l.createElement("span",{className:"button button-type-clear",title:g.get("btnClear"),onClick:this.handleClick},l.createElement(s,{type:"delete"}))},t}(y);te.pluginName="clear";var ne=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"b",keyCode:66,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return n.editor.insertMarkdown("bold")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-bold",title:g.get("btnBold"),onClick:function(){return e.editor.insertMarkdown("bold")}},l.createElement(s,{type:"bold"}))},t}(y);ne.pluginName="font-bold";var re=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"i",keyCode:73,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return n.editor.insertMarkdown("italic")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-italic",title:g.get("btnItalic"),onClick:function(){return e.editor.insertMarkdown("italic")}},l.createElement(s,{type:"italic"}))},t}(y);re.pluginName="font-italic";var ie=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"d",keyCode:68,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return n.editor.insertMarkdown("strikethrough")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-strikethrough",title:g.get("btnStrikethrough"),onClick:function(){return e.editor.insertMarkdown("strikethrough")}},l.createElement(s,{type:"strikethrough"}))},t}(y);ie.pluginName="font-strikethrough";var oe=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"u",keyCode:85,withKey:["ctrlKey"],callback:function(){return n.editor.insertMarkdown("underline")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-underline",title:g.get("btnUnderline"),onClick:function(){return e.editor.insertMarkdown("underline")}},l.createElement(s,{type:"underline"}))},t}(y);oe.pluginName="font-underline";var ae=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleClick=n.handleClick.bind((0,i.Z)(n)),n.handleChange=n.handleChange.bind((0,i.Z)(n)),n.state={enable:n.editor.isFullScreen()},n}a(t,e);var n=t.prototype;return n.handleClick=function(){this.editor.fullScreen(!this.state.enable)},n.handleChange=function(e){this.setState({enable:e})},n.componentDidMount=function(){this.editor.on("fullscreen",this.handleChange)},n.componentWillUnmount=function(){this.editor.off("fullscreen",this.handleChange)},n.render=function(){if(this.editorConfig.canView&&this.editorConfig.canView.fullScreen){var e=this.state.enable;return l.createElement("span",{className:"button button-type-fullscreen",title:g.get(e?"btnExitFullScreen":"btnFullScreen"),onClick:this.handleClick},l.createElement(s,{type:e?"fullscreen-exit":"fullscreen"}))}return null},t}(y);ae.pluginName="full-screen",ae.align="right";var le=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleClose=n.handleClose.bind((0,i.Z)(n)),n}a(t,e);var n=t.prototype;return n.handleClose=function(e){e.stopPropagation();var t=this.props.onClose;"function"===typeof t&&t()},n.render=function(){return l.createElement("div",{className:"drop-wrap "+(this.props.show?"show":"hidden"),onClick:this.handleClose},this.props.children)},t}(l.Component),se=function(e){function t(){return e.apply(this,arguments)||this}a(t,e);var n=t.prototype;return n.handleHeader=function(e){var t=this.props.onSelectHeader;"function"===typeof t&&t(e)},n.render=function(){return l.createElement("ul",{className:"header-list"},l.createElement("li",{className:"list-item"},l.createElement("h1",{onClick:this.handleHeader.bind(this,"h1")},"H1")),l.createElement("li",{className:"list-item"},l.createElement("h2",{onClick:this.handleHeader.bind(this,"h2")},"H2")),l.createElement("li",{className:"list-item"},l.createElement("h3",{onClick:this.handleHeader.bind(this,"h3")},"H3")),l.createElement("li",{className:"list-item"},l.createElement("h4",{onClick:this.handleHeader.bind(this,"h4")},"H4")),l.createElement("li",{className:"list-item"},l.createElement("h5",{onClick:this.handleHeader.bind(this,"h5")},"H5")),l.createElement("li",{className:"list-item"},l.createElement("h6",{onClick:this.handleHeader.bind(this,"h6")},"H6")))},t}(l.Component),ce=function(e){function t(t){var n;return(n=e.call(this,t)||this).show=n.show.bind((0,i.Z)(n)),n.hide=n.hide.bind((0,i.Z)(n)),n.state={show:!1},n}a(t,e);var n=t.prototype;return n.show=function(){this.setState({show:!0})},n.hide=function(){this.setState({show:!1})},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-header",title:g.get("btnHeader"),onMouseEnter:this.show,onMouseLeave:this.hide},l.createElement(s,{type:"font-size"}),l.createElement(le,{show:this.state.show,onClose:this.hide},l.createElement(se,{onSelectHeader:function(t){return e.editor.insertMarkdown(t)}})))},t}(y);ce.pluginName="header";var ue=function(e){function t(t){var n;return(n=e.call(this,t)||this).timerId=void 0,n.locked=!1,n.input=l.createRef(),n}a(t,e);var n=t.prototype;return n.click=function(){var e=this;!this.locked&&this.input.current&&(this.locked=!0,this.input.current.value="",this.input.current.click(),this.timerId&&window.clearTimeout(this.timerId),this.timerId=window.setTimeout((function(){e.locked=!1,window.clearTimeout(e.timerId),e.timerId=void 0}),200))},n.componentWillUnmount=function(){this.timerId&&window.clearTimeout(this.timerId)},n.render=function(){return l.createElement("input",{type:"file",ref:this.input,accept:this.props.accept,style:{position:"absolute",zIndex:-1,left:0,top:0,width:0,height:0,opacity:0},onChange:this.props.onChange})},t}(l.Component),he=function(e){function t(t){var n;return(n=e.call(this,t)||this).inputFile=l.createRef(),n.onImageChanged=n.onImageChanged.bind((0,i.Z)(n)),n.handleCustomImageUpload=n.handleCustomImageUpload.bind((0,i.Z)(n)),n.handleImageUpload=n.handleImageUpload.bind((0,i.Z)(n)),n.state={show:!1},n}a(t,e);var n=t.prototype;return n.handleImageUpload=function(){"function"===typeof this.editorConfig.onImageUpload?this.inputFile.current&&this.inputFile.current.click():this.editor.insertMarkdown("image")},n.onImageChanged=function(e){var t=this.editorConfig.onImageUpload;if(t){var n=F(e,t);this.editor.insertPlaceholder(n.placeholder,n.uploaded)}},n.handleCustomImageUpload=function(e){var t=this,n=this.editorConfig.onCustomImageUpload;if(n){var r=n.call(this,e);k(r)&&r.then((function(e){e&&e.url&&t.editor.insertMarkdown("image",{target:e.text,imageUrl:e.url})}))}},n.render=function(){var e=this;return!!this.editorConfig.onCustomImageUpload?l.createElement("span",{className:"button button-type-image",title:g.get("btnImage"),onClick:this.handleCustomImageUpload},l.createElement(s,{type:"image"})):l.createElement("span",{className:"button button-type-image",title:g.get("btnImage"),onClick:this.handleImageUpload,style:{position:"relative"}},l.createElement(s,{type:"image"}),l.createElement(ue,{accept:this.editorConfig.imageAccept||"",ref:this.inputFile,onChange:function(t){t.persist(),t.target.files&&t.target.files.length>0&&e.onImageChanged(t.target.files[0])}}))},t}(y);he.pluginName="image";var de=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"k",keyCode:75,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return n.editor.insertMarkdown("link")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-link",title:g.get("btnLink"),onClick:function(){return e.editor.insertMarkdown("link")}},l.createElement(s,{type:"link"}))},t}(y);de.pluginName="link";var fe=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"7",keyCode:55,withKey:["ctrlKey","shiftKey"],aliasCommand:!0,callback:function(){return n.editor.insertMarkdown("order")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-ordered",title:g.get("btnOrdered"),onClick:function(){return e.editor.insertMarkdown("order")}},l.createElement(s,{type:"list-ordered"}))},t}(y);fe.pluginName="list-ordered";var pe=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"8",keyCode:56,withKey:["ctrlKey","shiftKey"],aliasCommand:!0,callback:function(){return n.editor.insertMarkdown("unordered")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-unordered",title:g.get("btnUnordered"),onClick:function(){return e.editor.insertMarkdown("unordered")}},l.createElement(s,{type:"list-unordered"}))},t}(y);pe.pluginName="list-unordered";var me,ge=function(){function e(){this.record=[],this.recycle=[],this.initValue=""}var t=e.prototype;return t.push=function(e){for(var t=this.record.push(e);this.record.length>100;)this.record.shift();return t},t.get=function(){return this.record},t.getLast=function(){var e=this.record.length;return this.record[e-1]},t.undo=function(e){var t=this.record.pop();if("undefined"===typeof t)return this.initValue;if(t!==e)return this.recycle.push(t),t;var n=this.record.pop();return"undefined"===typeof n?(this.recycle.push(t),this.initValue):(this.recycle.push(t),n)},t.redo=function(){var e=this.recycle.pop();if("undefined"!==typeof e)return this.push(e),e},t.cleanRedo=function(){this.recycle=[]},t.getUndoCount=function(){return this.undo.length},t.getRedoCount=function(){return this.recycle.length},e}(),ve=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboards=[],n.lastPop=null,n.handleChange=n.handleChange.bind((0,i.Z)(n)),n.handleRedo=n.handleRedo.bind((0,i.Z)(n)),n.handleUndo=n.handleUndo.bind((0,i.Z)(n)),n.handleKeyboards=[{key:"y",keyCode:89,withKey:["ctrlKey"],callback:n.handleRedo},{key:"z",keyCode:90,withKey:["metaKey","shiftKey"],callback:n.handleRedo},{key:"z",keyCode:90,aliasCommand:!0,withKey:["ctrlKey"],callback:n.handleUndo}],n.logger=new ge,n}a(t,e);var n=t.prototype;return n.handleUndo=function(){var e=this.logger.undo(this.editor.getMdValue());"undefined"!==typeof e&&(this.pause(),this.lastPop=e,this.editor.setText(e),this.forceUpdate())},n.handleRedo=function(){var e=this.logger.redo();"undefined"!==typeof e&&(this.lastPop=e,this.editor.setText(e),this.forceUpdate())},n.handleChange=function(e,t,n){var r=this;if(this.logger.getLast()!==e&&(null===this.lastPop||this.lastPop!==e)){if(this.logger.cleanRedo(),n)return this.logger.push(e),this.lastPop=null,void this.forceUpdate();this.timerId&&(window.clearTimeout(this.timerId),this.timerId=0),this.timerId=window.setTimeout((function(){r.logger.getLast()!==e&&(r.logger.push(e),r.lastPop=null,r.forceUpdate()),window.clearTimeout(r.timerId),r.timerId=0}),600)}},n.componentDidMount=function(){var e=this;this.editor.on("change",this.handleChange),this.handleKeyboards.forEach((function(t){return e.editor.onKeyboard(t)})),this.logger.initValue=this.editor.getMdValue(),this.forceUpdate()},n.componentWillUnmount=function(){var e=this;this.timerId&&window.clearTimeout(this.timerId),this.editor.off("change",this.handleChange),this.handleKeyboards.forEach((function(t){return e.editor.offKeyboard(t)}))},n.pause=function(){this.timerId&&(window.clearTimeout(this.timerId),this.timerId=void 0)},n.render=function(){var e=this.logger.getUndoCount()>1||this.logger.initValue!==this.editor.getMdValue(),t=this.logger.getRedoCount()>0;return l.createElement(l.Fragment,null,l.createElement("span",{className:"button button-type-undo "+(e?"":"disabled"),title:g.get("btnUndo"),onClick:this.handleUndo},l.createElement(s,{type:"undo"})),l.createElement("span",{className:"button button-type-redo "+(t?"":"disabled"),title:g.get("btnRedo"),onClick:this.handleRedo},l.createElement(s,{type:"redo"})))},t}(y);ve.pluginName="logger",function(e){e[e.SHOW_ALL=0]="SHOW_ALL",e[e.SHOW_MD=1]="SHOW_MD",e[e.SHOW_HTML=2]="SHOW_HTML"}(me||(me={}));var ye=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleClick=n.handleClick.bind((0,i.Z)(n)),n.handleChange=n.handleChange.bind((0,i.Z)(n)),n.state={view:n.editor.getView()},n}a(t,e);var n=t.prototype;return n.handleClick=function(){switch(this.next){case me.SHOW_ALL:this.editor.setView({html:!0,md:!0});break;case me.SHOW_HTML:this.editor.setView({html:!0,md:!1});break;case me.SHOW_MD:this.editor.setView({html:!1,md:!0})}},n.handleChange=function(e){this.setState({view:e})},n.componentDidMount=function(){this.editor.on("viewchange",this.handleChange)},n.componentWillUnmount=function(){this.editor.off("viewchange",this.handleChange)},n.getDisplayInfo=function(){switch(this.next){case me.SHOW_ALL:return{icon:"view-split",title:"All"};case me.SHOW_HTML:return{icon:"visibility",title:"Preview"};default:return{icon:"keyboard",title:"Editor"}}},n.render=function(){if(this.isDisplay){var e=this.getDisplayInfo();return l.createElement("span",{className:"button button-type-mode",title:g.get("btnMode"+e.title),onClick:this.handleClick},l.createElement(s,{type:e.icon}))}return null},(0,v.Z)(t,[{key:"isDisplay",get:function(){var e=this.editorConfig.canView;return!!e&&[e.html,e.md,e.both].filter((function(e){return e})).length>=2}},{key:"next",get:function(){var e=this.editorConfig.canView,t=this.state.view,n=[me.SHOW_ALL,me.SHOW_MD,me.SHOW_HTML];e&&(e.both||n.splice(n.indexOf(me.SHOW_ALL),1),e.md||n.splice(n.indexOf(me.SHOW_MD),1),e.html||n.splice(n.indexOf(me.SHOW_HTML),1));var r=me.SHOW_MD;if(t.html&&(r=me.SHOW_HTML),t.html&&t.md&&(r=me.SHOW_ALL),0===n.length)return r;if(1===n.length)return n[0];var i=n.indexOf(r);return i=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)for(var l,s=C(n);!(l=s()).done;){var c=l.value;if("undefined"!==typeof a[c]&&!a[c])return!1}else if(a.metaKey||a.ctrlKey||a.shiftKey||a.altKey)return!1;return a.key?a.key===i:a.keyCode===r}function T(e,t){var n=e.split("\n"),r=e.substr(0,t).split("\n"),i=r.length,o=r[r.length-1].length,a=n[r.length-1],l=r.length>1?r[r.length-2]:null,s=n.length>r.length?n[r.length]:null;return{line:i,col:o,beforeText:e.substr(0,t),afterText:e.substr(t),curLine:a,prevLine:l,nextLine:s}}for(var N={bold:["**","**"],italic:["*","*"],underline:["++","++"],strikethrough:["~~","~~"],quote:["\n> ","\n"],inlinecode:["`","`"],code:["\n```\n","\n```\n"]},x=1;x<=6;x++)N["h"+x]=["\n"+S("#",x)+" ","\n"];function L(e){for(var t=e.row,n=void 0===t?2:t,r=e.col,i=void 0===r?2:r,o=["|"],a=["|"],l=["|"],s="",c=1;c<=i;c++)o.push(" Head |"),l.push(" --- |"),a.push(" Data |");for(var u=1;u<=n;u++)s+="\n"+a.join("");return o.join("")+"\n"+l.join("")+s}function K(e,t){var n=t;if("\n"!==n.substr(0,1)&&(n="\n"+n),"unordered"===e)return n.length>1?n.replace(/\n/g,"\n* ").trim():"* ";var r=1;return n.length>1?n.replace(/\n/g,(function(){return"\n"+r+++". "})).trim():"1. "}function U(e,t){return{text:e,newBlock:t,selection:{start:e.length,end:e.length}}}var _,V=function(e,t,n){if("undefined"!==typeof N[t])return{text:""+N[t][0]+e+N[t][1],selection:{start:N[t][0].length,end:N[t][0].length+e.length}};switch(t){case"tab":var r=1===n.tabMapValue?"\t":" ".repeat(n.tabMapValue),i=r+e.replace(/\n/g,"\n"+r),o=e.includes("\n")?e.match(/\n/g).length:0;return{text:i,selection:{start:n.tabMapValue,end:n.tabMapValue*(o+1)+e.length}};case"unordered":return U(K("unordered",e),!0);case"order":return U(K("order",e),!0);case"hr":return U("---",!0);case"table":return{text:L(n),newBlock:!0};case"image":return{text:"!["+(e||n.target)+"]("+(n.imageUrl||"")+")",selection:{start:2,end:e.length+2}};case"link":return{text:"["+e+"]("+(n.linkUrl||"")+")",selection:{start:1,end:e.length+1}}}return{text:e,selection:{start:0,end:e.length}}};function H(e,t){var n={};return Object.keys(e).forEach((function(r){"undefined"!==typeof t[r]?"object"!==typeof t[r]?n[r]=t[r]:Array.isArray(t[r])?n[r]=[].concat(t[r]):n[r]=H(e[r],t[r]):n[r]=e[r]})),n}var I=new Uint8Array(16);function A(){if(!_&&!(_="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _(I)}var O=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var D=function(e){return"string"===typeof e&&O.test(e)},R=[],W=0;W<256;++W)R.push((W+256).toString(16).substr(1));var P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(R[e[t+0]]+R[e[t+1]]+R[e[t+2]]+R[e[t+3]]+"-"+R[e[t+4]]+R[e[t+5]]+"-"+R[e[t+6]]+R[e[t+7]]+"-"+R[e[t+8]]+R[e[t+9]]+"-"+R[e[t+10]]+R[e[t+11]]+R[e[t+12]]+R[e[t+13]]+R[e[t+14]]+R[e[t+15]]).toLowerCase();if(!D(n))throw TypeError("Stringified UUID is invalid");return n};var Z=function(e,t,n){var r=(e=e||{}).random||(e.rng||A)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return P(r)};var F=function(e,t){return{placeholder:V("","image",{target:"Uploading_"+Z(),imageUrl:""}).text,uploaded:new Promise((function(n){var r=!0,i=function(t){r&&console.warn("Deprecated: onImageUpload should return a Promise, callback will be removed in future"),n(V("","image",{target:e.name,imageUrl:t}).text)},o=t(e,i);k(o)&&(r=!1,o.then(i))}))}},B={theme:"default",view:{menu:!0,md:!0,html:!0},canView:{menu:!0,md:!0,html:!0,both:!0,fullScreen:!0,hideMenu:!0},htmlClass:"",markdownClass:"",syncScrollMode:["rightFollowLeft","leftFollowRight"],imageUrl:"",imageAccept:"",linkUrl:"",table:{maxRow:4,maxCol:6},allowPasteImage:!0,onImageUpload:void 0,onCustomImageUpload:void 0,shortcuts:!0},j=function(e){function t(){return e.apply(this,arguments)||this}a(t,e);var n=t.prototype;return n.getHtml=function(){return"string"===typeof this.props.html?this.props.html:this.el.current?this.el.current.innerHTML:""},n.render=function(){return"string"===typeof this.props.html?l.createElement("div",{ref:this.el,dangerouslySetInnerHTML:{__html:this.props.html},className:this.props.className||"custom-html-style"}):l.createElement("div",{ref:this.el,className:this.props.className||"custom-html-style"},this.props.html)},t}(function(e){function t(t){var n;return(n=e.call(this,t)||this).el=l.createRef(),n}a(t,e);var n=t.prototype;return n.getElement=function(){return this.el.current},n.getHeight=function(){return this.el.current?this.el.current.offsetHeight:0},t}(l.Component));function G(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return z(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 z(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),o=1;o0&&h.length>0&&(l="\n"+l,s&&(s.start++,s.end++));var d=c.afterText;n.start!==n.end&&(d=T(this.getMdValue(),n.end).afterText),""!==d.trim()&&"\n\n"!==d.substr(0,2)&&("\n"!==d.substr(0,1)&&(l+="\n"),l+="\n")}this.insertText(l,!0,s)},n.insertPlaceholder=function(e,t){var n=this;this.insertText(e,!0),t.then((function(t){var r=n.getMdValue().replace(e,t);n.setText(r)}))},n.insertText=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=!1);var r=this.state.text,i=this.getSelection(),o=r.slice(0,i.start),a=r.slice(t?i.end:i.start,r.length);this.setText(o+e+a,void 0,n?{start:n.start+o.length,end:n.end+o.length}:{start:i.start,end:i.start})},n.setText=function(e,t,n){var r=this;void 0===e&&(e="");var i=this.config.onChangeTrigger,o=void 0===i?"both":i,a=e.replace(/\u21b5/g,"\n");if(this.state.text!==e){this.setState({text:a}),!this.props.onChange||"both"!==o&&"beforeRender"!==o||this.props.onChange({text:a,html:this.getHtmlValue()},t),this.emitter.emit(this.emitter.EVENT_CHANGE,e,t,"undefined"===typeof t),n&&setTimeout((function(){return r.setSelection(n)})),this.hasContentChanged||(this.hasContentChanged=!0);var l=this.renderHTML(a);"both"!==o&&"afterRender"!==o||l.then((function(){r.props.onChange&&r.props.onChange({text:r.state.text,html:r.getHtmlValue()},t)}))}},n.getMdValue=function(){return this.state.text},n.getHtmlValue=function(){return"string"===typeof this.state.html?this.state.html:this.nodeMdPreview.current?this.nodeMdPreview.current.getHtml():""},n.onKeyboard=function(e){var t=this;Array.isArray(e)?e.forEach((function(e){return t.onKeyboard(e)})):this.keyboardListeners.includes(e)||this.keyboardListeners.push(e)},n.offKeyboard=function(e){var t=this;if(Array.isArray(e))e.forEach((function(e){return t.offKeyboard(e)}));else{var n=this.keyboardListeners.indexOf(e);n>=0&&this.keyboardListeners.splice(n,1)}},n.handleKeyDown=function(e){for(var t,n=G(this.keyboardListeners);!(t=n()).done;){var r=t.value;if(M(e,r))return e.preventDefault(),void r.callback(e)}this.emitter.emit(this.emitter.EVENT_KEY_DOWN,e)},n.getEventType=function(e){switch(e){case"change":return this.emitter.EVENT_CHANGE;case"fullscreen":return this.emitter.EVENT_FULL_SCREEN;case"viewchange":return this.emitter.EVENT_VIEW_CHANGE;case"keydown":return this.emitter.EVENT_KEY_DOWN;case"blur":return this.emitter.EVENT_BLUR;case"focus":return this.emitter.EVENT_FOCUS;case"scroll":return this.emitter.EVENT_SCROLL}},n.on=function(e,t){var n=this.getEventType(e);n&&this.emitter.on(n,t)},n.off=function(e,t){var n=this.getEventType(e);n&&this.emitter.off(n,t)},n.setView=function(e){var t=this,n=(0,r.Z)({},this.state.view,e);this.setState({view:n},(function(){t.emitter.emit(t.emitter.EVENT_VIEW_CHANGE,n)}))},n.getView=function(){return(0,r.Z)({},this.state.view)},n.fullScreen=function(e){var t=this;this.state.fullScreen!==e&&this.setState({fullScreen:e},(function(){t.emitter.emit(t.emitter.EVENT_FULL_SCREEN,e)}))},n.isFullScreen=function(){return this.state.fullScreen},n.uploadWithDataTransfer=function(e){var t=this,n=this.config.onImageUpload;if(n){var r=[];Array.prototype.forEach.call(e,(function(e){if("file"===e.kind&&e.type.includes("image")){var i=e.getAsFile();if(i){var o=F(i,n);r.push(Promise.resolve(o.placeholder)),o.uploaded.then((function(e){var n=t.getMdValue().replace(o.placeholder,e),r=e.length-o.placeholder.length,i=t.getSelection();t.setText(n,void 0,{start:i.start+r,end:i.start+r})}))}}else"string"===e.kind&&"text/plain"===e.type&&r.push(new Promise((function(t){return e.getAsString(t)})))})),Promise.all(r).then((function(e){var n=e.join(""),r=t.getSelection();t.insertText(n,!0,{start:r.start===r.end?n.length:0,end:n.length})}))}},n.render=function(){var e=this,t=this.config.canView&&this.config.canView.hideMenu&&!this.config.canView.menu,n=this.state,r=n.view,i=n.fullScreen,o=function(t){return e.state.plugins[t]||[]},a=!!r.menu,h=this.props.id,d=h?h+"_md":void 0,f=h?h+"_html":void 0;return l.createElement("div",{id:h,className:"rc-md-editor "+(i?"full":""),style:this.props.style,onKeyDown:this.handleKeyDown,onDrop:this.handleDrop},l.createElement(c,{visible:a,left:o("left"),right:o("right")}),l.createElement("div",{className:"editor-container"},t&&l.createElement(u,null,l.createElement("span",{className:"button button-type-menu",title:a?"hidden menu":"show menu",onClick:this.handleToggleMenu},l.createElement(s,{type:"expand-"+(a?"less":"more")}))),l.createElement("section",{className:"section sec-md "+(r.md?"visible":"in-visible")},l.createElement("textarea",{id:d,ref:this.nodeMdText,name:this.props.name||"textarea",autoFocus:this.props.autoFocus,placeholder:this.props.placeholder,readOnly:this.props.readOnly,value:this.state.text,className:"section-container input "+(this.config.markdownClass||""),wrap:"hard",onChange:this.handleChange,onScroll:this.handleInputScroll,onMouseOver:function(){return e.shouldSyncScroll="md"},onKeyDown:this.handleEditorKeyDown,onPaste:this.handlePaste,onFocus:this.handleFocus,onBlur:this.handleBlur})),l.createElement("section",{className:"section sec-html "+(r.html?"visible":"in-visible")},l.createElement("div",{id:f,className:"section-container html-wrap",ref:this.nodeMdPreviewWrapper,onMouseOver:function(){return e.shouldSyncScroll="html"},onScroll:this.handlePreviewScroll},l.createElement(j,{html:this.state.html,className:this.config.htmlClass,ref:this.nodeMdPreview})))))},t}(l.Component);q.plugins=[],q.addLocale=g.add.bind(g),q.useLocale=g.setCurrent.bind(g),q.getLocale=g.getCurrent.bind(g);var Q=q,$=function(e){function t(t){var n;return(n=e.call(this,t)||this).timer=null,n.useTimer=n.getConfig("useTimer")||"undefined"===typeof requestAnimationFrame,n.handleChange=n.handleChange.bind((0,i.Z)(n)),n.doResize=n.doResize.bind((0,i.Z)(n)),n}a(t,e);var n=t.prototype;return n.doResize=function(){var e=this,t=function(t){t.style.height="auto";var n=Math.min(Math.max(e.getConfig("min"),t.scrollHeight),e.getConfig("max"));return t.style.height=n+"px",n};this.timer=null;var n=this.editor.getView(),r=this.editor.getMdElement(),i=this.editor.getHtmlElement();if(r&&n.md){var o=t(r);i&&(i.style.height=o+"px")}else i&&n.html&&t(i)},n.handleChange=function(){null===this.timer&&(this.useTimer?this.timer=window.setTimeout(this.doResize):this.timer=requestAnimationFrame(this.doResize))},n.componentDidMount=function(){this.editor.on("change",this.handleChange),this.editor.on("viewchange",this.handleChange),this.handleChange()},n.componentWillUnmount=function(){this.editor.off("change",this.handleChange),this.editor.off("viewchange",this.handleChange),null!==this.timer&&this.useTimer&&(window.clearTimeout(this.timer),this.timer=null)},n.render=function(){return l.createElement("span",null)},t}(y);$.pluginName="auto-resize",$.align="left",$.defaultConfig={min:200,max:1/0,useTimer:!1};var Y=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t.prototype.render=function(){var e=this;return l.createElement("span",{className:"button button-type-code-block",title:g.get("btnCode"),onClick:function(){return e.editor.insertMarkdown("code")}},l.createElement(s,{type:"code-block"}))},t}(y);Y.pluginName="block-code-block";var J=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t.prototype.render=function(){var e=this;return l.createElement("span",{className:"button button-type-code-inline",title:g.get("btnInlineCode"),onClick:function(){return e.editor.insertMarkdown("inlinecode")}},l.createElement(s,{type:"code"}))},t}(y);J.pluginName="block-code-inline";var X=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t.prototype.render=function(){var e=this;return l.createElement("span",{className:"button button-type-quote",title:g.get("btnQuote"),onClick:function(){return e.editor.insertMarkdown("quote")}},l.createElement(s,{type:"quote"}))},t}(y);X.pluginName="block-quote";var ee=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t.prototype.render=function(){var e=this;return l.createElement("span",{className:"button button-type-wrap",title:g.get("btnLineBreak"),onClick:function(){return e.editor.insertMarkdown("hr")}},l.createElement(s,{type:"wrap"}))},t}(y);ee.pluginName="block-wrap";var te=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleClick=n.handleClick.bind((0,i.Z)(n)),n}a(t,e);var n=t.prototype;return n.handleClick=function(){""!==this.editor.getMdValue()&&(window.confirm&&"function"===typeof window.confirm&&window.confirm(g.get("clearTip"))&&this.editor.setText(""))},n.render=function(){return l.createElement("span",{className:"button button-type-clear",title:g.get("btnClear"),onClick:this.handleClick},l.createElement(s,{type:"delete"}))},t}(y);te.pluginName="clear";var ne=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"b",keyCode:66,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return n.editor.insertMarkdown("bold")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-bold",title:g.get("btnBold"),onClick:function(){return e.editor.insertMarkdown("bold")}},l.createElement(s,{type:"bold"}))},t}(y);ne.pluginName="font-bold";var re=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"i",keyCode:73,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return n.editor.insertMarkdown("italic")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-italic",title:g.get("btnItalic"),onClick:function(){return e.editor.insertMarkdown("italic")}},l.createElement(s,{type:"italic"}))},t}(y);re.pluginName="font-italic";var ie=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"d",keyCode:68,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return n.editor.insertMarkdown("strikethrough")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-strikethrough",title:g.get("btnStrikethrough"),onClick:function(){return e.editor.insertMarkdown("strikethrough")}},l.createElement(s,{type:"strikethrough"}))},t}(y);ie.pluginName="font-strikethrough";var oe=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"u",keyCode:85,withKey:["ctrlKey"],callback:function(){return n.editor.insertMarkdown("underline")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-underline",title:g.get("btnUnderline"),onClick:function(){return e.editor.insertMarkdown("underline")}},l.createElement(s,{type:"underline"}))},t}(y);oe.pluginName="font-underline";var ae=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleClick=n.handleClick.bind((0,i.Z)(n)),n.handleChange=n.handleChange.bind((0,i.Z)(n)),n.state={enable:n.editor.isFullScreen()},n}a(t,e);var n=t.prototype;return n.handleClick=function(){this.editor.fullScreen(!this.state.enable)},n.handleChange=function(e){this.setState({enable:e})},n.componentDidMount=function(){this.editor.on("fullscreen",this.handleChange)},n.componentWillUnmount=function(){this.editor.off("fullscreen",this.handleChange)},n.render=function(){if(this.editorConfig.canView&&this.editorConfig.canView.fullScreen){var e=this.state.enable;return l.createElement("span",{className:"button button-type-fullscreen",title:g.get(e?"btnExitFullScreen":"btnFullScreen"),onClick:this.handleClick},l.createElement(s,{type:e?"fullscreen-exit":"fullscreen"}))}return null},t}(y);ae.pluginName="full-screen",ae.align="right";var le=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleClose=n.handleClose.bind((0,i.Z)(n)),n}a(t,e);var n=t.prototype;return n.handleClose=function(e){e.stopPropagation();var t=this.props.onClose;"function"===typeof t&&t()},n.render=function(){return l.createElement("div",{className:"drop-wrap "+(this.props.show?"show":"hidden"),onClick:this.handleClose},this.props.children)},t}(l.Component),se=function(e){function t(){return e.apply(this,arguments)||this}a(t,e);var n=t.prototype;return n.handleHeader=function(e){var t=this.props.onSelectHeader;"function"===typeof t&&t(e)},n.render=function(){return l.createElement("ul",{className:"header-list"},l.createElement("li",{className:"list-item"},l.createElement("h1",{onClick:this.handleHeader.bind(this,"h1")},"H1")),l.createElement("li",{className:"list-item"},l.createElement("h2",{onClick:this.handleHeader.bind(this,"h2")},"H2")),l.createElement("li",{className:"list-item"},l.createElement("h3",{onClick:this.handleHeader.bind(this,"h3")},"H3")),l.createElement("li",{className:"list-item"},l.createElement("h4",{onClick:this.handleHeader.bind(this,"h4")},"H4")),l.createElement("li",{className:"list-item"},l.createElement("h5",{onClick:this.handleHeader.bind(this,"h5")},"H5")),l.createElement("li",{className:"list-item"},l.createElement("h6",{onClick:this.handleHeader.bind(this,"h6")},"H6")))},t}(l.Component),ce=function(e){function t(t){var n;return(n=e.call(this,t)||this).show=n.show.bind((0,i.Z)(n)),n.hide=n.hide.bind((0,i.Z)(n)),n.state={show:!1},n}a(t,e);var n=t.prototype;return n.show=function(){this.setState({show:!0})},n.hide=function(){this.setState({show:!1})},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-header",title:g.get("btnHeader"),onMouseEnter:this.show,onMouseLeave:this.hide},l.createElement(s,{type:"font-size"}),l.createElement(le,{show:this.state.show,onClose:this.hide},l.createElement(se,{onSelectHeader:function(t){return e.editor.insertMarkdown(t)}})))},t}(y);ce.pluginName="header";var ue=function(e){function t(t){var n;return(n=e.call(this,t)||this).timerId=void 0,n.locked=!1,n.input=l.createRef(),n}a(t,e);var n=t.prototype;return n.click=function(){var e=this;!this.locked&&this.input.current&&(this.locked=!0,this.input.current.value="",this.input.current.click(),this.timerId&&window.clearTimeout(this.timerId),this.timerId=window.setTimeout((function(){e.locked=!1,window.clearTimeout(e.timerId),e.timerId=void 0}),200))},n.componentWillUnmount=function(){this.timerId&&window.clearTimeout(this.timerId)},n.render=function(){return l.createElement("input",{type:"file",ref:this.input,accept:this.props.accept,style:{position:"absolute",zIndex:-1,left:0,top:0,width:0,height:0,opacity:0},onChange:this.props.onChange})},t}(l.Component),he=function(e){function t(t){var n;return(n=e.call(this,t)||this).inputFile=l.createRef(),n.onImageChanged=n.onImageChanged.bind((0,i.Z)(n)),n.handleCustomImageUpload=n.handleCustomImageUpload.bind((0,i.Z)(n)),n.handleImageUpload=n.handleImageUpload.bind((0,i.Z)(n)),n.state={show:!1},n}a(t,e);var n=t.prototype;return n.handleImageUpload=function(){"function"===typeof this.editorConfig.onImageUpload?this.inputFile.current&&this.inputFile.current.click():this.editor.insertMarkdown("image")},n.onImageChanged=function(e){var t=this.editorConfig.onImageUpload;if(t){var n=F(e,t);this.editor.insertPlaceholder(n.placeholder,n.uploaded)}},n.handleCustomImageUpload=function(e){var t=this,n=this.editorConfig.onCustomImageUpload;if(n){var r=n.call(this,e);k(r)&&r.then((function(e){e&&e.url&&t.editor.insertMarkdown("image",{target:e.text,imageUrl:e.url})}))}},n.render=function(){var e=this;return!!this.editorConfig.onCustomImageUpload?l.createElement("span",{className:"button button-type-image",title:g.get("btnImage"),onClick:this.handleCustomImageUpload},l.createElement(s,{type:"image"})):l.createElement("span",{className:"button button-type-image",title:g.get("btnImage"),onClick:this.handleImageUpload,style:{position:"relative"}},l.createElement(s,{type:"image"}),l.createElement(ue,{accept:this.editorConfig.imageAccept||"",ref:this.inputFile,onChange:function(t){t.persist(),t.target.files&&t.target.files.length>0&&e.onImageChanged(t.target.files[0])}}))},t}(y);he.pluginName="image";var de=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"k",keyCode:75,aliasCommand:!0,withKey:["ctrlKey"],callback:function(){return n.editor.insertMarkdown("link")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-link",title:g.get("btnLink"),onClick:function(){return e.editor.insertMarkdown("link")}},l.createElement(s,{type:"link"}))},t}(y);de.pluginName="link";var fe=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"7",keyCode:55,withKey:["ctrlKey","shiftKey"],aliasCommand:!0,callback:function(){return n.editor.insertMarkdown("order")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-ordered",title:g.get("btnOrdered"),onClick:function(){return e.editor.insertMarkdown("order")}},l.createElement(s,{type:"list-ordered"}))},t}(y);fe.pluginName="list-ordered";var pe=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboard={key:"8",keyCode:56,withKey:["ctrlKey","shiftKey"],aliasCommand:!0,callback:function(){return n.editor.insertMarkdown("unordered")}},n}a(t,e);var n=t.prototype;return n.componentDidMount=function(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)},n.componentWillUnmount=function(){this.editor.offKeyboard(this.handleKeyboard)},n.render=function(){var e=this;return l.createElement("span",{className:"button button-type-unordered",title:g.get("btnUnordered"),onClick:function(){return e.editor.insertMarkdown("unordered")}},l.createElement(s,{type:"list-unordered"}))},t}(y);pe.pluginName="list-unordered";var me,ge=function(){function e(){this.record=[],this.recycle=[],this.initValue=""}var t=e.prototype;return t.push=function(e){for(var t=this.record.push(e);this.record.length>100;)this.record.shift();return t},t.get=function(){return this.record},t.getLast=function(){var e=this.record.length;return this.record[e-1]},t.undo=function(e){var t=this.record.pop();if("undefined"===typeof t)return this.initValue;if(t!==e)return this.recycle.push(t),t;var n=this.record.pop();return"undefined"===typeof n?(this.recycle.push(t),this.initValue):(this.recycle.push(t),n)},t.redo=function(){var e=this.recycle.pop();if("undefined"!==typeof e)return this.push(e),e},t.cleanRedo=function(){this.recycle=[]},t.getUndoCount=function(){return this.undo.length},t.getRedoCount=function(){return this.recycle.length},e}(),ve=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleKeyboards=[],n.lastPop=null,n.handleChange=n.handleChange.bind((0,i.Z)(n)),n.handleRedo=n.handleRedo.bind((0,i.Z)(n)),n.handleUndo=n.handleUndo.bind((0,i.Z)(n)),n.handleKeyboards=[{key:"y",keyCode:89,withKey:["ctrlKey"],callback:n.handleRedo},{key:"z",keyCode:90,withKey:["metaKey","shiftKey"],callback:n.handleRedo},{key:"z",keyCode:90,aliasCommand:!0,withKey:["ctrlKey"],callback:n.handleUndo}],n.logger=new ge,n}a(t,e);var n=t.prototype;return n.handleUndo=function(){var e=this.logger.undo(this.editor.getMdValue());"undefined"!==typeof e&&(this.pause(),this.lastPop=e,this.editor.setText(e),this.forceUpdate())},n.handleRedo=function(){var e=this.logger.redo();"undefined"!==typeof e&&(this.lastPop=e,this.editor.setText(e),this.forceUpdate())},n.handleChange=function(e,t,n){var r=this;if(this.logger.getLast()!==e&&(null===this.lastPop||this.lastPop!==e)){if(this.logger.cleanRedo(),n)return this.logger.push(e),this.lastPop=null,void this.forceUpdate();this.timerId&&(window.clearTimeout(this.timerId),this.timerId=0),this.timerId=window.setTimeout((function(){r.logger.getLast()!==e&&(r.logger.push(e),r.lastPop=null,r.forceUpdate()),window.clearTimeout(r.timerId),r.timerId=0}),600)}},n.componentDidMount=function(){var e=this;this.editor.on("change",this.handleChange),this.handleKeyboards.forEach((function(t){return e.editor.onKeyboard(t)})),this.logger.initValue=this.editor.getMdValue(),this.forceUpdate()},n.componentWillUnmount=function(){var e=this;this.timerId&&window.clearTimeout(this.timerId),this.editor.off("change",this.handleChange),this.handleKeyboards.forEach((function(t){return e.editor.offKeyboard(t)}))},n.pause=function(){this.timerId&&(window.clearTimeout(this.timerId),this.timerId=void 0)},n.render=function(){var e=this.logger.getUndoCount()>1||this.logger.initValue!==this.editor.getMdValue(),t=this.logger.getRedoCount()>0;return l.createElement(l.Fragment,null,l.createElement("span",{className:"button button-type-undo "+(e?"":"disabled"),title:g.get("btnUndo"),onClick:this.handleUndo},l.createElement(s,{type:"undo"})),l.createElement("span",{className:"button button-type-redo "+(t?"":"disabled"),title:g.get("btnRedo"),onClick:this.handleRedo},l.createElement(s,{type:"redo"})))},t}(y);ve.pluginName="logger",function(e){e[e.SHOW_ALL=0]="SHOW_ALL",e[e.SHOW_MD=1]="SHOW_MD",e[e.SHOW_HTML=2]="SHOW_HTML"}(me||(me={}));var ye=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleClick=n.handleClick.bind((0,i.Z)(n)),n.handleChange=n.handleChange.bind((0,i.Z)(n)),n.state={view:n.editor.getView()},n}a(t,e);var n=t.prototype;return n.handleClick=function(){switch(this.next){case me.SHOW_ALL:this.editor.setView({html:!0,md:!0});break;case me.SHOW_HTML:this.editor.setView({html:!0,md:!1});break;case me.SHOW_MD:this.editor.setView({html:!1,md:!0})}},n.handleChange=function(e){this.setState({view:e})},n.componentDidMount=function(){this.editor.on("viewchange",this.handleChange)},n.componentWillUnmount=function(){this.editor.off("viewchange",this.handleChange)},n.getDisplayInfo=function(){switch(this.next){case me.SHOW_ALL:return{icon:"view-split",title:"All"};case me.SHOW_HTML:return{icon:"visibility",title:"Preview"};default:return{icon:"keyboard",title:"Editor"}}},n.render=function(){if(this.isDisplay){var e=this.getDisplayInfo();return l.createElement("span",{className:"button button-type-mode",title:g.get("btnMode"+e.title),onClick:this.handleClick},l.createElement(s,{type:e.icon}))}return null},(0,v.Z)(t,[{key:"isDisplay",get:function(){var e=this.editorConfig.canView;return!!e&&[e.html,e.md,e.both].filter((function(e){return e})).length>=2}},{key:"next",get:function(){var e=this.editorConfig.canView,t=this.state.view,n=[me.SHOW_ALL,me.SHOW_MD,me.SHOW_HTML];e&&(e.both||n.splice(n.indexOf(me.SHOW_ALL),1),e.md||n.splice(n.indexOf(me.SHOW_MD),1),e.html||n.splice(n.indexOf(me.SHOW_HTML),1));var r=me.SHOW_MD;if(t.html&&(r=me.SHOW_HTML),t.html&&t.md&&(r=me.SHOW_ALL),0===n.length)return r;if(1===n.length)return n[0];var i=n.indexOf(r);return i=i)&&Object.keys(t.O).every((function(e){return t.O[e](r[c])}))?r.splice(c--,1):(a=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[r,o,i]}}(),t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.f={},t.e=function(e){return Promise.all(Object.keys(t.f).reduce((function(n,r){return t.f[r](e,n),n}),[]))},t.u=function(e){return"static/chunks/"+e+".b96ba7349cc7167f.js"},t.miniCssF=function(e){return"static/css/"+{142:"325160c29fde2de0",888:"8358967c8f0c4bf5"}[e]+".css"},t.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},function(){var e={},n="_N_E:";t.l=function(r,o,i,u){if(e[r])e[r].push(o);else{var a,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),l=0;l=i)&&Object.keys(t.O).every((function(e){return t.O[e](r[c])}))?r.splice(c--,1):(a=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[r,o,i]}}(),t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.f={},t.e=function(e){return Promise.all(Object.keys(t.f).reduce((function(n,r){return t.f[r](e,n),n}),[]))},t.u=function(e){return"static/chunks/"+e+".6e0d7eb5a76a471d.js"},t.miniCssF=function(e){return"static/css/"+{142:"325160c29fde2de0",888:"8358967c8f0c4bf5"}[e]+".css"},t.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},function(){var e={},n="_N_E:";t.l=function(r,o,i,u){if(e[r])e[r].push(o);else{var a,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),l=0;lOwncast Admin

What is your stream about today?

What is your stream about today?
Offline

Access Tokens

Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control.
Read more about how to use these tokens, with examples, at our documentation.
NameTokenScopesLast Used
No Data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Access Tokens

Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control.
Read more about how to use these tokens, with examples, at our documentation.
NameTokenScopesLast Used
No Data

\ No newline at end of file diff --git a/static/admin/actions/index.html b/static/admin/actions/index.html index 5a38f1b9f..177f2b4c4 100644 --- a/static/admin/actions/index.html +++ b/static/admin/actions/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

External Actions

External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.
Read more about how to use actions, with examples, at our documentation.
NameDescriptionURLIconColorOpens
No Data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

External Actions

External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.
Read more about how to use actions, with examples, at our documentation.
NameDescriptionURLIconColorOpens
No Data

\ No newline at end of file diff --git a/static/admin/chat/messages/index.html b/static/admin/chat/messages/index.html index d5a202250..58a30104a 100644 --- a/static/admin/chat/messages/index.html +++ b/static/admin/chat/messages/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Chat Messages

Manage the messages from viewers that show up on your stream.

Check multiple messages to change their visibility to:
Time
User
Message
No Data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Chat Messages

Manage the messages from viewers that show up on your stream.

Check multiple messages to change their visibility to:
Time
User
Message
No Data
\ No newline at end of file diff --git a/static/admin/chat/users/index.html b/static/admin/chat/users/index.html index 84fa5ee3a..5076adddc 100644 --- a/static/admin/chat/users/index.html +++ b/static/admin/chat/users/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

When a stream is active and chat is enabled, connected chat clients will be displayed here.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

When a stream is active and chat is enabled, connected chat clients will be displayed here.

\ No newline at end of file diff --git a/static/admin/config-chat/index.html b/static/admin/config-chat/index.html index ae21cc600..5f3bc5995 100644 --- a/static/admin/config-chat/index.html +++ b/static/admin/config-chat/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/admin/config-public-details/index.html b/static/admin/config-public-details/index.html index ac8bc2514..5e6930214 100644 --- a/static/admin/config-public-details/index.html +++ b/static/admin/config-public-details/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

General Settings

The following are displayed on your site to describe your stream and its content. Learn more.

Custom Page Content

Edit the content of your page by using simple Markdown syntax.


Customize your page styling with CSS

Customize the look and feel of your Owncast instance by overriding the CSS styles of various components on the page. Refer to the CSS & Components guide.

Please input plain CSS text, as this will be directly injected onto your page during load.


\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

General Settings

The following are displayed on your site to describe your stream and its content. Learn more.

Custom Page Content

Edit the content of your page by using simple Markdown syntax.


Customize your page styling with CSS

Customize the look and feel of your Owncast instance by overriding the CSS styles of various components on the page. Refer to the CSS & Components guide.

Please input plain CSS text, as this will be directly injected onto your page during load.


\ No newline at end of file diff --git a/static/admin/config-server-details/index.html b/static/admin/config-server-details/index.html index 8393b6472..8ff591b01 100644 --- a/static/admin/config-server-details/index.html +++ b/static/admin/config-server-details/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Server Settings

You should change your stream key from the default and keep it safe. For most people it's likely the other settings will not need to be changed.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Server Settings

You should change your stream key from the default and keep it safe. For most people it's likely the other settings will not need to be changed.

\ No newline at end of file diff --git a/static/admin/config-social-items/index.html b/static/admin/config-social-items/index.html index 85162a7da..e55883363 100644 --- a/static/admin/config-social-items/index.html +++ b/static/admin/config-social-items/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Social Items

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Social Items

\ No newline at end of file diff --git a/static/admin/config-storage/index.html b/static/admin/config-storage/index.html index 4f3c2448a..5c9f53128 100644 --- a/static/admin/config-storage/index.html +++ b/static/admin/config-storage/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Storage

Owncast supports optionally using external storage providers to stream your video. Learn more about this by visiting our Storage Documentation.

Configuring this incorrectly will likely cause your video to be unplayable. Double check the documentation for your storage provider on how to configure the bucket you created for Owncast.

Keep in mind this is for live streaming, not for archival, recording or VOD purposes.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Storage

Owncast supports optionally using external storage providers to stream your video. Learn more about this by visiting our Storage Documentation.

Configuring this incorrectly will likely cause your video to be unplayable. Double check the documentation for your storage provider on how to configure the bucket you created for Owncast.

Keep in mind this is for live streaming, not for archival, recording or VOD purposes.

\ No newline at end of file diff --git a/static/admin/config-video/index.html b/static/admin/config-video/index.html index f41a64e1c..341f884ae 100644 --- a/static/admin/config-video/index.html +++ b/static/admin/config-video/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Video configuration

Before changing your video configuration visit the video documentation to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities.

Stream output

NameVideo bitrateCPU Usage
No name800 kbpsMedium

Latency Buffer

While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended.

For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it. Read to learn more.

LowestHighest

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Video configuration

Before changing your video configuration visit the video documentation to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities.

Stream output

NameVideo bitrateCPU Usage
No name800 kbpsMedium

Latency Buffer

While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended.

For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it. Read to learn more.

LowestHighest

\ No newline at end of file diff --git a/static/admin/hardware-info/index.html b/static/admin/hardware-info/index.html index 010d2bf56..b1ce76c82 100644 --- a/static/admin/hardware-info/index.html +++ b/static/admin/hardware-info/index.html @@ -1,4 +1,4 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Hardware Info


Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Hardware Info


Disk
0%
Loading...
\ No newline at end of file + a 47,47 0 1 1 0,94" stroke="" stroke-linecap="round" stroke-width="6" opacity="0" fill-opacity="0" style="stroke:#52C41A;stroke-dasharray:0px 295.3097094374406px;stroke-dashoffset:-37.5px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s">
Disk
0%
Loading...
\ No newline at end of file diff --git a/static/admin/help/index.html b/static/admin/help/index.html index be1275d86..f16e20e5a 100644 --- a/static/admin/help/index.html +++ b/static/admin/help/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

How can we help you?

Troubleshooting

Fix your problems

Documentation

Read the Docs

Common tasks

I want to configure my owncast instance
Help configuring my broadcasting software
I want to embed my stream into another site
I want to customize my website
I want to tweak my video output
I want to use an external storage provider

Other

I found a bug
If you found a bug, then please let us know
I have a general question
Most general questions are answered in our FAQ or exist in our discussions
I want to build add-ons for Owncast
You can build your own bots, overlays, tools and add-ons with our developer APIs. 
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

How can we help you?

Troubleshooting

Fix your problems

Documentation

Read the Docs

Common tasks

I want to configure my owncast instance
Help configuring my broadcasting software
I want to embed my stream into another site
I want to customize my website
I want to tweak my video output
I want to use an external storage provider

Other

I found a bug
If you found a bug, then please let us know
I have a general question
Most general questions are answered in our FAQ or exist in our discussions
I want to build add-ons for Owncast
You can build your own bots, overlays, tools and add-ons with our developer APIs. 
\ No newline at end of file diff --git a/static/admin/index.html b/static/admin/index.html index 88bab3610..8fa564ba7 100644 --- a/static/admin/index.html +++ b/static/admin/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

No stream is active

You should start one.

Use your broadcasting software
Chat is disabled
Chat will continue to be disabled until you begin a live stream.
Find an audience on the Owncast Directory
List yourself in the Owncast Directory and show off your stream. Enable it in settings.
Not sure what to do next?
If you're having issues or would like to know how to customize and configure your Owncast server visit the help page.

News & Updates from Owncast

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

No stream is active

You should start one.

Use your broadcasting software
Chat is disabled
Chat will continue to be disabled until you begin a live stream.
Find an audience on the Owncast Directory
List yourself in the Owncast Directory and show off your stream. Enable it in settings.
Not sure what to do next?
If you're having issues or would like to know how to customize and configure your Owncast server visit the help page.

News & Updates from Owncast

\ No newline at end of file diff --git a/static/admin/logs/index.html b/static/admin/logs/index.html index 31ff11e27..943af5560 100644 --- a/static/admin/logs/index.html +++ b/static/admin/logs/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/admin/upgrade/index.html b/static/admin/upgrade/index.html index 358b66fae..7cd766e58 100644 --- a/static/admin/upgrade/index.html +++ b/static/admin/upgrade/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Thu Jan 01 1970

Downloads

NameSize
No Data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Thu Jan 01 1970

Downloads

NameSize
No Data
\ No newline at end of file diff --git a/static/admin/viewer-info/index.html b/static/admin/viewer-info/index.html index 1a1b57d60..3868b937b 100644 --- a/static/admin/viewer-info/index.html +++ b/static/admin/viewer-info/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
no info
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
no info
\ No newline at end of file diff --git a/static/admin/webhooks/index.html b/static/admin/webhooks/index.html index cf6f7e82f..bf1e3b3ea 100644 --- a/static/admin/webhooks/index.html +++ b/static/admin/webhooks/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Webhooks

A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming.
Read more about how to use webhooks, with examples, at our documentation.
URLEvents
No Data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Webhooks

A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming.
Read more about how to use webhooks, with examples, at our documentation.
URLEvents
No Data

\ No newline at end of file