@wangeditor-next/editor 5.7.8 → 5.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ var e;function t(){"undefined"==typeof globalThis&&(window.globalThis=window)}fu
9
9
  * @param {string} phrase that needs interpolation, with placeholders
10
10
  * @param {object} options with values that will be used to replace placeholders
11
11
  * @returns {any[]} interpolated
12
- */function i(e,t){const n=/\$/g;let r=[e];if(null==t)return r;for(const e of Object.keys(t))if("_"!==e){let i=t[e];"string"==typeof i&&(i=n[Symbol.replace](i,"$$$$")),r=o(r,new RegExp(`%\\{${e}\\}`,"g"),i)}return r}var a=n("apply");function s(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}return _=class{constructor(t){Object.defineProperty(this,a,{value:s}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(t)?t.forEach(e(this,a)[a],this):e(this,a)[a](t)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!r(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return i(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return i(n,t)}},_}function de(){return M||(M=1,L=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,o,i,a,s){var u=function(e){var n=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(t),a=0,s=i.length;for(;a<s;a++){var u=i[a];if("*"===u&&(n=n.concat(t[u])),2===o.length&&o[0]===u){n=n.concat(t[u]);break}}return n}(e);u.length&&function(e,t,n){var r=0,o=t.length;for(;r<o&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,u,[n,r,o,i,a,s])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,function r(){n.apply(this,arguments),e.off(t,r)})},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],o=0,i=r?r.length:0;o<i;o++)r[o]!==t&&n.push(r[o]);n.length?this._fns[e]=n:delete this._fns[e]},e}),L}function fe(){if(H)return j;H=1;var e="Expected a function",t=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,a="object"==typeof h&&h&&h.Object===Object&&h,s="object"==typeof self&&self&&self.Object===Object&&self,u=a||s||Function("return this")(),l=Object.prototype.toString,c=Math.max,d=Math.min,f=function(){return u.Date.now()};function p(t,n,r){var o,i,a,s,u,l,p=0,h=!1,m=!1,y=!0;if("function"!=typeof t)throw new TypeError(e);function b(e){var n=o,r=i;return o=i=void 0,p=e,s=t.apply(r,n)}function E(e){var t=e-l;return void 0===l||t>=n||t<0||m&&e-p>=a}function w(){var e=f();if(E(e))return C(e);u=setTimeout(w,function(e){var t=n-(e-l);return m?d(t,a-(e-p)):t}(e))}function C(e){return u=void 0,y&&o?b(e):(o=i=void 0,s)}function D(){var e=f(),t=E(e);if(o=arguments,i=this,l=e,t){if(void 0===u)return function(e){return p=e,u=setTimeout(w,n),h?b(e):s}(l);if(m)return u=setTimeout(w,n),b(l)}return void 0===u&&(u=setTimeout(w,n)),s}return n=v(n)||0,g(r)&&(h=!!r.leading,a=(m="maxWait"in r)?c(v(r.maxWait)||0,n):a,y="trailing"in r?!!r.trailing:y),D.cancel=function(){void 0!==u&&clearTimeout(u),p=0,o=l=i=u=void 0},D.flush=function(){return void 0===u?s:C(f())},D}function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(g(e)){var a="function"==typeof e.valueOf?e.valueOf():e;e=g(a)?a+"":a}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var s=r.test(e);return s||o.test(e)?i(e.slice(2),s?2:8):n.test(e)?NaN:+e}return j=function(t,n,r){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError(e);return g(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),p(t,n,{leading:o,maxWait:n,trailing:i})}}function pe(){if($)return z;$=1;var e=0;function t(t){return"__private_"+e+++"_"+t}var n=t("publish");class r{constructor(){Object.defineProperty(this,n,{value:o}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},r={...this.state,...e};this.state=r,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,n)[n](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach(e=>{e(...t)})}return r.VERSION="2.1.1",z=function(){return new r}}function he(){if(V)return U;return V=1,U=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}}function ge(){return G?W:(G=1,W={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"})}function ve(){if(oe)return re;oe=1;var e=S(),t=A(),n=ue();let r,o;function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var a=0;function s(e){return"__private_"+a+++"_"+e}const u=ce(),l=de(),c=fe(),d=pe(),f=function(){if(K)return q;K=1;const e=he(),t=ge();return q=function(n){var r;if(n.type)return n.type;const o=n.name?null==(r=e(n.name).extension)?void 0:r.toLowerCase():null;return o&&o in t?t[o]:"application/octet-stream"}}(),p=he(),h=function(){if(X)return Y;function e(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}return X=1,Y=function(t){let n="uppy";return"string"==typeof t.name&&(n+=`-${e(t.name.toLowerCase())}`),void 0!==t.type&&(n+=`-${t.type}`),t.meta&&"string"==typeof t.meta.relativePath&&(n+=`-${e(t.meta.relativePath.toLowerCase())}`),void 0!==t.data.size&&(n+=`-${t.data.size}`),void 0!==t.data.lastModified&&(n+=`-${t.data.lastModified}`),n}}(),g=(J||(J=1,Z=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[r,o]=n.split(".");return r=parseInt(r,10),o=parseInt(o,10),r<15||15===r&&o<15063||r>18||18===r&&o>=18218}),Z),v=ee?Q:(ee=1,Q=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}),m=ne?te:(ne=1,te={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}});var y=s("plugins"),b=s("restricter"),E=s("storeUnsubscribe"),w=s("emitter"),C=s("preProcessors"),D=s("uploaders"),x=s("postProcessors"),N=s("informAndEmit"),B=s("checkRequiredMetaFieldsOnFile"),O=s("checkRequiredMetaFields"),T=s("assertNewUploadAllowed"),k=s("checkAndCreateFileStateObject"),F=s("startIfAutoProceed"),I=s("addListeners"),P=s("updateOnlineStatus"),_=s("createUpload"),R=s("getUpload"),L=s("removeUpload"),M=s("runUpload");r=Symbol.for("uppy test: getPlugins"),o=Symbol.for("uppy test: createUpload");class j{constructor(e){Object.defineProperty(this,M,{value:le}),Object.defineProperty(this,L,{value:se}),Object.defineProperty(this,R,{value:ae}),Object.defineProperty(this,_,{value:ie}),Object.defineProperty(this,I,{value:G}),Object.defineProperty(this,F,{value:W}),Object.defineProperty(this,k,{value:V}),Object.defineProperty(this,T,{value:U}),Object.defineProperty(this,O,{value:$}),Object.defineProperty(this,B,{value:z}),Object.defineProperty(this,N,{value:H}),Object.defineProperty(this,y,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,b,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,w,{writable:!0,value:l()}),Object.defineProperty(this,C,{writable:!0,value:new Set}),Object.defineProperty(this,D,{writable:!0,value:new Set}),Object.defineProperty(this,x,{writable:!0,value:new Set}),Object.defineProperty(this,P,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=m;const r={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:n.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:d(),logger:t.justErrorsLogger,infoTimeout:5e3};this.opts={...r,...e,restrictions:{...r.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=t.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=c(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:g(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),i(this,b)[b]=new n.Restricter(()=>this.opts,this.i18n),i(this,E)[E]=this.store.subscribe((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),i(this,I)[I]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i(this,w)[w].emit(e,...n)}on(e,t){return i(this,w)[w].on(e,t),this}once(e,t){return i(this,w)[w].once(e,t),this}off(e,t){return i(this,w)[w].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new u([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(e=>{e.setOptions()}),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach(r=>{const o={...t[r]};o.progress={...o.progress,...e},n[r]=o}),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){i(this,C)[C].add(e)}removePreProcessor(e){return i(this,C)[C].delete(e)}addPostProcessor(e){i(this,x)[x].add(e)}removePostProcessor(e){return i(this,x)[x].delete(e)}addUploader(e){i(this,D)[D].add(e)}removeUploader(e){return i(this,D)[D].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach(t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const r={...n[e].meta,...t};n[e]={...n[e],meta:r},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=r.filter(e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted}),i=r.filter(e=>!e.progress.uploadStarted),a=r.filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess),s=r.filter(e=>e.progress.uploadStarted),u=r.filter(e=>e.isPaused),l=r.filter(e=>e.progress.uploadComplete),c=r.filter(e=>e.error),d=o.filter(e=>!e.isPaused),f=r.filter(e=>e.progress.preprocess||e.progress.postprocess);return{newFiles:i,startedFiles:a,uploadStartedFiles:s,pausedFiles:u,completeFiles:l,erroredFiles:c,inProgressFiles:o,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:s.length>0,isAllComplete:100===t&&l.length===r.length&&0===f.length,isAllErrored:!!n&&c.length===r.length,isAllPaused:0!==o.length&&u.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(e=>e.isGhost)}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return i(this,b)[b].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){i(this,T)[T](e);const{files:t}=this.getState();let n=i(this,k)[k](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),i(this,F)[F](),n.id}addFiles(e){i(this,T)[T]();const t={...this.getState().files},n=[],r=[];for(let o=0;o<e.length;o++)try{let r=i(this,k)[k](t,e[o]);t[r.id]&&t[r.id].isGhost&&(r={...t[r.id],data:e[o].data,isGhost:!1},this.log(`Replaced blob in a ghost file: ${r.name}, ${r.id}`)),t[r.id]=r,n.push(r)}catch(e){e.isRestriction||r.push(e)}if(this.setState({files:t}),n.forEach(e=>{this.emit("file-added",e)}),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach(e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)}),n.length>0&&i(this,F)[F](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach(t=>{e+=`\n * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}}removeFiles(e,t){const{files:n,currentUploads:r}=this.getState(),o={...n},i={...r},a=Object.create(null);function s(e){return void 0===a[e]}e.forEach(e=>{n[e]&&(a[e]=n[e],delete o[e])}),Object.keys(i).forEach(e=>{const t=r[e].fileIDs.filter(s);if(0===t.length)return void delete i[e];const{capabilities:n}=this.getState();if(t.length!==r[e].fileIDs.length&&!n.individualCancellation)throw new Error("individualCancellation is disabled");i[e]={...r[e],fileIDs:t}});const u={currentUploads:i,files:o};0===Object.keys(o).length&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),this.calculateTotalProgress();const l=Object.keys(a);l.forEach(e=>{this.emit("file-removed",a[e],t)}),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const n={...e[t],isPaused:!0};e[t]=n}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter(t=>e[t].error);if(t.forEach(t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n}),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=i(this,_)[_](t,{forceAllowNewUpload:!0});return i(this,M)[M](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=i(this,_)[_]([e],{forceAllowNewUpload:!0});return i(this,M)[M](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins(e=>{e.provider&&e.provider.logout&&e.provider.logout()})}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter(e=>null!=e.progress.bytesTotal),n=e.filter(e=>null==e.progress.bytesTotal);if(0===t.length){const t=100*e.length,r=n.reduce((e,t)=>e+t.progress.percentage,0),o=Math.round(r/t*100);return void this.setState({totalProgress:o})}let r=t.reduce((e,t)=>e+t.progress.bytesTotal,0);const o=r/t.length;r+=o*n.length;let i=0;t.forEach(e=>{i+=e.progress.bytesUploaded}),n.forEach(e=>{i+=o*(e.progress.percentage||0)/100});let a=0===r?0:Math.round(i/r*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`)}const n=new e(this,t),r=n.id;if(!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(r);if(o){const e=`Already found a plugin named '${o.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in i(this,y)[y]?i(this,y)[y][n.type].push(n):i(this,y)[y][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(i(this,y)[y])){const n=t.find(t=>t.id===e);if(null!=n)return n}}[r](e){return i(this,y)[y][e]}iteratePlugins(e){Object.values(i(this,y)[y]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=i(this,y)[y][e.type],n=t.findIndex(t=>t.id===e.id);-1!==n&&t.splice(n,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),i(this,E)[E](),this.iteratePlugins(e=>{this.removePlugin(e)}),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",i(this,P)[P]),window.removeEventListener("offline",i(this,P)[P]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?i(this,M)[M](e):(i(this,L)[L](e),Promise.reject(new Error("Nonexistent upload")))}[o](){return i(this,_)[_](...arguments)}addResultData(e,t){if(!i(this,R)[R](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),r={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:r}})}upload(){var e;null!=(e=i(this,y)[y].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const r=this.opts.onBeforeUpload(t);return!1===r?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&"object"==typeof r&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>i(this,b)[b].validateMinNumberOfFiles(t)).catch(e=>{throw i(this,N)[N](e),e}).then(()=>{if(!i(this,O)[O](t))throw new n.RestrictionError(this.i18n("missingRequiredMetaField"))}).catch(e=>{throw e}).then(()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap(e=>e.fileIDs),r=[];Object.keys(t).forEach(e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||r.push(t.id)});const o=i(this,_)[_](r);return i(this,M)[M](o)}).catch(e=>{throw this.emit("error",e),this.log(e,"error"),e}))}}function H(e,t){const{message:n,details:r=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:r},"error",this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),"error")}function z(e){const{missingFields:t,error:n}=i(this,b)[b].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),!1)}function $(e){let t=!0;for(const n of Object.values(e))i(this,B)[B](n)||(t=!1);return t}function U(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new n.RestrictionError(this.i18n("noMoreFilesAllowed"));throw i(this,N)[N](t,e),t}}function V(e,t){const r=f(t),o=v(r,t),a=p(o).extension,s=Boolean(t.isRemote),u=h({...t,type:r});if(this.checkIfFileAlreadyExists(u)){const e=new n.RestrictionError(this.i18n("noDuplicates",{fileName:o}));throw i(this,N)[N](e,t),e}const l=t.meta||{};l.name=o,l.type=r;const c=Number.isFinite(t.data.size)?t.data.size:null;let d={source:t.source||"",id:u,name:o,extension:a||"",meta:{...this.getState().meta,...l},type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:c,uploadComplete:!1,uploadStarted:null},size:c,isRemote:s,remote:t.remote||"",preview:t.preview};const g=this.opts.onBeforeFileAdded(d,e);if(!1===g){const e=new n.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof g&&null!==g&&(d=g);try{const t=Object.keys(e).map(t=>e[t]);i(this,b)[b].validate(d,t)}catch(e){throw i(this,N)[N](e,d),e}return d}function W(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function G(){const e=(e,t,n)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on("error",e),this.on("upload-error",(t,n,r)=>{if(e(n,t,r),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),i(this,N)[N](e)}else i(this,N)[N](n)}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-started",e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:i(this,x)[x].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("preprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on("postprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("postprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",e=>{e&&i(this,B)[B](e)}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",i(this,P)[P]),window.addEventListener("offline",i(this,P)[P]),setTimeout(i(this,P)[P],3e3))}function ie(t,n){void 0===n&&(n={});const{forceAllowNewUpload:r=!1}=n,{allowNewUpload:o,currentUploads:i}=this.getState();if(!o&&!r)throw new Error("Cannot create a new upload: already uploading.");const a=(0,e.nanoid)();return this.emit("upload",{id:a,fileIDs:t}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...i,[a]:{fileIDs:t,step:0,result:{}}}}),a}function ae(e){const{currentUploads:t}=this.getState();return t[e]}function se(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function le(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,o=[...i(this,C)[C],...i(this,D)[D],...i(this,x)[x]];try{for(let i=r;i<o.length&&n;i++){const r=o[i],a={...n,step:i};this.setState({currentUploads:{...t,[e]:a}}),await r(a.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw i(this,L)[L](e),t}if(n){n.fileIDs.forEach(e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)});const r=n.fileIDs.map(e=>this.getFile(e)),o=r.filter(e=>!e.error),i=r.filter(e=>e.error);await this.addResultData(e,{successful:o,failed:i,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let a;return n&&(a=n.result,this.emit("complete",a),i(this,L)[L](e)),null==a&&this.log(`Not setting result for an upload that has been removed: ${e}`),a}return j.VERSION="2.3.4",re=j}var me,ye,be,Ee,we,Ce,De,Ae,Se,xe,Ne,Be,Oe,Te={},ke=[],Fe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ie=Array.isArray;function Pe(e,t){for(var n in t)e[n]=t[n];return e}function _e(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Re(e,t,n){var r,o,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?me.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return Le(e,a,r,o,null)}function Le(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++be:o,__i:-1,__u:0};return null==o&&null!=ye.vnode&&ye.vnode(i),i}function Me(e){return e.children}function je(e,t){this.props=e,this.context=t}function He(e,t){if(null==t)return e.__?He(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?He(e):null}function ze(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return ze(e)}}function $e(e){(!e.__d&&(e.__d=!0)&&we.push(e)&&!Ue.__r++||Ce!=ye.debounceRendering)&&((Ce=ye.debounceRendering)||De)(Ue)}function Ue(){for(var e,t,n,r,o,i,a,s=1;we.length;)we.length>s&&we.sort(Ae),e=we.shift(),s=we.length,e.__d&&(n=void 0,r=void 0,o=(r=(t=e).__v).__e,i=[],a=[],t.__P&&((n=Pe({},r)).__v=r.__v+1,ye.vnode&&ye.vnode(n),Ze(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,i,null==o?He(r):o,!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,Qe(i,n,a),r.__e=r.__=null,n.__e!=o&&ze(n)));Ue.__r=0}function Ve(e,t,n,r,o,i,a,s,u,l,c){var d,f,p,h,g,v,m,y=r&&r.__k||ke,b=t.length;for(u=We(n,t,y,u,b),d=0;d<b;d++)null!=(p=n.__k[d])&&(f=-1==p.__i?Te:y[p.__i]||Te,p.__i=d,v=Ze(e,p,f,o,i,a,s,u,l,c),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&nt(f.ref,null,p),c.push(p.ref,p.__c||h,p)),null==g&&null!=h&&(g=h),(m=!!(4&p.__u))||f.__k===p.__k?u=Ge(p,u,e,m):"function"==typeof p.type&&void 0!==v?u=v:h&&(u=h.nextSibling),p.__u&=-7);return n.__e=g,u}function We(e,t,n,r,o){var i,a,s,u,l,c=n.length,d=c,f=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(a=t[i])&&"boolean"!=typeof a&&"function"!=typeof a?(u=i+f,(a=e.__k[i]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?Le(null,a,null,null,null):Ie(a)?Le(Me,{children:a},null,null,null):null==a.constructor&&a.__b>0?Le(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,-1!=(l=a.__i=qe(a,n,u,d))&&(d--,(s=n[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(o>c?f--:o<c&&f++),"function"!=typeof a.type&&(a.__u|=4)):l!=u&&(l==u-1?f--:l==u+1?f++:(l>u?f--:f++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==r&&(r=He(s)),rt(s,s));return r}function Ge(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=Ge(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=He(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function qe(e,t,n,r){var o,i,a,s=e.key,u=e.type,l=t[n],c=null!=l&&!(2&l.__u);if(null===l&&null==e.key||c&&s==l.key&&u==l.type)return n;if(r>(c?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(l=t[a=o>=0?o--:i++])&&!(2&l.__u)&&s==l.key&&u==l.type)return a;return-1}function Ke(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Fe.test(t)?n:n+"px"}function Ye(e,t,n,r,o){var i,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ke(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||Ke(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(Se,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=xe,e.addEventListener(t,i?Be:Ne,i)):e.removeEventListener(t,i?Be:Ne,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function Xe(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=xe++;else if(t.t<n.u)return;return n(ye.event?ye.event(t):t)}}}function Ze(e,t,n,r,o,i,a,s,u,l){var c,d,f,p,h,g,v,m,y,b,E,w,C,D,A,S,x,N=t.type;if(null!=t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=t.__e=n.__e]),(c=ye.__b)&&c(t);e:if("function"==typeof N)try{if(m=t.props,y="prototype"in N&&N.prototype.render,b=(c=N.contextType)&&r[c.__c],E=c?b?b.props.value:c.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:(y?t.__c=d=new N(m,E):(t.__c=d=new je(m,E),d.constructor=N,d.render=ot),b&&b.sub(d),d.props=m,d.state||(d.state={}),d.context=E,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),y&&null==d.__s&&(d.__s=d.state),y&&null!=N.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Pe({},d.__s)),Pe(d.__s,N.getDerivedStateFromProps(m,d.__s))),p=d.props,h=d.state,d.__v=t,f)y&&null==N.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),y&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(y&&null==N.getDerivedStateFromProps&&m!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,E),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,E)||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,E),y&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,h,g)})}if(d.context=E,d.props=m,d.__P=e,d.__e=!1,C=ye.__r,D=0,y){for(d.state=d.__s,d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),A=0;A<d._sb.length;A++)d.__h.push(d._sb[A]);d._sb=[]}else do{d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++D<25);d.state=d.__s,null!=d.getChildContext&&(r=Pe(Pe({},r),d.getChildContext())),y&&!f&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,h)),S=c,null!=c&&c.type===Me&&null==c.key&&(S=et(c.props.children)),s=Ve(e,Ie(S)?S:[S],t,n,r,o,i,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),v&&(d.__E=d.__=null)}catch(e){if(t.__v=null,u||null!=i)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else{for(x=i.length;x--;)_e(i[x]);Je(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Je(t);ye.__e(e,t,n)}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=tt(n.__e,t,n,r,o,i,a,u,l);return(c=ye.diffed)&&c(t),128&t.__u?void 0:s}function Je(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Je)}function Qe(e,t,n){for(var r=0;r<n.length;r++)nt(n[r],n[++r],n[++r]);ye.__c&&ye.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){ye.__e(e,t.__v)}})}function et(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:Ie(e)?e.map(et):Pe({},e)}function tt(e,t,n,r,o,i,a,s,u){var l,c,d,f,p,h,g,v=n.props,m=t.props,y=t.type;if("svg"==y?o="http://www.w3.org/2000/svg":"math"==y?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(l=0;l<i.length;l++)if((p=i[l])&&"setAttribute"in p==!!y&&(y?p.localName==y:3==p.nodeType)){e=p,i[l]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(o,y,m.is&&m),s&&(ye.__m&&ye.__m(t,i),s=!1),i=null}if(null==y)v===m||s&&e.data==m||(e.data=m);else{if(i=i&&me.call(e.childNodes),v=n.props||Te,!s&&null!=i)for(v={},l=0;l<e.attributes.length;l++)v[(p=e.attributes[l]).name]=p.value;for(l in v)if(p=v[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=p;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;Ye(e,l,null,p,o)}for(l in m)p=m[l],"children"==l?f=p:"dangerouslySetInnerHTML"==l?c=p:"value"==l?h=p:"checked"==l?g=p:s&&"function"!=typeof p||v[l]===p||Ye(e,l,p,v[l],o);if(c)s||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Ve("template"==t.type?e.content:e,Ie(f)?f:[f],t,n,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&He(n,0),s,u),null!=i)for(l=i.length;l--;)_e(i[l]);s||(l="value","progress"==y&&null==h?e.removeAttribute("value"):null!=h&&(h!==e[l]||"progress"==y&&!h||"option"==y&&h!=v[l])&&Ye(e,l,h,v[l],o),l="checked",null!=g&&g!=e[l]&&Ye(e,l,g,v[l],o))}return e}function nt(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){ye.__e(e,n)}}function rt(e,t,n){var r,o;if(ye.unmount&&ye.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||nt(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){ye.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&rt(r[o],t,n||"function"!=typeof e.type);n||_e(e.__e),e.__c=e.__=e.__e=void 0}function ot(e,t,n){return this.constructor(e,n)}function it(e,t,n){var r,o,i,a;t==document&&(t=document.documentElement),ye.__&&ye.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],a=[],Ze(t,e=(!r&&n||t).__k=Re(Me,null,[e]),o||Te,Te,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?me.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),Qe(i,e,a)}me=ke.slice,ye={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},be=0,Ee=function(e){return null!=e&&null==e.constructor},je.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Pe({},this.state),"function"==typeof e&&(e=e(Pe({},n),this.props)),e&&Pe(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),$e(this))},je.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$e(this))},je.prototype.render=Me,we=[],De="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ae=function(e,t){return e.__v.__b-t.__v.__b},Ue.__r=0,Se=/(PointerCapture)$|Capture$/i,xe=0,Ne=Xe(!1),Be=Xe(!0),Oe=0;var at,st,ut,lt,ct,dt,ft,pt,ht,gt,vt,mt=Object.freeze({__proto__:null,Component:je,Fragment:Me,cloneElement:function(e,t,n){var r,o,i,a,s=Pe({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=void 0===t[i]&&null!=a?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?me.call(arguments,2):n),Le(e.type,s,r||e.key,o||e.ref,null)},createContext:function(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,$e(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Oe++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createElement:Re,createRef:function(){return{current:null}},h:Re,hydrate:function e(t,n){it(t,n,e)},get isValidElement(){return Ee},get options(){return ye},render:it,toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Ie(t)?t.some(function(t){e(t,n)}):n.push(t)),n}}),yt=v(mt);function bt(){if(lt)return ut;lt=1;const e=st?at:(st=1,at=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE});return ut=function(t,n){return void 0===n&&(n=document),"string"==typeof t?n.querySelector(t):e(t)?t:null}}function Et(){if(pt)return ft;pt=1;const e=ce();return ft=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const t=new e([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}}}function wt(){if(gt)return ht;gt=1;var e=yt;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var n=0;function r(e){return"__private_"+n+++"_"+e}const o=bt(),i=dt?ct:(dt=1,ct=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir}),a=Et();var s=r("updateUI");class u extends a{constructor(){super(...arguments),Object.defineProperty(this,s,{writable:!0,value:void 0})}mount(n,r){const a=r.id,l=o(n);if(l){this.isTargetDOMEl=!0;const r=document.createElement("div");return r.classList.add("uppy-Root"),t(this,s)[s]=function(e){let t=null,n=null;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=o,t||(t=Promise.resolve().then(()=>(t=null,e(...n)))),t}}(t=>{this.uppy.getPlugin(this.id)&&((0,e.render)(this.render(t),r),this.afterUpdate())}),this.uppy.log(`Installing ${a} to a DOM element '${n}'`),this.opts.replaceTargetContent&&(l.innerHTML=""),(0,e.render)(this.render(this.uppy.getState()),r),this.el=r,l.appendChild(r),r.dir=this.opts.direction||i(r)||"ltr",this.onMount(),this.el}let c;if("object"==typeof n&&n instanceof u)c=n;else if("function"==typeof n){const e=n;this.uppy.iteratePlugins(t=>{t instanceof e&&(c=t)})}if(c)return this.uppy.log(`Installing ${a} to ${c.id}`),this.parent=c,this.el=c.addTarget(r),this.onMount(),this.el;this.uppy.log(`Not installing ${a}`);let d=`Invalid target option given to ${a}.`;throw d+="function"==typeof n?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(d)}update(e){var n,r;null!=this.el&&(null==(n=(r=t(this,s))[s])||n.call(r,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}return ht=u}var Ct,Dt,At,St,xt,Nt,Bt,Ot,Tt,kt,Ft=(vt||(vt=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Uppy=t.UIPlugin=t.BasePlugin=void 0,Object.defineProperty(t,"debugLogger",{enumerable:!0,get:function(){return n.debugLogger}});var n=A();e.exports=ve();const r=wt();t.UIPlugin=r;const o=Et();t.BasePlugin=o;const i=ve();t.Uppy=i;const a=wt(),s=Et();i.Uppy=i,i.UIPlugin=a,i.BasePlugin=s,i.debugLogger=n.debugLogger}(C,C.exports)),C.exports),It=g(Ft),Pt={};function _t(){if(Dt)return Ct;Dt=1;class e extends Error{constructor(e,t){void 0===t&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}return Ct=e}function Rt(){if(kt)return Tt;let e;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}kt=1;var n=0;function r(e){return"__private_"+n+++"_"+e}const o=function(){if(St)return At;St=1;const e=_t();return At=function(){return fetch(...arguments).catch(t=>{throw"AbortError"===t.name?t:new e(t)})},At}(),i=function(){if(Nt)return xt;Nt=1;const e=le();class t extends Error{constructor(t,n){void 0===n&&(n={}),super(t),this.cause=n.cause,this.cause&&e(this.cause,"isNetworkError")&&(this.isNetworkError=this.cause.isNetworkError)}}return xt=t}(),a=function(){if(Ot)return Bt;Ot=1;class e extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}return Bt=e}();async function s(e){if(401===e.status)throw new a;const t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{const e=await t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw new Error(n)}}return t}var u=r("companionHeaders"),l=r("getPostResponseFunc"),c=r("getUrl"),d=r("errorHandler");e=Symbol.for("uppy test: getCompanionHeaders");class f{constructor(e,n){Object.defineProperty(this,d,{value:h}),Object.defineProperty(this,c,{value:p}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=n,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1,t(this,u)[u]=null==n?void 0:n.companionHeaders}setCompanionHeaders(e){t(this,u)[u]=e}[e](){return t(this,u)[u]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}headers(){return Promise.resolve({...f.defaultHeaders,...t(this,u)[u]})}onReceiveResponse(e){const t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:r}=e;return r.has("i-am")&&r.get("i-am")!==t[n]&&this.uppy.setState({companion:{...t,[n]:r.get("i-am")}}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(t(this,c)[c](e),{method:"OPTIONS"}).then(e=>(e.headers.has("access-control-allow-headers")&&(this.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map(e=>e.trim().toLowerCase())),this.preflightDone=!0,this.allowedHeaders.slice())).catch(e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,"warning"),this.preflightDone=!0,this.allowedHeaders.slice()))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then(e=>{let[t,n]=e;return Object.keys(n).forEach(e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])}),n})}get(e,n){return this.preflightAndHeaders(e).then(n=>o(t(this,c)[c](e),{method:"get",headers:n,credentials:this.opts.companionCookiesRule||"same-origin"})).then(t(this,l)[l](n)).then(s).catch(t(this,d)[d]("get",e))}post(e,n,r){const i="post";return this.preflightAndHeaders(e).then(r=>o(t(this,c)[c](e),{method:i,headers:r,credentials:this.opts.companionCookiesRule||"same-origin",body:JSON.stringify(n)})).then(t(this,l)[l](r)).then(s).catch(t(this,d)[d](i,e))}delete(e,n,r){const i="delete";return this.preflightAndHeaders(e).then(t=>o(`${this.hostname}/${e}`,{method:i,headers:t,credentials:this.opts.companionCookiesRule||"same-origin",body:n?JSON.stringify(n):null})).then(t(this,l)[l](r)).then(s).catch(t(this,d)[d](i,e))}}function p(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function h(e,n){return r=>{var o;return null!=(o=r)&&o.isAuthError||(r=new i(`Could not ${e} ${t(this,c)[c](n)}`,{cause:r})),Promise.reject(r)}}return f.VERSION="2.2.2",f.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Uppy-Versions":`@uppy/companion-client=${f.VERSION}`},Tt=f}var Lt,Mt,jt,Ht,zt,$t,Ut,Vt,Wt={};function Gt(){if(Lt)return Wt;return Lt=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},Wt.removeItem=function(e){return new Promise(t=>{localStorage.removeItem(e),t()})},Wt.setItem=function(e,t){return new Promise(n=>{localStorage.setItem(e,t),n()})},Wt}function qt(){if(Vt)return Pt;Vt=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.Socket=Pt.SearchProvider=Pt.RequestClient=Pt.Provider=void 0;const e=Rt();Pt.RequestClient=e;const t=function(){if(jt)return Mt;jt=1;var e=Gt();const t=Rt();return Mt=class extends t{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then(e=>{let[t,n]=e;const r={};return n&&(r["uppy-auth-token"]=n),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...r}})}onReceiveResponse(e){e=super.onReceiveResponse(e);const t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authUrl(e){void 0===e&&(e={});const t=new URLSearchParams(e);return this.preAuthToken&&t.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async fetchPreAuthToken(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e){return this.get(`${this.id}/list/${e||""}`)}logout(){return this.get(`${this.id}/logout`).then(e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)])).then(e=>{let[t]=e;return t})}static initPlugin(t,n,r){if(t.type="acquirer",t.files=[],r&&(t.opts={...r,...n}),n.serverUrl||n.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(n.companionAllowedHosts){const e=n.companionAllowedHosts;if(!("string"==typeof e||Array.isArray(e)||e instanceof RegExp))throw new TypeError(`${t.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);t.opts.companionAllowedHosts=e}else/^(?!https?:\/\/).*$/i.test(n.companionUrl)?t.opts.companionAllowedHosts=`https://${n.companionUrl.replace(/^\/\//,"")}`:t.opts.companionAllowedHosts=new URL(n.companionUrl).origin;t.storage=t.opts.storage||e}},Mt}();Pt.Provider=t;const n=function(){if(zt)return Ht;zt=1;const e=Rt();return Ht=class extends e{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}},Ht}();Pt.SearchProvider=n;const r=function(){if(Ut)return $t;let e,t;function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Ut=1;var r=0;function o(e){return"__private_"+r+++"_"+e}const i=de();var a=o("queued"),s=o("emitter"),u=o("isOpen"),l=o("socket"),c=o("handleMessage");return e=Symbol.for("uppy test: getSocket"),t=Symbol.for("uppy test: getQueued"),$t=class{constructor(e){Object.defineProperty(this,a,{writable:!0,value:[]}),Object.defineProperty(this,s,{writable:!0,value:i()}),Object.defineProperty(this,u,{writable:!0,value:!1}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:e=>{try{const t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,e&&!1===e.autoOpen||this.open()}get isOpen(){return n(this,u)[u]}[e](){return n(this,l)[l]}[t](){return n(this,a)[a]}open(){n(this,l)[l]=new WebSocket(this.opts.target),n(this,l)[l].onopen=()=>{for(n(this,u)[u]=!0;n(this,a)[a].length>0&&n(this,u)[u];){const e=n(this,a)[a].shift();this.send(e.action,e.payload)}},n(this,l)[l].onclose=()=>{n(this,u)[u]=!1},n(this,l)[l].onmessage=n(this,c)[c]}close(){var e;null==(e=n(this,l)[l])||e.close()}send(e,t){n(this,u)[u]?n(this,l)[l].send(JSON.stringify({action:e,payload:t})):n(this,a)[a].push({action:e,payload:t})}on(e,t){n(this,s)[s].on(e,t)}emit(e,t){n(this,s)[s].emit(e,t)}once(e,t){n(this,s)[s].once(e,t)}},$t}();return Pt.Socket=r,Pt}var Kt,Yt,Xt,Zt,Jt,Qt,en,tn,nn,rn,on,an,sn,un,ln,cn,dn,fn={};function pn(){if(Kt)return fn;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Kt=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.internalRateLimitedQueue=fn.RateLimitedQueue=void 0;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("activeRequests"),o=n("queuedHandlers"),i=n("paused"),a=n("pauseTimer"),s=n("downLimit"),u=n("upperLimit"),l=n("rateLimitingTimer"),c=n("call"),d=n("queueNext"),f=n("next"),p=n("queue"),h=n("dequeue"),g=n("resume"),v=n("increaseLimit");function m(t){e(this,r)[r]+=1;let n,o=!1;try{n=t()}catch(t){throw e(this,r)[r]-=1,t}return{abort:()=>{o||(o=!0,e(this,r)[r]-=1,n(),e(this,d)[d]())},done:()=>{o||(o=!0,e(this,r)[r]-=1,e(this,d)[d]())}}}function y(){queueMicrotask(()=>e(this,f)[f]())}function b(){if(e(this,i)[i]||e(this,r)[r]>=this.limit)return;if(0===e(this,o)[o].length)return;const t=e(this,o)[o].shift(),n=e(this,c)[c](t.fn);t.abort=n.abort,t.done=n.done}function E(t,n){void 0===n&&(n={});const r={fn:t,priority:n.priority||0,abort:()=>{e(this,h)[h](r)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=e(this,o)[o].findIndex(e=>r.priority>e.priority);return-1===i?e(this,o)[o].push(r):e(this,o)[o].splice(i,0,r),r}function w(t){const n=e(this,o)[o].indexOf(t);-1!==n&&e(this,o)[o].splice(n,1)}fn.RateLimitedQueue=class{constructor(t){Object.defineProperty(this,h,{value:w}),Object.defineProperty(this,p,{value:E}),Object.defineProperty(this,f,{value:b}),Object.defineProperty(this,d,{value:y}),Object.defineProperty(this,c,{value:m}),Object.defineProperty(this,r,{writable:!0,value:0}),Object.defineProperty(this,o,{writable:!0,value:[]}),Object.defineProperty(this,i,{writable:!0,value:!1}),Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,s,{writable:!0,value:1}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,g,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,v,{writable:!0,value:()=>{if(e(this,i)[i])e(this,l)[l]=setTimeout(e(this,v)[v],0);else{e(this,s)[s]=this.limit,this.limit=Math.ceil((e(this,u)[u]+e(this,s)[s])/2);for(let t=e(this,s)[s];t<=this.limit;t++)e(this,d)[d]();e(this,u)[u]-e(this,s)[s]>3?e(this,l)[l]=setTimeout(e(this,v)[v],2e3):e(this,s)[s]=Math.floor(e(this,s)[s]/2)}}}),this.limit="number"!=typeof t||0===t?1/0:t}run(t,n){return!e(this,i)[i]&&e(this,r)[r]<this.limit?e(this,c)[c](t):e(this,p)[p](t,n)}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];let a;const s=new Promise((r,i)=>{a=n.run(()=>{let t,n;try{n=Promise.resolve(e(...o))}catch(e){n=Promise.reject(e)}return n.then(e=>{t?i(t):(a.done(),r(e))},e=>{t?i(t):(a.done(),i(e))}),()=>{t=new Error("Cancelled")}},t)});return s.abort=()=>{a.abort()},s}}resume(){e(this,i)[i]=!1,clearTimeout(e(this,a)[a]);for(let t=0;t<this.limit;t++)e(this,d)[d]()}pause(t){void 0===t&&(t=null),e(this,i)[i]=!0,clearTimeout(e(this,a)[a]),null!=t&&(e(this,a)[a]=setTimeout(e(this,g)[g],t))}rateLimit(t){clearTimeout(e(this,l)[l]),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(e(this,u)[u]=this.limit-1,this.limit=e(this,s)[s],e(this,l)[l]=setTimeout(e(this,v)[v],t))}get isPaused(){return e(this,i)[i]}};const C=Symbol("__queue");return fn.internalRateLimitedQueue=C,fn}function hn(){return ln?un:(ln=1,un={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}})}var gn,vn,mn=function(){if(dn)return cn;dn=1;var e=S(),t=qt(),n=pn();const r=Et(),o=function(){if(Xt)return Yt;Xt=1;const e=fe();return Yt=e(function(e,t,n){const{progress:r,bytesUploaded:o,bytesTotal:i}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",n,{uploader:e,bytesUploaded:o,bytesTotal:i}))},300,{leading:!0,trailing:!0})}(),i=Jt?Zt:(Jt=1,Zt=function(e){const t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return`${/^http:\/\//i.test(e)?"ws":"wss"}://${t}`}),a=en?Qt:(en=1,Qt=function(e){const t=[],n=[];function r(e){t.push(e)}function o(e){n.push(e)}return Promise.all(e.map(e=>e.then(r,o))).then(()=>({successful:t,failed:n}))}),s=function(){if(nn)return tn;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}nn=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("emitter"),o=n("events");return tn=class{constructor(t){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:[]}),e(this,r)[r]=t}on(t,n){return e(this,o)[o].push([t,n]),e(this,r)[r].on(t,n)}remove(){for(const[t,n]of e(this,o)[o].splice(0))e(this,r)[r].off(t,n)}}}(),u=function(){if(on)return rn;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}on=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("aliveTimer"),o=n("isDone"),i=n("onTimedOut"),a=n("timeout");return rn=class{constructor(t,n){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:!1}),Object.defineProperty(this,i,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),e(this,a)[a]=t,e(this,i)[i]=n}progress(){e(this,o)[o]||e(this,a)[a]>0&&(clearTimeout(e(this,r)[r]),e(this,r)[r]=setTimeout(e(this,i)[i],e(this,a)[a]))}done(){e(this,o)[o]||(clearTimeout(e(this,r)[r]),e(this,r)[r]=null,e(this,o)[o]=!0)}}}(),l=_t(),c=sn?an:(sn=1,an=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)}),d=hn();function f(e,t){let n=t;return n||(n=new Error("Upload error")),"string"==typeof n&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),c(e)?(n=new l(n,e),n):(n.request=e,n)}function p(e){return e.data.slice(0,e.data.size,e.meta.type)}class h extends r{constructor(e,t){super(e,t),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.title="XHRUpload",this.defaultLocale=d;const r={formData:!0,fieldName:t.bundle?"files[]":"file",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:"",getResponseData(t){let n={};try{n=JSON.parse(t)}catch(t){e.log(t)}return n},getResponseError(e,t){let n=new Error("Upload error");return c(t)&&(n=new l(n,t)),n},validateStatus:e=>e>=200&&e<300};if(this.opts={...r,...t},this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),n.internalRateLimitedQueue in this.opts?this.requests=this.opts[n.internalRateLimitedQueue]:this.requests=new n.RateLimitedQueue(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:n}=this.opts,r={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof n?r.headers=n(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach(n=>{e.append(n,t[n])})}createFormDataUpload(e,t){const n=new FormData;this.addMetadata(n,e.meta,t);const r=p(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n}createBundledUpload(e,t){const n=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(n,r,t),e.forEach(e=>{const t=this.getOptions(e),r=p(e);e.name?n.append(t.fieldName,r,e.name):n.append(t.fieldName,r)}),n}upload(t,n,r){const o=this.getOptions(t);return this.uppy.log(`uploading ${n} of ${r}`),new Promise((n,r)=>{this.uppy.emit("upload-started",t);const i=o.formData?this.createFormDataUpload(t,o):t.data,a=new XMLHttpRequest;let l;this.uploaderEvents[t.id]=new s(this.uppy);const c=new u(o.timeout,()=>{a.abort(),l.done();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(o.timeout/1e3)}));this.uppy.emit("upload-error",t,e),r(e)}),d=(0,e.nanoid)();a.upload.addEventListener("loadstart",()=>{this.uppy.log(`[XHRUpload] ${d} started`)}),a.upload.addEventListener("progress",e=>{this.uppy.log(`[XHRUpload] ${d} progress: ${e.loaded} / ${e.total}`),c.progress(),e.lengthComputable&&this.uppy.emit("upload-progress",t,{uploader:this,bytesUploaded:e.loaded,bytesTotal:e.total})}),a.addEventListener("load",()=>{if(this.uppy.log(`[XHRUpload] ${d} finished`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null),o.validateStatus(a.status,a.responseText,a)){const e=o.getResponseData(a.responseText,a),r=e[o.responseUrlFieldName],i={status:a.status,body:e,uploadURL:r};return this.uppy.emit("upload-success",t,i),r&&this.uppy.log(`Download ${t.name} from ${r}`),n(t)}const e=o.getResponseData(a.responseText,a),i=f(a,o.getResponseError(a.responseText,a)),s={status:a.status,body:e};return this.uppy.emit("upload-error",t,i,s),r(i)}),a.addEventListener("error",()=>{this.uppy.log(`[XHRUpload] ${d} errored`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null);const e=f(a,o.getResponseError(a.responseText,a));return this.uppy.emit("upload-error",t,e),r(e)}),a.open(o.method.toUpperCase(),o.endpoint,!0),a.withCredentials=o.withCredentials,""!==o.responseType&&(a.responseType=o.responseType),l=this.requests.run(()=>{this.uppy.emit("upload-started",t);const e=this.getOptions(t);return Object.keys(e.headers).forEach(t=>{a.setRequestHeader(t,e.headers[t])}),a.send(i),()=>{c.done(),a.abort()}}),this.onFileRemove(t.id,()=>{l.abort(),r(new Error("File removed"))}),this.onCancelAll(t.id,e=>{let{reason:t}=e;"user"===t&&l.abort(),r(new Error("Upload cancelled"))})})}uploadRemote(e){const n=this.getOptions(e);return new Promise((r,a)=>{this.uppy.emit("upload-started",e);const u={};(Array.isArray(n.metaFields)?n.metaFields:Object.keys(e.meta)).forEach(t=>{u[t]=e.meta[t]});new(e.remote.providerOptions.provider?t.Provider:t.RequestClient)(this.uppy,e.remote.providerOptions).post(e.remote.url,{...e.remote.body,endpoint:n.endpoint,size:e.data.size,fieldname:n.fieldName,metadata:u,httpMethod:n.method,useFormData:n.formData,headers:n.headers}).then(u=>{const{token:l}=u,c=i(e.remote.companionUrl),d=new t.Socket({target:`${c}/api/${l}`,autoOpen:!1});let f;this.uploaderEvents[e.id]=new s(this.uppy),this.onFileRemove(e.id,()=>{d.send("cancel",{}),f.abort(),r(`upload ${e.id} was removed`)}),this.onCancelAll(e.id,function(t){let{reason:n}=void 0===t?{}:t;"user"===n&&(d.send("cancel",{}),f.abort()),r(`upload ${e.id} was canceled`)}),this.onRetry(e.id,()=>{d.send("pause",{}),d.send("resume",{})}),this.onRetryAll(e.id,()=>{d.send("pause",{}),d.send("resume",{})}),d.on("progress",t=>o(this,t,e)),d.on("success",t=>{const o=n.getResponseData(t.response.responseText,t.response),i=o[n.responseUrlFieldName],a={status:t.response.status,body:o,uploadURL:i};return this.uppy.emit("upload-success",e,a),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r()}),d.on("error",t=>{const r=t.response,o=r?n.getResponseError(r.responseText,r):Object.assign(new Error(t.error.message),{cause:t.error});this.uppy.emit("upload-error",e,o),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),a(o)}),f=this.requests.run(()=>(d.open(),e.isPaused&&d.send("pause",{}),()=>d.close()))}).catch(t=>{this.uppy.emit("upload-error",e,t),a(t)})})}uploadBundle(e){return new Promise((t,n)=>{const{endpoint:r}=this.opts,{method:o}=this.opts,i=this.uppy.getState().xhrUpload,a=this.createBundledUpload(e,{...this.opts,...i||{}}),s=new XMLHttpRequest,l=t=>{e.forEach(e=>{this.uppy.emit("upload-error",e,t)})},c=new u(this.opts.timeout,()=>{s.abort();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(this.opts.timeout/1e3)}));l(e),n(e)});s.upload.addEventListener("loadstart",()=>{this.uppy.log("[XHRUpload] started uploading bundle"),c.progress()}),s.upload.addEventListener("progress",t=>{c.progress(),t.lengthComputable&&e.forEach(e=>{this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})})}),s.addEventListener("load",r=>{if(c.done(),this.opts.validateStatus(r.target.status,s.responseText,s)){const n=this.opts.getResponseData(s.responseText,s),o={status:r.target.status,body:n};return e.forEach(e=>{this.uppy.emit("upload-success",e,o)}),t()}const o=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return o.request=s,l(o),n(o)}),s.addEventListener("error",()=>{c.done();const e=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return l(e),n(e)}),this.uppy.on("cancel-all",function(e){let{reason:t}=void 0===e?{}:e;"user"===t&&(c.done(),s.abort())}),s.open(o.toUpperCase(),r,!0),s.withCredentials=this.opts.withCredentials,""!==this.opts.responseType&&(s.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach(e=>{s.setRequestHeader(e,this.opts.headers[e])}),s.send(a),e.forEach(e=>{this.uppy.emit("upload-started",e)})})}uploadFiles(e){const t=e.map((t,n)=>{const r=parseInt(n,10)+1,o=e.length;return t.error?Promise.reject(new Error(t.error)):t.isRemote?this.uploadRemote(t,r,o):this.upload(t,r,o)});return a(t)}onFileRemove(e,t){this.uploaderEvents[e].on("file-removed",n=>{e===n.id&&t(n.id)})}onRetry(e,t){this.uploaderEvents[e].on("upload-retry",n=>{e===n&&t()})}onRetryAll(e,t){this.uploaderEvents[e].on("retry-all",()=>{this.uppy.getFile(e)&&t()})}onCancelAll(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",function(){n.uppy.getFile(e)&&t(...arguments)})}handleUpload(e){if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts[n.internalRateLimitedQueue]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=e.map(e=>this.uppy.getFile(e));if(this.opts.bundle){if(t.some(e=>e.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then(()=>null)}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.handleUpload)}}return h.VERSION="2.1.3",cn=h}(),yn=g(mn);var bn=function(){if(vn)return gn;vn=1;var e=9007199254740991,t="[object Arguments]",n="[object Function]",r="[object GeneratorFunction]",o=/^(?:0|[1-9]\d*)$/;function i(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););return e}var a,s,u=Object.prototype,l=u.hasOwnProperty,c=u.toString,d=u.propertyIsEnumerable,f=(a=Object.keys,s=Object,function(e){return a(s(e))});function p(e,n){var r=b(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&E(e)}(e)&&l.call(e,"callee")&&(!d.call(e,"callee")||c.call(e)==t)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=r.length,i=!!o;for(var a in e)!l.call(e,a)||i&&("length"==a||y(a,o))||r.push(a);return r}var h,g=(h=function(e,t){return e&&v(e,t,w)},function(e,t){if(null==e)return e;if(!E(e))return h(e,t);for(var n=e.length,r=-1,o=Object(e);++r<n&&!1!==t(o[r],r,o););return e}),v=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[++r];if(!1===t(o[s],s,o))break}return e};function m(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||u,t!==r)return f(e);var t,n,r,o=[];for(var i in Object(e))l.call(e,i)&&"constructor"!=i&&o.push(i);return o}function y(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||o.test(t))&&t>-1&&t%1==0&&t<n}var b=Array.isArray;function E(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?c.call(e):"";return t==n||t==r}(t)}function w(e){return E(e)?p(e):m(e)}function C(e){return e}return gn=function(e,t){return(b(e)?i:g)(e,"function"==typeof t?t:C)}}(),En=g(bn);let wn=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};function Cn(e){Promise.resolve().then(e)}function Dn(e){return e.replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&reg;/g,"®").replace(/&copy;/g,"©").replace(/&trade;/g,"™").replace(/&quot;/g,'"')}var An=function(e){return Object.prototype.toString.call(e)};function Sn(e){return e||{name:""}}function xn(e){return Object.keys(e).reduce(function(t,n){return t[n]=String(e[n]),t},{})}function Nn(e){var t=e.server,n=void 0===t?"":t,r=e.fieldName,o=void 0===r?"":r,i=e.maxFileSize,a=void 0===i?10485760:i,u=e.maxNumberOfFiles,l=void 0===u?100:u,f=e.meta,p=void 0===f?{}:f,h=e.metaWithUrl,g=void 0!==h&&h,v=e.headers,m=void 0===v?{}:v,y=e.withCredentials,b=void 0!==y&&y,E=e.timeout,w=void 0===E?1e4:E,C=e.onBeforeUpload,D=void 0===C?function(e){return e}:C,A=e.onSuccess,S=void 0===A?function(e,t){}:A,x=e.onError,N=void 0===x?function(e,t,n){console.error("".concat(e.name," upload error"),t,n)}:x,B=e.onProgress,O=void 0===B?function(e){}:B;if(!n)throw new Error("Cannot get upload server address\n没有配置上传地址");if(!o)throw new Error("Cannot get fieldName\n没有配置 fieldName");var T=n;g&&(T=function(e,t){var n=d(e.split("#"),2),r=n[0],o=n[1],i=r,a=[];En(t,function(e,t){a.push("".concat(t,"=").concat(e))});var s=a.join("&");return i=i.indexOf("?")>0?"".concat(i,"&").concat(s):"".concat(i,"?").concat(s),o?"".concat(i,"#").concat(o):i}(T,p)),function(){if("undefined"!=typeof AbortSignal){var e=AbortSignal;"function"!=typeof e.any&&(e.any=function(e){var t,n,r=new AbortController,o=function(t){e.forEach(function(e){return e.removeEventListener("abort",o)});var n=t.target.reason;r.abort(n)};try{for(var i=c(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.aborted){var u=s.reason;return r.abort(u),r.signal}s.addEventListener("abort",o,{once:!0})}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r.signal})}}();var k=function(e){if(e)return"function"==typeof e?function(t){return xn(e(t))}:xn(e)}(m),F=new It(s({onBeforeUpload:function(e){return D(e)},restrictions:{maxFileSize:a,maxNumberOfFiles:l},meta:p},e.uppyConfig)).use(yn,s({endpoint:T,headers:k,formData:!0,fieldName:o,bundle:!1,withCredentials:b,timeout:w},e.xhrConfig));return F.on("upload-success",function(e,t){var n=(null!=t?t:{}).body,r=void 0===n?{}:n,o=Sn(e);try{S(o,r)}catch(e){console.error("wangEditor upload file - onSuccess error",e)}}),F.on("progress",function(e){e<1||O(e)}),F.on("upload-error",function(e,t,n){var r=Sn(e);try{N(r,t,n)}catch(e){console.error("wangEditor upload file - onError error",e)}}),F.on("restriction-failed",function(e,t){var n=Sn(e);try{N(n,t,void 0)}catch(e){console.error("wangEditor upload file - onError error",e)}}),F}function Bn(e,t){return e.uploadAdapter?e.uploadAdapter({config:e,editor:t}):Nn(e)}var On={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=jn.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},Tn={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Mr.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},kn={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Gn.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},Fn=new WeakMap,In=new WeakMap,Pn=new WeakMap,_n=new WeakMap,Rn=new WeakMap,Ln=new WeakMap,Mn=new WeakMap,jn={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=jn.levels(e,t);return r=n?r.slice(1):r.slice(0,-1)},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r],i=t[r];if("number"!=typeof o||"number"!=typeof i)throw new Error("Got non-numeric path index");if(o!==i)break;n.push(o)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return jn.equals(r,o)&&i>a},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return jn.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return jn.equals(r,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===jn.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===jn.compare(e,t),isBefore:(e,t)=>-1===jn.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===jn.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===jn.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===jn.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===jn.compare(e,t),isPath:e=>Array.isArray(e)&&e.every(e=>"number"==typeof e),isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&jn.equals(n,r)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!jn.isAncestor(t,e)&&!jn.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(0===e.length)return r;switch(t.type){case"insert_node":var{path:i}=t;(jn.equals(i,r)||jn.endsBefore(i,r)||jn.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(jn.equals(a,r)||jn.isAncestor(a,r))return null;jn.endsBefore(a,r)&&(r[a.length-1]-=1);break;case"merge_node":var{path:s,position:u}=t;jn.equals(s,r)||jn.endsBefore(s,r)?r[s.length-1]-=1:jn.isAncestor(s,r)&&(r[s.length-1]-=1,r[s.length]+=u);break;case"split_node":var{path:l,position:c}=t;if(jn.equals(l,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else jn.endsBefore(l,r)?r[l.length-1]+=1:jn.isAncestor(l,r)&&e[l.length]>=c&&(r[l.length-1]+=1,r[l.length]-=c);break;case"move_node":var{path:d,newPath:f}=t;if(jn.equals(d,f))return r;if(jn.isAncestor(d,r)||jn.equals(d,r)){var p=f.slice();return jn.endsBefore(d,f)&&d.length<f.length&&(p[d.length-1]-=1),p.concat(r.slice(d.length))}jn.isSibling(d,f)&&(jn.isAncestor(f,r)||jn.equals(f,r))?jn.endsBefore(d,r)?r[d.length-1]-=1:r[d.length-1]+=1:jn.endsBefore(f,r)||jn.equals(f,r)||jn.isAncestor(f,r)?(jn.endsBefore(d,r)&&(r[d.length-1]-=1),r[f.length-1]+=1):jn.endsBefore(d,r)&&(jn.equals(f,r)&&(r[f.length-1]+=1),r[d.length-1]-=1)}return r}};function Hn(e){return Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hn(e)}function zn(e){var t=function(e,t){if("object"!==Hn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Hn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Hn(t)?t:String(t)}function $n(e,t,n){return(t=zn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Un(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Vn=["anchor","focus"];function Wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var Gn={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return Gn.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=Gn.edges(e);return t},equals:(e,t)=>Mr.equals(e.anchor,t.anchor)&&Mr.equals(e.focus,t.focus),surrounds(e,t){var n=Gn.intersection(e,t);return!!n&&Gn.equals(n,t)},includes(e,t){if(_r.isRange(t)){if(Gn.includes(e,t.anchor)||Gn.includes(e,t.focus))return!0;var[n,r]=Gn.edges(e),[o,i]=Gn.edges(t);return Mr.isBefore(n,o)&&Mr.isAfter(r,i)}var[a,s]=Gn.edges(e),u=!1,l=!1;return _r.isPoint(t)?(u=Mr.compare(t,a)>=0,l=Mr.compare(t,s)<=0):(u=jn.compare(t,a.path)>=0,l=jn.compare(t,s.path)<=0),u&&l},intersection(e,t){var{anchor:n,focus:r}=e,o=Un(e,Vn),[i,a]=Gn.edges(e),[s,u]=Gn.edges(t),l=Mr.isBefore(i,s)?s:i,c=Mr.isBefore(a,u)?a:u;return Mr.isBefore(c,l)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wn(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({anchor:l,focus:c},o)},isBackward(e){var{anchor:t,focus:n}=e;return Mr.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return Mr.equals(t,n)},isExpanded:e=>!Gn.isCollapsed(e),isForward:e=>!Gn.isBackward(e),isRange:e=>or(e)&&Mr.isPoint(e.anchor)&&Mr.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Gn.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var a=Gn.isCollapsed(e);Gn.isForward(e)?(r="forward",o=a?r:"backward"):(r="backward",o=a?r:"forward")}else"outward"===i?Gn.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var s=Mr.transform(e.anchor,t,{affinity:r}),u=Mr.transform(e.focus,t,{affinity:o});return s&&u?{anchor:s,focus:u}:null}},qn=function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!or(e)&&("function"!=typeof e.apply&&(t?Qn.isNodeList(e.children):Array.isArray(e.children)))},Kn={isAncestor(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return or(e)&&Qn.isNodeList(e.children,{deep:t})},isElement:qn,isElementList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>Kn.isElement(e,{deep:t}))},isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return qn(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},Yn=["text"],Xn=["children"];function Zn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zn(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Qn={ancestor(e,t){var n=Qn.get(e,t);if(Qn.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Hr.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of jn.ancestors(t,n)){var o=[Qn.ancestor(e,r),r];yield o}}()},child(e,t){if(Qn.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Hr.stringify(e)));if("number"!=typeof t)throw new Error("Expected index to be a number");var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Hr.stringify(e)));return n},children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=Qn.ancestor(e,t),{children:i}=o,a=r?i.length-1:0;r?a>=0:a<i.length;){var s=Qn.child(o,a),u=t.concat(a);yield[s,u],a=r?a-1:a+1}}()},common(e,t,n){var r=jn.common(t,n);return[Qn.get(e,r),r]},descendant(e,t){var n=Qn.get(e,t);if(Qn.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Hr.stringify(n)));return n},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Qn.nodes(e,t))0!==r.length&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Qn.nodes(e,t))Qn.isElement(n)&&(yield[n,r])}()},extractProps(e){if(Qn.isText(e)){var{text:t}=e;return Un(e,Yn)}var{children:n}=e;return Un(e,Xn)},first(e,t){for(var n=t.slice(),r=Qn.get(e,n);r&&!Qn.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){var n={children:e.children},[r,o]=Gn.edges(t),i=Qn.nodes(n,{reverse:!0,pass:e=>{var[,n]=e;return!Gn.includes(t,n)}}),a=function(){if(!Gn.includes(t,s)){var e=s[s.length-1];Jr(n,jn.parent(s),t=>Xr(t,e,1))}jn.equals(s,o.path)&&Qr(n,s,e=>{var t=e.text.slice(0,o.offset);return Jn(Jn({},e),{},{text:t})}),jn.equals(s,r.path)&&Qr(n,s,e=>{var t=e.text.slice(r.offset);return Jn(Jn({},e),{},{text:t})})};for(var[,s]of i)a();return n.children},get(e,t){var n=Qn.getIf(e,t);if(void 0===n)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Hr.stringify(e)));return n},getIf(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if("number"!=typeof o)throw new Error("Got non-numeric path index");if(Qn.isText(n)||!n.children[o])return;n=n.children[o]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if("number"!=typeof o)throw new Error("Got non-numeric path index");if(Qn.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isAncestor:e=>!Qn.isText(e),isEditor:e=>"function"==typeof e.apply,isElement:e=>Array.isArray(e.children)&&"function"!=typeof e.apply,isNode(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Wr.isText(e)||Kn.isElement(e,{deep:t})||Pr.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>Qn.isNode(e,{deep:t}))},isText:e=>"string"==typeof e.text,last(e,t){for(var n=t.slice(),r=Qn.get(e,n);r&&!Qn.isText(r)&&0!==r.children.length;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=Qn.get(e,t);if(!Qn.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Hr.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of jn.levels(t,n)){var o=Qn.get(e,r);yield[o,r]}}()},matches:(e,t)=>Qn.isElement(e)&&Kn.isElementProps(t)&&Kn.matches(e,t)||Qn.isText(e)&&Wr.isTextProps(t)&&Wr.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,a=new Set,s=[],u=e;!i||!(r?jn.isBefore(s,i):jn.isAfter(s,i));)if(a.has(u)||(yield[u,s]),a.has(u)||Qn.isText(u)||0===u.children.length||null!=n&&!1!==n([u,s])){if(0===s.length)break;if(!r){var l=jn.next(s);if(Qn.has(e,l)){s=l,u=Qn.get(e,s);continue}}if(r&&0!==s[s.length-1])s=jn.previous(s),u=Qn.get(e,s);else s=jn.parent(s),u=Qn.get(e,s),a.add(u)}else{a.add(u);var c=r?u.children.length-1:0;jn.isAncestor(s,o)&&(c=o[s.length]),s=s.concat(c),u=Qn.get(e,s)}}()},parent(e,t){var n=jn.parent(t),r=Qn.get(e,n);if(Qn.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:e=>Qn.isText(e)?e.text:e.children.map(Qn.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Qn.nodes(e,t))Qn.isText(n)&&(yield[n,r])}()}};function er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?er(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):er(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var nr,rr={isNodeOperation:e=>rr.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!or(e))return!1;switch(e.type){case"insert_node":case"remove_node":return jn.isPath(e.path)&&Qn.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&jn.isPath(e.path);case"merge_node":return"number"==typeof e.position&&jn.isPath(e.path)&&or(e.properties);case"move_node":return jn.isPath(e.path)&&jn.isPath(e.newPath);case"set_node":return jn.isPath(e.path)&&or(e.properties)&&or(e.newProperties);case"set_selection":return null===e.properties&&Gn.isRange(e.newProperties)||null===e.newProperties&&Gn.isRange(e.properties)||or(e.properties)&&or(e.newProperties);case"split_node":return jn.isPath(e.path)&&"number"==typeof e.position&&or(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(e=>rr.isOperation(e)),isSelectionOperation:e=>rr.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>rr.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return tr(tr({},e),{},{type:"remove_node"});case"insert_text":return tr(tr({},e),{},{type:"remove_text"});case"merge_node":return tr(tr({},e),{},{type:"split_node",path:jn.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(jn.equals(t,n))return e;if(jn.isSibling(n,t))return tr(tr({},e),{},{path:t,newPath:n});var r=jn.transform(n,e),o=jn.transform(jn.next(n),e);return tr(tr({},e),{},{path:r,newPath:o});case"remove_node":return tr(tr({},e),{},{type:"insert_node"});case"remove_text":return tr(tr({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return tr(tr({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:s,newProperties:u}=e;return tr(tr({},e),{},null==s?{properties:u,newProperties:null}:null==u?{properties:null,newProperties:s}:{properties:u,newProperties:s});case"split_node":return tr(tr({},e),{},{type:"merge_node",path:jn.next(e.path)})}}},or=e=>"object"==typeof e&&null!==e,ir=(e,t)=>{for(var n in e){var r=Object.hasOwn(e,n)?e[n]:void 0,o=Object.hasOwn(t,n)?t[n]:void 0;if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==o[i])return!1}else if(or(r)&&or(o)){if(!ir(r,o))return!1}else if(r!==o)return!1}for(var a in t)if(void 0===e[a]&&void 0!==t[a])return!1;return!0},ar=e=>e.selection?e.selection:e.children.length>0?Pr.end(e,[]):[0],sr=(e,t)=>{var[n]=Pr.node(e,t);return e=>e===n},ur=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!t,r=t?hr(e):e,o=nr.None,i=nr.None,a=0,s=null;for(var u of r){var l=u.codePointAt(0);if(!l)break;var c=xr(u,l);if([o,i]=n?[i,c]:[c,o],Nr(o,nr.ZWJ)&&Nr(i,nr.ExtPict)&&!kr(n?e.substring(0,a):e.substring(0,e.length-a)))break;if(Nr(o,nr.RI)&&Nr(i,nr.RI)&&!(s=null!==s?!s:!!n||Ir(e.substring(0,e.length-a))))break;if(o!==nr.None&&i!==nr.None&&Or(o,i))break;a+=u.length}return a||1},lr=/\s/,cr=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,dr=/['\u2018\u2019]/,fr=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},pr=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(lr.test(t))return!1;if(dr.test(t)){var o=ur(n,r),[i,a]=fr(n,o,r);if(e(i,a,r))return!0}return!cr.test(t)},hr=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var r=e.charAt(t-n);if(vr(r.charCodeAt(0))){var o=e.charAt(t-n-1);if(gr(o.charCodeAt(0))){yield o+r,n++;continue}}yield r}},gr=e=>e>=55296&&e<=56319,vr=e=>e>=56320&&e<=57343;!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(nr||(nr={}));var mr=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,yr=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,br=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,Er=/^[\u1100-\u115F\uA960-\uA97C]$/,wr=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,Cr=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Dr=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,Ar=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,Sr=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,xr=(e,t)=>{var n=nr.Any;return-1!==e.search(mr)&&(n|=nr.Extend),8205===t&&(n|=nr.ZWJ),t>=127462&&t<=127487&&(n|=nr.RI),-1!==e.search(yr)&&(n|=nr.Prepend),-1!==e.search(br)&&(n|=nr.SpacingMark),-1!==e.search(Er)&&(n|=nr.L),-1!==e.search(wr)&&(n|=nr.V),-1!==e.search(Cr)&&(n|=nr.T),-1!==e.search(Dr)&&(n|=nr.LV),-1!==e.search(Ar)&&(n|=nr.LVT),-1!==e.search(Sr)&&(n|=nr.ExtPict),n};function Nr(e,t){return 0!==(e&t)}var Br=[[nr.L,nr.L|nr.V|nr.LV|nr.LVT],[nr.LV|nr.V,nr.V|nr.T],[nr.LVT|nr.T,nr.T],[nr.Any,nr.Extend|nr.ZWJ],[nr.Any,nr.SpacingMark],[nr.Prepend,nr.Any],[nr.ZWJ,nr.ExtPict],[nr.RI,nr.RI]];function Or(e,t){return-1===Br.findIndex(n=>Nr(e,n[0])&&Nr(t,n[1]))}var Tr=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,kr=e=>-1!==e.search(Tr),Fr=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Ir=e=>{var t=e.match(Fr);return null!==t&&t[0].length/2%2==1},Pr={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!or(e))return!1;var n="function"==typeof e.above&&"function"==typeof e.addMark&&"function"==typeof e.after&&"function"==typeof e.apply&&"function"==typeof e.before&&"function"==typeof e.collapse&&"function"==typeof e.delete&&"function"==typeof e.deleteBackward&&"function"==typeof e.deleteForward&&"function"==typeof e.deleteFragment&&"function"==typeof e.deselect&&"function"==typeof e.edges&&"function"==typeof e.elementReadOnly&&"function"==typeof e.end&&"function"==typeof e.first&&"function"==typeof e.fragment&&"function"==typeof e.getDirtyPaths&&"function"==typeof e.getFragment&&"function"==typeof e.getMarks&&"function"==typeof e.hasBlocks&&"function"==typeof e.hasInlines&&"function"==typeof e.hasPath&&"function"==typeof e.hasTexts&&"function"==typeof e.insertBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertNodes&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertText&&"function"==typeof e.isBlock&&"function"==typeof e.isEdge&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isEmpty&&"function"==typeof e.isEnd&&"function"==typeof e.isInline&&"function"==typeof e.isNormalizing&&"function"==typeof e.isSelectable&&"function"==typeof e.isStart&&"function"==typeof e.isVoid&&"function"==typeof e.last&&"function"==typeof e.leaf&&"function"==typeof e.levels&&"function"==typeof e.liftNodes&&"function"==typeof e.markableVoid&&"function"==typeof e.mergeNodes&&"function"==typeof e.move&&"function"==typeof e.moveNodes&&"function"==typeof e.next&&"function"==typeof e.node&&"function"==typeof e.nodes&&"function"==typeof e.normalize&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.parent&&"function"==typeof e.path&&"function"==typeof e.pathRef&&"function"==typeof e.pathRefs&&"function"==typeof e.point&&"function"==typeof e.pointRef&&"function"==typeof e.pointRefs&&"function"==typeof e.positions&&"function"==typeof e.previous&&"function"==typeof e.range&&"function"==typeof e.rangeRef&&"function"==typeof e.rangeRefs&&"function"==typeof e.removeMark&&"function"==typeof e.removeNodes&&"function"==typeof e.select&&"function"==typeof e.setNodes&&"function"==typeof e.setNormalizing&&"function"==typeof e.setPoint&&"function"==typeof e.setSelection&&"function"==typeof e.shouldMergeNodesRemovePrevNode&&"function"==typeof e.shouldNormalize&&"function"==typeof e.splitNodes&&"function"==typeof e.start&&"function"==typeof e.string&&"function"==typeof e.unhangRange&&"function"==typeof e.unsetNodes&&"function"==typeof e.unwrapNodes&&"function"==typeof e.void&&"function"==typeof e.withoutNormalizing&&"function"==typeof e.wrapNodes&&(null===e.marks||or(e.marks))&&(null===e.selection||Gn.isRange(e.selection))&&(t?Qn.isNodeList(e.children)&&rr.isOperationList(e.operations):Array.isArray(e.children)&&Array.isArray(e.operations));return n},isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,n)=>e.shouldMergeNodesRemovePrevNode(t,n)},_r={isLocation:e=>jn.isPath(e)||Mr.isPoint(e)||Gn.isRange(e),isPath:e=>Array.isArray(e),isPoint:e=>"offset"in e,isRange:e=>"anchor"in e,isSpan:e=>Array.isArray(e)&&Array.isArray(e[0])};function Rr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rr(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Mr={compare(e,t){var n=jn.compare(e.path,t.path);return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>1===Mr.compare(e,t),isBefore:(e,t)=>-1===Mr.compare(e,t),equals:(e,t)=>e.offset===t.offset&&jn.equals(e.path,t.path),isPoint:e=>or(e)&&"number"==typeof e.offset&&jn.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var{affinity:r="forward"}=n,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":o=jn.transform(o,t,n);break;case"insert_text":jn.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===r)&&(i+=t.text.length);break;case"merge_node":jn.equals(t.path,o)&&(i+=t.position),o=jn.transform(o,t,n);break;case"remove_text":jn.equals(t.path,o)&&t.offset<=i&&(i-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(jn.equals(t.path,o)||jn.isAncestor(t.path,o))return null;o=jn.transform(o,t,n);break;case"split_node":if(jn.equals(t.path,o)){if(t.position===i&&null==r)return null;(t.position<i||t.position===i&&"forward"===r)&&(i-=t.position,o=jn.transform(o,t,Lr(Lr({},n),{},{affinity:"forward"})))}else o=jn.transform(o,t,n);break;default:return e}return{path:o,offset:i}}},jr=void 0,Hr={setScrubber(e){jr=e},stringify:e=>JSON.stringify(e,jr)},zr=["text"],$r=["anchor","focus","merge"];function Ur(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ur(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ur(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Wr={equals(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){var{text:t}=e;return Un(e,zr)}return ir(r?o(e):e,r?o(t):t)},isText:e=>or(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every(e=>Wr.isText(e)),isTextProps:e=>void 0!==e.text,matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[{leaf:Vr({},e)}];for(var r of t){var{anchor:o,focus:i,merge:a}=r,s=Un(r,$r),[u,l]=Gn.edges(r),c=[],d=0,f=u.offset,p=l.offset,h=null!=a?a:Object.assign;for(var{leaf:g}of n){var{length:v}=g.text,m=d;if(d+=v,f<=m&&d<=p)h(g,s),c.push({leaf:g});else if(f!==p&&(f===d||p===m)||f>d||p<m||p===m&&0!==m)c.push({leaf:g});else{var y=g,b=void 0,E=void 0;if(p<d){var w=p-m;E={leaf:Vr(Vr({},y),{},{text:y.text.slice(w)})},y=Vr(Vr({},y),{},{text:y.text.slice(0,w)})}if(f>m){var C=f-m;b={leaf:Vr(Vr({},y),{},{text:y.text.slice(0,C)})},y=Vr(Vr({},y),{},{text:y.text.slice(C)})}h(y,s),b&&c.push(b),c.push({leaf:y}),E&&c.push(E)}}n=c}if(n.length>1){var D=0;for(var[A,S]of n.entries()){var x=D,N=x+S.leaf.text.length,B={start:x,end:N};0===A&&(B.isFirst=!0),A===n.length-1&&(B.isLast=!0),S.position=B,D=N}}return n}};function Gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Kr=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return[...e.slice(0,t),...r,...e.slice(t)]},Yr=function(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];return[...e.slice(0,t),...o,...e.slice(t+n)]},Xr=Yr,Zr=(e,t,n)=>{if(0===t.length)throw new Error("Cannot modify the editor");for(var r=Qn.get(e,t),o=t.slice(),i=n(r);o.length>1;){var a=o.pop(),s=Qn.get(e,o);i=qr(qr({},s),{},{children:Yr(s.children,a,1,i)})}var u=o.pop();e.children=Yr(e.children,u,1,i)},Jr=(e,t,n)=>{0===t.length?e.children=n(e.children):Zr(e,t,e=>{if(Qn.isText(e))throw new Error("Cannot get the element at path [".concat(t,"] because it refers to a leaf node: ").concat(Hr.stringify(e)));return qr(qr({},e),{},{children:n(e.children)})})},Qr=(e,t,n)=>Zr(e,t,e=>{if(!Qn.isText(e))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Hr.stringify(e)));return n(e)});function eo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function to(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var no=["children","text",...Object.getOwnPropertyNames(Object.prototype)],ro=Object.getOwnPropertyNames(Object.prototype),oo={transform(e,t){var n=!1;switch(t.type){case"insert_node":var{path:r,node:o}=t;Jr(e,jn.parent(r),e=>{var t=r[r.length-1];if(t>e.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));return Kr(e,t,o)}),n=!0;break;case"insert_text":var{path:i,offset:a,text:s}=t;if(0===s.length)break;Qr(e,i,e=>{var t=e.text.slice(0,a),n=e.text.slice(a);return to(to({},e),{},{text:t+s+n})}),n=!0;break;case"merge_node":var{path:u}=t,l=u[u.length-1],c=jn.previous(u),d=c[c.length-1];if(0===u.length)throw new Error('Cannot apply a "merge_node" operation at path ['.concat(u,"] because the root node cannot be merged."));if("number"!=typeof l||"number"!=typeof d)throw new Error("Index must be number");Jr(e,jn.parent(u),e=>{var t,n=e[l],r=e[d];if(Qn.isText(n)&&Qn.isText(r))t=to(to({},r),{},{text:r.text+n.text});else{if(!Qn.isElement(n)||!Qn.isElement(r))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(u,"] to nodes of different interfaces: ").concat(Hr.stringify(n)," ").concat(Hr.stringify(r)));t=to(to({},r),{},{children:r.children.concat(n.children)})}return Yr(e,d,2,t)}),n=!0;break;case"move_node":var{path:f,newPath:p}=t,h=f[f.length-1];if(jn.isAncestor(f,p))throw new Error("Cannot move a path [".concat(f,"] to new path [").concat(p,"] because the destination is inside itself."));var g=Qn.get(e,f);Jr(e,jn.parent(f),e=>Xr(e,h,1));var v=jn.transform(f,t),m=v[v.length-1];Jr(e,jn.parent(v),e=>Kr(e,m,g)),n=!0;break;case"remove_node":var{path:y}=t,b=y[y.length-1];if(Jr(e,jn.parent(y),e=>Xr(e,b,1)),e.selection){var E=to({},e.selection);for(var[w,C]of Gn.points(E)){var D=Mr.transform(w,t);if(null!=E&&null!=D)E[C]=D;else{var A=void 0,S=void 0;for(var[x,N]of Qn.texts(e)){if(-1!==jn.compare(N,y)){S=[x,N];break}A=[x,N]}var B=!1;A&&S&&(B=!jn.isSibling(A[1],y)&&(!!jn.equals(S[1],y)||jn.common(A[1],y).length<jn.common(S[1],y).length)),A&&!B?E[C]={path:A[1],offset:A[0].text.length}:S?E[C]={path:S[1],offset:0}:E=null}}E&&Gn.equals(E,e.selection)||(e.selection=E)}break;case"remove_text":var{path:O,offset:T,text:k}=t;if(0===k.length)break;Qr(e,O,e=>{var t=e.text.slice(0,T),n=e.text.slice(T+k.length);return to(to({},e),{},{text:t+n})}),n=!0;break;case"set_node":var{path:F,properties:I,newProperties:P}=t;if(0===F.length)throw new Error("Cannot set properties on the root node!");Zr(e,F,e=>{var t=to({},e);for(var n in P){if(no.includes(n))throw new Error('Cannot set the "'.concat(n,'" property of nodes!'));var r=P[n];if("then"===n&&"function"==typeof r)throw new Error('Cannot set the "then" property of a node to a function');null==r?delete t[n]:t[n]=r}for(var o in I)Object.hasOwn(P,o)||delete t[o];return t});break;case"set_selection":var{newProperties:_}=t;if(null==_){e.selection=null;break}if(null==e.selection){if(!_.anchor||!_.focus)throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Hr.stringify(_)," when there is no current selection."));e.selection=to({},_);break}var R=to({},e.selection);for(var L in _){if(ro.includes(L))throw new Error('Cannot set the "'.concat(L,'" property of the selection!'));var M=_[L];if("then"===L&&"function"==typeof M)throw new Error('Cannot set the "then" property of the selection to a function');if(null==M){if("anchor"===L||"focus"===L)throw new Error('Cannot remove the "'.concat(L,'" selection property'));delete R[L]}else R[L]=M}e.selection=R;break;case"split_node":var{path:j,position:H,properties:z}=t,$=j[j.length-1];if(0===j.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(j,"] because the root node cannot be split."));if("number"!=typeof $)throw new Error("Index must be number");Jr(e,jn.parent(j),e=>{var t,n,r=e[$];if(Qn.isText(r)){var o=r.text.slice(0,H),i=r.text.slice(H);t=to(to({},r),{},{text:o}),n={text:i}}else{var a=r.children.slice(0,H),s=r.children.slice(H);t=to(to({},r),{},{children:a}),n={children:s}}for(var u in z){if(no.includes(u))throw new Error('Cannot set the "'.concat(u,'" property of nodes!'));var l=z[u];if("then"===u&&"function"==typeof l)throw new Error('Cannot set the "then" property of a node to a function');null!=l&&(n[u]=l)}return Yr(e,$,1,t,n)}),n=!0}if(n&&e.selection){var U=to({},e.selection);for(var[V,W]of Gn.points(U))U[W]=Mr.transform(V,t);Gn.equals(U,e.selection)||(e.selection=U)}}},io={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},ao={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},so={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pr.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:o=ar(e)}=n;if(_r.isPath(o)&&(o=Pr.range(e,o)),_r.isRange(o))if(Gn.isCollapsed(o))o=o.anchor;else{var i=Gn.end(o);if(!r&&Pr.void(e,{at:i}))return;var a=Gn.start(o),s=Pr.pointRef(e,a),u=Pr.pointRef(e,i);co.delete(e,{at:o,voids:r});var l=s.unref(),c=u.unref();o=l||c,co.setSelection(e,{anchor:o,focus:o})}if(!(!r&&Pr.void(e,{at:o})||Pr.elementReadOnly(e,{at:o}))){var{path:d,offset:f}=o;t.length>0&&e.apply({type:"insert_text",path:d,offset:f,text:t})}})}};function uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var co=lo(lo(lo(lo({},oo),io),ao),so),fo=new WeakMap;function po(e,t,n){var r,o,i=Fn.get(e)||[],a=In.get(e)||new Set,s=e=>{if(e){var t=e.join(",");o.has(t)||(o.add(t),r.push(e))}};if(n)for(var u of(r=[],o=new Set,i)){s(n(u))}else r=i,o=a;for(var l of t)s(l);Fn.set(e,r),In.set(e,o)}var ho=(e,t)=>{for(var n of Pr.pathRefs(e))On.transform(n,t);for(var r of Pr.pointRefs(e))Tn.transform(r,t);for(var o of Pr.rangeRefs(e))kn.transform(o,t);if(!(e=>fo.get(e)||!1)(e)){var i=jn.operationCanTransformPath(t)?e=>jn.transform(e,t):void 0;po(e,e.getDirtyPaths(t),i)}co.transform(e,t),e.operations.push(t),Pr.normalize(e,{operation:t}),"set_selection"===t.type&&(e.marks=null),Pn.get(e)||(Pn.set(e,!0),Promise.resolve().then(()=>{Pn.set(e,!1),e.onChange({operation:t}),e.operations=[]}))};function go(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?go(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):go(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Eo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Co(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Do(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ao(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Do(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Do(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function So(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var xo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r,marks:o}=e;if(r){if(o){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?So(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):So(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({text:t},o);co.insertNodes(e,i,{at:n.at,voids:n.voids})}else co.insertText(e,t,n);e.marks=null}};var No=["text"],Bo=["text"];var Oo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{force:n=!1,operation:r}=t,o=e=>Fn.get(e)||[],i=e=>{var t=o(e).pop(),n=t.join(",");return(e=>In.get(e)||new Set)(e).delete(n),t};if(Pr.isNormalizing(e)){if(n){var a=Array.from(Qn.nodes(e),e=>{var[,t]=e;return t}),s=new Set(a.map(e=>e.join(",")));Fn.set(e,a),In.set(e,s)}0!==o(e).length&&Pr.withoutNormalizing(e,()=>{for(var t of o(e))if(Qn.has(e,t)){var a=Pr.node(e,t),[s,u]=a;Qn.isElement(s)&&0===s.children.length&&e.normalizeNode(a,{operation:r,force:n})}for(var l=o(e),c=l.length,d=0;0!==l.length;){if(!e.shouldNormalize({dirtyPaths:l,iteration:d,initialDirtyPathsLength:c,operation:r}))return;var f=i(e);if(Qn.has(e,f)){var p=Pr.node(e,f);e.normalizeNode(p,{operation:r,force:n})}d++,l=o(e)}})}};function To(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:i=!1}=t;if(n){var a=Pr.range(e,n),[s,u]=Gn.edges(a),l=o?u:s,c=!1,d="",f=0,p=0,h=0,g=[],v=function*(t){var n=g.some(e=>jn.isAncestor(e,t));function*a(e){n||(yield e)}if(Qn.isElement(m)){if(!e.isSelectable(m)){if(g.push(t),o)return jn.hasPrevious(t)&&(yield*a(Pr.end(e,jn.previous(t)))),0;var v=jn.next(t);return Pr.hasPath(e,v)&&(yield*a(Pr.start(e,v))),0}if(!i&&(e.isVoid(m)||e.isElementReadOnly(m)))return yield*a(Pr.start(e,t)),0;if(e.isInline(m))return 0;if(Pr.hasInlines(e,m)){var y=jn.isAncestor(t,u.path)?u:Pr.end(e,t),E=jn.isAncestor(t,s.path)?s:Pr.start(e,t);d=Pr.string(e,{anchor:E,focus:y},{voids:i}),c=!0}}if(Qn.isText(m)){var w=jn.equals(t,l.path);for(w?(p=o?l.offset:m.text.length-l.offset,h=l.offset):(p=m.text.length,h=o?p:0),(w||c||"offset"===r)&&(yield*a({path:t,offset:h}),c=!1);;){if(0===f){if(""===d)break;f=b(d,r,o),d=fr(d,f,o)[1]}if(h=o?h-f:h+f,(p-=f)<0){f=-p;break}f=0,yield*a({path:t,offset:h})}}};for(var[m,y]of Pr.nodes(e,{at:n,reverse:o,voids:i}))yield*v(y)}function b(e,t,n){return"character"===t?ur(e,n):"word"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=!1;e.length>0;){var o=ur(e,t),[i,a]=fr(e,o,t);if(pr(i,a,t))r=!0,n+=o;else{if(r)break;n+=o}e=a}return n}(e,n):"line"===t||"block"===t?e.length:1}}()}function ko(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var Fo=(e,t)=>{var{selection:n}=e;if(n){var r=(t,n)=>{if(!Qn.isText(t))return!1;var[r,o]=Pr.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},o=Gn.isExpanded(n),i=!1;if(!o){var[a,s]=Pr.node(e,n);if(a&&r(a,s)){var[u]=Pr.parent(e,s);i=u&&e.markableVoid(u)}}if(o||i)co.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ko(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ko(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},Pr.marks(e)||{});delete l[t],e.marks=l,Pn.get(e)||e.onChange()}}};function Io(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Po(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Io(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Io(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _o(e,t,n){return("anchor"===e||"focus"===e)&&Mr.isPoint(t)&&Mr.isPoint(n)?!Mr.equals(t,n):t!==n}var Ro=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pr.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest",batchDirty:a=!0}=n,{at:s,match:u,select:l}=n;if(Qn.isNode(t)&&(t=[t]),0!==t.length){var[c]=t;if(s||(s=ar(e),!1!==l&&(l=!0)),null==l&&(l=!1),_r.isRange(s))if(r||(s=Pr.unhangRange(e,s,{voids:o})),Gn.isCollapsed(s))s=s.anchor;else{var[,d]=Gn.edges(s),f=Pr.pointRef(e,d);co.delete(e,{at:s}),s=f.unref()}if(_r.isPoint(s)){null==u&&(u=Qn.isText(c)?e=>Qn.isText(e):e.isInline(c)?t=>Qn.isText(t)||Pr.isInline(e,t):t=>Qn.isElement(t)&&Pr.isBlock(e,t));var[p]=Pr.nodes(e,{at:s.path,match:u,mode:i,voids:o});if(!p)return;var[,h]=p,g=Pr.pathRef(e,h),v=Pr.isEnd(e,s,h);co.splitNodes(e,{at:s,match:u,mode:i,voids:o});var m=g.unref();s=v?jn.next(m):m}var y=jn.parent(s),b=s[s.length-1];if(o||!Pr.void(e,{at:y})){if(a){var E=[],w=jn.levels(y);((e,t,n)=>{var r=fo.get(e)||!1;fo.set(e,!0);try{t(),n()}finally{fo.set(e,r)}})(e,()=>{var n=function(){var t=y.concat(b);b++;var n={type:"insert_node",path:t,node:r};e.apply(n),s=jn.next(s),E.push(n),Qn.isText(r)?w.push(t):w.push(...Array.from(Qn.nodes(r),e=>{var[,n]=e;return t.concat(n)}))};for(var r of t)n()},()=>{po(e,w,e=>{var t=e;for(var n of E)if(jn.operationCanTransformPath(n)&&!(t=jn.transform(t,n)))return null;return t})})}else for(var C of t){var D=y.concat(b);b++,e.apply({type:"insert_node",path:D,node:C}),s=jn.next(s)}if(s=jn.previous(s),l){var A=Pr.end(e,s);A&&co.select(e,A)}}}})},Lo=["text"],Mo=["children"],jo=(e,t)=>t!==e&&(Qn.isText(t)||Pr.isVoid(e,t)||1===t.children.length&&jo(e,t.children[0])),Ho=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection,height:a=0,always:s=!1}=t;if(i&&(null==o&&(o=t=>Qn.isElement(t)&&Pr.isBlock(e,t)),!_r.isRange(i)||(i=((e,t)=>{if(Gn.isCollapsed(t))return t.anchor;var[,n]=Gn.edges(t),r=Pr.pointRef(e,n);return co.delete(e,{at:t}),r.unref()})(e,i),i))){if(_r.isPath(i)){var u=i,l=Pr.point(e,u),[c]=Pr.parent(e,u);o=e=>e===c,a=l.path.length-u.length+1,i=l,s=!0}var d,f=Pr.pointRef(e,i,{affinity:"backward"});try{var[p]=Pr.nodes(e,{at:i,match:o,mode:n,voids:r});if(!p)return;var h=Pr.void(e,{at:i,mode:"highest"});if(!r&&h){var[g,v]=h;if(e.isInline(g)){var m=Pr.after(e,v);if(!m){var y=jn.next(v);co.insertNodes(e,{text:""},{at:y,voids:r}),m=Pr.point(e,y)}i=m,s=!0}a=i.path.length-v.length+1,s=!0}d=Pr.pointRef(e,i);var b=i.path.length-a,[,E]=p,w=i.path.slice(0,b),C=0===a?i.offset:i.path[b]+0;for(var[D,A]of Pr.levels(e,{at:w,reverse:!0,voids:r})){var S=!1;if(A.length<E.length||0===A.length||!r&&Qn.isElement(D)&&Pr.isVoid(e,D))break;var x=f.current,N=Pr.isEnd(e,x,A);if(s||!f||!Pr.isEdge(e,x,A)){S=!0;var B=Qn.extractProps(D);e.apply({type:"split_node",path:A,position:C,properties:B})}C=A[A.length-1]+(S||N?1:0)}if(null==t.at){var O=d.current||Pr.end(e,[]);co.select(e,O)}}finally{var T;f.unref(),null===(T=d)||void 0===T||T.unref()}}})};function zo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Uo,Vo=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ho(e,...n)},addMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var{selection:r}=e;if(r){var o=(t,n)=>{if(!Qn.isText(t))return!1;var[r,o]=Pr.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},i=Gn.isExpanded(r),a=!1;if(!i){var[s,u]=Pr.node(e,r);if(s&&o(s,u)){var[l]=Pr.parent(e,u);a=l&&e.markableVoid(l)}}if(i||a)co.setNodes(e,{[t]:n},{match:o,split:!0,voids:!0});else{var c=vo(vo({},Pr.marks(e)||{}),{},{[t]:n});e.marks=c,Pn.get(e)||e.onChange()}}})(e,...n)},deleteBackward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&Gn.isCollapsed(n)&&co.delete(e,{unit:t,reverse:!0})})(e,...n)},deleteForward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&Gn.isCollapsed(n)&&co.delete(e,{unit:t})})(e,...n)},deleteFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{direction:t="forward"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e;n&&Gn.isExpanded(n)&&co.delete(e,{reverse:"backward"===t})}(e,...n)},getFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;return t?Qn.fragment(e,t):[]})(e,...n)},insertBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{co.splitNodes(e,{always:!0})})(e,...n)},insertSoftBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{co.splitNodes(e,{always:!0})})(e,...n)},insertFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pr.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1}=n,{at:i=ar(e),batchDirty:a=!0}=n;if(t.length){if(_r.isRange(i))if(r||(i=Pr.unhangRange(e,i,{voids:o})),Gn.isCollapsed(i))i=i.anchor;else{var[,s]=Gn.edges(i);if(!o&&Pr.void(e,{at:s}))return;var u=Pr.pointRef(e,s);co.delete(e,{at:i}),i=u.unref()}else _r.isPath(i)&&(i=Pr.start(e,i));if(o||!Pr.void(e,{at:i})){var l=Pr.above(e,{at:i,match:t=>Qn.isElement(t)&&Pr.isInline(e,t),mode:"highest",voids:o});if(l){var[,c]=l;Pr.isEnd(e,i,c)?i=Pr.after(e,c):Pr.isStart(e,i,c)&&(i=Pr.before(e,c))}var d=Pr.above(e,{match:t=>Qn.isElement(t)&&Pr.isBlock(e,t),at:i,voids:o}),[,f]=d,p=Pr.isStart(e,i,f),h=Pr.isEnd(e,i,f),g=p&&h,[,v]=Qn.first({children:t},[]),[,m]=Qn.last({children:t},[]),y=t=>{var[n,r]=t;return!(0===r.length||!g&&(!p&&jn.isAncestor(r,v)&&Qn.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)||!h&&jn.isAncestor(r,m)&&Qn.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)))},b=!0,E=[],w=[],C=[];for(var D of Qn.nodes({children:t},{pass:y})){var[A,S]=D;b&&Qn.isElement(A)&&!e.isInline(A)&&!jn.isAncestor(S,v)&&(b=!1),y(D)&&(Qn.isElement(A)&&!e.isInline(A)?(b=!1,w.push(A)):b?E.push(A):C.push(A))}var[x]=Pr.nodes(e,{at:i,match:t=>Qn.isText(t)||Pr.isInline(e,t),mode:"highest",voids:o}),[,N]=x,B=Pr.isStart(e,i,N),O=Pr.isEnd(e,i,N),T=Pr.pathRef(e,h&&!C.length?jn.next(f):f),k=Pr.pathRef(e,O?jn.next(N):N),F=C.length>0;co.splitNodes(e,{at:i,match:t=>F?Qn.isElement(t)&&Pr.isBlock(e,t):Qn.isText(t)||Pr.isInline(e,t),mode:F?"lowest":"highest",always:F&&(!p||E.length>0)&&(!h||C.length>0),voids:o});var I,P=Pr.pathRef(e,!B||B&&O?jn.next(N):N);if(co.insertNodes(e,E,{at:P.current,match:t=>Qn.isText(t)||Pr.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),g&&!E.length&&w.length&&!C.length&&co.delete(e,{at:f,voids:o}),co.insertNodes(e,w,{at:T.current,match:t=>Qn.isElement(t)&&Pr.isBlock(e,t),mode:"lowest",voids:o,batchDirty:a}),co.insertNodes(e,C,{at:k.current,match:t=>Qn.isText(t)||Pr.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),!n.at&&(C.length>0&&k.current?I=jn.previous(k.current):w.length>0&&T.current?I=jn.previous(T.current):P.current&&(I=jn.previous(P.current)),I)){var _=Pr.end(e,I);co.select(e,_)}P.unref(),T.unref(),k.unref()}}})}(e,...n)},insertNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{co.insertNodes(e,t,n)})(e,...n)},insertText:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return xo(e,...n)},normalizeNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var[r,o]=t;if(!Qn.isText(r)){"children"in r||(r.children=[]);var i=r;if(i!==e&&0===i.children.length&&(co.insertNodes(e,{text:""},{at:o.concat(0),voids:!0}),i=Qn.get(e,o)),i!==e&&(e.isInline(i)||Qn.isText(i.children[0])||e.isInline(i.children[0])))for(var a=0;a<i.children.length;a++){var s=i.children[a],u=i.children[a-1];Qn.isText(s)?null!=u&&Qn.isText(u)&&(""===s.text?(co.removeNodes(e,{at:o.concat(a),voids:!0}),i=Qn.get(e,o),a--):""===u.text?(co.removeNodes(e,{at:o.concat(a-1),voids:!0}),i=Qn.get(e,o),a--):Wr.equals(s,u,{loose:!0})&&(co.mergeNodes(e,{at:o.concat(a),voids:!0}),i=Qn.get(e,o),a--)):e.isInline(s)?(null!=u&&Qn.isText(u)||(co.insertNodes(e,{text:""},{at:o.concat(a),voids:!0}),i=Qn.get(e,o),a++),a===i.children.length-1&&(co.insertNodes(e,{text:""},{at:o.concat(a+1),voids:!0}),i=Qn.get(e,o),a++)):(co.unwrapNodes(e,{at:o.concat(a),voids:!0}),i=Qn.get(e,o),a--)}else for(var l=0;l<i.children.length;l++){var c=i.children[l];(Qn.isText(c)||e.isInline(c))&&(null!=n&&n.fallbackElement?co.wrapNodes(e,n.fallbackElement(),{at:o.concat(l),voids:!0}):co.removeNodes(e,{at:o.concat(l),voids:!0}),i=Qn.get(e,o),l--)}}})(e,...n)},removeMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fo(e,...n)},getDirtyPaths:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":var{path:n}=t;return jn.levels(n);case"insert_node":var{node:r,path:o}=t,i=jn.levels(o),a=Qn.isText(r)?[]:Array.from(Qn.nodes(r),e=>{var[,t]=e;return o.concat(t)});return[...i,...a];case"merge_node":var{path:s}=t;return[...jn.ancestors(s),jn.previous(s)];case"move_node":var{path:u,newPath:l}=t;if(jn.equals(u,l))return[];var c=[],d=[];for(var f of jn.ancestors(u)){var p=jn.transform(f,t);c.push(p)}for(var h of jn.ancestors(l)){var g=jn.transform(h,t);d.push(g)}var v=d[d.length-1],m=l[l.length-1],y=v.concat(m);return[...c,...d,y];case"remove_node":var{path:b}=t;return[...jn.ancestors(b)];case"split_node":var{path:E}=t;return[...jn.levels(E),jn.next(E)];default:return[]}})(e,...n)},shouldNormalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,o=42*r;if(n>o)throw new Error("Could not completely normalize the editor after ".concat(o," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0})(e,...n)},above:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{voids:n=!1,mode:r="lowest",at:o=e.selection,match:i}=t;if(o){var a=Pr.path(e,o);if(!_r.isRange(o)||jn.equals(o.focus.path,o.anchor.path)){if(0===a.length)return;a=jn.parent(a)}var s="lowest"===r,[u]=Pr.levels(e,{at:a,voids:n,match:i,reverse:s});return u}}(e,...n)},after:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:Pr.point(e,t,{edge:"end"}),focus:Pr.end(e,[])},{distance:i=1}=r,a=0;for(var s of Pr.positions(e,yo(yo({},r),{},{at:o}))){if(a>i)break;0!==a&&(n=s),a++}return n}(e,...n)},before:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:Pr.start(e,[]),focus:Pr.point(e,t,{edge:"start"})},{distance:i=1}=r,a=0;for(var s of Pr.positions(e,Eo(Eo({},r),{},{at:o,reverse:!0}))){if(a>i)break;0!==a&&(n=s),a++}return n}(e,...n)},collapse:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{edge:n="anchor"}=t,{selection:r}=e;if(r)if("anchor"===n)co.select(e,r.anchor);else if("focus"===n)co.select(e,r.focus);else if("start"===n){var[o]=Gn.edges(r);co.select(e,o)}else if("end"===n){var[,i]=Gn.edges(r);co.select(e,i)}}(e,...n)},delete:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var n,r,{reverse:o=!1,unit:i="character",distance:a=1,voids:s=!1}=t,{at:u=e.selection,hanging:l=!1}=t;if(u){var c=!1;if(_r.isRange(u)&&Gn.isCollapsed(u)&&(c=!0,u=u.anchor),_r.isPoint(u)){var d=Pr.void(e,{at:u,mode:"highest"});if(!s&&d){var[,f]=d;u=f}else{var p={unit:i,distance:a};u={anchor:u,focus:o?Pr.before(e,u,p)||Pr.start(e,[]):Pr.after(e,u,p)||Pr.end(e,[])},l=!0}}if(_r.isPath(u))co.removeNodes(e,{at:u,voids:s});else if(!Gn.isCollapsed(u)){if(!l){var[,h]=Gn.edges(u),g=Pr.end(e,[]);Mr.equals(h,g)||(u=Pr.unhangRange(e,u,{voids:s}))}var[v,m]=Gn.edges(u),y=Pr.above(e,{match:t=>Qn.isElement(t)&&Pr.isBlock(e,t),at:v,voids:s}),b=Pr.above(e,{match:t=>Qn.isElement(t)&&Pr.isBlock(e,t),at:m,voids:s}),E=y&&b&&!jn.equals(y[1],b[1]),w=jn.equals(v.path,m.path),C=s?null:null!==(n=Pr.void(e,{at:v,mode:"highest"}))&&void 0!==n?n:Pr.elementReadOnly(e,{at:v,mode:"highest"}),D=s?null:null!==(r=Pr.void(e,{at:m,mode:"highest"}))&&void 0!==r?r:Pr.elementReadOnly(e,{at:m,mode:"highest"});if(C){var A=Pr.before(e,v);A&&y&&jn.isAncestor(y[1],A.path)&&(v=A)}if(D){var S=Pr.after(e,m);S&&b&&jn.isAncestor(b[1],S.path)&&(m=S)}var x,N=[];for(var B of Pr.nodes(e,{at:u,voids:s})){var[O,T]=B;x&&0===jn.compare(T,x)||(!s&&Qn.isElement(O)&&(Pr.isVoid(e,O)||Pr.isElementReadOnly(e,O))||!jn.isCommon(T,v.path)&&!jn.isCommon(T,m.path))&&(N.push(B),x=T)}var k=Array.from(N,t=>{var[,n]=t;return Pr.pathRef(e,n)}),F=Pr.pointRef(e,v),I=Pr.pointRef(e,m),P="";if(!w&&!C){var _=F.current,[R]=Pr.leaf(e,_),{path:L}=_,{offset:M}=v,j=R.text.slice(M);j.length>0&&(e.apply({type:"remove_text",path:L,offset:M,text:j}),P=j)}if(k.reverse().map(e=>e.unref()).filter(e=>null!==e).forEach(t=>co.removeNodes(e,{at:t,voids:s})),!D){var H=I.current,[z]=Pr.leaf(e,H),{path:$}=H,U=w?v.offset:0,V=z.text.slice(U,m.offset);V.length>0&&(e.apply({type:"remove_text",path:$,offset:U,text:V}),P=V)}!w&&E&&I.current&&F.current&&co.mergeNodes(e,{at:I.current,hanging:!0,voids:s}),c&&o&&"character"===i&&P.length>1&&P.match(/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/)&&co.insertText(e,P.slice(0,P.length-a));var W=F.unref(),G=I.unref(),q=o?W||G:G||W;null==t.at&&q&&co.select(e,q)}}})}(e,...n)},deselect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})})(e,...n)},edges:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>[Pr.start(e,t),Pr.end(e,t)])(e,...n)},elementReadOnly:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Pr.above(e,Co(Co({},t),{},{match:t=>Qn.isElement(t)&&Pr.isElementReadOnly(e,t)}))}(e,...n)},end:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Pr.point(e,t,{edge:"end"}))(e,...n)},first:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Pr.path(e,t,{edge:"start"});return Pr.node(e,n)})(e,...n)},fragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Pr.range(e,t);return Qn.fragment(e,n)})(e,...n)},getMarks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{marks:t,selection:n}=e;if(!n)return null;var{anchor:r,focus:o}=n;if(t)return t;if(Gn.isExpanded(n)){if(Gn.isBackward(n)&&([o,r]=[r,o]),Pr.isEnd(e,r,r.path)){var i=Pr.after(e,r);i&&(r=i)}var[a]=Pr.nodes(e,{match:Qn.isText,at:{anchor:r,focus:o}});if(a){var[s]=a,{text:u}=s;return Un(s,No)}return{}}var{path:l}=r,[c]=Pr.leaf(e,l);if(0===r.offset){var d=Pr.previous(e,{at:l,match:Qn.isText}),f=Pr.above(e,{match:t=>Qn.isElement(t)&&Pr.isVoid(e,t)&&e.markableVoid(t)});if(!f){var p=Pr.above(e,{match:t=>Qn.isElement(t)&&Pr.isBlock(e,t)});if(d&&p){var[h,g]=d,[,v]=p;jn.isAncestor(v,g)&&(c=h)}}}var{text:m}=c;return Un(c,Bo)}(e,...n)},hasBlocks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some(t=>Qn.isElement(t)&&Pr.isBlock(e,t)))(e,...n)},hasInlines:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some(t=>Qn.isText(t)||Pr.isInline(e,t)))(e,...n)},hasPath:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Qn.has(e,t))(e,...n)},hasTexts:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.every(e=>Qn.isText(e)))(e,...n)},insertNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ro(e,...n)},isBlock:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>!e.isInline(t))(e,...n)},isEdge:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>Pr.isStart(e,t,n)||Pr.isEnd(e,t,n))(e,...n)},isEmpty:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{children:n}=t,[r]=n;return 0===n.length||1===n.length&&Qn.isText(r)&&""===r.text&&!e.isVoid(t)})(e,...n)},isEnd:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var r=Pr.end(e,n);return Mr.equals(t,r)})(e,...n)},isNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=_n.get(e);return void 0===t||t})(e,...n)},isStart:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{if(0!==t.offset)return!1;var r=Pr.start(e,n);return Mr.equals(t,r)})(e,...n)},last:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Pr.path(e,t,{edge:"end"});return Pr.node(e,n)})(e,...n)},leaf:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Pr.path(e,t,n);return[Qn.leaf(e,r),r]}(e,...n)},levels:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:o=!1}=t,{match:i}=t;if(null==i&&(i=()=>!0),n){var a=[],s=Pr.path(e,n);for(var[u,l]of Qn.levels(e,s))if(i(u,l)&&(a.push([u,l]),!o&&Qn.isElement(u)&&Pr.isVoid(e,u)))break;r&&a.reverse(),yield*a}}()}(e,...n)},liftNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var{at:n=e.selection,mode:r="lowest",voids:o=!1}=t,{match:i}=t;if(n){null==i&&(i=_r.isPath(n)?sr(e,n):t=>Qn.isElement(t)&&Pr.isBlock(e,t));var a=Pr.nodes(e,{at:n,match:i,mode:r,voids:o}),s=Array.from(a,t=>{var[,n]=t;return Pr.pathRef(e,n)});for(var u of s){var l=u.unref();if(l.length<2)throw new Error("Cannot lift node at a path [".concat(l,"] because it has a depth of less than `2`."));var c=Pr.node(e,jn.parent(l)),[d,f]=c,p=l[l.length-1],{length:h}=d.children;if(1===h){var g=jn.next(f);co.moveNodes(e,{at:l,to:g,voids:o}),co.removeNodes(e,{at:f,voids:o})}else if(0===p)co.moveNodes(e,{at:l,to:f,voids:o});else if(p===h-1){var v=jn.next(f);co.moveNodes(e,{at:l,to:v,voids:o})}else{var m=jn.next(l),y=jn.next(f);co.splitNodes(e,{at:m,voids:o}),co.moveNodes(e,{at:l,to:y,voids:o})}}}})}(e,...n)},mergeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var{match:n,at:r=e.selection}=t,{hanging:o=!1,voids:i=!1,mode:a="lowest"}=t;if(r){var s=_r.isPath(r),u=s?r:null,l=null==n&&s;if(null==n)if(s){var[c]=Pr.parent(e,r);n=e=>c.children.includes(e)}else n=t=>Qn.isElement(t)&&Pr.isBlock(e,t);if(!o&&_r.isRange(r)&&(r=Pr.unhangRange(e,r,{voids:i})),_r.isRange(r))if(Gn.isCollapsed(r))r=r.anchor;else{var[,d]=Gn.edges(r),f=Pr.pointRef(e,d);co.delete(e,{at:r}),r=f.unref(),null==t.at&&co.select(e,r)}var[p]=Pr.nodes(e,{at:r,match:n,voids:i,mode:a}),h=l&&u&&jn.hasPrevious(u)?jn.previous(u):null,g=h?Pr.node(e,h):Pr.previous(e,{at:r,match:n,voids:i,mode:a});if(p&&g){var[v,m]=p,[y,b]=g;if(0!==m.length&&0!==b.length){var E,w,C=jn.next(b),D=jn.common(m,b),A=jn.isSibling(m,b),S=Array.from(Pr.levels(e,{at:m}),e=>{var[t]=e;return t}).slice(D.length).slice(0,-1),x=Pr.above(e,{at:m,mode:"highest",match:t=>S.includes(t)&&jo(e,t)}),N=x&&Pr.pathRef(e,x[1]);if(Qn.isText(v)&&Qn.isText(y)){var{text:B}=v,O=Un(v,Lo);w=y.text.length,E=O}else{if(!Qn.isElement(v)||!Qn.isElement(y))throw new Error("Cannot merge the node at path [".concat(m,"] with the previous sibling because it is not the same kind: ").concat(Hr.stringify(v)," ").concat(Hr.stringify(y)));var{children:T}=v;O=Un(v,Mo),w=y.children.length,E=O}A||co.moveNodes(e,{at:m,to:C,voids:i}),N&&co.removeNodes(e,{at:N.current,voids:i}),Pr.shouldMergeNodesRemovePrevNode(e,g,p)?co.removeNodes(e,{at:b,voids:i}):e.apply({type:"merge_node",path:C,position:w,properties:E}),N&&N.unref()}}}})}(e,...n)},move:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:o="character",reverse:i=!1}=t,{edge:a=null}=t;if(n){"start"===a&&(a=Gn.isBackward(n)?"focus":"anchor"),"end"===a&&(a=Gn.isBackward(n)?"anchor":"focus");var{anchor:s,focus:u}=n,l={distance:r,unit:o},c={};if(null==a||"anchor"===a){var d=i?Pr.before(e,s,l):Pr.after(e,s,l);d&&(c.anchor=d)}if(null==a||"focus"===a){var f=i?Pr.before(e,u,l):Pr.after(e,u,l);f&&(c.focus=f)}co.setSelection(e,c)}}(e,...n)},moveNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{Pr.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:o="lowest",voids:i=!1}=t,{match:a}=t;if(r){null==a&&(a=_r.isPath(r)?sr(e,r):t=>Qn.isElement(t)&&Pr.isBlock(e,t));var s=Pr.pathRef(e,n),u=Pr.nodes(e,{at:r,match:a,mode:o,voids:i}),l=Array.from(u,t=>{var[,n]=t;return Pr.pathRef(e,n)});for(var c of l){var d=c.unref(),f=s.current;0!==d.length&&e.apply({type:"move_node",path:d,newPath:f}),s.current&&jn.isSibling(f,d)&&jn.isAfter(f,d)&&(s.current=jn.next(s.current))}s.unref()}})})(e,...n)},next:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=Pr.after(e,i,{voids:r});if(a){var[,s]=Pr.last(e,[]),u=[a.path,s];if(_r.isPath(i)&&0===i.length)throw new Error("Cannot get the next node from the root node!");if(null==o)if(_r.isPath(i)){var[l]=Pr.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=Pr.nodes(e,{at:u,match:o,mode:n,voids:r});return c}}}(e,...n)},node:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Pr.path(e,t,n),o=Qn.get(e,r);return[o,r]}(e,...n)},nodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:o=!1,reverse:i=!1,voids:a=!1,pass:s}=t,{match:u}=t;if(u||(u=()=>!0),n){var l,c;if(_r.isSpan(n))l=n[0],c=n[1];else{var d=Pr.path(e,n,{edge:"start"}),f=Pr.path(e,n,{edge:"end"});l=i?f:d,c=i?d:f}var p,h=Qn.nodes(e,{reverse:i,from:l,to:c,pass:t=>{var[n,r]=t;return!(!s||!s([n,r]))||!!Qn.isElement(n)&&!(a||!Pr.isVoid(e,n)&&!Pr.isElementReadOnly(e,n))}}),g=[];for(var[v,m]of h){var y=p&&0===jn.compare(m,p[1]);if("highest"!==r||!y)if(u(v,m))if("lowest"===r&&y)p=[v,m];else{var b="lowest"===r?p:[v,m];b&&(o?g.push(b):yield b),p=[v,m]}else if(o&&!y&&Qn.isText(v))return}"lowest"===r&&p&&(o?g.push(p):yield p),o&&(yield*g)}}()}(e,...n)},normalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Oo(e,...n)},parent:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Pr.path(e,t,n),o=jn.parent(r);return Pr.node(e,o)}(e,...n)},path:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{depth:r,edge:o}=n;if(_r.isPath(t))if("start"===o){var[,i]=Qn.first(e,t);t=i}else if("end"===o){var[,a]=Qn.last(e,t);t=a}return _r.isRange(t)&&(t="start"===o?Gn.start(t):"end"===o?Gn.end(t):jn.common(t.anchor.path,t.focus.path)),_r.isPoint(t)&&(t=t.path),null!=r&&(t=t.slice(0,r)),t}(e,...n)},pathRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Pr.pathRefs(e).delete(o),o.current=null,t}};return Pr.pathRefs(e).add(o),o}(e,...n)},pathRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Rn.get(e);return t||(t=new Set,Rn.set(e,t)),t})(e,...n)},point:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{edge:r="start"}=n;if(_r.isPath(t)){var o;if("end"===r){var[,i]=Qn.last(e,t);o=i}else{var[,a]=Qn.first(e,t);o=a}var s=Qn.get(e,o);if(!Qn.isText(s))throw new Error("Cannot get the ".concat(r," point in the node at path [").concat(t,"] because it has no ").concat(r," text node."));return{path:o,offset:"end"===r?s.text.length:0}}if(_r.isRange(t)){var[u,l]=Gn.edges(t);return"start"===r?u:l}return t}(e,...n)},pointRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Pr.pointRefs(e).delete(o),o.current=null,t}};return Pr.pointRefs(e).add(o),o}(e,...n)},pointRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Ln.get(e);return t||(t=new Set,Ln.set(e,t)),t})(e,...n)},positions:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return To(e,...n)},previous:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=Pr.before(e,i,{voids:r});if(a){var[,s]=Pr.first(e,[]),u=[a.path,s];if(_r.isPath(i)&&0===i.length)throw new Error("Cannot get the previous node from the root node!");if(null==o)if(_r.isPath(i)){var[l]=Pr.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=Pr.nodes(e,{reverse:!0,at:u,match:o,mode:n,voids:r});return c}}}(e,...n)},range:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>_r.isRange(t)&&!n?t:{anchor:Pr.start(e,t),focus:Pr.end(e,n||t)})(e,...n)},rangeRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Pr.rangeRefs(e).delete(o),o.current=null,t}};return Pr.rangeRefs(e).add(o),o}(e,...n)},rangeRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Mn.get(e);return t||(t=new Set,Mn.set(e,t)),t})(e,...n)},removeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:r=!1,mode:o="lowest"}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=_r.isPath(i)?sr(e,i):t=>Qn.isElement(t)&&Pr.isBlock(e,t)),!n&&_r.isRange(i)&&(i=Pr.unhangRange(e,i,{voids:r}));var s=Pr.nodes(e,{at:i,match:a,mode:o,voids:r}),u=Array.from(s,t=>{var[,n]=t;return Pr.pathRef(e,n)});for(var l of u){var c=l.unref();if(c){var[d]=Pr.node(e,c);e.apply({type:"remove_node",path:c,node:d})}}}})}(e,...n)},select:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;if(t=Pr.range(e,t),n)co.setSelection(e,t);else{if(!_r.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Hr.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})}})(e,...n)},setNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pr.withoutNormalizing(e,()=>{var{match:r,at:o=e.selection,compare:i,merge:a}=n,{hanging:s=!1,mode:u="lowest",split:l=!1,voids:c=!1}=n;if(o){if(null==r&&(r=_r.isPath(o)?sr(e,o):t=>Qn.isElement(t)&&Pr.isBlock(e,t)),!s&&_r.isRange(o)&&(o=Pr.unhangRange(e,o,{voids:c})),l&&_r.isRange(o)){if(Gn.isCollapsed(o)&&Pr.leaf(e,o.anchor)[0].text.length>0)return;var d=Pr.rangeRef(e,o,{affinity:"inward"}),[f,p]=Gn.edges(o),h="lowest"===u?"lowest":"highest",g=Pr.isEnd(e,p,p.path);co.splitNodes(e,{at:p,match:r,mode:h,voids:c,always:!g});var v=Pr.isStart(e,f,f.path);co.splitNodes(e,{at:f,match:r,mode:h,voids:c,always:!v}),o=d.unref(),null==n.at&&co.select(e,o)}for(var[m,y]of(i||(i=(e,t)=>e!==t),Pr.nodes(e,{at:o,match:r,mode:u,voids:c}))){var b={},E={};if(0!==y.length){var w=!1;for(var C in t)if(!no.includes(C)){var D=Object.hasOwn(m,C)?m[C]:void 0,A=t[C];i(A,D)&&(w=!0,Object.hasOwn(m,C)&&(b[C]=D),a?null!=A&&(E[C]=a(D,A)):null!=A&&(E[C]=A))}w&&e.apply({type:"set_node",path:y,properties:b,newProperties:E})}}}})}(e,...n)},setNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{_n.set(e,t)})(e,...n)},setPoint:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r}=e,{edge:o="both"}=n;if(r){"start"===o&&(o=Gn.isBackward(r)?"focus":"anchor"),"end"===o&&(o=Gn.isBackward(r)?"anchor":"focus");var{anchor:i,focus:a}=r,s="anchor"===o?i:a;co.setSelection(e,{["anchor"===o?"anchor":"focus"]:Po(Po({},s),t)})}}(e,...n)},setSelection:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e,r={},o={};if(n){for(var i in t)ro.includes(i)||_o(i,Object.hasOwn(n,i)?n[i]:void 0,t[i])&&(r[i]=n[i],o[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}})(e,...n)},splitNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ho(e,...n)},start:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Pr.point(e,t,{edge:"start"}))(e,...n)},string:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,o=Pr.range(e,t),[i,a]=Gn.edges(o),s="";for(var[u,l]of Pr.nodes(e,{at:o,match:Qn.isText,voids:r})){var c=u.text;jn.equals(l,a.path)&&(c=c.slice(0,a.offset)),jn.equals(l,i.path)&&(c=c.slice(i.offset)),s+=c}return s}(e,...n)},unhangRange:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,[o,i]=Gn.edges(t);if(0!==o.offset||0!==i.offset||Gn.isCollapsed(t)||jn.hasPrevious(i.path))return t;var a=Pr.above(e,{at:i,match:t=>Qn.isElement(t)&&Pr.isBlock(e,t),voids:r}),s=a?a[1]:[],u={anchor:Pr.start(e,o),focus:i},l=!0;for(var[c,d]of Pr.nodes(e,{at:u,match:Qn.isText,reverse:!0,voids:r}))if(l)l=!1;else if(""!==c.text||jn.isBefore(d,s)){i={path:d,offset:c.text.length};break}return{anchor:o,focus:i}}(e,...n)},unsetNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var o of t)r[o]=null;co.setNodes(e,r,n)}(e,...n)},unwrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var{mode:n="lowest",split:r=!1,voids:o=!1}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=_r.isPath(i)?sr(e,i):t=>Qn.isElement(t)&&Pr.isBlock(e,t)),_r.isPath(i)&&(i=Pr.range(e,i));var s=_r.isRange(i)?Pr.rangeRef(e,i):null,u=Pr.nodes(e,{at:i,match:a,mode:n,voids:o}),l=Array.from(u,t=>{var[,n]=t;return Pr.pathRef(e,n)}).reverse(),c=function(){var t=d.unref(),[n]=Pr.node(e,t),i=Pr.range(e,t);r&&s&&(i=Gn.intersection(s.current,i)),co.liftNodes(e,{at:i,match:e=>!Qn.isText(n)&&n.children.includes(e),voids:o})};for(var d of l)c();s&&s.unref()}})}(e,...n)},void:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Pr.above(e,Ao(Ao({},t),{},{match:t=>Qn.isElement(t)&&Pr.isVoid(e,t)}))}(e,...n)},withoutNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Pr.isNormalizing(e);Pr.setNormalizing(e,!1);try{t()}finally{Pr.setNormalizing(e,n)}Pr.normalize(e)})(e,...n)},wrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pr.withoutNormalizing(e,()=>{var{mode:r="lowest",split:o=!1,voids:i=!1}=n,{match:a,at:s=e.selection}=n;if(s){if(null==a&&(a=_r.isPath(s)?sr(e,s):e.isInline(t)?t=>Qn.isElement(t)&&Pr.isInline(e,t)||Qn.isText(t):t=>Qn.isElement(t)&&Pr.isBlock(e,t)),o&&_r.isRange(s)){var[u,l]=Gn.edges(s),c=Pr.rangeRef(e,s,{affinity:"inward"}),d=t=>{var n=Pr.above(e,{at:t,match:t=>Qn.isElement(t)&&Pr.isBlock(e,t)});return n&&Pr.isEdge(e,t,n[1])};co.splitNodes(e,{at:l,match:a,voids:i,always:!d(l)}),co.splitNodes(e,{at:u,match:a,voids:i,always:!d(u)}),s=c.unref(),null==n.at&&co.select(e,s)}var f=Array.from(Pr.nodes(e,{at:s,match:e.isInline(t)?t=>Qn.isElement(t)&&Pr.isBlock(e,t):e=>Qn.isEditor(e),mode:"lowest",voids:i})),p=function(){var n=_r.isRange(s)?Gn.intersection(s,Pr.range(e,h)):s;if(!n)return 0;var o=Array.from(Pr.nodes(e,{at:n,match:a,mode:r,voids:i}));if(o.length>0){var[u]=o,l=o[o.length-1],[,c]=u,[,d]=l;if(0===c.length&&0===d.length)return 0;var f=jn.equals(c,d)?jn.parent(c):jn.common(c,d),p=Pr.range(e,c,d),g=Pr.node(e,f),[v]=g,m=f.length+1,y=jn.next(d.slice(0,m)),b=$o($o({},t),{},{children:[]});co.insertNodes(e,b,{at:y,voids:i}),co.moveNodes(e,{at:p,match:e=>!Qn.isText(v)&&v.children.includes(e),to:y.concat(0),voids:i})}};for(var[,h]of f)p()}})}(e,...n)},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var[r,o]=t,[i,a]=n;return Qn.isElement(r)&&Pr.isEmpty(e,r)||Qn.isText(r)&&""===r.text&&0!==o[o.length-1]})(e,...n)}};return e},Wo={exports:{}};var Go=(Uo||(Uo=1,function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Boolean]",a="[object Date]",s="[object Function]",u="[object GeneratorFunction]",l="[object Map]",c="[object Number]",d="[object Object]",f="[object Promise]",p="[object RegExp]",g="[object Set]",v="[object String]",m="[object Symbol]",y="[object WeakMap]",b="[object ArrayBuffer]",E="[object DataView]",w="[object Float32Array]",C="[object Float64Array]",D="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",x="[object Uint8Array]",N="[object Uint8ClampedArray]",B="[object Uint16Array]",O="[object Uint32Array]",T=/\w*$/,k=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,I={};I[o]=I["[object Array]"]=I[b]=I[E]=I[i]=I[a]=I[w]=I[C]=I[D]=I[A]=I[S]=I[l]=I[c]=I[d]=I[p]=I[g]=I[v]=I[m]=I[x]=I[N]=I[B]=I[O]=!0,I["[object Error]"]=I[s]=I[y]=!1;var P="object"==typeof h&&h&&h.Object===Object&&h,_="object"==typeof self&&self&&self.Object===Object&&self,R=P||_||Function("return this")(),L=t&&!t.nodeType&&t,M=L&&e&&!e.nodeType&&e,j=M&&M.exports===L;function H(e,t){return e.set(t[0],t[1]),e}function z(e,t){return e.add(t),e}function $(e,t,n,r){for(var o=-1,i=e?e.length:0;++o<i;)n=t(n,e[o],o,e);return n}function U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function W(e,t){return function(n){return e(t(n))}}function G(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var q,K=Array.prototype,Y=Function.prototype,X=Object.prototype,Z=R["__core-js_shared__"],J=(q=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"",Q=Y.toString,ee=X.hasOwnProperty,te=X.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=j?R.Buffer:void 0,oe=R.Symbol,ie=R.Uint8Array,ae=W(Object.getPrototypeOf,Object),se=Object.create,ue=X.propertyIsEnumerable,le=K.splice,ce=Object.getOwnPropertySymbols,de=re?re.isBuffer:void 0,fe=W(Object.keys,Object),pe=Me(R,"DataView"),he=Me(R,"Map"),ge=Me(R,"Promise"),ve=Me(R,"Set"),me=Me(R,"WeakMap"),ye=Me(Object,"create"),be=Ue(pe),Ee=Ue(he),we=Ue(ge),Ce=Ue(ve),De=Ue(me),Ae=oe?oe.prototype:void 0,Se=Ae?Ae.valueOf:void 0;function xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ne(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Be(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){this.__data__=new Ne(e)}function Te(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ge(e)}(e)&&ee.call(e,"callee")&&(!ue.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!ee.call(e,a)||i&&("length"==a||ze(a,r))||n.push(a);return n}function ke(e,t,n){var r=e[t];ee.call(e,t)&&Ve(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Fe(e,t){for(var n=e.length;n--;)if(Ve(e[n][0],t))return n;return-1}function Ie(e,t,n,r,f,h,y){var k;if(r&&(k=h?r(e,f,h,y):r(e)),void 0!==k)return k;if(!Ye(e))return e;var F=We(e);if(F){if(k=function(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!t)return function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,k)}else{var P=He(e),_=P==s||P==u;if(qe(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(P==d||P==o||_&&!h){if(U(e))return h?e:{};if(k=function(e){return"function"!=typeof e.constructor||$e(e)?{}:Ye(t=ae(e))?se(t):{};var t}(_?{}:e),!t)return function(e,t){return Re(e,je(e),t)}(e,function(e,t){return e&&Re(t,Xe(t),e)}(k,e))}else{if(!I[P])return h?e:{};k=function(e,t,n,r){var o,s=e.constructor;switch(t){case b:return _e(e);case i:case a:return new s(+e);case E:return function(e,t){var n=t?_e(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case w:case C:case D:case A:case S:case x:case N:case B:case O:return function(e,t){var n=t?_e(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case l:return function(e,t,n){var r=t?n(V(e),!0):V(e);return $(r,H,new e.constructor)}(e,r,n);case c:case v:return new s(e);case p:return function(e){var t=new e.constructor(e.source,T.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return function(e,t,n){var r=t?n(G(e),!0):G(e);return $(r,z,new e.constructor)}(e,r,n);case m:return o=e,Se?Object(Se.call(o)):{}}}(e,P,Ie,t)}}y||(y=new Oe);var R=y.get(e);if(R)return R;if(y.set(e,k),!F)var L=n?function(e){return function(e,t,n){var r=t(e);return We(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Xe,je)}(e):Xe(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(L||e,function(o,i){L&&(o=e[i=o]),ke(k,i,Ie(o,t,n,r,i,e,y))}),k}function Pe(e){return!(!Ye(e)||(t=e,J&&J in t))&&(Ke(e)||U(e)?ne:k).test(Ue(e));var t}function _e(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Re(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o];ke(n,a,e[a])}return n}function Le(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Me(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Pe(n)?n:void 0}xe.prototype.clear=function(){this.__data__=ye?ye(null):{}},xe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},xe.prototype.get=function(e){var t=this.__data__;if(ye){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},xe.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:ee.call(t,e)},xe.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?n:t,this},Ne.prototype.clear=function(){this.__data__=[]},Ne.prototype.delete=function(e){var t=this.__data__,n=Fe(t,e);return!(n<0||(n==t.length-1?t.pop():le.call(t,n,1),0))},Ne.prototype.get=function(e){var t=this.__data__,n=Fe(t,e);return n<0?void 0:t[n][1]},Ne.prototype.has=function(e){return Fe(this.__data__,e)>-1},Ne.prototype.set=function(e,t){var n=this.__data__,r=Fe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Be.prototype.clear=function(){this.__data__={hash:new xe,map:new(he||Ne),string:new xe}},Be.prototype.delete=function(e){return Le(this,e).delete(e)},Be.prototype.get=function(e){return Le(this,e).get(e)},Be.prototype.has=function(e){return Le(this,e).has(e)},Be.prototype.set=function(e,t){return Le(this,e).set(e,t),this},Oe.prototype.clear=function(){this.__data__=new Ne},Oe.prototype.delete=function(e){return this.__data__.delete(e)},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ne){var r=n.__data__;if(!he||r.length<199)return r.push([e,t]),this;n=this.__data__=new Be(r)}return n.set(e,t),this};var je=ce?W(ce,Object):function(){return[]},He=function(e){return te.call(e)};function ze(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||F.test(e))&&e>-1&&e%1==0&&e<t}function $e(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||X)}function Ue(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ve(e,t){return e===t||e!=e&&t!=t}(pe&&He(new pe(new ArrayBuffer(1)))!=E||he&&He(new he)!=l||ge&&He(ge.resolve())!=f||ve&&He(new ve)!=g||me&&He(new me)!=y)&&(He=function(e){var t=te.call(e),n=t==d?e.constructor:void 0,r=n?Ue(n):void 0;if(r)switch(r){case be:return E;case Ee:return l;case we:return f;case Ce:return g;case De:return y}return t});var We=Array.isArray;function Ge(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Ke(e)}var qe=de||function(){return!1};function Ke(e){var t=Ye(e)?te.call(e):"";return t==s||t==u}function Ye(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Xe(e){return Ge(e)?Te(e):function(e){if(!$e(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Ie(e,!0,!0)}}(Wo,Wo.exports)),Wo.exports),qo=g(Go),Ko=new Set(["base","embed","math","meta","object","script","svg"]),Yo=new Set(["href","poster","src","xlink:href"]),Xo=["java","script:"].join("");function Zo(e,t,n){var r=function(e){return Array.from(e).filter(function(e){return e>" "}).join("").toLowerCase()}(n);return!r||!r.startsWith(Xo)&&!r.startsWith("vbscript:")&&(!r.startsWith("data:")||"href"!==t&&"xlink:href"!==t&&(("img"===e||"poster"===t)&&r.startsWith("data:image/")))}function Jo(e){if(void 0===e&&(e=""),!e)return"";var t=document.createElement("div");t.innerHTML=e;var n=function(e){Array.from(e.childNodes).forEach(function(e){if(e instanceof Element){var t=e,r=t.tagName.toLowerCase();if("template"===r){var o=t,i=Jo(o.innerHTML);return i?(o.insertAdjacentHTML("beforebegin",i),void o.remove()):void o.remove()}Ko.has(r)?t.remove():(Array.from(t.attributes).forEach(function(e){var n=e.name.toLowerCase(),o=e.value||"";("srcdoc"===n||n.startsWith("on")||Yo.has(n)&&!Zo(r,n,o))&&t.removeAttribute(e.name)}),n(t))}})};return n(t),t.innerHTML}var Qo={};var ei="created",ti="destroyed",ni="change",ri="scroll",oi="fullscreen",ii="unFullScreen",ai="modalOrPanelShow",si="modalOrPanelHide",ui={};function li(e,t){var n=e.key,r=e.factory,o=e.config,i=s(s({},o),t||{});if(null!=ui[n])throw new Error("Duplicated key '".concat(n,"' in menu items"));ui[n]=r,function(e,t){null!=t&&(Qo[e]=t)}(n,i)}var ci=new WeakMap,di=new WeakMap,fi=new WeakMap,pi=new WeakMap,hi=new WeakMap,gi=new WeakMap,vi=new WeakMap,mi=new WeakMap,yi=new WeakMap,bi=new WeakMap,Ei=new WeakMap,wi=new WeakMap,Ci=new WeakMap,Di=new WeakMap,Ai=new WeakMap,Si=new WeakMap,xi=new WeakMap,Ni=new WeakMap,Bi=new WeakMap,Oi=new WeakMap,Ti=new WeakMap,ki=new WeakMap,Fi=new WeakMap,Ii=new WeakMap,Pi=new WeakMap,_i=new WeakMap,Ri=new WeakMap,Li=new WeakMap,Mi=new WeakMap,ji=function(e){var t=e;return t.getAllMenuKeys=function(){var e=[];for(var t in ui)e.push(t);return e},t.getConfig=function(){var e=bi.get(t);if(null==e)throw new Error("Can not get editor config");return e},t.getMenuConfig=function(e){var n=t.getConfig().MENU_CONF;return(void 0===n?{}:n)[e]||{}},t.alert=function(e,n){void 0===n&&(n="info");var r=t.getConfig().customAlert;r&&r(e,n)},t},Hi=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function zi(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function $i(e={},t={}){Object.keys(t).forEach(n=>{void 0===e[n]?e[n]=t[n]:zi(t[n])&&zi(e[n])&&Object.keys(t[n]).length>0&&$i(e[n],t[n])})}const Ui={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Vi(){const e="undefined"!=typeof document?document:{};return $i(e,Ui),e}const Wi={document:Ui,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function Gi(){const e="undefined"!=typeof window?window:{};return $i(e,Wi),e}class qi extends Array{constructor(e){"number"==typeof e?super(e):(super(...e||[]),function(e){const t=e.__proto__;Object.defineProperty(e,"__proto__",{get:()=>t,set(e){t.__proto__=e}})}(this))}}function Ki(e=[]){const t=[];return e.forEach(e=>{Array.isArray(e)?t.push(...Ki(e)):t.push(e)}),t}function Yi(e,t){return Array.prototype.filter.call(e,t)}function Xi(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Zi(e,t){const n=Gi(),r=Vi();let o=[];if(!t&&e instanceof qi)return e;if(!e)return new qi(o);if("string"==typeof e){const n=e.trim();if(n.indexOf("<")>=0&&n.indexOf(">")>=0){let e="div";0===n.indexOf("<li")&&(e="ul"),0===n.indexOf("<tr")&&(e="tbody"),0!==n.indexOf("<td")&&0!==n.indexOf("<th")||(e="tr"),0===n.indexOf("<tbody")&&(e="table"),0===n.indexOf("<option")&&(e="select");const t=r.createElement(e);t.innerHTML=n;for(let e=0;e<t.childNodes.length;e+=1)o.push(t.childNodes[e])}else o=function(e,t){if("string"!=typeof e)return[e];const n=[],r=t.querySelectorAll(e);for(let e=0;e<r.length;e+=1)n.push(r[e]);return n}(e.trim(),t||r)}else if(e.nodeType||e===n||e===r)o.push(e);else if(Array.isArray(e)){if(e instanceof qi)return e;o=e}return new qi(function(e){const t=[];for(let n=0;n<e.length;n+=1)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(o))}function Ji(...e){const t=Ki(e.map(e=>e.split(" ")));return this.forEach(e=>{e.classList.add(...t)}),this}function Qi(...e){const t=Ki(e.map(e=>e.split(" ")));return this.forEach(e=>{e.classList.remove(...t)}),this}function ea(...e){const t=Ki(e.map(e=>e.split(" ")));return Yi(this,e=>t.filter(t=>e.classList.contains(t)).length>0).length>0}function ta(e,t){if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(let n=0;n<this.length;n+=1)if(2===arguments.length)this[n].setAttribute(e,t);else for(const t in e)this[n][t]=e[t],this[n].setAttribute(t,e[t]);return this}function na(e){for(let t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this}function ra(e,t){let n;if(void 0===t){if(n=this[0],!n)return;if(n.dom7ElementDataStorage&&e in n.dom7ElementDataStorage)return n.dom7ElementDataStorage[e];const t=n.getAttribute(`data-${e}`);return t||void 0}for(let r=0;r<this.length;r+=1)n=this[r],n.dom7ElementDataStorage||(n.dom7ElementDataStorage={}),n.dom7ElementDataStorage[e]=t;return this}function oa(){const e=this[0];if(!e)return;const t={};if(e.dataset)for(const n in e.dataset)t[n]=e.dataset[n];else for(let n=0;n<e.attributes.length;n+=1){const r=e.attributes[n];r.name.indexOf("data-")>=0&&(t[Xi(r.name.split("data-")[1])]=r.value)}for(const e in t)"false"===t[e]?t[e]=!1:"true"===t[e]?t[e]=!0:parseFloat(t[e])===1*t[e]&&(t[e]*=1);return t}function ia(e){if(void 0===e){const e=this[0];if(!e)return;if(e.multiple&&"select"===e.nodeName.toLowerCase()){const t=[];for(let n=0;n<e.selectedOptions.length;n+=1)t.push(e.selectedOptions[n].value);return t}return e.value}for(let t=0;t<this.length;t+=1){const n=this[t];if(Array.isArray(e)&&n.multiple&&"select"===n.nodeName.toLowerCase())for(let t=0;t<n.options.length;t+=1)n.options[t].selected=e.indexOf(n.options[t].value)>=0;else n.value=e}return this}function aa(...e){let[t,n,r,o]=e;function i(e){const t=e.target;if(!t)return;const o=e.target.dom7EventData||[];if(o.indexOf(e)<0&&o.unshift(e),Zi(t).is(n))r.apply(t,o);else{const e=Zi(t).parents();for(let t=0;t<e.length;t+=1)Zi(e[t]).is(n)&&r.apply(e[t],o)}}function a(e){const t=e&&e.target&&e.target.dom7EventData||[];t.indexOf(e)<0&&t.unshift(e),r.apply(this,t)}"function"==typeof e[1]&&([t,r,o]=e,n=void 0),o||(o=!1);const s=t.split(" ");let u;for(let e=0;e<this.length;e+=1){const t=this[e];if(n)for(u=0;u<s.length;u+=1){const e=s[u];t.dom7LiveListeners||(t.dom7LiveListeners={}),t.dom7LiveListeners[e]||(t.dom7LiveListeners[e]=[]),t.dom7LiveListeners[e].push({listener:r,proxyListener:i}),t.addEventListener(e,i,o)}else for(u=0;u<s.length;u+=1){const e=s[u];t.dom7Listeners||(t.dom7Listeners={}),t.dom7Listeners[e]||(t.dom7Listeners[e]=[]),t.dom7Listeners[e].push({listener:r,proxyListener:a}),t.addEventListener(e,a,o)}}return this}function sa(...e){let[t,n,r,o]=e;"function"==typeof e[1]&&([t,r,o]=e,n=void 0),o||(o=!1);const i=t.split(" ");for(let e=0;e<i.length;e+=1){const t=i[e];for(let e=0;e<this.length;e+=1){const i=this[e];let a;if(!n&&i.dom7Listeners?a=i.dom7Listeners[t]:n&&i.dom7LiveListeners&&(a=i.dom7LiveListeners[t]),a&&a.length)for(let e=a.length-1;e>=0;e-=1){const n=a[e];r&&n.listener===r||r&&n.listener&&n.listener.dom7proxy&&n.listener.dom7proxy===r?(i.removeEventListener(t,n.proxyListener,o),a.splice(e,1)):r||(i.removeEventListener(t,n.proxyListener,o),a.splice(e,1))}}}return this}function ua(){const e=Gi();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}function la(){const e=Gi();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null}function ca(){if(this.length>0){const e=Gi(),t=Vi(),n=this[0],r=n.getBoundingClientRect(),o=t.body,i=n.clientTop||o.clientTop||0,a=n.clientLeft||o.clientLeft||0,s=n===e?e.scrollY:n.scrollTop,u=n===e?e.scrollX:n.scrollLeft;return{top:r.top+s-i,left:r.left+u-a}}return null}function da(){for(let e=0;e<this.length;e+=1)this[e].style.display="none";return this}function fa(){const e=Gi();for(let t=0;t<this.length;t+=1){const n=this[t];"none"===n.style.display&&(n.style.display=""),"none"===e.getComputedStyle(n,null).getPropertyValue("display")&&(n.style.display="block")}return this}function pa(e,t){const n=Gi();let r;if(1===arguments.length){if("string"!=typeof e){for(r=0;r<this.length;r+=1)for(const t in e)this[r].style[t]=e[t];return this}if(this[0])return n.getComputedStyle(this[0],null).getPropertyValue(e)}if(2===arguments.length&&"string"==typeof e){for(r=0;r<this.length;r+=1)this[r].style[e]=t;return this}return this}function ha(e){return e?(this.forEach((t,n)=>{e.apply(t,[t,n])}),this):this}function ga(e){return Zi(Yi(this,e))}function va(e){if(void 0===e)return this[0]?this[0].innerHTML:null;for(let t=0;t<this.length;t+=1)this[t].innerHTML=e;return this}function ma(e){if(void 0===e)return this[0]?this[0].textContent.trim():null;for(let t=0;t<this.length;t+=1)this[t].textContent=e;return this}function ya(e){const t=Gi(),n=Vi(),r=this[0];let o,i;if(!r||void 0===e)return!1;if("string"==typeof e){if(r.matches)return r.matches(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);for(o=Zi(e),i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}if(e===n)return r===n;if(e===t)return r===t;if(e.nodeType||e instanceof qi){for(o=e.nodeType?[e]:e,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function ba(...e){let t;const n=Vi();for(let r=0;r<e.length;r+=1){t=e[r];for(let e=0;e<this.length;e+=1)if("string"==typeof t){const r=n.createElement("div");for(r.innerHTML=t;r.firstChild;)this[e].appendChild(r.firstChild)}else if(t instanceof qi)for(let n=0;n<t.length;n+=1)this[e].appendChild(t[n]);else this[e].appendChild(t)}return this}function Ea(e){const t=Vi();let n,r;for(n=0;n<this.length;n+=1)if("string"==typeof e){const o=t.createElement("div");for(o.innerHTML=e,r=o.childNodes.length-1;r>=0;r-=1)this[n].insertBefore(o.childNodes[r],this[n].childNodes[0])}else if(e instanceof qi)for(r=0;r<e.length;r+=1)this[n].insertBefore(e[r],this[n].childNodes[0]);else this[n].insertBefore(e,this[n].childNodes[0]);return this}function wa(e){const t=[];for(let n=0;n<this.length;n+=1)null!==this[n].parentNode&&(e?Zi(this[n].parentNode).is(e)&&t.push(this[n].parentNode):t.push(this[n].parentNode));return Zi(t)}function Ca(e){const t=[];for(let n=0;n<this.length;n+=1){let r=this[n].parentNode;for(;r;)e?Zi(r).is(e)&&t.push(r):t.push(r),r=r.parentNode}return Zi(t)}function Da(e){const t=[];for(let n=0;n<this.length;n+=1){const r=this[n].querySelectorAll(e);for(let e=0;e<r.length;e+=1)t.push(r[e])}return Zi(t)}function Aa(e){const t=[];for(let n=0;n<this.length;n+=1){const r=this[n].children;for(let n=0;n<r.length;n+=1)e&&!Zi(r[n]).is(e)||t.push(r[n])}return Zi(t)}function Sa(){for(let e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this}function xa(){for(let e=0;e<this.length;e+=1){const t=this[e];if(1===t.nodeType){for(let e=0;e<t.childNodes.length;e+=1)t.childNodes[e].parentNode&&t.childNodes[e].parentNode.removeChild(t.childNodes[e]);t.textContent=""}}return this}Zi.fn=qi.prototype;const Na="resize scroll".split(" ");function Ba(e){return function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)Na.indexOf(e)<0&&(e in this[t]?this[t][e]():Zi(this[t]).trigger(e));return this}return this.on(e,...t)}}const Oa=Ba("click"),Ta=Ba("focus"),ka=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Fa,Ia=globalThis.Node;pa&&(Zi.fn.css=pa),ba&&(Zi.fn.append=ba),Ji&&(Zi.fn.addClass=Ji),Qi&&(Zi.fn.removeClass=Qi),ea&&(Zi.fn.hasClass=ea),aa&&(Zi.fn.on=aa),Ta&&(Zi.fn.focus=Ta),ta&&(Zi.fn.attr=ta),na&&(Zi.fn.removeAttr=na),da&&(Zi.fn.hide=da),fa&&(Zi.fn.show=fa),ca&&(Zi.fn.offset=ca),ua&&(Zi.fn.width=ua),la&&(Zi.fn.height=la),wa&&(Zi.fn.parent=wa),Ca&&(Zi.fn.parents=Ca),ya&&(Zi.fn.is=ya),oa&&(Zi.fn.dataset=oa),ia&&(Zi.fn.val=ia),ma&&(Zi.fn.text=ma),va&&(Zi.fn.html=va),Aa&&(Zi.fn.children=Aa),Sa&&(Zi.fn.remove=Sa),Da&&(Zi.fn.find=Da),ha&&(Zi.fn.each=ha),xa&&(Zi.fn.empty=xa),function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(Fa||(Fa={}));var Pa=/\[object HTML([A-Z][a-z]*)*Element\]/,_a=function(e){return Pa.test(An(e))},Ra=function(e){return null!=e&&"number"==typeof e.nodeType},La=function(e){return Ra(e)&&e.nodeType===Fa.COMMENT_NODE},Ma=function(e){return Ra(e)&&e.nodeType===Fa.ELEMENT_NODE},ja=function(e){return"[object Selection]"===An(e)},Ha=function(e){return Ra(e)&&e.nodeType===Fa.TEXT_NODE},za=function(e,t,n){for(var r=e.childNodes,o=r[t],i=t,a=!1,s=!1;(La(o)||Ma(o)&&0===o.childNodes.length||Ma(o)&&"false"===o.getAttribute("contenteditable"))&&(!a||!s);)i>=r.length?(a=!0,i=t-1,n="backward"):i<0?(s=!0,i=t+1,n="forward"):(o=r[i],t=i,i+="forward"===n?1:-1);return[o,t]},$a=function(e,t,n){return d(za(e,t,n),1)[0]},Ua=function(e){var t,n,r="";if(Ha(e)&&e.nodeValue)return e.nodeValue;if(Ma(e)){try{for(var o=c(Array.from(e.childNodes)),i=o.next();!i.done;i=o.next()){var a=i.value;r+=Ua(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}var s=getComputedStyle(e).getPropertyValue("display");"block"!==s&&"list"!==s&&"table-row"!==s&&"BR"!==e.tagName||(r+="\n")}return r};function Va(e,t){if(!_a(e)||"true"!==e.dataset.slateVoid)for(var n=e.childNodes,r=n.length;r-=1;){var o=n[r],i=o.nodeType;Ha(o)?t(o,e):[Fa.ELEMENT_NODE,Fa.DOCUMENT_NODE,Fa.DOCUMENT_FRAGMENT_NODE].includes(i)&&Va(o,t)}}function Wa(e){if(0===e.length)return"";var t=e[0];return t.nodeType!==Fa.ELEMENT_NODE?"":t.tagName.toLowerCase()}var Ga=new RegExp(String.fromCharCode(160),"g");function qa(e){return e.replace(Ga," ")}var Ka=["span","b","strong","i","em","s","strike","u","font","sub","sup"],Ya=[];var Xa=[];var Za,Ja,Qa={};function es(e,t){var n=e.length;if(n){var r=e[n-1];if(Wr.isText(r)){var o=Object.keys(r);if(1===o.length&&"text"===o[0])return r.text+=t,!0}}return!1}function ts(e,t,n){return{type:"paragraph",children:[{text:Zi(e).text().replace(/\s+/gm," ")}]}}function ns(e,t){var n=function(e,t){var n=[];if(null!=e.attr("data-w-e-is-void"))return n;var r=e[0].childNodes;return 1===r.length&&"BR"===r[0].nodeName?(n.push({text:""}),n):(r.forEach(function(e){if(Ma(e)){if("BR"===e.nodeName)return void(es(n,"\n")||n.push({text:"\n"}));var r=us(Zi(e),t);Array.isArray(r)?r.forEach(function(e){return n.push(e)}):n.push(r)}else if(Ha(e)){var o=e.textContent||"";if(""===o.trim()&&o.indexOf("\n")>=0)return;o&&(o=qa(o),es(n,o)||n.push({text:o}))}}),n)}(e,t),r=function(e){for(var t in Qa)if(e[0].matches(t))return Qa[t];return ts}(e),o=r(e[0],n,t);return Array.isArray(o)||(o=[o]),o.forEach(function(r){Pr.isVoid(t,r)||(0===n.length&&(r.children=[{text:e.text().replace(/\s+/gm," ")}]),Xa.forEach(function(n){r=n(e[0],r,t)}))}),o}function rs(e,t){0===e.parents("pre").length&&(e[0].innerHTML=e[0].innerHTML.replace(/[\r\n\t]+/g,"").replace(/<br>/g,"\n"));var n=e[0].textContent||"",r={text:n=qa(n=Dn(n))};return Xa.forEach(function(n){r=n(e[0],r,t)}),r}function os(e,t){var n={text:""};return Xa.forEach(function(r){n=r(e[0],n,t)}),n}function is(e,t){var n=t.parentElement;return null==n?e:(null==n.closest("pre")&&(e=e.replace(/[\r\n\t]+/g,"")),e=qa(e=Dn(e)))}function as(e,t){var n=s(s({},e),t);return Object.keys(t).forEach(function(e){!1===t[e]&&delete n[e]}),n}function ss(e,t,n){var r=e[0];if(Ma(r)){var o=us(e,n),i=s({},t);return delete i.text,Array.isArray(o)?o.map(function(e){return as(i,e)}):[as(i,o)]}return La(r)?null:[as(t,Ha(r)?{text:is(r.textContent||"",r)}:rs(e,n))]}function us(e,t){Ya.forEach(function(t){var n=t.selector,r=t.preParseHtml;e[0].matches(n)&&(e=Zi(r(e[0])))});var n=Wa(e);if("span"===n){if(e.attr("data-w-e-type"))return ns(e,t);if((o=Array.from(e[0].childNodes)).some(function(e){return!Ha(e)&&!La(e)})){var r=os(Zi(e[0]),t);return o.flatMap(function(e){return ss(Zi(e),r,t)||[]})}return rs(e,t)}if("code"===n)return"pre"===Wa(e.parent())?ns(e,t):rs(e,t);if(Ka.includes(n)){var o;if((o=Array.from(e[0].childNodes)).some(function(e){return!Ha(e)&&!La(e)})){var i=os(Zi(e[0]),t);return o.flatMap(function(e){return ss(Zi(e),i,t)||[]})}return rs(e,t)}return ns(e,t)}function ls(e,t,n){var r=Zi(n);return!!r.attr(t)||(r.attr(t,"true"),e.on(ti,function(){r.removeAttr(t)}),!1)}function cs(e,t){void 0===t&&(t="");var n=[],r=e.getConfig().sanitizeHtml;""===t&&(t="<p><br></p>"),0!==t.indexOf("<")&&(t=t.split(/\n/).map(function(e){return"<p>".concat(e,"</p>")}).join("")),t=r?r(t):t;var o=Zi("<div>".concat(t,"</div>"));return Array.from(o.children()).forEach(function(t){var r=us(Zi(t),e);Array.isArray(r)?r.forEach(function(e){return n.push(e)}):n.push(r)}),n}function ds(e,t){return"w-e-element-".concat(e,"-").concat(t)}var fs=function(){if(Ja)return Za;Ja=1;var e=9007199254740991,t="[object Arguments]",n="[object Map]",r="[object Promise]",o="[object Set]",i="[object WeakMap]",a="[object DataView]",s=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l="\\ud800-\\udfff",c="\\u0300-\\u036f\\ufe20-\\ufe23",d="\\u20d0-\\u20f0",f="\\ufe0e\\ufe0f",p="["+l+"]",g="["+c+d+"]",v="\\ud83c[\\udffb-\\udfff]",m="[^"+l+"]",y="(?:\\ud83c[\\udde6-\\uddff]){2}",b="[\\ud800-\\udbff][\\udc00-\\udfff]",E="\\u200d",w="(?:"+g+"|"+v+")"+"?",C="["+f+"]?",D=C+w+("(?:"+E+"(?:"+[m,y,b].join("|")+")"+C+w+")*"),A="(?:"+[m+g+"?",g,y,b,p].join("|")+")",S=RegExp(v+"(?="+v+")|"+A+D,"g"),x=RegExp("["+E+l+c+d+f+"]"),N="object"==typeof h&&h&&h.Object===Object&&h,B="object"==typeof self&&self&&self.Object===Object&&self,O=N||B||Function("return this")();function T(e,t){return function(e,t){for(var n=-1,r=e?e.length:0,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(t,function(t){return e[t]})}function k(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function F(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function I(e){return function(e){return x.test(e)}(e)?function(e){return e.match(S)||[]}(e):function(e){return e.split("")}(e)}var P,_,R,L=Function.prototype,M=Object.prototype,j=O["__core-js_shared__"],H=(P=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"",z=L.toString,$=M.hasOwnProperty,U=M.toString,V=RegExp("^"+z.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=O.Symbol,G=W?W.iterator:void 0,q=M.propertyIsEnumerable,K=(_=Object.keys,R=Object,function(e){return _(R(e))}),Y=ue(O,"DataView"),X=ue(O,"Map"),Z=ue(O,"Promise"),J=ue(O,"Set"),Q=ue(O,"WeakMap"),ee=de(Y),te=de(X),ne=de(Z),re=de(J),oe=de(Q);function ie(e,n){var r=fe(e)||function(e){return function(e){return ve(e)&&pe(e)}(e)&&$.call(e,"callee")&&(!q.call(e,"callee")||U.call(e)==t)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=r.length,i=!!o;for(var a in e)!$.call(e,a)||i&&("length"==a||ce(a,o))||r.push(a);return r}function ae(e){if(!ge(e)||function(e){return!!H&&H in e}(e))return!1;var t=he(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?V:s;return t.test(de(e))}function se(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||M,t!==r)return K(e);var t,n,r,o=[];for(var i in Object(e))$.call(e,i)&&"constructor"!=i&&o.push(i);return o}function ue(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ae(n)?n:void 0}var le=function(e){return U.call(e)};function ce(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<n}function de(e){if(null!=e){try{return z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(Y&&le(new Y(new ArrayBuffer(1)))!=a||X&&le(new X)!=n||Z&&le(Z.resolve())!=r||J&&le(new J)!=o||Q&&le(new Q)!=i)&&(le=function(e){var t=U.call(e),s="[object Object]"==t?e.constructor:void 0,u=s?de(s):void 0;if(u)switch(u){case ee:return a;case te:return n;case ne:return r;case re:return o;case oe:return i}return t});var fe=Array.isArray;function pe(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!he(t)}function he(e){var t=ge(e)?U.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ve(e){return!!e&&"object"==typeof e}function me(e){return e?T(e,function(e){return pe(e)?ie(e):se(e)}(e)):[]}return Za=function(e){if(!e)return[];if(pe(e))return function(e){return"string"==typeof e||!fe(e)&&ve(e)&&"[object String]"==U.call(e)}(e)?I(e):function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e);if(G&&e[G])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[G]());var t=le(e);return(t==n?k:t==o?F:me)(e)},Za}(),ps=g(fs),hs=0,gs=function(){this.id="".concat(hs),hs+=1},vs="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),ms="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ys="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bs="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),Es="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),ws="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent),Cs=!Es&&!bs&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,Ds=function(e,t){return Boolean(e.compareDocumentPosition(t)&Ia.DOCUMENT_POSITION_PRECEDING)},As=function(e,t){return Boolean(e.compareDocumentPosition(t)&Ia.DOCUMENT_POSITION_FOLLOWING)},Ss={getWindow:function(e){var t=Fi.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},findKey:function(e,t){var n=ki.get(t);return n||(n=new gs,ki.set(t,n)),n},setNewKey:function(e){var t=new gs;ki.set(e,t)},findPath:function(e,t){for(var n=[],r=t;;){var o=xi.get(r);if(null==o){if(Pr.isEditor(r))return n;break}var i=Si.get(r);if(null==i)break;n.unshift(i),r=o}throw new Error("Unable to find the path for Slate node: ".concat(JSON.stringify(t)))},findDocumentOrShadowRoot:function(e){if(e.isDestroyed)return window.document;var t=Ss.toDOMNode(e,e),n=t.getRootNode();return"[object HTMLDocument]"!==An(n)&&!function(e){return"[object ShadowRoot]"===An(e)}(n)||null==Reflect.get(n,"getSelection")?t.ownerDocument:n},getParentNode:function(e,t){return xi.get(t)||null},getParentsNodes:function(e,t){for(var n=[],r=t;r!==e&&null!=r;){var o=Ss.getParentNode(e,r);if(null==o)break;n.push(o),r=o}return n},getTopNode:function(e,t){var n=[Ss.findPath(e,t)[0]];return Qn.get(e,n)},toDOMNode:function(e,t){var n;if(Pr.isEditor(t))n=Ni.get(e);else{var r=Ss.findKey(e,t);n=Oi.get(r)}if(!n)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(JSON.stringify(t)));return n},hasDOMNodeBySlateNode:function(e,t){if(Pr.isEditor(t))return!!Ni.get(e);var n=Ss.findKey(e,t);return!!Oi.get(n)},canResolveDOMRange:function(e,t){try{var n=d(Pr.node(e,t.anchor.path),1)[0],r=d(Gn.isCollapsed(t)?[n]:Pr.node(e,t.focus.path),1)[0];return Ss.hasDOMNodeBySlateNode(e,n)&&Ss.hasDOMNodeBySlateNode(e,r)}catch(e){return!1}},hasDOMNode:function(e,t,n){void 0===n&&(n={});var r,o=n.editable,i=void 0!==o&&o,a=Ss.toDOMNode(e,e);try{r=Ma(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes('Permission denied to access property "nodeType"'))throw e}return!!r&&(r.closest("[data-slate-editor]")===a&&(!i||r.isContentEditable||r.closest('[contenteditable="false"]')===a||!!r.getAttribute("data-slate-zero-width"))||!!r.getAttribute("data-slate-string"))},toDOMRange:function(e,t){var n=t.anchor,r=t.focus,o=Gn.isBackward(t),i=Ss.toDOMPoint(e,n),a=Gn.isCollapsed(t)?i:Ss.toDOMPoint(e,r),s=Ss.getWindow(e).document.createRange(),u=d(o?a:i,2),l=u[0],c=u[1],f=d(o?i:a,2),p=f[0],h=f[1],g=!!(Ma(l)?l:l.parentElement).getAttribute("data-slate-zero-width"),v=!!(Ma(p)?p:p.parentElement).getAttribute("data-slate-zero-width");return s.setStart(l,g?1:c),s.setEnd(p,v?1:h),s},toDOMPoint:function(e,t){var n,r,o,i=d(Pr.node(e,t.path),1)[0],a=Ss.toDOMNode(e,i);Pr.void(e,{at:t})&&(t={path:t.path,offset:0});var s=Array.from(a.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),u=0;try{for(var l=c(s),f=l.next();!f.done;f=l.next()){var p=f.value,h=p.childNodes[0];if(null!=h&&null!=h.textContent){var g=h.textContent.length,v=p.getAttribute("data-slate-length"),m=u+(null==v?g:parseInt(v,10));if(t.offset<=m){o=[h,Math.min(g,Math.max(0,t.offset-u))];break}u=m}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}if(!o)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(JSON.stringify(t)));return o},toSlateNode:function(e,t){var n=Ma(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Bi.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},findEventRange:function(e,t){"nativeEvent"in t&&(t=t.nativeEvent);var n=t.clientX,r=t.clientY,o=t.target;if(null==n||null==r)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var i,a=Ss.toSlateNode(e,t.target),s=Ss.findPath(e,a);if(Kn.isElement(a)&&Pr.isVoid(e,a)){var u=o.getBoundingClientRect(),l=e.isInline(a)?n-u.left<u.left+u.width-n:r-u.top<u.top+u.height-r,c=Pr.point(e,s,{edge:l?"start":"end"}),d=l?Pr.before(e,c):Pr.after(e,c);if(d)return Pr.range(e,d)}var f=this.getWindow(e).document;if(f.caretRangeFromPoint)i=f.caretRangeFromPoint(n,r);else{var p=f.caretPositionFromPoint(n,r);p&&((i=f.createRange()).setStart(p.offsetNode,p.offset),i.setEnd(p.offsetNode,p.offset))}if(!i)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));return Ss.toSlateRange(e,i,{exactMatch:!1,suppressThrow:!1})},toSlateRange:function(e,t,n){var r,o,i,a,s,u=n.exactMatch,l=n.suppressThrow;if((ja(t)?t.anchorNode:t.startContainer)&&(ja(t)?(r=t.anchorNode,o=t.anchorOffset,i=t.focusNode,a=t.focusOffset,s=ws&&window.document.activeElement&&window.document.activeElement.shadowRoot?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed):(r=t.startContainer,o=t.startOffset,i=t.endContainer,a=t.endOffset,s=t.collapsed)),null==r||null==i||null==o||null==a)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));var c=Ss.toSlatePoint(e,[r,o],{exactMatch:u,suppressThrow:l});if(!c)return null;var d=s?c:Ss.toSlatePoint(e,[i,a],{exactMatch:u,suppressThrow:l,searchDirection:Ds(r,i)||r===i&&a<o?"forward":"backward"});if(!d)return null;var f={anchor:c,focus:d};return Gn.isExpanded(f)&&Gn.isForward(f)&&Ma(i)&&Pr.void(e,{at:f.focus,mode:"highest"})&&(f=Pr.unhangRange(e,f,{voids:!0})),f},toSlatePoint:function(e,t,n){var r,o,i,a=n.exactMatch,s=n.suppressThrow,u=d(a?t:function(e){var t,n=d(e,2),r=n[0],o=n[1];if(Ma(r)&&r.childNodes.length){var i=o===r.childNodes.length,a=i?o-1:o;for(r=(t=d(za(r,a,i?"backward":"forward"),2))[0],i=(a=t[1])<o;Ma(r)&&r.childNodes.length;){var s=i?r.childNodes.length-1:0;r=$a(r,s,i?"backward":"forward")}o=i&&null!=r.textContent?r.textContent.length:0}return[r,o]}(t),2),l=u[0],p=u[1],h=l.parentNode,g=n.searchDirection,v=null,m=0;if(h){var y=Ss.toDOMNode(e,e),b=h.closest('[data-slate-void="true"]'),E=b&&y.contains(b)?b:null,w=h.closest('[contenteditable="false"]'),C=w&&y.contains(w)?w:null,D=h.closest("[data-slate-leaf]"),A=null,S=Ss.getWindow(e);if(D&&S.document.createRange){v=D.closest('[data-slate-node="text"]');var x=S.document.createRange();x.setStart(v,0),x.setEnd(l,p);var N=x.cloneContents();f(f([],d(ps(N.querySelectorAll("[data-slate-zero-width]"))),!1),d(ps(N.querySelectorAll("[contenteditable=false]"))),!1).forEach(function(e){e.parentNode.removeChild(e)}),m=N.textContent.length,A=v}else if(E)D=Array.from(E.querySelectorAll("[data-slate-leaf]")).find(function(t){return Ss.hasDOMNode(e,t)})||null,D?(v=D.closest('[data-slate-node="text"]'),m=(A=D).textContent.length,A.querySelectorAll("[data-slate-zero-width]").forEach(function(e){m-=e.textContent.length})):m=1;else if(C){var B=Boolean(C.closest("[data-w-e-reserve]"));!g&&B&&(g="forward");var O=g,T=function(t){return t?Array.from(t.querySelectorAll("[data-slate-leaf]")).filter(function(t){return Ss.hasDOMNode(e,t)}):[]},k=C.closest('[data-slate-node="element"]');if("backward"===g||!g)for(var F=(P=f(f([],d(T(null==k?void 0:k.previousElementSibling)),!1),d(T(k)),!1)).length-1;F>=0;F-=1){var I=P[F];if(Ds(C,I)){D=I,g="backward";break}}if(!D&&("forward"===g||!g||B)){var P=f(f([],d(T(k)),!1),d(T(null==k?void 0:k.nextElementSibling)),!1);try{for(var _=c(P),R=_.next();!R.done;R=_.next()){I=R.value;if(As(C,I)){D=I,O="backward"===g&&B?"backward":"forward";break}}}catch(e){r={error:e}}finally{try{R&&!R.done&&(o=_.return)&&o.call(_)}finally{if(r)throw r.error}}}D&&(v=D.closest('[data-slate-node="text"]'),A=D,"forward"===O?m=0:(m=A.textContent.length,A.querySelectorAll("[data-slate-zero-width]").forEach(function(e){m-=e.textContent.length})))}A&&m===A.textContent.length&&(h.hasAttribute("data-slate-zero-width")||ms&&(null===(i=A.textContent)||void 0===i?void 0:i.endsWith("\n")))&&(m-=1)}if(!v){if(s)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var L,M=Ss.toSlateNode(e,v);try{L=Ss.findPath(e,M)}catch(e){if(s)return null;throw e}return{path:L,offset:m}},hasRange:function(e,t){var n=t.anchor,r=t.focus;return Pr.hasPath(e,n.path)&&Pr.hasPath(e,r.path)},getNodeType:function(e){return Kn.isElement(e)?e.type:""},checkNodeType:function(e,t){return this.getNodeType(e)===t},getNodesStr:function(e){return e.map(function(e){return Qn.string(e)}).join("")},getSelectedElems:function(e){var t,n,r=[],o=Pr.nodes(e,{universal:!0});try{for(var i=c(o),a=i.next();!a.done;a=i.next()){var s=d(a.value,1)[0];Kn.isElement(s)&&r.push(s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},getSelectedNodeByType:function(e,t){var n=this,r=d(Pr.nodes(e,{match:function(e){return n.checkNodeType(e,t)},universal:!0}),1),o=r[0];return null==o?null:o[0]},getSelectedTextNode:function(e){var t=d(Pr.nodes(e,{match:function(e){return Wr.isText(e)},universal:!0}),1),n=t[0];return null==n?null:n[0]},isNodeSelected:function(e,t){var n=d(Pr.nodes(e,{match:function(e){return e===t},universal:!0}),1),r=n[0];return null!=r&&d(r,1)[0]===t},isSelectionAtLineEnd:function(e,t){var n=e.selection;return!!n&&(Pr.isEnd(e,n.anchor,t)||Pr.isEnd(e,n.focus,t))},getTextarea:function(e){var t=ci.get(e);if(null==t)throw new Error("Cannot find textarea instance by editor");return t},getToolbar:function(e){return pi.get(e)||null},getHoverbar:function(e){return gi.get(e)||null},normalizeContent:function(e){e.children.forEach(function(t,n){e.normalizeNode([t,[n]])})},getLeftLengthOfMaxLength:function(e){var t=e.getConfig(),n=t.maxLength,r=t.onMaxLength;if("number"!=typeof n||n<=0)return 1/0;var o=n-e.getText().replace(/\r|\n|(\r\n)|(\n\r)/g,"").length;return o<=0&&r&&r(e),o},cleanExposedTexNodeInSelectionBlock:function(e){var t,n,r,o,i=Ss.getTextarea(e).$textArea,a=null==i?void 0:i[0].childNodes;if(a)try{for(var s=c(Array.from(a)),u=s.next();!u.done;u=s.next()){var l=u.value;if(!Ha(l))break;l.remove()}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}var d=Pr.nodes(e,{match:function(t){return!(!Kn.isElement(t)||e.isInline(t))},universal:!0});try{for(var f=c(d),p=f.next();!p.done;p=f.next()){var h=p.value;if(null!=h){var g=h[0];if(!Ss.hasDOMNodeBySlateNode(e,g))continue;Va(Ss.toDOMNode(e,g),function(e,t){var n=Zi(t);n.attr("data-slate-string")||n.attr("data-slate-zero-width")||n.attr("data-w-e-reserve")||t.removeChild(e)})}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}},isLastNode:function(e,t){var n=e.children||[];return n[n.length-1]===t},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(e){var t,n,r=Pr.nodes(e,{match:function(t){return e.isVoid(t)}}),o=0;try{for(var i=c(r),a=i.next();!a.done;a=i.next()){a.value&&(o+=1)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o>0},isSelectedEmptyParagraph:function(e){var t=e.selection;if(null==t)return!1;if(Gn.isExpanded(t))return!1;var n=Ss.getSelectedNodeByType(e,"paragraph");if(null===n)return!1;var r=n.children;return 1===r.length&&(""===r[0].text||void 0)},isEmptyPath:function(e,t){var n=Pr.node(e,t);if(null==n)return!1;var r=d(n,1)[0].children;if(1===r.length&&""===r[0].text)return!0;return!1}},xs=[];var Ns={};function Bs(e,t,n){var r=n.isInline(e)?"span":"div";return"<".concat(r,">").concat(t,"</").concat(r,">")}var Os="data-w-e-id",Ts=/^[A-Za-z_:-][A-Za-z0-9_:.-]*$/;function ks(e,t,n,r){if(!r.includeId)return e;var o=function(e){return e&&Ts.test(e)?e:Os}(r.idKey),i=Ss.findKey(n,t);return function(e,t,n){if(!e)return e;var r=e.match(/^<([A-Za-z][A-Za-z0-9-]*)([^>]*)>/);if(!r)return e;var o=d(r,3),i=o[0],a=o[1],s=o[2],u=void 0===s?"":s;if(new RegExp("\\s".concat(t,"=")).test(u))return e;var l=/\/\s*$/.test(u),c=u.replace(/\s*\/\s*$/,""),f=c.trim()?" ".concat(c.trim()):"",p=l?" /":"";return"<".concat(a).concat(f," ").concat(t,'="').concat(n,'"').concat(p,">")+e.slice(i.length)}(e,o,ds(Ss.getNodeType(t),i.id))}function Fs(e,t,n){void 0===n&&(n={});var r=e.type,o=void 0===r?"":r,i=e.children,a=void 0===i?[]:i,s=Pr.isVoid(t,e),u="";s||(u=a.map(function(e){return Is(e,t,n)}).join(""));var l=function(e){return Ns[e]||Bs}(o),c=l(e,u,t),d="";if(d="string"==typeof c?c:c.html||"",s||xs.forEach(function(n){return d=n(e,d,t)}),d=ks(d,e,t,n),"string"==typeof c)return d;var f=c.prefix,p=void 0===f?"":f,h=c.suffix,g=void 0===h?"":h;return p&&(d=p+d),g&&(d+=g),d}function Is(e,t,n){return void 0===n&&(n={}),Kn.isElement(e)?Fs(e,t,n):function(e,t){var n=e.text;if(null==n)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=n;r=function(e){return e.replace(/ {2}/g," &nbsp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/®/g,"&reg;").replace(/©/g,"&copy;").replace(/™/g,"&trade;")}(r);var o=Ss.getParentsNodes(t,e).some(function(e){return"pre"===Ss.getNodeType(e)});if(o||(r=r.replace(/\n\r|\r\n|\r|\n/g,"<br>")),o&&(r=r.replace(/&nbsp;/g," ")),""===r){var i=Ss.getParentNode(null,e);if(!i||0!==i.children.length)return r;r="<br>"}return xs.forEach(function(n){return r=n(e,r,t)}),r}(e,t)}var Ps=function(e,t){var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},_s=function(e,t,n){var r=Ss.toDOMRange(e,t).getBoundingClientRect(),o=Ss.toDOMRange(e,n).getBoundingClientRect();return Ps(r,o)&&Ps(o,r)},Rs=function(e,t){var n,r,o=[];try{for(var i=c(Pr.levels(e,{at:t})),a=i.next();!a.done;a=i.next()){var s=d(a.value,2),u=s[0],l=s[1],f=Ss.findKey(e,u);o.push([l,f])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o};var Ls,Ms,js,Hs,zs,$s,Us,Vs,Ws,Gs,qs,Ks,Ys,Xs,Zs,Js,Qs,eu,tu,nu,ru,ou,iu,au,su,uu,lu,cu,du,fu,pu,hu,gu,vu,mu,yu,bu,Eu,wu,Cu,Du=function(e){var t=e,n=t.onChange,r=t.insertText,o=t.apply,i=t.deleteBackward,a=t.deleteFragment;return t.insertText=function(e){t.getConfig().readOnly||r(e)},t.apply=function(e){var n,r,i,a,s,u,l,p,h=[];switch(e.type){case"insert_text":case"remove_text":case"set_node":case"split_node":h.push.apply(h,f([],d(Rs(t,e.path)),!1));break;case"insert_node":case"remove_node":h.push.apply(h,f([],d(Rs(t,jn.parent(e.path))),!1));break;case"merge_node":var g=jn.previous(e.path);h.push.apply(h,f([],d(Rs(t,g)),!1));break;case"move_node":var v=jn.common(jn.parent(e.path),jn.parent(e.newPath));h.push.apply(h,f([],d(Rs(t,v)),!1));break;case"set_selection":(null===(a=null===(i=e.newProperties)||void 0===i?void 0:i.focus)||void 0===a?void 0:a.path)&&(h.push.apply(h,f([],d(Rs(t,null===(u=null===(s=e.newProperties)||void 0===s?void 0:s.focus)||void 0===u?void 0:u.path)),!1)),h.push.apply(h,f([],d(Rs(t,null===(p=null===(l=e.properties)||void 0===l?void 0:l.focus)||void 0===p?void 0:p.path)),!1)))}o(e);try{for(var m=c(h),y=m.next();!y.done;y=m.next()){var b=d(y.value,2),E=b[0],w=b[1],C=d(Pr.node(t,E),1)[0];ki.set(C,w),"type"in C&&(Di.has(C)&&Di.delete(C),Ai.has(C)&&Ai.delete(C))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}},t.deleteBackward=function(n){if("line"!==n)return i(n);if(e.selection&&Gn.isCollapsed(e.selection)){var r=Pr.above(e,{match:function(t){return Kn.isElement(t)&&Pr.isBlock(e,t)},at:e.selection});if(r){var o=d(r,2)[1],a=Pr.range(e,o,e.selection.anchor),s=function(e,t){var n=Pr.range(e,Gn.end(t)),r=Array.from(Pr.positions(e,{at:t})),o=0,i=r.length,a=Math.floor(i/2);if(_s(e,Pr.range(e,r[o]),n))return Pr.range(e,r[o],n);if(r.length<2)return Pr.range(e,r[r.length-1],n);for(;a!==r.length&&a!==o;)_s(e,Pr.range(e,r[a]),n)?i=a:o=a,a=Math.floor((o+i)/2);return Pr.range(e,r[i],n)}(t,a);Gn.isCollapsed(s)||co.delete(e,{at:s})}}},t.deleteFragment=function(e){var n=function(e){var t=e.selection;if(null==t||Gn.isCollapsed(t))return!1;var n=d(Gn.edges(t),2),r=n[0],o=n[1],i=d(Pr.edges(e,[]),2),a=i[0],s=i[1];return Mr.equals(r,a)&&Mr.equals(o,s)}(t);a(e),n&&(!function(e){var t=[{type:"paragraph",children:[{text:""}]}];Pr.withoutNormalizing(e,function(){for(var n=e.children.length-1;n>=0;n-=1)co.removeNodes(e,{at:[n]});co.insertNodes(e,t,{at:[0]})})}(t),t.children.length>0&&co.select(t,Pr.start(t,[])))},t.onChange=function(){var e=t.selection;null!=e&&Pi.set(t,e),t.emit(ni),n()},t.handleTab=function(){t.insertText(" ")},t.getHtml=function(){var e=t.children,n=void 0===e?[]:e,r=t.getConfig().skipCacheTypes,o=void 0===r?["list-item"]:r;return n.map(function(e){var n=Ss.getNodeType(e);if(o.includes(n))return Is(e,t);var r=Ai.get(e);if(r)return r;var i=Is(e,t);return Ai.set(e,i),i}).join("")},t.getHtmlWithId=function(e){void 0===e&&(e="data-w-e-id");var n=t.children;return(void 0===n?[]:n).map(function(n){return Is(n,t,{includeId:!0,idKey:e})}).join("")},t.getText=function(){var e=t.children;return(void 0===e?[]:e).map(function(e){return Qn.string(e)}).join("\n")},t.getSelectionText=function(){var n=t.selection;return null==n?"":Pr.string(e,n)},t.getElemsByType=function(e,n){var r,o;void 0===n&&(n=!1);var i=[],a=Pr.nodes(t,{at:[],universal:!0});try{for(var u=c(a),l=u.next();!l.done;l=u.next()){var f=d(l.value,1)[0];if(Kn.isElement(f))if(n?f.type.indexOf(e)>=0:f.type===e){var p=Ss.findKey(t,f),h=ds(f.type,p.id);i.push(s(s({},f),{id:h}))}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return i},t.getElemsByTypePrefix=function(e){return t.getElemsByType(e,!0)},t.isEmpty=function(){var e=t.children,n=void 0===e?[]:e;if(n.length>1)return!1;var r=n[0];if(null==r)return!0;if(!Kn.isElement(r)||"paragraph"!==r.type)return!1;var o=r.children,i=void 0===o?[]:o;if(i.length>1)return!1;var a=i[0];return null==a||Wr.isText(a)&&""===a.text},t.clear=function(){for(var e=t.children.length-1;e>=0;e-=1)co.removeNodes(t,{at:[e]});0!==t.children.length?function(e){var t=e.children[0];if(1===e.children.length&&Kn.isElement(t)&&("paragraph"!==t.type||""!==Qn.string(t))&&""===Qn.string(t)){var n=[{type:"paragraph",children:[{text:""}]}];Pr.withoutNormalizing(e,function(){co.removeNodes(e,{at:[0]}),co.insertNodes(e,n,{at:[0]})})}}(t):co.insertNodes(t,[{type:"paragraph",children:[{text:""}]}])},t.getParentNode=function(e){return Ss.getParentNode(t,e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e){var r=document.createElement("div");r.innerHTML=e;var o=Array.from(r.childNodes);if(o=o.filter(function(e){var t=e.nodeName;return!!Ha(e)||!!Ma(e)&&!Hi.has(t.toLowerCase())}),0!==o.length){var i=t.selection;if(null!=i){var a=null;if(Ss.isSelectedEmptyParagraph(t)&&!n)a=[i.focus.path[0]];r.setAttribute("hidden","true"),document.body.appendChild(r);var s=0;o.forEach(function(e,n){var r=e.nodeName,i=e.textContent,a=void 0===i?"":i;if(Ha(e)){if(!a||!a.trim())return;t.insertNode({text:a})}else if("BR"!==r){var u=e,l=!1;if(Ka.includes(r.toLowerCase()))l=!0;else for(var c in Qa)if(u.matches(c)){l=!0;break}if(l){var f=us(Zi(u),t),p=Array.isArray(f)?f:[f];if(p.forEach(function(e){return function(e,t){e.isInline(t)?(e.insertNode(t),"link"===t.type&&e.insertFragment([{text:""}])):co.insertNodes(e,t,{mode:"highest"})}(t,e)}),s+=p.length,Ss.isSelectedVoidNode(t)&&t.move(1),p.some(function(e){return!!Kn.isElement(e)&&(!!t.isInline(e)||e.children.some(function(e){return Kn.isElement(e)&&t.isInline(e)}))})&&t.selection){var h=Pr.nodes(t,{at:t.selection,match:function(e){return Kn.isElement(e)&&t.isInline(e)},universal:!0}),g=h.next().value;if(g){var v=d(g,2)[1],m=jn.next(v);Pr.hasPath(t,m)?co.select(t,{anchor:{path:m,offset:0},focus:{path:m,offset:0}}):t.move(1)}}}else{var y=window.getComputedStyle(u).display;if(!Ss.isSelectedEmptyParagraph(t)&&y.indexOf("inline")<0){if(n>=1)(function(e){return"matches"in e&&/^[ou]l$/i.test(e.tagName)&&!e.hasAttribute("data-w-e-type")})(o[n-1])&&t.insertBreak();t.insertBreak()}t.dangerouslyInsertHtml(u.innerHTML,!0)}}else t.insertText("\n")}),s&&a&&Ss.isEmptyPath(t,a)&&co.removeNodes(t,{at:a}),r.remove()}}}},t.setHtml=function(e){void 0===e&&(e="");var n=t.isDisabled(),r=t.isFocused(),o=JSON.stringify(t.selection);t.enable(),Pi.delete(t),t.focus(),t.clear();var i=cs(t,null==e?"":e);if(co.insertFragment(t,i),r||(t.deselect(),t.blur()),n&&(t.deselect(),t.disable()),t.isFocused())try{var a=JSON.parse(o);Gn.isRange(a)&&Ss.hasRange(t,a)?t.select(a):t.select(Pr.start(t,[]))}catch(e){t.select(Pr.start(t,[]))}},t},Au=1,Su=function(e){var t=e;return t.id="wangEditor-".concat(Au),Au+=1,t.isDestroyed=!1,t.isFullScreen=!1,t.focus=function(e){if(Ss.toDOMNode(t,t).focus({preventScroll:!0}),Ii.set(t,!0),e){var n=Pr.end(t,[]);co.select(t,n)}else{var r=Pi.get(t);r?co.select(t,r):co.select(t,Pr.start(t,[]))}},t.isFocused=function(){return!!Ii.get(t)},t.blur=function(){Ss.toDOMNode(t,t).blur(),co.deselect(t),Ii.set(t,!1)},t.updateView=function(){Ss.getTextarea(t).changeViewState();var e=Ss.getToolbar(t);e&&e.changeToolbarState();var n=Ss.getHoverbar(t);n&&n.changeHoverbarState()},t.destroy=function(){if(!t.isDestroyed){var e=Ss.getTextarea(t);e.destroy(),ci.delete(t),di.delete(e);var n=Ss.getToolbar(t);n&&(n.destroy(),pi.delete(t),fi.delete(n));var r=Ss.getHoverbar(t);r&&(r.destroy(),gi.delete(t),hi.delete(r)),t.isDestroyed=!0,t.emit(ti)}},t.scrollToElem=function(e){if(!t.getConfig().scroll){var n="编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能";return n+="\nYou has disabled editor scroll, please do this yourself",void console.warn(n)}var r=Zi("#".concat(e));if(0!==r.length){var o=r[0];if(!Ss.hasDOMNode(t,o)){n="Element (found by id is '".concat(e,"') is not in editor DOM");return n+="\n 通过 id '".concat(e,"' 找到的 element 不在 editor DOM 之内"),void console.error(n,o)}var i=Ss.getTextarea(t),a=i.$textAreaContainer,s=i.$scroll,u=r.offset().top,l=a.offset().top;s[0].scrollBy({top:u-l,behavior:"smooth"})}},t.showProgressBar=function(e){e<1||Ss.getTextarea(t).changeProgress(e)},t.hidePanelOrModal=function(){var e=mi.get(t);null!=e&&e.forEach(function(e){return e.hide()})},t.enable=function(){t.getConfig().readOnly=!1,t.updateView()},t.disable=function(){t.getConfig().readOnly=!0,t.updateView()},t.isDisabled=function(){return t.getConfig().readOnly},t.toDOMNode=function(e){return Ss.toDOMNode(t,e)},t.fullScreen=function(){if(!t.isFullScreen){var e=null,n=Ss.getToolbar(t);n&&(e=n.$box);var r=Ss.getTextarea(t).$box.parent();if(e&&e.parent()[0]!==r[0]){throw new Error("Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent\n不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致")}r.addClass("w-e-full-screen-container");var o=r.css("z-index");r.attr("data-z-index",o.toString()),t.isFullScreen=!0,t.emit(oi)}},t.unFullScreen=function(){if(t.isFullScreen){var e=Ss.getTextarea(t).$box.parent();setTimeout(function(){e.removeClass("w-e-full-screen-container"),t.isFullScreen=!1,t.emit(ii)},200)}},t.getEditableContainer=function(){return Ss.getTextarea(t).$textAreaContainer[0]},t},xu={exports:{}},Nu={exports:{}};function Bu(){if(Ms)return Ls;Ms=1;return Ls=function(e){return null!=e}}function Ou(){if($s)return zs;$s=1;var e=function(){if(Hs)return js;Hs=1;var e=Bu(),t={object:!0,function:!0,undefined:!0};return js=function(n){return!!e(n)&&hasOwnProperty.call(t,typeof n)}}();return zs=function(t){if(!e(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(e){return!1}}}function Tu(){if(Gs)return Ws;Gs=1;var e=function(){if(Vs)return Us;Vs=1;var e=Ou();return Us=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(e){return!1}return!e(t)}}(),t=/^\s*class[\s{/}]/,n=Function.prototype.toString;return Ws=function(r){return!!e(r)&&!t.test(n.call(r))}}function ku(){if(eu)return Qs;eu=1;var e=(Js?Zs:(Js=1,Zs=function(){}))();return Qs=function(t){return t!==e&&null!==t},Qs}function Fu(){return ou||(ou=1,ru=(Xs?Ys:(Xs=1,Ys=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}))()?Object.keys:function(){if(nu)return tu;nu=1;var e=ku(),t=Object.keys;return tu=function(n){return t(e(n)?Object(n):n)}}()),ru}function Iu(){if(uu)return su;uu=1;var e=Fu(),t=function(){if(au)return iu;au=1;var e=ku();return iu=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t}}(),n=Math.max;return su=function(r,o){var i,a,s,u=n(arguments.length,2);for(r=Object(t(r)),s=function(e){try{r[e]=o[e]}catch(e){i||(i=e)}},a=1;a<u;++a)e(o=arguments[a]).forEach(s);if(void 0!==i)throw i;return r},su}function Pu(){return cu?lu:(cu=1,lu=(Ks||(Ks=1,qs=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}),qs)()?Object.assign:Iu())}function _u(){return yu||(yu=1,mu=function(){if(hu)return pu;hu=1;var e="razdwatrzy";return pu=function(){return"function"==typeof e.contains&&!0===e.contains("dwa")&&!1===e.contains("foo")}}()()?String.prototype.contains:function(){if(vu)return gu;vu=1;var e=String.prototype.indexOf;return gu=function(t){return e.call(this,t,arguments[1])>-1},gu}()),mu}function Ru(){if(bu)return Nu.exports;bu=1;var e=Bu(),t=Tu(),n=Pu(),r=function(){if(fu)return du;fu=1;var e=ku(),t=Array.prototype.forEach,n=Object.create;return du=function(r){var o=n(null);return t.call(arguments,function(t){e(t)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(t),o)}),o},du}(),o=_u(),i=Nu.exports=function(t,i){var a,s,u,l,c;return arguments.length<2||"string"!=typeof t?(l=i,i=t,t=null):l=arguments[2],e(t)?(a=o.call(t,"c"),s=o.call(t,"e"),u=o.call(t,"w")):(a=u=!0,s=!1),c={value:i,configurable:a,enumerable:s,writable:u},l?n(r(l),c):c};return i.gs=function(i,a,s){var u,l,c,d;return"string"!=typeof i?(c=s,s=a,a=i,i=null):c=arguments[3],e(a)?t(a)?e(s)?t(s)||(c=s,s=void 0):s=void 0:(c=a,a=s=void 0):a=void 0,e(i)?(u=o.call(i,"c"),l=o.call(i,"e")):(u=!0,l=!1),d={get:a,set:s,configurable:u,enumerable:l},c?n(r(c),d):d},Nu.exports}var Lu=(Cu||(Cu=1,function(e,t){var n,r,o,i,a,s,u,l=Ru(),c=wu?Eu:(wu=1,Eu=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}),d=Function.prototype.apply,f=Function.prototype.call,p=Object.create,h=Object.defineProperty,g=Object.defineProperties,v=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};n=function(e,t){var n;return c(t),v.call(this,"__ee__")?n=this.__ee__:(n=m.value=p(null),h(this,"__ee__",m),m.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},r=function(e,t){var r,i;return c(t),i=this,n.call(this,e,r=function(){o.call(i,e,r),d.call(t,this,arguments)}),r.__eeOnceListener__=t,this},o=function(e,t){var n,r,o,i;if(c(t),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},i=function(e){var t,n,r,o,i;if(v.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)d.call(r,this,i)}else switch(arguments.length){case 1:f.call(o,this);break;case 2:f.call(o,this,arguments[1]);break;case 3:f.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];d.call(o,this,i)}},a={on:n,once:r,off:o,emit:i},s={on:l(n),once:l(r),off:l(o),emit:l(i)},u=g({},s),e.exports=t=function(e){return null==e?p(u):g(Object(e),s)},t.methods=a}(xu,xu.exports)),xu.exports),Mu=g(Lu);function ju(e){var t=_i.get(e);return null==t&&(t=Mu(),_i.set(e,t)),t}var Hu=new WeakMap;function zu(e,t){var n=Hu.get(e);null==n&&(n=new Set,Hu.set(e,n)),n.add(t)}var $u=function(e){var t=e;return t.on=function(e,n){var r=ju(t);if(r.on(e,n),"destroyed"===e&&zu(t,n),"destroyed"!==e){var o=function(){return r.off(e,n)};r.on("destroyed",o),zu(t,o)}},t.once=function(e,n){ju(t).once(e,n)},t.off=function(e,n){ju(t).off(e,n)},t.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=ju(t);if(o.emit.apply(o,f([e],d(n),!1)),"destroyed"===e){var i=function(e){return Hu.get(e)||new Set}(t);i.forEach(function(e){return o.off("destroyed",e)}),function(e){Hu.set(e,new Set)}(t)}},t};var Uu=function(e){var t=e;return t.setFragmentData=function(e){var n=t.selection;if(n){var r=d(Gn.edges(n),2),o=r[0],i=r[1],a=Pr.void(t,{at:o.path}),s=Pr.void(t,{at:i.path});if(!Gn.isCollapsed(n)||a){var u=Ss.toDOMRange(t,n),l=u.cloneContents(),c=l.childNodes[0];if(l.childNodes.forEach(function(e){e.textContent&&""!==e.textContent.trim()&&(c=e)}),s){var f=d(s,1)[0],p=u.cloneRange(),h=Ss.toDOMNode(t,f);p.setEndAfter(h),l=p.cloneContents()}if(a&&(c=l.querySelector("[data-slate-spacer]")),Array.from(l.querySelectorAll("[data-slate-zero-width]")).forEach(function(e){var t="n"===e.getAttribute("data-slate-zero-width");e.textContent=t?"\n":""}),Ha(c)){var g=c.ownerDocument.createElement("span");g.style.whiteSpace="pre",g.appendChild(c),l.appendChild(g),c=g}var v=t.getFragment(),m=JSON.stringify(v),y=window.btoa(encodeURIComponent(m));c.setAttribute("data-slate-fragment",y),e.setData("application/x-slate-fragment",y);var b=l.ownerDocument.createElement("div");return b.appendChild(l),b.setAttribute("hidden","true"),l.ownerDocument.body.appendChild(b),e.setData("text/html",b.innerHTML),e.setData("text/plain",Ua(b)),l.ownerDocument.body.removeChild(b),e}}},t.insertData=function(e){var n=e.getData("application/x-slate-fragment");if(n){var r=decodeURIComponent(window.atob(n)),o=JSON.parse(r);t.insertFragment(o)}else{var i=e.getData("text/plain"),a=e.getData("text/html");if(a){var s=t.getConfig().sanitizeHtml;t.dangerouslyInsertHtml(s?s(a):a)}else if(i){if(!/[\r\n]/.test(i))return void t.insertText(i);var u=function(e){return e.replace(/\n\r|\r\n|\r/g,"\n").split("\n").map(function(e){return{type:"paragraph",children:[{text:e}]}})}(i);t.insertFragment(u)}}},t},Vu={isHistory:e=>or(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||rr.isOperationList(e.redos[0].operations))&&(0===e.undos.length||rr.isOperationList(e.undos[0].operations))},Wu=new WeakMap,Gu=new WeakMap,qu=new WeakMap,Ku={isHistoryEditor:e=>Vu.isHistory(e.history)&&Pr.isEditor(e),isMerging:e=>Gu.get(e),isSplittingOnce:e=>qu.get(e),setSplittingOnce(e,t){qu.set(e,t)},isSaving:e=>Wu.get(e),redo(e){e.redo()},undo(e){e.undo()},withMerging(e,t){var n=Ku.isMerging(e);Gu.set(e,!0),t(),Gu.set(e,n)},withNewBatch(e,t){var n=Ku.isMerging(e);Gu.set(e,!0),qu.set(e,!0),t(),Gu.set(e,n),qu.delete(e)},withoutMerging(e,t){var n=Ku.isMerging(e);Gu.set(e,!1),t(),Gu.set(e,n)},withoutSaving(e,t){var n=Ku.isSaving(e);Wu.set(e,!1);try{t()}finally{Wu.set(e,n)}}},Yu=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!jn.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!jn.equals(e.path,t.path)),Xu=(e,t)=>"set_selection"!==e.type,Zu=function(e){var t=(e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];r.selectionBefore&&co.setSelection(t,r.selectionBefore),Ku.withoutSaving(t,()=>{Pr.withoutNormalizing(t,()=>{for(var e of r.operations)t.apply(e)})}),e.redos.pop(),t.writeHistory("undos",r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];Ku.withoutSaving(t,()=>{Pr.withoutNormalizing(t,()=>{var e=r.operations.map(rr.inverse).reverse();for(var n of e)t.apply(n);r.selectionBefore&&co.setSelection(t,r.selectionBefore)})}),t.writeHistory("redos",r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:o}=t,{undos:i}=o,a=i[i.length-1],s=a&&a.operations[a.operations.length-1],u=Ku.isSaving(t),l=Ku.isMerging(t);if(null==u&&(u=Xu(e)),u){if(null==l&&(l=null!=a&&(!!r.includes(s)||Yu(e,s))),Ku.isSplittingOnce(t)&&(l=!1,Ku.setSplittingOnce(t,void 0)),a&&l)a.operations.push(e);else{var c={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",c)}for(;i.length>100;)i.shift();o.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t})(e);return t.clearHistory=function(){t.history.undos=[],t.history.redos=[]},t};function Ju(e){return e.replace(/\n\r|\r\n|\r|\n/g,"").length}function Qu(e,t){var n,r;if(t<=0)return"";var o=t,i="";try{for(var a=c(e),s=a.next();!s.done;s=a.next()){var u=s.value;if(/\r|\n/.test(u))i+=u;else{if(o<=0)break;i+=u,o-=1}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}var el=function(e){var t=e,n=t.insertText,r=t.insertNode,o=t.insertFragment,i=t.dangerouslyInsertHtml;return t.insertText=function(e){if(t.getConfig().maxLength){var r=Ss.getLeftLengthOfMaxLength(t);r<=0||(r<e.length?n(e.slice(0,r)):n(e))}else n(e)},t.insertNode=function(e){if(t.getConfig().maxLength){var n=Ss.getLeftLengthOfMaxLength(t);if(!(n<=0))n<Qn.string(e).length||r(e)}else r(e)},t.insertFragment=function(e){if(t.getConfig().maxLength){if(e.length>0){var n=e[0];if(Ss.getLeftLengthOfMaxLength(t)<Qn.string(n).length)return;o([n]);for(var r=1;r<e.length;r+=1)t.insertNode(e[r])}}else o(e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e)if(t.getConfig().maxLength){var r=Ss.getLeftLengthOfMaxLength(t);if(!(r<=0)){var o=function(e,t){if(t<=0)return"";var n=document.createElement("div");n.innerHTML=e;var r=function(e){e.forEach(function(e){return e.remove()})},o=function(e){for(var n=Array.from(e.childNodes),i=0;i<n.length;i+=1){var a=n[i];if(Ha(a)){var s=a.textContent||"",u=Ju(s);if(u<=t){t-=u;continue}return a.textContent=Qu(s,t),t=0,r(n.slice(i+1)),!1}if(Ma(a)){if(Hi.has(a.nodeName.toLowerCase())){a.remove();continue}if(!o(a))return r(n.slice(i+1)),!1}else a.remove()}return t>0};return o(n),n.innerHTML}(e,r);o&&i(o,n)}}else i(e,n)},t};function tl(e){return e<0?0:e}function nl(e){var t=Ss.getTextarea(e).$textAreaContainer,n=t.width(),r=t.height(),o=t.offset();return{top:o.top,left:o.left,width:n,height:r}}function rl(e){var t={top:"0",left:"0"},n=e.selection;if(null==n)return t;var r=nl(e);if(null==r)return t;var o=r.top,i=r.left,a=r.width,s=r.height,u=Ss.toDOMRange(e,n).getClientRects(),l=u?u[0]:null;if(null==l)return t;var c={},d=l.top-o,f=l.left-i;if(f>a/2){var p=tl(a-f);c.right="".concat(p+5,"px")}else{var h=tl(f);c.left="".concat(h+5,"px")}if(d>s/2){var g=tl(s-d);c.bottom="".concat(g+5,"px")}else{var v=u[u.length-1],m=v.top-o+v.height;m<0&&(m=0),c.top="".concat(m+5,"px")}return c}function ol(e,t,n){void 0===n&&(n="modal");var r={top:"0",left:"0"};if(null==e.selection)return r;var o=Kn.isElement(t)&&e.isVoid(t),i=Kn.isElement(t)&&e.isInline(t),a=Ti.get(t);if(null==a)return r;var s=a.getBoundingClientRect(),u=s.top,l=s.left,c=s.height,d=s.width;if(o){var f=function(e){var t=[];t.push(e);for(var n=0;t.length>0;){var r=t.pop();if(null==r)break;if((n+=1)>1e4)break;var o=r.nodeName;if(r.nodeType===Fa.ELEMENT_NODE){var i=o.toLowerCase();if(ka.includes(i)||"iframe"===i||"video"===i)return r;var a=r.children||[],s=a.length;if(s)for(var u=s-1;u>=0;u-=1)t.push(a[u])}}return null}(a);if(null!=f){var p=f.getBoundingClientRect();u=p.top,c=p.height}}var h=nl(e);if(null==h)return r;var g=h.top,v=h.left,m=h.width,y=h.height,b={},E=u-g,w=l-v;if("bar"===n){if(b.left="".concat(tl(w),"px"),E>40){var C=tl(y-E);b.bottom="".concat(C+5,"px")}else b.top="".concat(E+c+5,"px");return b}if("modal"===n){if(o)if(i)if(w>(m-d)/2){var D=tl(m-w);b.right="".concat(D+5,"px")}else{var A=tl(w+d);b.left="".concat(A+5,"px")}else b.left="20px";else b.left="".concat(tl(w),"px");if(o)(S=E)<0&&(S=0),b.top="".concat(S,"px");else if(E>(y-c)/2){C=tl(y-E);b.bottom="".concat(C+5,"px")}else{var S;(S=E+c)<0&&(S=0),b.top="".concat(S+5,"px")}return b}throw new Error("type '".concat(n,"' is invalid"))}function il(e,t){Cn(function(){var n=nl(e);if(null!=n){var r,o=n.top,i=n.left,a=n.width,s=n.height,u=t.offset(),l=u.top,c=u.left,d=t.width(),f=t.height(),p=l-o,h=c-i,g=t.attr("style");if(g.indexOf("top")>=0)if((r=p+f-s)>0){var v=t.css("top"),m=parseInt(v.toString(),10)-r;m<0&&(m=0),t.css("top","".concat(m,"px"))}if(g.indexOf("bottom")>=0&&l<0){var y=t.css("bottom"),b=parseInt(y.toString(),10)-Math.abs(l);t.css("bottom","".concat(b,"px"))}if(g.indexOf("left")>=0)if((r=h+d-a)>0){var E=t.css("left"),w=parseInt(E.toString(),10)-r;w<0&&(w=0),t.css("left","".concat(w,"px"))}if(g.indexOf("right")>=0&&c<0){var C=t.css("right"),D=parseInt(C.toString(),10)-Math.abs(c);t.css("right","".concat(D,"px"))}}})}var al,sl,ul=function(e){var t=e,n=t.select,r=t.deselect,o=t.move;return t.select=function(e){n(e)},t.deselect=function(){var e=t.selection,n=Ss.findDocumentOrShadowRoot(t).getSelection();n&&n.rangeCount>0&&Ss.hasDOMNode(t,n.anchorNode)&&Ss.hasDOMNode(t,n.focusNode)&&n.removeAllRanges(),e&&r()},t.move=function(e,t){void 0===t&&(t=!1),"number"==typeof e?e&&(e<0||o({distance:e,unit:"character",reverse:t})):o(e)},t.moveReverse=function(e){t.move(e,!0)},t.restoreSelection=function(){var e=Pi.get(t);null!=e&&(t.focus(),n(e))},t.getSelectionPosition=function(){return rl(t)},t.getNodePosition=function(e){return ol(t,e)},t.isSelectedAll=function(){var e=t.selection;if(null==e)return!1;var n=d(Gn.edges(e),2),r=n[0],o=n[1],i=d(Pr.edges(t,[]),2),a=i[0],s=i[1];return!(!Mr.equals(r,a)||!Mr.equals(o,s))},t.selectAll=function(){var e=Pr.start(t,[]),r=Pr.end(t,[]);n({anchor:e,focus:r})},t};var ll=function(){if(sl)return al;sl=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,o=parseInt,i="object"==typeof h&&h&&h.Object===Object&&h,a="object"==typeof self&&self&&self.Object===Object&&self,s=i||a||Function("return this")(),u=Object.prototype.toString,l=Math.max,c=Math.min,d=function(){return s.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function p(i){if("number"==typeof i)return i;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(i))return NaN;if(f(i)){var a="function"==typeof i.valueOf?i.valueOf():i;i=f(a)?a+"":a}if("string"!=typeof i)return 0===i?i:+i;i=i.replace(e,"");var s=n.test(i);return s||r.test(i)?o(i.slice(2),s?2:8):t.test(i)?NaN:+i}return al=function(e,t,n){var r,o,i,a,s,u,h=0,g=!1,v=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,h=t,a=e.apply(i,n)}function b(e){var n=e-u;return void 0===u||n>=t||n<0||v&&e-h>=i}function E(){var e=d();if(b(e))return w(e);s=setTimeout(E,function(e){var n=t-(e-u);return v?c(n,i-(e-h)):n}(e))}function w(e){return s=void 0,m&&r?y(e):(r=o=void 0,a)}function C(){var e=d(),n=b(e);if(r=arguments,o=this,u=e,n){if(void 0===s)return function(e){return h=e,s=setTimeout(E,t),g?y(e):a}(u);if(v)return s=setTimeout(E,t),y(u)}return void 0===s&&(s=setTimeout(E,t)),a}return t=p(t)||0,f(n)&&(g=!!n.leading,i=(v="maxWait"in n)?l(p(n.maxWait)||0,t):i,m="trailing"in n?!!n.trailing:m),C.cancel=function(){void 0!==s&&clearTimeout(s),h=0,r=u=o=s=void 0},C.flush=function(){return void 0===s?a:w(d())},C},al}(),cl=g(ll);const dl=e=>"string"==typeof e,fl=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},pl=e=>null==e?"":""+e,hl=/###/g,gl=e=>e&&e.indexOf("###")>-1?e.replace(hl,"."):e,vl=e=>!e||dl(e),ml=(e,t,n)=>{const r=dl(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(vl(e))return{};const t=gl(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return vl(e)?{}:{obj:e,k:gl(r[o])}},yl=(e,t,n)=>{const{obj:r,k:o}=ml(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],a=t.slice(0,t.length-1),s=ml(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=ml(e,a,Object),s&&s.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},bl=(e,t)=>{const{obj:n,k:r}=ml(e,t);if(n)return n[r]},El=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?dl(e[r])||e[r]instanceof String||dl(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):El(e[r],t[r],n):e[r]=t[r]);return e},wl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Cl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Dl=e=>dl(e)?e.replace(/[&<>"'\/]/g,e=>Cl[e]):e;const Al=[" ",",","?","!",";"],Sl=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),xl=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let e=0;e<r.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let a=e;a<r.length;++a)if(a!==e&&(i+=n),i+=r[a],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<r.length-1)continue;e+=a-e+1;break}o=t}return o},Nl=e=>e&&e.replace("_","-"),Bl={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Ol{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Bl,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(dl(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ol(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Ol(this.logger,e)}}var Tl=new Ol;class kl{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(e=>{let[t,r]=e;for(let e=0;e<r;e++)t(...n)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(t=>{let[r,o]=t;for(let t=0;t<o;t++)r.apply(r,[e,...n])})}}}class Fl extends kl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):dl(n)&&o?a.push(...n.split(o)):a.push(n)));const s=bl(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&i&&dl(n)?xl(this.data&&this.data[e]&&this.data[e][t],n,o):s}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),yl(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const r in n)(dl(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=bl(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?El(s,n,o):s={...s,...n},yl(this.data,a,s),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Il={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))}),t}};const Pl={};class _l extends kl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Tl.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=Al.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=Sl.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:dl(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:dl(o)?[o]:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],t),s=a[a.length-1],u=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(l){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:`${s}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:i}const c=this.resolve(e,t);let d=c&&c.res;const f=c&&c.usedKey||i,p=c&&c.exactUsedKey||i,h=Object.prototype.toString.apply(d),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,m=!dl(d)&&"boolean"!=typeof d&&"number"!=typeof d;if(!(v&&d&&m&&["[object Number]","[object Function]","[object RegExp]"].indexOf(h)<0)||dl(g)&&Array.isArray(d))if(v&&dl(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,t,n));else{let r=!1,a=!1;const l=void 0!==t.count&&!dl(t.count),f=_l.hasDefaultValue(t),p=l?this.pluralResolver.getSuffix(u,t.count,t):"",h=t.ordinal&&l?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",g=l&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),v=g&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(d)&&f&&(r=!0,d=v),this.isValidLookup(d)||(a=!0,d=i);const m=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:d,y=f&&v!==d&&this.options.updateMissing;if(a||r||y){if(this.logger.log(y?"updateKey":"missingKey",u,s,i,y?v:d),o){const e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,n,r)=>{const o=f&&r!==d?r:m;this.options.missingKeyHandler?this.options.missingKeyHandler(e,s,n,o,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,s,n,o,y,t),this.emit("missingKey",e,s,n,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&l?e.forEach(e=>{const n=this.pluralResolver.getSuffixes(e,t);g&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach(n=>{r([e],i+n,t[`defaultValue${n}`]||v)})}):r(e,i,v))}d=this.extendTranslation(d,e,t,c,n),a&&d===i&&this.options.appendNamespaceToMissingKey&&(d=`${s}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${i}`:i,r?d:void 0):this.options.parseMissingKeyHandler(d))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,d,{...t,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(o){const e=Array.isArray(d),n=e?[]:{},r=e?p:f;for(const e in d)if(Object.prototype.hasOwnProperty.call(d,e)){const i=`${r}${o}${e}`;n[e]=this.translate(i,{...t,joinArrays:!1,ns:a}),n[e]===i&&(n[e]=d[e])}d=n}}return r?(c.res=d,c.usedParams=this.getUsedParamsDetails(t),c):d}extendTranslation(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a=dl(e)&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(a){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let u=n.replace&&!dl(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,n.lng||this.language||r.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null):i.translate(...r,t)},n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,s=dl(a)?[a]:a;return null!=e&&s&&s.length&&!1!==n.applyPostProcessor&&(e=Il.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,r,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return dl(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;const s=this.extractFromKey(e,a),u=s.key;n=u;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==a.count&&!dl(a.count),d=c&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),f=void 0!==a.context&&(dl(a.context)||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);l.forEach(e=>{this.isValidLookup(t)||(i=e,!Pl[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(Pl[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(n=>{if(this.isValidLookup(t))return;o=n;const i=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(i,u,n,e,a);else{let e;c&&(e=this.pluralResolver.getSuffix(n,a.count,a));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(i.push(u+e),a.ordinal&&0===e.indexOf(r)&&i.push(u+e.replace(r,this.options.pluralSeparator)),d&&i.push(u+t)),f){const n=`${u}${this.options.contextSeparator}${a.context}`;i.push(n),c&&(i.push(n+e),a.ordinal&&0===e.indexOf(r)&&i.push(n+e.replace(r,this.options.pluralSeparator)),d&&i.push(n+t))}}let s;for(;s=i.pop();)this.isValidLookup(t)||(r=s,t=this.getResource(n,e,s,a))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!dl(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}const Rl=e=>e.charAt(0).toUpperCase()+e.slice(1);class Ll{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Tl.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Nl(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Nl(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(dl(e)&&e.indexOf("-")>-1){if("undefined"!=typeof Intl&&void 0!==Intl.getCanonicalLocales)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(e){}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Rl(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Rl(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Rl(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),dl(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return dl(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):dl(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}let Ml=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],jl={1:e=>Number(e>1),2:e=>Number(1!=e),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)};const Hl=["v1","v2","v3"],zl=["v4"],$l={zero:0,one:1,two:2,few:3,many:4,other:5};class Ul{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Tl.create("pluralResolver"),this.options.compatibilityJSON&&!zl.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const e={};return Ml.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:jl[t.fc]}})}),e})(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi()){const n=Nl("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(n){if(!e.match(/-|_/))return;const r=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(r,t)}return this.pluralRulesCache[o]=i,i}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>$l[e]-$l[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!Hl.includes(this.options.compatibilityJSON)}}const Vl=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=((e,t,n)=>{const r=bl(e,n);return void 0!==r?r:bl(t,n)})(e,t,n);return!i&&o&&dl(n)&&(i=xl(e,n,r),void 0===i&&(i=xl(t,n,r))),i},Wl=e=>e.replace(/\$/g,"$$$$");class Gl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Tl.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:u,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:m}=e.interpolation;this.escape=void 0!==t?t:Dl,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?wl(o):i||"{{",this.suffix=a?wl(a):s||"}}",this.formatSeparator=u||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=d?wl(d):f||wl("$t("),this.nestingSuffix=p?wl(p):h||wl(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(e.indexOf(this.formatSeparator)<0){const o=Vl(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(Vl(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,d=[{regex:this.regexpUnescape,safeValue:e=>Wl(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Wl(this.escape(e)):Wl(e)}];return d.forEach(t=>{for(a=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=u(n),void 0===i)if("function"==typeof l){const t=l(e,o,r);i=dl(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(c){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else dl(i)||this.useRawValueToEscape||(i=pl(i));const s=t.safeValue(i);if(e=e.replace(o[0],s),c?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];o={...i},o=o.replace&&!dl(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),s=e,u=!0}if(r=t(a.call(this,n[1].trim(),o),o),r&&n[0]===e&&!dl(r))return r;dl(r)||(r=pl(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),u&&(r=s.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const ql=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=t[a];return s||(s=e(Nl(r),o),t[a]=s),s(n)}};class Kl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Tl.create("formatter"),this.options=e,this.formats={number:ql((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:ql((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:ql((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:ql((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:ql((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ql(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class Yl extends kl{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Tl.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const o={},i={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=ml(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();dl(e)&&(e=this.languageUtils.toResolveHierarchy(e)),dl(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const s={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let o;o=5===u.length?u(e,t,n,r,s):u(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else u(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}const Xl=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),dl(e[1])&&(t.defaultValue=e[1]),dl(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Zl=e=>(dl(e.ns)&&(e.ns=[e.ns]),dl(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),dl(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Jl=()=>{};class Ql extends kl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=Zl(e),this.services={},this.logger=Tl,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(dl(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Xl();this.options={...r,...this.options,...Zl(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?Tl.init(o(this.modules.logger),this.options):Tl.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=Kl);const n=new Ll(this.options);this.store=new Fl(this.options.resources,this.options);const i=this.services;i.logger=Tl,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new Ul(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=o(t),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Gl(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Yl(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)}),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new _l(this.services,this.options),this.translator.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Jl),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});const i=fl(),a=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),i}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jl;const n=dl(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>r(e))}this.options.preload&&this.options.preload.forEach(e=>r(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,n){const r=fl();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Jl),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Il.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=fl();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=dl(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{i(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const o=function(e,t){let i;if("object"!=typeof t){for(var a=arguments.length,s=new Array(a>2?a-2:0),u=2;u<a;u++)s[u-2]=arguments[u];i=r.options.overloadTranslationOptionHandler([e,t].concat(s))}else i={...t};i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const l=r.options.keySeparator||".";let c;return c=i.keyPrefix&&Array.isArray(e)?e.map(e=>`${i.keyPrefix}${l}${e}`):i.keyPrefix?`${i.keyPrefix}${l}${e}`:e,r.t(c,i)};return dl(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=fl();return this.options.ns?(dl(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=fl();dl(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new Ll(Xl());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Ql(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jl;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new Ql(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));return["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new Fl(this.store.data,r),o.services.resourceStore=o.store),o.translator=new _l(o.services,r),o.translator.on("*",function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit(e,...n)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ec=Ql.createInstance();ec.createInstance=Ql.createInstance,ec.createInstance,ec.dir,ec.init,ec.loadResources,ec.reloadResources,ec.use,ec.changeLanguage,ec.getFixedT,ec.t,ec.exists,ec.setDefaultNamespace,ec.hasLoadedNamespace,ec.loadNamespaces,ec.loadLanguages;var tc="translation";function nc(e,t){ec.addResourceBundle(e,tc,t,!0,!0)}function rc(e){ec.changeLanguage(e)}function oc(e){return ec.getResourceBundle(e,tc)}function ic(e){return ec.on("languageChanged",e),function(){return ec.off("languageChanged",e)}}ec.init({lng:"zh-CN",resources:{}});var ac=ec.t.bind(ec);function sc(e){if(e.removeAttr){e.removeAttr("width"),e.removeAttr("height"),e.removeAttr("fill"),e.removeAttr("class"),e.removeAttr("t"),e.removeAttr("p-id");var t=e.children();t.length&&sc(t)}}function uc(){return Zi('<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>')}function lc(){return Zi('<div class="w-e-bar-divider"></div>')}var cc=function(){function e(e){this.isShow=!1,this.showTime=0,this.record(e)}return e.prototype.record=function(e){var t=mi.get(e);null==t&&(t=new Set,mi.set(e,t)),t.add(this),yi.set(this,e)},e.prototype.renderContent=function(e){var t=this.$elem;t.empty(),t.append(e);var n=this.genSelfElem();n&&t.append(n)},e.prototype.appendTo=function(e){var t=this.$elem;e.append(t)},e.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var e=yi.get(this);e&&e.emit(ai,this)}},e.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var e=yi.get(this);e&&e.emit(si)}},e}(),dc=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.type="dropPanel",t.$elem=Zi('<div class="w-e-drop-panel"></div>'),t}return a(t,e),t.prototype.genSelfElem=function(){return null},t}(cc);function fc(e,t,n,r,o){if(void 0===r&&(r=""),void 0===o&&(o=!1),t){if(r){var i=vs?"cmd":"ctrl";r=r.replace("mod",i)}if(o)r&&(e.attr("data-tooltip",r),e.addClass("w-e-menu-tooltip-v5"),e.addClass("tooltip-right"));else{var a=r?"".concat(n,"\n").concat(r):n;e.attr("data-tooltip",a),e.addClass("w-e-menu-tooltip-v5")}}}var pc=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=Zi('<div class="w-e-bar-item"></div>'),this.$button=Zi('<button type="button"></button>'),this.disabled=!1,this.menu=t;var o=t.tag,i=t.width;if("button"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'button'"));var a=t.title,s=t.hotkey,u=void 0===s?"":s,l=t.iconSvg,c=void 0===l?"":l,d=this.$button;if(c){var f=Zi(c);sc(f),d.append(f)}else d.text(a);fc(d,c,a,u,n),n&&c&&d.append(Zi('<span class="title">'.concat(a,"</span>"))),i&&d.css("width","".concat(i,"px")),d.attr("data-menu-key",e),this.$elem.append(d),Cn(function(){return r.init()})}return e.prototype.init=function(){var e=this;this.setActive(),this.setDisabled(),this.$button.on("click",function(t){t.preventDefault(),Sc(e).hidePanelOrModal(),e.disabled||(e.exec(),e.onButtonClick())})},e.prototype.exec=function(){var e=Sc(this),t=this.menu,n=t.getValue(e);t.exec(e,n),this.changeMenuState()},e.prototype.setActive=function(){var e=Sc(this),t=this.$button,n="active";this.menu.isActive(e)?t.addClass(n):t.removeClass(n)},e.prototype.setDisabled=function(){var e=Sc(this),t=this.$button,n=this.menu.isDisabled(e);(null==e.selection||e.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var r="disabled";n?t.addClass(r):t.removeClass(r),this.disabled=n},e.prototype.setIcon=function(){var e=Sc(this),t=this.$button;if(this.menu.getIcon){var n=this.menu.getIcon(e);if(n){t.find("svg").remove();var r=Zi(n);sc(r),t.append(r)}}},e.prototype.setTooltip=function(){var e=Sc(this),t=this.$button;if(this.menu.getTitle){var n=this.menu.getTitle(e),r=this.menu.iconSvg;n&&r&&fc(t,r,n)}},e.prototype.changeMenuState=function(){this.setActive(),this.setDisabled(),this.setIcon(),this.setTooltip()},e}(),hc=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var i=uc();o.$button.append(i)}return o}return a(t,e),t.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},t.prototype.handleDropPanel=function(){var e=this.menu;if(null!=e.getPanelContentElem){var t=Sc(this);if(null==this.dropPanel){var n=new dc(t),r=e.getPanelContentElem(t);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{var o=this.dropPanel;if(o.isShow)o.hide();else{r=e.getPanelContentElem(t);o.renderContent(r),o.show()}}var i=this.dropPanel;if(i.isShow){var a=this.$elem,s=a.offset().left,u=a.parents(".w-e-bar");s-u.offset().left>=u.width()/2?i.$elem.css({left:"none",right:"0"}):i.$elem.css({left:"0",right:"none"})}}},t}(pc),gc=function(){function e(e){this.$elem=Zi('<div class="w-e-bar-item w-e-bar-item-group"></div>'),this.$container=Zi('<div class="w-e-bar-item-menus-container"></div>'),this.$button=Zi('<button type="button"></button>');var t=e.key,n=e.iconSvg,r=e.title,o=this.$elem,i=this.$button;if(n){var a=Zi(n);sc(a),i.append(a)}else i.text(r);i.attr("data-menu-key",t);var s=uc();i.append(s),o.append(i);var u=this.$container;o.append(u);var l=this.createObserver();this.observe(l)}return e.prototype.appendBarItem=function(e){var t=e.$elem;this.$container.append(t)},e.prototype.observe=function(e){var t=this.$container;e.observe(t[0],{childList:!0,subtree:!0,attributes:!0})},e.prototype.createObserver=function(){var e=this,t=this.$container,n=this.$button,r=new MutationObserver(function(){var o=t.find("button"),i=o.length;if(0!==i){var a=0;o.each(function(e){Zi(e).hasClass("disabled")&&(a+=1)}),r.disconnect(),a===i?n.addClass("disabled"):n.removeClass("disabled"),e.observe(r)}});return r},e}(),vc=function(e){function t(t,n){void 0===n&&(n=0);var r=e.call(this,t)||this;r.type="modal",r.$elem=Zi('<div class="w-e-modal"></div>'),r.width=0,n&&(r.width=n);var o=r.$elem;return o.on("click",function(e){return e.stopPropagation()}),o.on("keyup",function(e){"Escape"===e.code&&(r.hide(),t.restoreSelection())}),r}return a(t,e),t.prototype.genSelfElem=function(){var e=this,t=Zi('<span class="btn-close">'.concat('<svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg>',"</span>")),n=yi.get(this);return t.on("click",function(){e.hide(),null==n||n.restoreSelection()}),t},t.prototype.setStyle=function(e){var t=this.width,n=this.$elem;n.attr("style",""),t&&n.css("width","".concat(t,"px")),n.css(e)},t}(cc);function mc(e,t,n){var r=Zi('<label class="babel-container"></label>');r.append("<span>".concat(e,"</span>"));var o=Zi('<input type="text" id="'.concat(t,'" placeholder="').concat(n||"",'">'));return r.append(o),[r[0],o[0]]}function yc(e,t,n){var r=Zi('<label class="babel-container"></label>');r.append("<span>".concat(e,"</span>"));var o=Zi('<textarea type="text" id="'.concat(t,'" placeholder="').concat(n||"",'"></textarea>'));return r.append(o),[r[0],o[0]]}function bc(e,t){var n=Zi('<div class="button-container"></div>'),r=Zi('<button type="button" id="'.concat(e,'">').concat(t,"</button>"));return n.append(r),[n[0],r[0]]}var Ec=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;return o.$body=Zi("body"),o.modal=null,o.menu=n,o}return a(t,e),t.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},t.prototype.getPosition=function(){var e=Sc(this),t=this.menu.getModalPositionNode(e);return Kn.isElement(t)?ol(e,t,"modal"):rl(e)},t.prototype.handleModal=function(){var e=Sc(this),t=this.menu;if(null==this.modal){var n=new vc(e,t.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else{(n=this.modal).isShow?n.hide():this.renderAndShowModal(n,!1)}},t.prototype.renderAndShowModal=function(e,t){void 0===t&&(t=!1);var n=Sc(this),r=this.menu;if(null!=r.getModalContentElem){var o=Ss.getTextarea(n),i=Ss.getToolbar(n),a=((null==i?void 0:i.getConfig())||{}).modalAppendToBody,s=r.getModalContentElem(n);if(e.renderContent(s),a)e.setStyle({left:"0",right:"0"});else{var u=this.getPosition();e.setStyle(u)}t&&(a?e.appendTo(this.$body):e.appendTo(o.$textAreaContainer)),e.show(),a||il(n,e.$elem),setTimeout(function(){n.blur()})}},t}(pc);var wc=function(e){function t(t,n){var r=e.call(this,t)||this;return r.type="selectList",r.$elem=Zi('<div class="w-e-select-list"></div>'),n&&r.$elem.css("width","".concat(n,"px")),r.$elem.on("click",function(e){e.stopPropagation()}),r}return a(t,e),t.prototype.renderList=function(e){var t=this.$elem;t.empty();var n=Zi("<ul></ul>");e.forEach(function(e){var t=e.value,r=e.text,o=e.selected,i=e.styleForRenderMenuList,a=Zi('<li data-value="'.concat(t,'"></li>'));if(i&&a.css(i),o){var s=Zi('<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>');a.append(s),a.addClass("selected")}a.append(Zi('<span data-value="'.concat(t,'">').concat(r,"</span>"))),a.attr("title",r),n.append(a)}),t.append(n)},t.prototype.genSelfElem=function(){return null},t}(cc);var Cc=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=Zi('<div class="w-e-bar-item"></div>'),this.$button=Zi('<button type="button" class="select-button"></button>'),this.disabled=!1,this.selectList=null;var o=t.tag,i=t.title,a=t.width,s=t.iconSvg,u=void 0===s?"":s,l=t.hotkey,c=void 0===l?"":l;if("select"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'select'"));var d=this.$button;a&&d.css("width","".concat(a,"px")),d.attr("data-menu-key",e),fc(d,u,i,c,n),this.$elem.append(d),this.menu=t,Cn(function(){return r.init()})}return e.prototype.init=function(){var e=this;this.setSelectedValue(),this.$button.on("click",function(t){t.preventDefault(),Sc(e).hidePanelOrModal(),e.trigger()})},e.prototype.trigger=function(){var e=this,t=Sc(this);if(!t.isDisabled()&&!this.disabled){var n=this.menu;if(null==this.selectList){this.selectList=new wc(t,n.selectPanelWidth);var r=this.selectList,o=n.getOptions(t);r.renderList(o),r.appendTo(this.$elem),r.show(),r.$elem.on("click","li",function(t){var n=t.target;if(null!=n){t.preventDefault();var r=Zi(n).attr("data-value");e.onChange(r)}})}else{if((r=this.selectList).isShow)r.hide();else{o=n.getOptions(t);r.renderList(o),r.show()}}}},e.prototype.onChange=function(e){var t=Sc(this),n=this.menu;null!=n.exec&&n.exec(t,e)},e.prototype.setSelectedValue=function(){var e=Sc(this),t=this.menu,n=t.getValue(e),r=function(e,t){for(var n=e.length,r="",o=0;o<n;o+=1){var i=e[o];if(i.value===t){r=i.text;break}}return r}(t.getOptions(e),n.toString()),o=this.$button,i=uc();o.empty(),o.text(r),o.append(i)},e.prototype.setDisabled=function(){var e=Sc(this),t=this.menu.isDisabled(e),n=this.$button;(null==e.selection||e.isDisabled())&&(t=!0);var r="disabled";t?n.addClass(r):n.removeClass(r),this.disabled=t},e.prototype.changeMenuState=function(){this.setSelectedValue(),this.setDisabled()},e}(),Dc=function(e){function t(t,n,r){return void 0===r&&(r=!1),e.call(this,t,n,r)||this}return a(t,e),t.prototype.onButtonClick=function(){},t}(pc),Ac=new WeakMap;function Sc(e){var t=vi.get(e);if(null==t)throw new Error("Can not get editor instance");return t}function xc(e,t,n){void 0===n&&(n=!1);var r=Ac.get(t);if(r)return r;var o=t.tag;if("button"===o){var i=t.showDropPanel,a=t.showModal;r=i?new hc(e,t,n):a?new Ec(e,t,n):new Dc(e,t,n)}if("select"===o&&(r=new Cc(e,t,n)),null==r)throw new Error("Invalid tag in menu ".concat(JSON.stringify(t)));return Ac.set(t,r),r}function Nc(e,t){var n=e.selection;return null!=n&&(!Gn.isCollapsed(n)&&(!Ss.getSelectedElems(e).some(function(t){if(e.isVoid(t))return!0;var n=t.type;return!!["pre","code","table"].includes(n)})&&!!Wr.isText(t)))}var Bc=function(){function e(){var e=this;this.$elem=Zi('<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>'),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=function(){},this.changeHoverbarState=cl(function(){var t=e.isShow,n=e.getSelectedNodeAndMenuKeys()||{},r=n.node,o=void 0===r?null:r,i=n.menuKeys,a=void 0===i?[]:i,s=e.getEditorInstance();if(null!=o&&e.changeItemsState(),o&&Kn.isElement(o)&&t){var u=e.isSamePath(o,e.prevSelectedNode);if(!Pr.isBlock(s,o)&&u)return}e.hideAndClean(),null!=o&&(e.registerItems(a),e.setPosition(o),e.show()),e.prevSelectedNode=o},200),Cn(function(){var t=e.getEditorInstance(),n=e.$elem;n.on("mousedown",function(e){return e.preventDefault()},{passive:!1}),Ss.getTextarea(t).$textAreaContainer.append(n),t.on(ni,e.changeHoverbarState);var r=e.hideAndClean.bind(e);t.on(ri,r),t.on(oi,r),t.on(ii,r)}),this.lngListen=ic(function(){e.menus={},e.hideAndClean(),e.getEditorInstance().deselect()})}return e.prototype.getMenus=function(){return this.menus},e.prototype.hideAndClean=function(){var e=this.$elem;e.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],e.empty(),this.isShow=!1},e.prototype.checkPositionBottom=function(){var e=this.$elem,t=!1,n="undefined"!=typeof window?window.innerHeight:null;n&&n>=360&&(n-e[0].getBoundingClientRect().bottom<360&&(t=!0));t?e.addClass("w-e-bar-bottom"):e.removeClass("w-e-bar-bottom")},e.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},e.prototype.changeItemsState=function(){var e=this;Cn(function(){e.hoverbarItems.forEach(function(e){e.changeMenuState()})})},e.prototype.registerItems=function(e){var t=this,n=this.$elem;e.forEach(function(e){if("|"!==e)t.registerSingleItem(e);else{var r=lc();n.append(r)}})},e.prototype.registerSingleItem=function(e){var t=this.getEditorInstance(),n=this.menus,r=n[e];if(null==r){var o=ui[e];if(null==o)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof o)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));r=o(),n[e]=r}var i=t.getMenuConfig(e);i&&void 0!==i.iconSvg&&(r.iconSvg=i.iconSvg);var a=xc(e,r);this.hoverbarItems.push(a),vi.set(a,t),this.$elem.append(a.$elem)},e.prototype.setPosition=function(e){var t=this.getEditorInstance(),n=this.$elem;if(n.attr("style",""),Kn.isElement(e)){var r=ol(t,e,"bar");return n.css(r),void il(t,n)}if(Wr.isText(e)){r=rl(t);return n.css(r),void il(t,n)}throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},e.prototype.getSelectedNodeAndMenuKeys=function(){var e=this.getEditorInstance();if(null==e.selection)return null;var t=this.getHoverbarKeysConf(),n=null,r=[],o=function(o){var i=t[o],a=i.match,s=i.menuKeys,u=void 0===s?[]:s,l=a||function(e,t){return Ss.checkNodeType(t,o)},c=d(Pr.nodes(e,{match:function(t){return l(e,t)},universal:!0}),1),f=c[0];if(null!=f)return n=f[0],r=u,"break"};for(var i in t){if("break"===o(i))break}return null==n||0===r.length?null:{node:n,menuKeys:r}},e.prototype.getEditorInstance=function(){var e=hi.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.getHoverbarKeysConf=function(){var e=this.getEditorInstance().getConfig().hoverbarKeys,t=void 0===e?{}:e,n=t.text;return n&&null==n.match&&(n.match=Nc),t},e.prototype.isSamePath=function(e,t){if(null==e||null==t)return!1;var n=Ss.findPath(null,e),r=Ss.findPath(null,t);return jn.equals(n,r)},e.prototype.destroy=function(){var e;this.changeHoverbarState.cancel(),this.$elem.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},e}(),Oc=g(fe());function Tc(e,t){return Ra(t)&&Ss.hasDOMNode(e,t,{editable:!0})}function kc(e,t){return Ra(t)&&Ss.hasDOMNode(e,t)}function Fc(e,t){if(Tc(e,t))return!0;if(!kc(e,t))return!1;var n=null;return Ma(t)?n=t:Ha(t)&&(n=t.parentElement),!!(null==n?void 0:n.closest("[data-w-e-reserve]"))||function(e,t){if(e.getConfig().readOnly)return!1;var n=kc(e,t)&&Ss.toSlateNode(e,t);return!!n&&Kn.isElement(n)&&Pr.isVoid(e,n)}(e,t)}const Ic=e=>"object"==typeof e&&null!=e&&1===e.nodeType,Pc=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,_c=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Pc(n.overflowY,t)||Pc(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Rc=(e,t,n,r,o,i,a,s)=>i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0,Lc=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},Mc=(e,t)=>{var n,r,o,i;if("undefined"==typeof document)return[];const{scrollMode:a,block:s,inline:u,boundary:l,skipOverflowHiddenElements:c}=t,d="function"==typeof l?l:e=>e!==l;if(!Ic(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,p=[];let h=e;for(;Ic(h)&&d(h);){if(h=Lc(h),h===f){p.push(h);break}null!=h&&h===document.body&&_c(h)&&!_c(document.documentElement)||null!=h&&_c(h,c)&&p.push(h)}const g=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,{scrollX:m,scrollY:y}=window,{height:b,width:E,top:w,right:C,bottom:D,left:A}=e.getBoundingClientRect(),{top:S,right:x,bottom:N,left:B}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let O="start"===s||"nearest"===s?w-S:"end"===s?D+N:w+b/2-S+N,T="center"===u?A+E/2-B+x:"end"===u?C+x:A-B;const k=[];for(let e=0;e<p.length;e++){const t=p[e],{height:n,width:r,top:o,right:i,bottom:l,left:c}=t.getBoundingClientRect();if("if-needed"===a&&w>=0&&A>=0&&D<=v&&C<=g&&(t===f&&!_c(t)||w>=o&&D<=l&&A>=c&&C<=i))return k;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),S=parseInt(d.borderTopWidth,10),x=parseInt(d.borderRightWidth,10),N=parseInt(d.borderBottomWidth,10);let B=0,F=0;const I="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-x:0,P="offsetHeight"in t?t.offsetHeight-t.clientHeight-S-N:0,_="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,R="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(f===t)B="start"===s?O:"end"===s?O-v:"nearest"===s?Rc(y,y+v,v,S,N,y+O,y+O+b,b):O-v/2,F="start"===u?T:"center"===u?T-g/2:"end"===u?T-g:Rc(m,m+g,g,h,x,m+T,m+T+E,E),B=Math.max(0,B+y),F=Math.max(0,F+m);else{B="start"===s?O-o-S:"end"===s?O-l+N+P:"nearest"===s?Rc(o,l,n,S,N+P,O,O+b,b):O-(o+n/2)+P/2,F="start"===u?T-c-h:"center"===u?T-(c+r/2)+I/2:"end"===u?T-i+x+I:Rc(c,i,r,h,x+I,T,T+E,E);const{scrollLeft:e,scrollTop:a}=t;B=0===R?0:Math.max(0,Math.min(a+B/R,t.scrollHeight-n/R+P)),F=0===_?0:Math.max(0,Math.min(e+F/_,t.scrollWidth-r/_+I)),O+=a-B,T+=e-F}k.push({el:t,top:B,left:F})}return k};function jc(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(Mc(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:o,top:i,left:a}of Mc(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=i-n.top+n.bottom,t=a-n.left+n.right;o.scroll({top:e,left:t,behavior:r})}}function Hc(e){null!=e.selection&&(e.selection=null,e.onChange())}function zc(e,t,n){void 0===n&&(n=!1);var r=t.selection,o=t.getConfig(),i=Ss.findDocumentOrShadowRoot(t).getSelection();if(i&&(!e.isComposing||n)&&t.isFocused()){var a="None"!==i.type;if(r||a){var s=Ni.get(t),u=!1;if(s.contains(i.anchorNode)&&s.contains(i.focusNode)&&(u=!0),a&&u&&r){var l=Ss.toSlateRange(t,i,{exactMatch:!0,suppressThrow:!0});if(l&&Gn.equals(l,r)){var c=!0;if(Gn.isCollapsed(r)){var d=i.anchorNode,f=i.anchorOffset;if(d===s){var p=s.childNodes,h=void 0;(h=p[f])&&h.matches("table")&&(c=!1),(h=p[f-1])&&h.matches("table")&&(c=!1)}}if(c)return}}if(!r||Ss.hasRange(t,r)){e.isUpdatingSelection=!0;var g=null;try{g=r&&Ss.toDOMRange(t,r)}catch(e){g=null}if(g){Gn.isBackward(r)?i.setBaseAndExtent(g.endContainer,g.endOffset,g.startContainer,g.startOffset):i.setBaseAndExtent(g.startContainer,g.startOffset,g.endContainer,g.endOffset);var v=g.startContainer.parentElement;if(!v.closest("[data-slate-spacer]")&&g.getBoundingClientRect){var m=g.getBoundingClientRect.bind(g)();0===m.top&&0===m.right&&0===m.bottom&&0===m.left&&0===m.height&&0===m.width||(v.getBoundingClientRect=g.getBoundingClientRect.bind(g));var y=document.body;if(jc(v,{scrollMode:"if-needed",boundary:o.scroll&&s.parentElement||y,block:"end",behavior:"auto"}),o.scroll){var b=s.parentElement;if(b){var E=function(){var e=g.getBoundingClientRect(),t=b.getBoundingClientRect(),n=e.bottom-t.bottom,r=t.top-e.top;n>0?b.scrollTop+=n+1:r>0&&(b.scrollTop-=r+1)};E(),requestAnimationFrame(E)}}delete v.getBoundingClientRect}}else i.removeAllRanges();setTimeout(function(){g&&ms&&s.focus(),e.isUpdatingSelection=!1})}else t.selection=Ss.toSlateRange(t,i,{exactMatch:!1,suppressThrow:!0})}}}var $c=new WeakMap,Uc=new WeakMap;function Vc(e){var t;try{t=Ss.findDocumentOrShadowRoot(e)}catch(e){return null}var n=t.getSelection();if(!n||n.rangeCount<=0)return null;try{return n.getRangeAt(0).startContainer}catch(e){return null}}var Wc,Gc={};var qc=function(){if(Wc)return Gc;Wc=1,Object.defineProperty(Gc,"__esModule",{value:!0});for(var e="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},n={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:e?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},r={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)r["f"+o]=111+o;function i(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(e){return a(e,t)}),o=function(e){return r.some(function(t){return s(t,e)})};return null==n?o:o(n)}function a(e,o){var i=o&&o.byKey,a={},s=(e=e.replace("++","+add")).split("+"),c=s.length;for(var d in t)a[t[d]]=!1;var f=!0,p=!1,h=void 0;try{for(var g,v=s[Symbol.iterator]();!(f=(g=v.next()).done);f=!0){var m=g.value,y=m.endsWith("?")&&m.length>1;y&&(m=m.slice(0,-1));var b=l(m),E=t[b];if(m.length>1&&!E&&!n[m]&&!r[b])throw new TypeError('Unknown modifier: "'+m+'"');1!==c&&E||(i?a.key=b:a.which=u(m)),E&&(a[E]=!y||null)}}catch(e){p=!0,h=e}finally{try{!f&&v.return&&v.return()}finally{if(p)throw h}}return a}function s(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function u(e){return e=l(e),r[e]||e.toUpperCase().charCodeAt(0)}function l(e){return e=e.toLowerCase(),e=n[e]||e}return Gc.default=i,Gc.isHotkey=i,Gc.isCodeHotkey=function(e,t){return i(e,t)},Gc.isKeyHotkey=function(e,t){return i(e,{byKey:!0},t)},Gc.parseHotkey=a,Gc.compareHotkey=s,Gc.toKeyCode=u,Gc.toKeyName=l,Gc}(),Kc={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},Yc={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Xc={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Zc=function(e){var t=Kc[e],n=Yc[e],r=Xc[e],o=t&&qc.isKeyHotkey(t),i=n&&qc.isKeyHotkey(n),a=r&&qc.isKeyHotkey(r);return function(e){return!(!o||!o(e))||(!!(vs&&i&&i(e))||!(vs||!a||!a(e)))}},Jc={isBold:Zc("bold"),isCompose:Zc("compose"),isMoveBackward:Zc("moveBackward"),isMoveForward:Zc("moveForward"),isDeleteBackward:Zc("deleteBackward"),isDeleteForward:Zc("deleteForward"),isDeleteLineBackward:Zc("deleteLineBackward"),isDeleteLineForward:Zc("deleteLineForward"),isDeleteWordBackward:Zc("deleteWordBackward"),isDeleteWordForward:Zc("deleteWordForward"),isExtendBackward:Zc("extendBackward"),isExtendForward:Zc("extendForward"),isExtendLineBackward:Zc("extendLineBackward"),isExtendLineForward:Zc("extendLineForward"),isItalic:Zc("italic"),isMoveLineBackward:Zc("moveLineBackward"),isMoveLineForward:Zc("moveLineForward"),isMoveWordBackward:Zc("moveWordBackward"),isMoveWordForward:Zc("moveWordForward"),isRedo:Zc("redo"),isSplitBlock:Zc("splitBlock"),isTransposeCharacter:Zc("transposeCharacter"),isUndo:Zc("undo"),isTab:Zc("tab"),isSelectAll:Zc("selectAll")};function Qc(e){e.preventDefault()}var ed={beforeinput:function(e,t,n){var r,o=e,i=n.getConfig().readOnly;if(Cs&&!i&&Tc(n,o.target)){null===(r=t.flushDOMSelectionChange)||void 0===r||r.call(t);var a=n.selection,s=o.inputType,u=o.dataTransfer||o.data||void 0;if("insertCompositionText"!==s&&"deleteCompositionText"!==s){if(o.preventDefault(),!s.startsWith("delete")||s.startsWith("deleteBy")){var l=d(o.getTargetRanges(),1)[0];if(l){var c=null;try{c=Ss.toSlateRange(n,l,{exactMatch:!1,suppressThrow:!0})}catch(e){c=null}!c||a&&Gn.equals(a,c)||co.select(n,c)}}if(a&&Gn.isExpanded(a)){var f=Ss.getSelectedElems(n),p="table"===f[0].type,h="table-cell"!==f[f.length-1].type;if(p&&h)return;if(s.startsWith("delete")){var g=s.endsWith("Backward")?"backward":"forward";return void Pr.deleteFragment(n,{direction:g})}}switch(s){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":Pr.deleteFragment(n);break;case"deleteContent":case"deleteContentForward":Pr.deleteForward(n);break;case"deleteContentBackward":Pr.deleteBackward(n);break;case"deleteEntireSoftLine":Pr.deleteBackward(n,{unit:"line"}),Pr.deleteForward(n,{unit:"line"});break;case"deleteHardLineBackward":Pr.deleteBackward(n,{unit:"block"});break;case"deleteSoftLineBackward":Pr.deleteBackward(n,{unit:"line"});break;case"deleteHardLineForward":Pr.deleteForward(n,{unit:"block"});break;case"deleteSoftLineForward":Pr.deleteForward(n,{unit:"line"});break;case"deleteWordBackward":Pr.deleteBackward(n,{unit:"word"});break;case"deleteWordForward":Pr.deleteForward(n,{unit:"word"});break;case"insertLineBreak":Pr.insertText(n,"\n");break;case"insertParagraph":Pr.insertBreak(n);break;case"insertFromDrop":case"insertFromComposition":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("insertFromComposition"===s&&(t.isComposing=!1,Li.set(n,!0)),"insertFromPaste"===s&&!Ri.get(n))break;"[object DataTransfer]"===An(u)?n.insertData(u):"string"==typeof u&&Pr.insertText(n,u)}}}},blur:function(e,t,n){var r=e,o=t.isUpdatingSelection,i=t.latestElement;if(!n.getConfig().readOnly&&!o&&Tc(n,r.target)){var a=Ss.findDocumentOrShadowRoot(n);if(i!==a.activeElement){var s=r.relatedTarget;if(!(s===Ss.toDOMNode(n,n)||Ma(s)&&s.hasAttribute("data-slate-spacer"))){if(null!=s&&Ra(s)&&Ss.hasDOMNode(n,s)){var u=Ss.toSlateNode(n,s);if(Kn.isElement(u)&&!n.isVoid(u))return}if(ys){var l=a.getSelection();null==l||l.removeAllRanges()}Ii.delete(n)}}}},focus:function(e,t,n){var r=Ss.toDOMNode(n,n),o=Ss.findDocumentOrShadowRoot(n);t.latestElement=o.activeElement,ms&&e.target!==r?r.focus():Ii.set(n,!0)},click:function(e,t,n){if(!n.getConfig().readOnly&&kc(n,e.target)&&Ra(e.target)){var r=Ss.toSlateNode(n,e.target),o=Ss.findPath(n,r);if(Pr.hasPath(n,o))if(Qn.get(n,o)===r){var i=Pr.start(n,o),a=Pr.end(n,o),s=Pr.void(n,{at:i}),u=Pr.void(n,{at:a});if(s&&u&&jn.equals(s[1],u[1])){var l=Pr.range(n,i);co.select(n,l)}}}},compositionstart:function(e,t,n){if(Tc(n,e.target)){Mi.delete(n);var r=n.selection;if(r&&Gn.isCollapsed(r)){var o=Vc(n);if(o){var i=o.textContent||"";$c.set(n,i),Uc.set(n,o)}}r&&Gn.isExpanded(r)&&(Pr.deleteFragment(n),Promise.resolve().then(function(){zc(t,n,!0)})),t.isComposing=!0,function(e,t){var n;t.getConfig().placeholder&&t.isEmpty()&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}(t,n)}},compositionend:function(e,t,n){var r=e;if(Tc(n,r.target)){t.isComposing=!1;var o=!0===Li.get(n);o?(Li.delete(n),Mi.delete(n)):Mi.delete(n);var i=n.selection;if(null!=i){(ws||ms)&&Ss.cleanExposedTexNodeInSelectionBlock(n);for(var a=Gn.isBackward(i)?i.focus:i.anchor,s=d(Pr.node(n,[a.path[0]]),1)[0],u=0;u<a.path.length;u+=1){var l=d(Pr.node(n,a.path.slice(0,u+1)),1)[0];if(Kn.isElement(l)&&((ys||ms)&&"link"===l.type||"code"===l.type)){Ss.setNewKey(s);break}}var c=r.data;if(c&&!o){if(n.getConfig().maxLength){var f=Ss.getLeftLengthOfMaxLength(n);if(f<c.length){var p=Vc(n);p&&p.nodeType===Node.TEXT_NODE&&(p.textContent=$c.get(n)||""),f>0&&Pr.insertText(n,c.slice(0,f)),t.changeViewState()}else Pr.insertText(n,c)}else{var h=Ss.findDocumentOrShadowRoot(n).getSelection();if(h&&function(e,t){if(Gn.isCollapsed(t)){var n=t.anchor,r=t.focus;if([2,3].includes(n.path.length)&&[2,3].includes(r.path.length)&&(0===n.offset||0===r.offset)){var o=Pr.node(e,n.path),i=0===n.offset?n.path:r.path,a=[i[0],i[1]-1];if(0===i[1])return!1;var s=Pr.node(e,a);if(Wr.isText(s[0])&&Wr.isText(o[0]))return!0}}}(n,i)){var g=Ss.toSlateRange(n,h,{exactMatch:!1,suppressThrow:!1});g&&(n.selection=g)}Pr.insertText(n,c)}ys||setTimeout(function(){if(null!=n.selection){var e=Uc.get(n);if(null!=e&&e.nodeType===Node.TEXT_NODE){var t=Vc(n);null!=t&&t.nodeType===Node.TEXT_NODE&&t!==e&&(e.textContent=$c.get(n)||"")}}})}}}},compositionupdate:function(e,t,n){Tc(n,e.target)&&(t.isComposing=!0)},keydown:function(e,t,n){var r=e,o=n.selection;if(!n.getConfig().readOnly&&!t.isComposing&&Tc(n,r.target)){if(function(e,t){var n,r,o=pi.get(e),i=o&&o.getMenus(),a=gi.get(e),u=a&&a.getMenus(),l=s(s({},i),u);try{for(var d=c(Object.keys(l)),f=d.next();!f.done;f=d.next()){var p=l[f.value],h=p.hotkey;if(h&&qc.isHotkey(h,t)&&!p.isDisabled(e)){var g=p.getValue(e);p.exec(e,g)}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}(n,r),Jc.isTab(r))return Qc(r),void n.handleTab();if(Jc.isRedo(r))return Qc(r),void("function"==typeof n.redo&&n.redo());if(Jc.isUndo(r))return Qc(r),void("function"==typeof n.undo&&n.undo());if(Jc.isMoveLineBackward(r))return Qc(r),void co.move(n,{unit:"line",reverse:!0});if(Jc.isMoveLineForward(r))return Qc(r),void co.move(n,{unit:"line"});if(Jc.isExtendLineBackward(r))return Qc(r),void co.move(n,{unit:"line",edge:"focus",reverse:!0});if(Jc.isExtendLineForward(r))return Qc(r),void co.move(n,{unit:"line",edge:"focus"});if(Jc.isMoveBackward(r))return Qc(r),void(o&&Gn.isCollapsed(o)?co.move(n,{reverse:!0}):co.collapse(n,{edge:"start"}));if(Jc.isMoveForward(r))return Qc(r),void(o&&Gn.isCollapsed(o)?co.move(n):co.collapse(n,{edge:"end"}));if(Jc.isMoveWordBackward(r))return Qc(r),o&&Gn.isExpanded(o)&&co.collapse(n,{edge:"focus"}),void co.move(n,{unit:"word",reverse:!0});if(Jc.isMoveWordForward(r))return Qc(r),o&&Gn.isExpanded(o)&&co.collapse(n,{edge:"focus"}),void co.move(n,{unit:"word"});if(Jc.isSelectAll(r))return Qc(r),void n.selectAll();if(Cs){if((ws||ys)&&o&&(Jc.isDeleteBackward(r)||Jc.isDeleteForward(r))&&Gn.isCollapsed(o)){var i=Qn.parent(n,o.anchor.path);Kn.isElement(i)&&Pr.isVoid(n,i)&&Pr.isInline(n,i)&&(r.preventDefault(),co.delete(n,{unit:"block"}))}}else{if(Jc.isBold(r)||Jc.isItalic(r)||Jc.isTransposeCharacter(r))return void Qc(r);if(Jc.isSplitBlock(r))return Qc(r),void(r.shiftKey?Pr.insertText(n,"\n"):Pr.insertBreak(n));if(Jc.isDeleteBackward(r))return Qc(r),void(o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"backward"}):Pr.deleteBackward(n));if(Jc.isDeleteForward(r))return Qc(r),void(o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"forward"}):Pr.deleteForward(n));if(Jc.isDeleteLineBackward(r))return Qc(r),void(o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"backward"}):Pr.deleteBackward(n,{unit:"line"}));if(Jc.isDeleteLineForward(r))return Qc(r),void(o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"forward"}):Pr.deleteForward(n,{unit:"line"}));if(Jc.isDeleteWordBackward(r))return Qc(r),void(o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"backward"}):Pr.deleteBackward(n,{unit:"word"}));Jc.isDeleteWordForward(r)&&(Qc(r),o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"forward"}):Pr.deleteForward(n,{unit:"word"}))}}},keypress:function(e,t,n){if(!Cs&&!n.getConfig().readOnly&&Tc(n,e.target)){e.preventDefault();var r=e.key;Pr.insertText(n,r)}},copy:function(e,t,n){var r=e;if(Tc(n,r.target)){n.getConfig().readOnly||r.preventDefault();var o=r.clipboardData;if(null!=o){n.setFragmentData(o);var i=n.getConfig().customCopy;i&&i(n,r)}}},cut:function(e,t,n){var r=e,o=n.selection;if(!n.getConfig().readOnly&&(r.preventDefault(),Tc(n,r.target))){var i=r.clipboardData;if(null!=i&&(n.setFragmentData(i),o))if(Gn.isExpanded(o))Pr.deleteFragment(n);else{var a=Qn.parent(n,o.anchor.path);Kn.isElement(a)&&Pr.isVoid(n,a)&&co.delete(n)}}},paste:function(e,t,n){Ri.set(n,!0);var r=e;if(!n.getConfig().readOnly&&Tc(n,r.target)){var o=n.getConfig().customPaste;if(o)if(!1===o(n,r))return Ri.set(n,!1),void r.preventDefault();if(ys||!Cs||function(e){return e.clipboardData&&""!==e.clipboardData.getData("text/plain")&&1===e.clipboardData.types.length}(r)){r.preventDefault();var i=r.clipboardData;null!=i&&n.insertData(i)}}},dragover:function(e,t,n){if(kc(n,e.target)){var r=Ss.toSlateNode(n,e.target);Kn.isElement(r)&&Pr.isVoid(n,r)&&e.preventDefault()}},dragstart:function(e,t,n){var r=e;if(kc(n,r.target)&&!n.getConfig().readOnly){var o=Ss.toSlateNode(n,r.target),i=Ss.findPath(n,o);if(Kn.isElement(o)&&Pr.isVoid(n,o)||Pr.void(n,{at:i,voids:!0})){var a=Pr.range(n,i);co.select(n,a)}var s=r.dataTransfer;if(null!=s)Ss.getSelectedNodeByType(n,"table")||(t.isDraggingInternally=!0,n.setFragmentData(s))}},dragend:function(e,t,n){var r=e;n.getConfig().readOnly||t.isDraggingInternally&&kc(n,r.target)&&(t.isDraggingInternally=!1)},drop:function(e,t,n){var r=e,o=r.dataTransfer;if(!n.getConfig().readOnly&&kc(n,r.target)&&null!=o&&!(Cs&&ys&&o.files.length>0)){r.preventDefault();var i=n.selection,a=Ss.findEventRange(n,r);co.select(n,a),t.isDraggingInternally&&(i&&co.delete(n,{at:i}),t.isDraggingInternally=!1),n.insertData(o),n.isFocused()||n.focus()}}};function td(e){if(nd(e)){for(;e&&nd(e);){e=rd(e).parent}return null!=e?e:null}return e.parentNode}function nd(e){return 11===e.nodeType}function rd(e,t){var n,r,o;const i=e;return null!==(n=i.parent)&&void 0!==n||(i.parent=null!=t?t:null),null!==(r=i.firstChildNode)&&void 0!==r||(i.firstChildNode=e.firstChild),null!==(o=i.lastChildNode)&&void 0!==o||(i.lastChildNode=e.lastChild),i}const od={createElement:function(e,t){return document.createElement(e,t)},createElementNS:function(e,t,n){return document.createElementNS(e,t,n)},createTextNode:function(e){return document.createTextNode(e)},createDocumentFragment:function(){return rd(document.createDocumentFragment())},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){if(nd(e)){let t=e;for(;t&&nd(t);){t=rd(t).parent}e=null!=t?t:e}nd(t)&&(t=rd(t,e)),n&&nd(n)&&(n=rd(n).firstChildNode),e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){nd(t)&&(t=rd(t,e)),e.appendChild(t)},parentNode:td,nextSibling:function(e){var t;if(nd(e)){const n=rd(e),r=td(n);if(r&&n.lastChildNode){const e=Array.from(r.childNodes),o=e.indexOf(n.lastChildNode);return null!==(t=e[o+1])&&void 0!==t?t:null}return null}return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return 1===e.nodeType},isText:function(e){return 3===e.nodeType},isComment:function(e){return 8===e.nodeType},isDocumentFragment:nd};function id(e,t,n,r,o){return{sel:e,data:t,children:n,text:r,elm:o,key:void 0===t?void 0:t.key}}const ad=Array.isArray;function sd(e){return"string"==typeof e||"number"==typeof e||e instanceof String||e instanceof Number}const ud=id("",{},[],void 0,void 0);function ld(e,t){var n,r;const o=e.key===t.key,i=(null===(n=e.data)||void 0===n?void 0:n.is)===(null===(r=t.data)||void 0===r?void 0:r.is),a=e.sel===t.sel,s=!(!e.sel&&e.sel===t.sel)||typeof e.text==typeof t.text;return a&&o&&i&&s}function cd(e,t,n){var r;const o={};for(let i=t;i<=n;++i){const t=null===(r=e[i])||void 0===r?void 0:r.key;void 0!==t&&(o[t]=i)}return o}const dd=["create","update","remove","destroy","pre","post"];function fd(e,t,n){const r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},o=od;for(const t of dd)for(const n of e){const e=n[t];void 0!==e&&r[t].push(e)}function i(e){const t=e.id?"#"+e.id:"",n=e.getAttribute("class"),r=n?"."+n.split(" ").join("."):"";return id(o.tagName(e).toLowerCase()+t+r,{},[],void 0,e)}function a(e){return id(void 0,{},[],void 0,e)}function s(e,t){return function(){if(0===--t){const t=o.parentNode(e);null!==t&&o.removeChild(t,e)}}}function u(e,t){var n,i,a;let s;const l=e.data,c=null==l?void 0:l.hook;null===(n=null==c?void 0:c.init)||void 0===n||n.call(c,e);const d=e.children,f=e.sel;if("!"===f)null!==(i=e.text)&&void 0!==i||(e.text=""),e.elm=o.createComment(e.text);else if(""===f)e.elm=o.createTextNode(e.text);else if(void 0!==f){const n=f.indexOf("#"),i=f.indexOf(".",n),p=n>0?n:f.length,h=i>0?i:f.length,g=-1!==n||-1!==i?f.slice(0,Math.min(p,h)):f,v=null==l?void 0:l.ns,m=void 0===v?o.createElement(g,l):o.createElementNS(v,g,l);for(e.elm=m,p<h&&m.setAttribute("id",f.slice(p+1,h)),i>0&&m.setAttribute("class",f.slice(h+1).replace(/\./g," ")),s=0;s<r.create.length;++s)r.create[s](ud,e);if(!sd(e.text)||ad(d)&&0!==d.length||o.appendChild(m,o.createTextNode(e.text)),ad(d))for(s=0;s<d.length;++s){const e=d[s];null!=e&&o.appendChild(m,u(e,t))}void 0!==c&&(null===(a=c.create)||void 0===a||a.call(c,ud,e),void 0!==c.insert&&t.push(e))}else e.elm=o.createTextNode(e.text);return e.elm}function l(e,t,n,r,i,a){for(;r<=i;++r){const i=n[r];null!=i&&o.insertBefore(e,u(i,a),t)}}function c(e){var t,n;const o=e.data;if(void 0!==o){null===(n=null===(t=null==o?void 0:o.hook)||void 0===t?void 0:t.destroy)||void 0===n||n.call(t,e);for(let t=0;t<r.destroy.length;++t)r.destroy[t](e);if(void 0!==e.children)for(let t=0;t<e.children.length;++t){const n=e.children[t];null!=n&&"string"!=typeof n&&c(n)}}}function d(e,t,n,i){for(var a,u;n<=i;++n){let i;const l=t[n];if(null!=l)if(void 0!==l.sel){c(l),i=r.remove.length+1;const e=s(l.elm,i);for(let t=0;t<r.remove.length;++t)r.remove[t](l,e);const t=null===(u=null===(a=null==l?void 0:l.data)||void 0===a?void 0:a.hook)||void 0===u?void 0:u.remove;void 0!==t?t(l,e):e()}else l.children?(c(l),d(e,l.children,0,l.children.length-1)):o.removeChild(e,l.elm)}}function f(e,t,n){var i,a,s,c,p,h,g,v;const m=null===(i=t.data)||void 0===i?void 0:i.hook;null===(a=null==m?void 0:m.prepatch)||void 0===a||a.call(m,e,t);const y=t.elm=e.elm;if(e===t)return;if(void 0!==t.data||void 0!==t.text&&t.text!==e.text){null!==(s=t.data)&&void 0!==s||(t.data={}),null!==(c=e.data)&&void 0!==c||(e.data={});for(let n=0;n<r.update.length;++n)r.update[n](e,t);null===(g=null===(h=null===(p=t.data)||void 0===p?void 0:p.hook)||void 0===h?void 0:h.update)||void 0===g||g.call(h,e,t)}const b=e.children,E=t.children;void 0===t.text?void 0!==b&&void 0!==E?b!==E&&function(e,t,n,r){let i,a,s,c,p=0,h=0,g=t.length-1,v=t[0],m=t[g],y=n.length-1,b=n[0],E=n[y];for(;p<=g&&h<=y;)null==v?v=t[++p]:null==m?m=t[--g]:null==b?b=n[++h]:null==E?E=n[--y]:ld(v,b)?(f(v,b,r),v=t[++p],b=n[++h]):ld(m,E)?(f(m,E,r),m=t[--g],E=n[--y]):ld(v,E)?(f(v,E,r),o.insertBefore(e,v.elm,o.nextSibling(m.elm)),v=t[++p],E=n[--y]):ld(m,b)?(f(m,b,r),o.insertBefore(e,m.elm,v.elm),m=t[--g],b=n[++h]):(void 0===i&&(i=cd(t,p,g)),a=i[b.key],void 0===a?(o.insertBefore(e,u(b,r),v.elm),b=n[++h]):void 0===i[E.key]?(o.insertBefore(e,u(E,r),o.nextSibling(m.elm)),E=n[--y]):(s=t[a],s.sel!==b.sel?o.insertBefore(e,u(b,r),v.elm):(f(s,b,r),t[a]=void 0,o.insertBefore(e,s.elm,v.elm)),b=n[++h]));h<=y&&(c=null==n[y+1]?null:n[y+1].elm,l(e,c,n,h,y,r)),p<=g&&d(e,t,p,g)}(y,b,E,n):void 0!==E?(void 0!==e.text&&o.setTextContent(y,""),l(y,null,E,0,E.length-1,n)):void 0!==b?d(y,b,0,b.length-1):void 0!==e.text&&o.setTextContent(y,""):e.text!==t.text&&(void 0!==b&&d(y,b,0,b.length-1),o.setTextContent(y,t.text)),null===(v=null==m?void 0:m.postpatch)||void 0===v||v.call(m,e,t)}return function(e,t){let n,s,l;const c=[];for(n=0;n<r.pre.length;++n)r.pre[n]();for(!function(e,t){return e.isElement(t)}(o,e)?function(e,t){return e.isDocumentFragment(t)}(o,e)&&(e=a(e)):e=i(e),ld(e,t)?f(e,t,c):(s=e.elm,l=o.parentNode(s),u(t,c),null!==l&&(o.insertBefore(l,t.elm,o.nextSibling(s)),d(l,[e],0,0))),n=0;n<c.length;++n)c[n].data.hook.insert(c[n]);for(n=0;n<r.post.length;++n)r.post[n]();return t}}function pd(e,t,n){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==n&&void 0!==t)for(let e=0;e<t.length;++e){const n=t[e];if("string"==typeof n)continue;const r=n.data;void 0!==r&&pd(r,n.children,n.sel)}}function hd(e,t,n){let r,o,i,a={};if(void 0!==n?(null!==t&&(a=t),ad(n)?r=n:sd(n)?o=n.toString():n&&n.sel&&(r=[n])):null!=t&&(ad(t)?r=t:sd(t)?o=t.toString():t&&t.sel?r=[t]:a=t),void 0!==r)for(i=0;i<r.length;++i)sd(r[i])&&(r[i]=id(void 0,void 0,void 0,r[i],void 0));return!e.startsWith("svg")||3!==e.length&&"."!==e[3]&&"#"!==e[3]||pd(a,r,e),id(e,a,r,o,void 0)}function gd(e,t){let n;const r=t.elm;let o=e.data.attrs,i=t.data.attrs;if((o||i)&&o!==i){for(n in o=o||{},i=i||{},i){const e=i[n];o[n]!==e&&(!0===e?r.setAttribute(n,""):!1===e?r.removeAttribute(n):120!==n.charCodeAt(0)?r.setAttribute(n,e):58===n.charCodeAt(3)?r.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,e):58===n.charCodeAt(5)?109===n.charCodeAt(1)?r.setAttributeNS("http://www.w3.org/2000/xmlns/",n,e):r.setAttributeNS("http://www.w3.org/1999/xlink",n,e):r.setAttribute(n,e))}for(n in o)n in i||r.removeAttribute(n)}}const vd={create:gd,update:gd};function md(e,t){let n,r;const o=t.elm;let i=e.data.class,a=t.data.class;if((i||a)&&i!==a){for(r in i=i||{},a=a||{},i)i[r]&&!Object.prototype.hasOwnProperty.call(a,r)&&o.classList.remove(r);for(r in a)n=a[r],n!==i[r]&&o.classList[n?"add":"remove"](r)}}const yd={create:md,update:md},bd=/[A-Z]/g;function Ed(e,t){const n=t.elm;let r,o=e.data.dataset,i=t.data.dataset;if(!o&&!i)return;if(o===i)return;o=o||{},i=i||{};const a=n.dataset;for(r in o)r in i||(a?r in a&&delete a[r]:n.removeAttribute("data-"+r.replace(bd,"-$&").toLowerCase()));for(r in i)o[r]!==i[r]&&(a?a[r]=i[r]:n.setAttribute("data-"+r.replace(bd,"-$&").toLowerCase(),i[r]))}const wd={create:Ed,update:Ed};function Cd(e,t,n){if("function"==typeof e)e.call(t,n,t);else if("object"==typeof e)for(let r=0;r<e.length;r++)Cd(e[r],t,n)}function Dd(e,t){const n=e.type,r=t.data.on;r&&r[n]&&Cd(r[n],t,e)}function Ad(e,t){const n=e.data.on,r=e.listener,o=e.elm,i=t&&t.data.on,a=t&&t.elm;let s;if(n!==i){if(n&&r)if(i)for(s in n)i[s]||o.removeEventListener(s,r,!1);else for(s in n)o.removeEventListener(s,r,!1);if(i){const r=t.listener=e.listener||function e(t){Dd(t,e.vnode)};if(r.vnode=t,n)for(s in i)n[s]||a.addEventListener(s,r,!1);else for(s in i)a.addEventListener(s,r,!1)}}}const Sd={create:Ad,update:Ad,destroy:Ad};function xd(e,t){let n,r,o;const i=t.elm;let a=e.data.props,s=t.data.props;if((a||s)&&a!==s)for(n in a=a||{},s=s||{},s)r=s[n],o=a[n],o===r||"value"===n&&i[n]===r||(i[n]=r)}const Nd={create:xd,update:xd},Bd="function"==typeof(null===window||void 0===window?void 0:window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):setTimeout;let Od=!1;function Td(e,t,n){var r;r=()=>{e[t]=n},Bd(()=>{Bd(r)})}function kd(e,t){let n,r;const o=t.elm;let i=e.data.style,a=t.data.style;if(!i&&!a)return;if(i===a)return;i=i||{},a=a||{};const s="delayed"in i;for(r in i)r in a||("-"===r[0]&&"-"===r[1]?o.style.removeProperty(r):o.style[r]="");for(r in a)if(n=a[r],"delayed"===r&&a.delayed)for(const e in a.delayed)n=a.delayed[e],s&&n===i.delayed[e]||Td(o.style,e,n);else"remove"!==r&&n!==i[r]&&("-"===r[0]&&"-"===r[1]?o.style.setProperty(r,n):o.style[r]=n)}const Fd={pre:function(){Od=!1},create:kd,update:kd,destroy:function(e){let t,n;const r=e.elm,o=e.data.style;if(o&&(t=o.destroy))for(n in t)r.style[n]=t[n]},remove:function(e,t){const n=e.data.style;if(!n||!n.remove)return void t();let r;Od||(e.elm.offsetLeft,Od=!0);const o=e.elm;let i=0;const a=n.remove;let s=0;const u=[];for(r in a)u.push(r),o.style[r]=a[r];const l=getComputedStyle(o)["transition-property"].split(", ");for(;i<l.length;++i)-1!==u.indexOf(l[i])&&s++;o.addEventListener("transitionend",e=>{e.target===o&&--s,0===s&&t()})}};function Id(e,t){for(const n of e)null!=n&&!1!==n&&""!==n&&(Array.isArray(n)?Id(n,t):"string"==typeof n||"number"==typeof n||"boolean"==typeof n?t.push(id(void 0,void 0,void 0,String(n),void 0)):t.push(n));return t}function Pd(e,t,...n){const r=Id(n,[]);return"function"==typeof e?e(t,r):1===r.length&&!r[0].sel&&r[0].text?hd(e,t,r[0].text):hd(e,t,r)}var _d=[];var Rd,Ld,Md={};function jd(e,t,n){return Pd(n.isInline(e)?"span":"div",null,t)}function Hd(e,t){var n,r=Ss.findKey(t,e),o=t.isInline(e),i=Pr.isVoid(t,e),a=ds(e.type,r.id),s={id:a,key:r.id,"data-slate-node":"element","data-slate-inline":o},u=e.type,l=e.children,c=void 0===l?[]:l,f=function(e){return Md[e]||jd}(u);n=i?null:c.map(function(n,r){return Vd(n,r,e,t)});var p=f(e,n,t);if(i){s["data-slate-void"]=!0;var h=o?"span":"div",g=d(Qn.texts(e),1),v=d(g[0],1)[0],m=Pd(h,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},Vd(v,0,e,t));p=Pd(h,{style:{position:"relative"}},p,m),Si.set(v,0),xi.set(v,e)}return null==p.data&&(p.data={}),Object.assign(p.data,s),i||o||(p=function(e,t,n){var r=t;return _d.forEach(function(t){r=t(e,r,n)}),r}(e,p,t)),Cn(function(){var n=Ni.get(t),o=null==n?void 0:n.querySelector("#".concat(a));null!=o&&(Oi.set(r,o),Ti.set(e,o),Bi.set(o,e))}),p}function zd(e,t){return void 0===t&&(t=!1),Pd("span",{"data-slate-string":!0},t?"".concat(e,"\n"):e)}function $d(e,t){return void 0===e&&(e=0),void 0===t&&(t=!1),Pd("span",{"data-slate-zero-width":t?"n":"z","data-slate-length":e},"\ufeff",t?Pd("br",null):null)}function Ud(e,t,n){if(null==e.text)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=Ss.findKey(n,e),o=n.getConfig().decorate;if(null==o)throw new Error("Can not get config.decorate");var i,a=Ss.findPath(n,e),s=o([e,a]),u=Wr.decorations(e,s),l=u.map(function(r){var o,i=r.leaf,a=r.position,s=null!==(o=null==a?void 0:a.isLast)&&void 0!==o?o:1===u.length,l=function(e,t,n,r,o){void 0===o&&(o=!1);var i=e.text,a=Ss.findPath(r,t),s=jn.parent(a);if(Pr.isEditor(n))throw new Error("Text node ".concat(JSON.stringify(t)," parent is Editor"));return r.isVoid(n)?$d(Qn.string(n).length):""!==i||n.children[n.children.length-1]!==t||r.isInline(n)||""!==Pr.string(r,s)?""===i?$d():o&&"\n"===i.slice(-1)?zd(i,!0):zd(i):$d(0,!0)}(i,e,t,n,s);return l=function(e,t,n){var r=t;return _d.forEach(function(t){r=t(e,r,n)}),r}(i,l,n),Pd("span",{"data-slate-leaf":!0},l)}),c=(i=r.id,"w-e-text-".concat(i)),d=Pd("span",{"data-slate-node":"text",id:c,key:r.id},l);return Cn(function(){var t=Ni.get(n),o=null==t?void 0:t.querySelector("#".concat(c));null!=o&&(Oi.set(r,o),Ti.set(e,o),Bi.set(o,e))}),d}function Vd(e,t,n,r){return Si.set(e,t),xi.set(e,n),Kn.isElement(e)?Hd(e,r):Ud(e,n,r)}var Wd=function(){if(Ld)return Rd;Ld=1;var e,t="[object Symbol]",n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",a="\\u20d0-\\u20f0",s="\\u2700-\\u27bf",u="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",c="\\ufe0e\\ufe0f",d="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",f="['’]",p="["+o+"]",g="["+d+"]",v="["+i+a+"]",m="\\d+",y="["+s+"]",b="["+u+"]",E="[^"+o+d+m+s+u+l+"]",w="\\ud83c[\\udffb-\\udfff]",C="[^"+o+"]",D="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",S="["+l+"]",x="\\u200d",N="(?:"+b+"|"+E+")",B="(?:"+S+"|"+E+")",O="(?:['’](?:d|ll|m|re|s|t|ve))?",T="(?:['’](?:D|LL|M|RE|S|T|VE))?",k="(?:"+v+"|"+w+")"+"?",F="["+c+"]?",I=F+k+("(?:"+x+"(?:"+[C,D,A].join("|")+")"+F+k+")*"),P="(?:"+[y,D,A].join("|")+")"+I,_="(?:"+[C+v+"?",v,D,A,p].join("|")+")",R=RegExp(f,"g"),L=RegExp(v,"g"),M=RegExp(w+"(?="+w+")|"+_+I,"g"),j=RegExp([S+"?"+b+"+"+O+"(?="+[g,S,"$"].join("|")+")",B+"+"+T+"(?="+[g,S+N,"$"].join("|")+")",S+"?"+N+"+"+O,S+"+"+T,m,P].join("|"),"g"),H=RegExp("["+x+o+i+a+c+"]"),z=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$="object"==typeof h&&h&&h.Object===Object&&h,U="object"==typeof self&&self&&self.Object===Object&&self,V=$||U||Function("return this")(),W=(e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(t){return null==e?void 0:e[t]});function G(e){return H.test(e)}function q(e){return G(e)?function(e){return e.match(M)||[]}(e):function(e){return e.split("")}(e)}var K=Object.prototype.toString,Y=V.Symbol,X=Y?Y.prototype:void 0,Z=X?X.toString:void 0;function J(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&K.call(e)==t}(e))return Z?Z.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}function Q(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(e,t,n)}function ee(e){return null==e?"":J(e)}var te,ne,re=(te=function(e,t,n){return t=t.toLowerCase(),e+(n?function(e){return oe(ee(e).toLowerCase())}(t):t)},function(e){return function(e,t,n){for(var r=-1,o=e?e.length:0;++r<o;)n=t(n,e[r],r,e);return n}(function(e,t){return e=ee(e),void 0===t?function(e){return z.test(e)}(e)?function(e){return e.match(j)||[]}(e):function(e){return e.match(n)||[]}(e):e.match(t)||[]}(function(e){return(e=ee(e))&&e.replace(r,W).replace(L,"")}(e).replace(R,"")),te,"")}),oe=(ne="toUpperCase",function(e){var t=G(e=ee(e))?q(e):void 0,n=t?t[0]:e.charAt(0),r=t?Q(t,1).join(""):e.slice(1);return n[ne]()+r});return Rd=re}(),Gd=g(Wd);var qd=["props","attrs","style","dataset","on","hook","ns"];function Kd(e){var t=e.data,n=void 0===t?{}:t,r=e.children,o=void 0===r?[]:r;Object.keys(n).forEach(function(t){var r,o,i=n[t];if("key"!==t){if(!qd.includes(t)){if(t.startsWith("data-")){var a=t.slice(5);return a=Gd(a),function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.dataset&&(n.dataset={}),Object.assign(n.dataset,t)}(e,((r={})[a]=i,r)),void delete n[t]}!function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.props&&(n.props={}),Object.assign(n.props,t)}(e,(o={},o[t]=i,o)),delete n[t]}}else e.key=i}),o.length>0&&o.forEach(function(e){"string"!=typeof e&&Kd(e)})}function Yd(e,t){var n,r,o=e.$scroll,i=(n=e.id,"w-e-textarea-".concat(n)),a=t.getConfig(),s=a.readOnly,u=a.autoFocus,l=function(e,t){return void 0===t&&(t=!1),hd("div#".concat(e),{props:{contentEditable:!t}})}(i,s),c=t.children||[];l.children=c.map(function(e,n){if(Di.has(e)){var r=Di.get(e);if(r){var o=d(r,2),i=o[0],a=o[1];if(a)return i!==n&&(Si.set(e,n),Di.set(e,[n,a])),a}}var s=Vd(e,n,t,t);Kd(s);var u=t.getConfig().skipCacheTypes,l=void 0===u?["list-item"]:u;return Kn.isElement(e)&&l.includes(e.type)||Di.set(e,[n,s]),s});var f,p=Ei.get(e);if(null==p&&(p=!0),p){var h=function(e){return Zi('<div\n id="'.concat(e,'"\n data-slate-editor\n data-slate-node="value"\n suppressContentEditableWarning\n role="textarea"\n spellCheck="true"\n autoCorrect="true"\n autoCapitalize="true"\n ></div>'))}(i);o.append(h),e.$textArea=h,r=h[0],Ni.set(t,r),Ti.set(t,r),Bi.set(r,t),(v=fd([yd,Nd,Fd,wd,Sd,vd]))(r,l),Ei.set(e,!1),wi.set(e,v)}else{var g=Ci.get(e),v=wi.get(e);if(null==g||null==v)return;r=g.elm,v(g,l)}if(null==r){var m=o[0];if(r=(null==m?void 0:m.querySelector("#".concat(i)))||function(e){var t,n,r;return null!==(t=window&&window.document.getElementById(e))&&void 0!==t?t:window&&(null===(r=null===(n=window.document.activeElement)||void 0===n?void 0:n.shadowRoot)||void 0===r?void 0:r.getElementById(e))||null}(i),null==r)return}if((p?u:t.isFocused())&&r.focus({preventScroll:!0}),p){var y=(f=r)&&f.ownerDocument&&f.ownerDocument.defaultView||null;y&&Fi.set(t,y)}Ni.set(t,r),Ti.set(t,r),Bi.set(r,t),Ci.set(e,l)}var Xd=1,Zd=function(){function e(e){var t=this;this.selectionChangeRoot=null,this.destroyed=!1,this.id=Xd++,this.$textArea=null,this.$progressBar=Zi('<div class="w-e-progress-bar"></div>'),this.$maxLengthInfo=Zi('<div class="w-e-max-length-info"></div>'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=Oc(function(e){var n=Ma(null==e?void 0:e.target)?e.target:null,r=null==n?void 0:n.tagName;if("INPUT"!==r&&"TEXTAREA"!==r){var o=t.getActiveEditor();null!=o&&function(e,t){var n=e.isComposing,r=e.isUpdatingSelection,o=e.isDraggingInternally,i=t.getConfig();if(!r&&!o){var a=Ss.findDocumentOrShadowRoot(t),s=a.activeElement,u=Ss.toDOMNode(t,t),l=a.getSelection();if(s!==u)return Ii.delete(t),void Hc(t);if(e.latestElement=s,Ii.set(t,!0),!l)return Hc(t);var c=l.anchorNode,d=l.focusNode,f=Fc(t,c),p=kc(t,d);if(!n)if(f&&p){var h=Ss.toSlateRange(t,l,{exactMatch:!1,suppressThrow:!0});h&&co.select(t,h)}else i.readOnly&&Hc(t)}}(t,o)}},100);var n=Zi(e);if(0===n.length)throw new Error("Cannot find textarea DOM by selector '".concat(e,"'"));this.$box=n;var r=Zi('<div class="w-e-text-container"></div>');r.append(this.$progressBar),r.append(this.$maxLengthInfo),n.append(r);var o=Zi('<div class="w-e-scroll"></div>');r.append(o),this.$scroll=o,this.$textAreaContainer=r,Cn(function(){var e=t.getActiveEditor();if(null!=e){t.bindSelectionChange(e),r.on("click",function(){return e.hidePanelOrModal()}),e.on(ni,t.changeViewState.bind(t));var o=e.getConfig(),i=o.onChange,a=o.scroll;i&&e.on(ni,function(){return i(e)}),a||(n.css("position","relative"),r.addClass("no-scroll")),t.onFocusAndOnBlur(),e.on(ni,t.changeMaxLengthInfo.bind(t)),t.bindEvent()}})}return Object.defineProperty(e.prototype,"editorInstance",{get:function(){var e=di.get(this);if(null==e)throw new Error("Can not get editor instance");return e},enumerable:!1,configurable:!0}),e.prototype.getActiveEditor=function(){if(this.destroyed)return null;var e=di.get(this);return null==e||e.isDestroyed?null:e},e.prototype.bindSelectionChange=function(e,t){var n=this;if(void 0===t&&(t=5),null==this.selectionChangeRoot&&!e.isDestroyed){try{var r=Ss.findDocumentOrShadowRoot(e);r.addEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=r}catch(r){if(t>0)return void setTimeout(function(){return n.bindSelectionChange(e,t-1)},0);window.document.addEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=window.document}e.on(ti,function(){var e;null===(e=n.selectionChangeRoot)||void 0===e||e.removeEventListener("selectionchange",n.onDOMSelectionChange),n.selectionChangeRoot=null})}},e.prototype.flushDOMSelectionChange=function(){this.onDOMSelectionChange.flush()},e.prototype.bindEvent=function(){var e=this,t=this.$textArea,n=this.$scroll,r=this.editorInstance;null!=t&&(En(ed,function(n,o){t.on(o,function(t){n(t,e,r)})}),r.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",Oc(function(){r.emit(ri)},100))))},e.prototype.onFocusAndOnBlur=function(){var e=this,t=this.getActiveEditor();if(null!=t){var n=t.getConfig(),r=n.onBlur,o=n.onFocus;this.latestEditorSelection=t.selection,t.on(ni,function(){null==e.latestEditorSelection&&null!=t.selection?setTimeout(function(){e.destroyed||t.isDestroyed||o&&o(t)}):null!=e.latestEditorSelection&&null==t.selection&&setTimeout(function(){e.destroyed||t.isDestroyed||r&&r(t)}),e.latestEditorSelection=t.selection})}},e.prototype.changeMaxLengthInfo=function(){var e=this.getActiveEditor();if(null!=e){var t=e.getConfig().maxLength;if(t){var n=t-Ss.getLeftLengthOfMaxLength(e);this.$maxLengthInfo[0].innerHTML="".concat(n,"/").concat(t)}}},e.prototype.changeProgress=function(e){var t=this.$progressBar;t.css("width","".concat(e,"%")),e>=100&&setTimeout(function(){t.hide(),t.css("width","0"),t.show()},1e3)},e.prototype.changeViewState=function(){var e=this,t=this.getActiveEditor();null!=t&&(Yd(this,t),function(e,t){var n,r=t.getConfig().placeholder;if(r){var o=t.isEmpty();if(o&&!e.showPlaceholder&&!e.isComposing){if(null==e.$placeholder){var i=Zi('<div class="w-e-text-placeholder">'.concat(r,"</div>"));e.$textAreaContainer.append(i),e.$placeholder=i}return e.$placeholder.show(),void(e.showPlaceholder=!0)}!o&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}}(this,t),Cn(function(){e.destroyed||t.isDestroyed||zc(e,t)}))},e.prototype.destroy=function(){var e;this.destroyed=!0,this.onDOMSelectionChange.cancel(),null===(e=this.selectionChangeRoot)||void 0===e||e.removeEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=null,this.$textAreaContainer.remove()},e}();function Jd(e,t,n,r){if(Si.set(e,t),xi.set(e,n),Kn.isElement(e)){var o=e.children;if((void 0===o?[]:o).forEach(function(t,n){return Jd(t,n,e,r)}),Pr.isVoid(r,e)){var i=d(Qn.texts(e),1),a=d(i[0],1)[0];Si.set(a,0),xi.set(a,e)}}}function Qd(e){var t=e.selector,n=void 0===t?"":t,r=e.config,o=void 0===r?{}:r,i=e.content,a=e.html,u=e.plugins,l=void 0===u?[]:u,c=function(e){return[Uu,Su,ji,Du,ul,$u,el,Zu].reduce(function(e,t){return t(e)},e)}(Vo());if(n&&function(e,t){return ls(e,"data-w-e-textarea",t)}(c,n))throw new Error("Repeated create editor by selector '".concat(n,"'"));var d=function(e){void 0===e&&(e={});var t=qo(Qo),n={},r=e.MENU_CONF,o=void 0===r?{}:r;return En(t,function(e,t){n[t]=s(s({},e),o[t]||{})}),delete e.MENU_CONF,s({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:n,hoverbarKeys:{},textStyleMode:"inline",classStylePolicy:"preserve-data",sanitizeHtml:Jo,customAlert:function(e,t){window.alert("".concat(t,":\n").concat(e))}},e)}(o);bi.set(c,d);var f=d.hoverbarKeys,p=void 0===f?{}:f;if(l.forEach(function(e){c=e(c)}),function(e,t){var n=t.html,r=t.content;null!=n?e.children=cs(e,n):r&&r.length&&(e.children=r),0===e.children.length&&(e.children=[{type:"paragraph",children:[{text:""}]}])}(c,{html:a,content:i}),n){var h=new Zd(n);ci.set(c,h),di.set(h,c),h.changeViewState();var g=void 0;Object.keys(p).length>0&&(g=new Bc,hi.set(g,c),gi.set(c,g)),c.on(ni,function(){c.hidePanelOrModal()}),c.on(ri,function(){c.hidePanelOrModal()})}else c.children.forEach(function(e,t){return Jd(e,t,c,c)});var v=d.onCreated,m=d.onDestroyed;return v&&c.on(ei,function(){return v(c)}),m&&c.on(ti,function(){return m(c)}),Cn(function(){return c.emit(ei)}),c}var ef=function(){function e(e,t){var n=this;this.$toolbar=Zi('<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>'),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=function(){},this.syncToolbarState=function(){n.toolbarItems.forEach(function(e){e.changeMenuState()})},this.changeToolbarState=cl(function(){n.syncToolbarState()},200),this.config=t;var r=Zi(e);if(0===r.length)throw new Error("Cannot find toolbar DOM by selector '".concat(e,"'"));this.$box=r;var o=this.$toolbar;o.on("mousedown",function(e){return e.preventDefault()},{passive:!1}),r.append(o),Cn(function(){n.initToolbar(),n.lngListen=ic(function(){return n.initToolbar()});var e=n.getEditorInstance();e.on(ni,n.changeToolbarState),e.on(oi,n.syncToolbarState),e.on(ii,n.syncToolbarState)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.getConfig=function(){return this.config},e.prototype.initToolbar=function(){this.menus={};var e=this.$toolbar;null==e||e.empty(),this.registerItems(),this.changeToolbarState()},e.prototype.registerItems=function(){var e=this,t="",n=this.$toolbar,r=this.config,o=r.toolbarKeys,i=void 0===o?[]:o,a=r.insertKeys,s=void 0===a?{index:0,keys:[]}:a,u=r.excludeKeys,l=void 0===u?[]:u,c=qo(i),d=[];d=Array.isArray(s)?s:[s];var f=0;d.forEach(function(e){var t=e.index+f;if(e.replaceFn&&c[t]){var n=e.replaceFn(c[t]);if(!n)throw new Error("This function needs to return the menu configuration: IToolbarMenuKey");c[t]=n}e.keys.length>0&&("string"==typeof e.keys&&(e.keys=[e.keys]),e.keys.forEach(function(e,n){c.splice(t+n,0,e)}),f+=e.keys.length)});var p=c.filter(function(e){var t="string"==typeof e?e:e.key;return!l.includes(t)}),h=p.length;p.forEach(function(r,o){if("|"===r){if(0===o)return;if(o+1===h)return;if("|"===t)return;var i=lc();return n.append(i),void(t=r)}return"string"==typeof r?(e.registerSingleItem(r,e),void(t=r)):e.isMenuGroup(r)?(e.registerGroup(r),void(t="group")):(e.registerSingleMenuByConf(r),void(t=r.key))})},e.prototype.isMenuGroup=function(e){return"string"!=typeof e&&Array.isArray(e.menuKeys)},e.prototype.registerSingleMenuByConf=function(e){var t=e.key,n=e.title,r=e.iconSvg;this.registerSingleItem(t,this,{title:n,iconSvg:r})},e.prototype.registerGroup=function(e){var t=this,n=this.$toolbar,r=function(e){return new gc(e)}(e),o=e.menuKeys,i=void 0===o?[]:o,a=this.config.excludeKeys,s=void 0===a?[]:a;i.forEach(function(e){s.includes(e)||t.registerSingleItem(e,r)}),n.append(r.$elem)},e.prototype.registerSingleItem=function(e,t,n){void 0===n&&(n={});var r=this.getEditorInstance(),o=t instanceof gc,i=this.menus,a=i[e];if(null==a){var s=ui[e];if(null==s)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof s)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));a=s(),i[e]=a}else console.warn("Duplicated toolbar menu key '".concat(e,"'\n重复注册了菜单栏 menu '").concat(e,"'"));var u=r.getMenuConfig(e);u&&void 0!==u.iconSvg&&(a.iconSvg=u.iconSvg),void 0!==n.iconSvg&&(a.iconSvg=n.iconSvg),void 0!==n.title&&(a.title=n.title);var l=xc(e,a,o);(this.toolbarItems.push(l),vi.set(l,r),o)?t.appendBarItem(l):t.$toolbar.append(l.$elem)},e.prototype.getEditorInstance=function(){var e=fi.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.destroy=function(){var e;this.$toolbar.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.toolbarItems=[]},e}();function tf(e,t){if(null==e)throw new Error("Cannot create toolbar, because editor is null");var n=t.selector,r=t.config,o=void 0===r?{}:r;if(function(e,t){return ls(e,"data-w-e-toolbar",t)}(e,n))throw new Error("Repeated create toolbar by selector '".concat(n,"'"));var i=s({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},o||{}),a=new ef(n,i);return fi.set(a,e),pi.set(e,a),a}function nf(e){return e&&"class"===e.getConfig().textStyleMode?"class":"inline"}function rf(e){if(!e)return"preserve-data";var t=e.getConfig().classStylePolicy;return"fallback-inline"===t?"fallback-inline":"strict"===t?"strict":"preserve-data"}function of(e,t){var n=null==e?void 0:e.getConfig().onClassStyleUnsupported;n?n(t):console.warn(t.message)}nc("en",{editor:{more:"More",justify:"Justify",indent:"Indent",image:"Image",video:"Video"}}),nc("zh-CN",{editor:{more:"更多",justify:"对齐",indent:"缩进",image:"图片",video:"视频"}});nc("en",{common:{ok:"OK",delete:"Delete",enter:"Enter"},blockQuote:{title:"Quote"},codeBlock:{title:"Code block",copy:"Copy",copied:"Copied",copyFailed:"Copy failed"},color:{color:"Font color",bgColor:"Back color",default:"Default color",clear:"Clear back color"},divider:{title:"Divider"},emotion:{title:"Emotion"},fontSize:{title:"Font size",default:"Default"},fontFamily:{title:"Font family",default:"Default"},fullScreen:{title:"Full screen",cancelTitle:"Cancel full screen"},header:{title:"Header",text:"Text"},image:{netImage:"Net image",delete:"Delete image",edit:"Edit image",editSize:"Edit size",preview:"Preview image",viewLink:"View link",src:"Image src",desc:"Description",link:"Image link",ok:"Ok",width:"Width",height:"Height"},indent:{decrease:"Decrease",increase:"Increase"},justify:{left:"Left",right:"Right",center:"Center",justify:"Justify"},lineHeight:{title:"Line height",default:"Default"},link:{insert:"Insert link",text:"Link text",url:"Link source",unLink:"Unlink",edit:"Edit link",view:"View link"},textStyle:{bold:"Bold",clear:"Clear styles",code:"Inline code",italic:"Italic",sub:"Sub",sup:"Sup",through:"Through",underline:"Underline"},undo:{undo:"undo",redo:"Redo"},todo:{todo:"Todo"},formatPainter:{title:"Format Painter"}}),nc("zh-CN",{common:{ok:"确定",delete:"删除",enter:"回车"},blockQuote:{title:"引用"},codeBlock:{title:"代码块",copy:"复制",copied:"已复制",copyFailed:"复制失败"},color:{color:"文字颜色",bgColor:"背景色",default:"默认颜色",clear:"清除背景色"},divider:{title:"分割线"},emotion:{title:"表情"},fontSize:{title:"字号",default:"默认字号"},fontFamily:{title:"字体",default:"默认字体"},fullScreen:{title:"全屏",cancelTitle:"取消全屏"},header:{title:"标题",text:"正文"},image:{netImage:"网络图片",delete:"删除图片",edit:"编辑图片",editSize:"修改尺寸",preview:"预览图片",viewLink:"查看链接",src:"图片地址",desc:"图片描述",link:"图片链接",ok:"确定",width:"宽度",height:"高度"},indent:{decrease:"减少缩进",increase:"增加缩进"},justify:{left:"左对齐",right:"右对齐",center:"居中对齐",justify:"两端对齐"},lineHeight:{title:"行高",default:"默认行高"},link:{insert:"插入链接",text:"链接文本",url:"链接地址",unLink:"取消链接",edit:"修改链接",view:"查看链接"},textStyle:{bold:"粗体",clear:"清除格式",code:"行内代码",italic:"斜体",sub:"下标",sup:"上标",through:"删除线",underline:"下划线"},undo:{undo:"撤销",redo:"重做"},todo:{todo:"待办"},formatPainter:{title:"格式刷"}});var af={type:"blockquote",elemToHtml:function(e,t){return"<blockquote>".concat(t,"</blockquote>")}},sf='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',uf='<svg viewBox="0 0 1024 1024"><path d="M924.402464 1023.068211H0.679665V99.345412h461.861399v98.909208H99.596867v725.896389h725.896389V561.206811h98.909208z" p-id="10909"></path><path d="M930.805104 22.977336l69.965436 69.965436-453.492405 453.492404-69.965435-69.901489z" p-id="10910"></path><path d="M1022.464381 304.030081h-98.917201V99.345412H709.230573V0.428211h313.233808z"></path></svg>',lf='<svg viewBox="0 0 1024 1024"><path d="M133.705143 335.433143V133.851429h201.581714a29.622857 29.622857 0 0 0 29.622857-29.549715V68.754286a29.622857 29.622857 0 0 0-29.622857-29.622857H61.732571A22.893714 22.893714 0 0 0 38.765714 62.025143V335.725714c0 16.310857 13.238857 29.622857 29.622857 29.622857h35.547429a29.842286 29.842286 0 0 0 29.696-29.842285zM690.980571 133.851429h201.581715v201.654857c0 16.310857 13.238857 29.549714 29.622857 29.549714h35.547428a29.622857 29.622857 0 0 0 29.549715-29.549714V61.952a22.893714 22.893714 0 0 0-22.820572-22.893714h-273.554285a29.622857 29.622857 0 0 0-29.549715 29.622857v35.547428c0 16.310857 13.238857 29.696 29.622857 29.696zM335.286857 892.781714H133.705143V691.2a29.622857 29.622857 0 0 0-29.622857-29.622857H68.534857a29.622857 29.622857 0 0 0-29.549714 29.622857v273.554286c0 12.653714 10.24 22.893714 22.820571 22.893714h273.554286a29.622857 29.622857 0 0 0 29.696-29.622857v-35.547429a29.769143 29.769143 0 0 0-29.769143-29.696z m557.348572-201.581714v201.581714H690.907429a29.622857 29.622857 0 0 0-29.622858 29.622857v35.547429c0 16.310857 13.238857 29.622857 29.622858 29.622857h273.554285c12.580571 0 22.893714-10.313143 22.893715-22.893714V691.2a29.622857 29.622857 0 0 0-29.622858-29.622857h-35.547428a29.622857 29.622857 0 0 0-29.696 29.622857z"></path></svg>',cf=function(){function e(){this.title=ac("blockQuote.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M894.6 907.1H605.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C752.7 180.4 711.3 315.8 711.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z m-472 0H133.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C280.7 180.4 239.3 315.8 239.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!!Ss.getSelectedNodeByType(e,"blockquote")},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=d(Pr.nodes(e,{match:function(e){var t=Ss.getNodeType(e);return"paragraph"===t||"blockquote"===t},universal:!0,mode:"highest"}),1);return!t[0]},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=this.isActive(e)?"paragraph":"blockquote";co.setNodes(e,{type:n},{mode:"highest"})}},e}(),df={key:"blockquote",factory:function(){return new cf}};function ff(e){return 0===Zi("<div>".concat(e,"</div>")).children().filter(function(e){return"BR"!==e.tagName}).length}function pf(e){return 0===e.length?"":e[0].outerHTML}function hf(e){return e.length?e[0].tagName.toLowerCase():""}function gf(e,t){for(var n="",r=(e.attr("style")||"").split(";"),o=r.length,i=0;i<o;i+=1){var a=r[i];if(a){var s=a.split(":");s[0].trim()===t&&(n=s[1].trim())}}return n}function vf(e,t){return!!Wr.isText(e)||!!t.isInline(e)}pa&&(Zi.fn.css=pa),ba&&(Zi.fn.append=ba),Ea&&(Zi.fn.prepend=Ea),Ji&&(Zi.fn.addClass=Ji),Qi&&(Zi.fn.removeClass=Qi),ea&&(Zi.fn.hasClass=ea),aa&&(Zi.fn.on=aa),sa&&(Zi.fn.off=sa),Ta&&(Zi.fn.focus=Ta),ta&&(Zi.fn.attr=ta),na&&(Zi.fn.removeAttr=na),da&&(Zi.fn.hide=da),fa&&(Zi.fn.show=fa),Ca&&(Zi.fn.parents=Ca),oa&&(Zi.fn.dataset=oa),ia&&(Zi.fn.val=ia),ma&&(Zi.fn.text=ma),va&&(Zi.fn.html=va),Aa&&(Zi.fn.children=Aa),Sa&&(Zi.fn.remove=Sa),Da&&(Zi.fn.find=Da),ua&&(Zi.fn.width=ua),la&&(Zi.fn.height=la),ga&&(Zi.fn.filter=ga),xa&&(Zi.fn.empty=xa);var mf={selector:"blockquote:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=Zi(e),o=[];return t.forEach(function(e,r){vf(e,n)?o.push(e):Kn.isElement(e)&&(o.push.apply(o,f([],d(function(e,t){var n=e.children.filter(function(e){return vf(e,t)});if(n.length>0)return n;var r=Qn.string(e);return r?[{text:r}]:[]}(e,n)),!1)),function(e,t,n){for(var r=t+1;r<e.length;r+=1){var o=e[r];if(Kn.isElement(o)&&!n.isInline(o))return!0}return!1}(t,r,n)&&function(e){var t=e[e.length-1];Wr.isText(t)&&t.text.endsWith("\n")||e.push({text:"\n"})}(o))}),0===(t=o).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"blockquote",children:t}}};function yf(e){e.deleteBackward("character");co.insertNodes(e,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}var bf={type:"blockquote",renderElem:function(e,t,n){return Pd("blockquote",null,t)}},Ef={renderElems:[bf],elemsToHtml:[af],parseElemsHtml:[mf],menus:[df],editorPlugin:function(e){var t=e.insertBreak,n=e.insertText,r=e;return r.insertBreak=function(){var o=r.selection;if(null==o)return t();var i=d(Pr.nodes(e,{match:function(e){return Ss.checkNodeType(e,"blockquote")},universal:!0}),1),a=i[0];if(!a)return t();var s=a[0];if(Ss.getParentNode(e,s)){var u=Ss.findPath(e,s),l=Pr.end(e,u);if(Mr.equals(l,o.focus)){var c=Pr.last(e,l.path),f=Qn.string(c[0]);if(f&&"\n"===f.slice(-1))return void yf(r)}n("\n")}else yf(r)},r}};var wf={type:"code",elemToHtml:function(e,t){return"<code>".concat(t,"</code>")}};var Cf={type:"pre",elemToHtml:function(e,t){return"<pre>".concat(t,"</pre>")}},Df=function(){function e(){this.title=ac("codeBlock.title"),this.iconSvg='<svg viewBox="0 0 1280 1024"><path d="M832 736l96 96 320-320L928 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224zM701.312 150.528l69.472 18.944-192 704.032-69.472-18.944 192-704.032z"></path></svg>',this.tag="button"}return e.prototype.getSelectCodeElem=function(e){var t=Ss.getSelectedNodeByType(e,"code");if(null==t)return null;var n=Ss.getParentNode(e,t);return null==n||"pre"!==Ss.getNodeType(n)?null:t},e.prototype.getValue=function(e){var t=this.getSelectCodeElem(e);if(null==t){var n=e.getMenuConfig("codeSelectLang").codeLangs,r=(void 0===n?[]:n).find(function(e){return e.selected});return(null==r?void 0:r.value)||""}return t.language||""},e.prototype.isActive=function(e){return!!this.getSelectCodeElem(e)},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=Ss.getSelectedElems(e);return!!t.some(function(t){return e.isVoid(t)})||!t.some(function(e){var t=Ss.getNodeType(e);return"pre"===t||"paragraph"===t})},e.prototype.exec=function(e,t){this.isActive(e)?this.changeToPlainText(e):this.changeToCodeBlock(e,t.toString())},e.prototype.changeToPlainText=function(e){var t=this.getSelectCodeElem(e);if(null!=t){var n=Qn.string(t);co.removeNodes(e,{mode:"highest"});var r=n.split("\n").map(function(e){return{type:"paragraph",children:[{text:e}]}});co.insertNodes(e,r,{mode:"highest"})}},e.prototype.changeToCodeBlock=function(e,t){var n,r,o=[],i=Pr.nodes(e,{match:function(t){return e.children.includes(t)},universal:!0});try{for(var a=c(i),s=a.next();!s.done;s=a.next()){var u=d(s.value,1)[0];u&&o.push(Qn.string(u))}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}co.removeNodes(e,{mode:"highest"});var l={type:"pre",children:[{type:"code",language:t,children:[{text:o.join("\n")}]}]};co.insertNodes(e,l,{mode:"highest"})},e}();var Af={selector:"pre:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=Zi(e);return 0===(t=t.filter(function(e){return"code"===Ss.getNodeType(e)})).length&&(t=[{type:"code",language:"",children:[{text:r[0].textContent||""}]}]),{type:"pre",children:t.filter(function(e){return"code"===Ss.getNodeType(e)})}}};function Sf(e){var t=document.createElement("textarea");t.value=e,t.setAttribute("readonly","readonly"),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",document.body.appendChild(t),t.select(),t.setSelectionRange(0,t.value.length);var n=document.execCommand("copy");return document.body.removeChild(t),n}function xf(e){return u(this,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:if(""===e)return[2,!0];n.label=1;case 1:return n.trys.push([1,4,,5]),"undefined"!=typeof navigator&&(null===(t=navigator.clipboard)||void 0===t?void 0:t.writeText)?[4,navigator.clipboard.writeText(e)]:[3,3];case 2:return n.sent(),[2,!0];case 3:return[3,5];case 4:return n.sent(),[3,5];case 5:try{return[2,Sf(e)]}catch(e){return[2,!1]}return[2]}})})}var Nf={type:"pre",renderElem:function(e,t,n){var r=this,o=(n.getMenuConfig("codeBlock")||{}).showCopyButton;if(!(void 0!==o&&o))return Pd("pre",null,t);var i=function(e){var t=e.children;return(void 0===t?[]:t).map(function(e){return(e.children||[]).map(function(e){return e.text||""}).join("")}).join("\n")}(e),a=ac("codeBlock.copy"),s=ac("codeBlock.copied"),c=ac("codeBlock.copyFailed"),d=Pd("pre",{className:"w-e-code-block"},Pd("button",{className:"w-e-code-block-copy-button",contentEditable:!1,on:{mousedown:function(e){e.preventDefault(),e.stopPropagation()},click:function(e){return u(r,void 0,void 0,function(){var t,n;return l(this,function(r){switch(r.label){case 0:return e.preventDefault(),e.stopPropagation(),null==(t=e.currentTarget||e.target)?[2]:[4,xf(i)];case 1:return n=r.sent(),function(e,t,n){var r=Number(e.dataset.copyResetTimer||0);r&&window.clearTimeout(r),e.textContent=t;var o=window.setTimeout(function(){e.textContent=n,delete e.dataset.copyResetTimer},1200);e.dataset.copyResetTimer="".concat(o)}(t,n?s:c,a),[2]}})})}}},a),t);return d}},Bf={type:"code",renderElem:function(e,t,n){return Pd("code",null,t)}},Of={menus:[{key:"codeBlock",config:{showCopyButton:!1},factory:function(){return new Df}}],editorPlugin:function(e){var t=e.insertBreak,n=e.normalizeNode,r=e.insertData,o=e.handleTab,i=e;return i.insertBreak=function(){var e=Ss.getSelectedNodeByType(i,"code");if(null!=e){var n=function(e,t){var n=t.selection;if(null==n)return"";var r=Qn.string(e),o=n.anchor.offset,i=r.slice(0,o).split("\n"),a=i.length;return 0===a?"":i[a-1]}(e,i);if(n){var r=n.match(/^\s+/);if(null!=r&&null!=r[0]){var o=r[0];return void i.insertText("\n".concat(o))}}i.insertText("\n")}else t()},e.handleTab=function(){var t=e.selection;if(t){var n=Ss.getSelectedNodeByType(e,"code");if(n&&!Gn.isCollapsed(t)){var r=d([t.anchor,t.focus].sort(function(e,t){return e.offset-t.offset}),2),i=r[0],a=r[1],s=n.children[0].text,u=s.split("\n"),l=s.slice(0,i.offset).split("\n").length-1,c=s.slice(0,a.offset).split("\n").length-1,f=u.map(function(e,t){return t>=l&&t<=c?" ".concat(e):e}),p=f.join("\n"),h={anchor:{path:i.path,offset:i.offset+2},focus:{path:a.path,offset:a.offset+2}};co.insertText(e,p,{at:{anchor:{path:i.path,offset:0},focus:{path:a.path,offset:s.length}}}),co.select(e,h)}else o()}},i.normalizeNode=function(e){var t=d(e,2),r=t[0],o=t[1],a=Ss.getNodeType(r);("code"===a&&o.length<=1&&co.setNodes(i,{type:"paragraph"},{at:o}),"pre"===a)&&(Ss.isLastNode(i,r)&&co.insertNodes(i,Ss.genEmptyParagraph(),{at:[o[0]+1]}),"code"!==Ss.getNodeType(r.children[0])&&(co.unwrapNodes(i),co.setNodes(i,{type:"paragraph"},{mode:"highest"})));return n([r,o])},i.insertData=function(e){if(null!=Ss.getSelectedNodeByType(i,"code")){var t=e.getData("text/plain");Pr.insertText(i,t)}else r(e)},i},renderElems:[Nf,Bf],elemsToHtml:[wf,Cf],preParseHtml:[{selector:"pre>code",preParseHtml:function(e){var t=Zi(e);if("code"!==hf(t))return e;var n=t.find("xmp");if(0===n.length)return e;var r=n.text();return n.remove(),t.text(r),t[0]}}],parseElemsHtml:[{selector:"pre:not([data-w-e-type])>code",parseElemHtml:function(e,t,n){return{type:"code",language:"",children:[{text:Zi(e)[0].textContent||""}]}}},Af]},Tf=function(){function e(){this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(e,t){},e.prototype.getValue=function(e){var t=this.mark,n=Pr.marks(e);return n&&n[t]?n[t]:""},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=d(Pr.nodes(e,{match:function(t){return"pre"===Ss.getNodeType(t)||!(!Kn.isElement(t)||!Pr.isVoid(e,t))},universal:!0}),1);return!!t[0]},e.prototype.getPanelContentElem=function(e){var t=this.mark;if(null==this.$content){var n=Zi('<ul class="w-e-panel-content-color"></ul>');n.on("click","li",function(n){var r=n.target;if(null!=r&&(n.preventDefault(),null!=e.selection)){var o=Zi(r).attr("data-value");"0"===o?Pr.removeMark(e,t):Pr.addMark(e,t,o)}}),this.$content=n}var r=this.$content;if(null==r)return document.createElement("ul");r.empty();var o=this.getValue(e),i=e.getMenuConfig(t).colors;(void 0===i?[]:i).forEach(function(e){var t=Zi('<div class="color-block" data-value="'.concat(e,'"></div>'));t.css("background-color",e);var n=Zi('<li data-value="'.concat(e,'"></li>'));o===e&&n.addClass("active"),n.append(t),r.append(n)});var a="";"color"===t&&(a=ac("color.default")),"bgColor"===t&&(a=ac("color.clear"));var s=Zi('\n <li data-value="0" class="clear">\n '.concat('<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>',"\n ").concat(a,"\n </li>\n "));return r.prepend(s),r[0]},e}(),kf=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("color.bgColor"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M510.030769 315.076923l84.676923 196.923077h-177.230769l76.8-196.923077h15.753846zM945.230769 157.538462v708.923076c0 43.323077-35.446154 78.769231-78.769231 78.769231H157.538462c-43.323077 0-78.769231-35.446154-78.769231-78.769231V157.538462c0-43.323077 35.446154-78.769231 78.769231-78.769231h708.923076c43.323077 0 78.769231 35.446154 78.769231 78.769231z m-108.307692 643.938461L600.615385 216.615385c-5.907692-11.815385-15.753846-19.692308-29.538462-19.692308h-139.815385c-11.815385 0-23.630769 7.876923-27.56923 19.692308l-216.615385 584.861538c-3.938462 11.815385 3.938462 25.6 17.723077 25.6h80.738462c11.815385 0 23.630769-9.846154 27.56923-21.661538l63.015385-175.261539h263.876923l68.923077 175.261539c3.938462 11.815385 15.753846 21.661538 27.569231 21.661538h80.738461c13.784615 0 23.630769-13.784615 19.692308-25.6z"></path></svg>',t.mark="bgColor",t}return a(t,e),t}(Tf),Ff=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("color.color"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 864h896v96H64zM360.58 576h302.85l81.53 224h102.16L579.24 64H444.77L176.89 800h102.16l81.53-224zM512 159.96L628.49 480H395.52L512 159.96z"></path></svg>',t.mark="color",t}return a(t,e),t}(Tf),If=["rgb(0, 0, 0)","rgb(38, 38, 38)","rgb(89, 89, 89)","rgb(140, 140, 140)","rgb(191, 191, 191)","rgb(217, 217, 217)","rgb(233, 233, 233)","rgb(245, 245, 245)","rgb(250, 250, 250)","rgb(255, 255, 255)","rgb(225, 60, 57)","rgb(231, 95, 51)","rgb(235, 144, 58)","rgb(245, 219, 77)","rgb(114, 192, 64)","rgb(89, 191, 192)","rgb(66, 144, 247)","rgb(54, 88, 226)","rgb(106, 57, 201)","rgb(216, 68, 147)","rgb(251, 233, 230)","rgb(252, 237, 225)","rgb(252, 239, 212)","rgb(252, 251, 207)","rgb(231, 246, 213)","rgb(218, 244, 240)","rgb(217, 237, 250)","rgb(224, 232, 250)","rgb(237, 225, 248)","rgb(246, 226, 234)","rgb(255, 163, 158)","rgb(255, 187, 150)","rgb(255, 213, 145)","rgb(255, 251, 143)","rgb(183, 235, 143)","rgb(135, 232, 222)","rgb(145, 213, 255)","rgb(173, 198, 255)","rgb(211, 173, 247)","rgb(255, 173, 210)","rgb(255, 77, 79)","rgb(255, 122, 69)","rgb(255, 169, 64)","rgb(255, 236, 61)","rgb(115, 209, 61)","rgb(54, 207, 201)","rgb(64, 169, 255)","rgb(89, 126, 247)","rgb(146, 84, 222)","rgb(247, 89, 171)","rgb(207, 19, 34)","rgb(212, 56, 13)","rgb(212, 107, 8)","rgb(212, 177, 6)","rgb(56, 158, 13)","rgb(8, 151, 156)","rgb(9, 109, 217)","rgb(29, 57, 196)","rgb(83, 29, 171)","rgb(196, 29, 127)","rgb(130, 0, 20)","rgb(135, 20, 0)","rgb(135, 56, 0)","rgb(97, 71, 0)","rgb(19, 82, 0)","rgb(0, 71, 79)","rgb(0, 58, 140)","rgb(6, 17, 120)","rgb(34, 7, 94)","rgb(120, 6, 80)"];function Pf(){return If}var _f={key:"color",factory:function(){return new Ff},config:{colors:Pf()}},Rf={key:"bgColor",factory:function(){return new kf},config:{colors:If}};function Lf(e,t){null==e.data&&(e.data={});var n=e.data;null==n.style&&(n.style={}),Object.assign(n.style,t)}var Mf={color:"w-e-color",bgColor:"w-e-bg-color",fontSize:"w-e-font-size",fontFamily:"w-e-font-family",textAlign:"w-e-text-align",lineHeight:"w-e-line-height",indent:"w-e-indent"},jf={color:"data-w-e-color",bgColor:"data-w-e-bg-color",fontSize:"data-w-e-font-size",fontFamily:"data-w-e-font-family",textAlign:"data-w-e-text-align",lineHeight:"data-w-e-line-height",indent:"data-w-e-indent"},Hf={color:"wEColor",bgColor:"wEBgColor",fontSize:"wEFontSize",fontFamily:"wEFontFamily",textAlign:"wETextAlign",lineHeight:"wELineHeight",indent:"wEIndent"},zf=new Set;function $f(e,t){var n=(t||"").trim();return n?"fontFamily"===e?n.replace(/"/g,"").replace(/\s+/g," ").toLowerCase():n.replace(/\s+/g,"").toLowerCase():""}function Uf(e,t){var n=$f(e,t),r=function(e){var t,n,r=7;try{for(var o=c(e),i=o.next();!i.done;i=o.next())r=(31*r+(i.value.codePointAt(0)||0))%2147483647}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.toString(36)}("".concat(e,":").concat(n));return"".concat(Mf[e],"-").concat(r)}function Vf(e,t){var n,r,o,i=(o=["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"].map(function(e){return"string"==typeof e?e:e.value}),{color:Pf(),bgColor:Pf(),fontSize:o,fontFamily:["黑体",{name:"仿宋",value:"仿宋"},"楷体","标楷体","华文仿宋","华文楷体",{name:"宋体",value:"宋体"},"微软雅黑","Arial","Tahoma","Verdana","Times New Roman","Courier New"].map(function(e){return"string"==typeof e?e:e.value}),textAlign:["left","center","right","justify"],lineHeight:["1","1.15","1.5","2","2.5","3"],indent:(n=o,r=new Set(["2em"]),n.forEach(function(e){var t="".concat(e||"").trim().match(/^(-?\d+(\.\d+)?)([a-z%]+)$/i);if(t){var n=parseFloat(t[1]),o=t[3];!Number.isFinite(n)||n<=0||!o||r.add("".concat(2*n).concat(o))}}),Array.from(r))})[t],a=function(e,t){var n,r=null===(n=null==e?void 0:e.getConfig().styleClassTokens)||void 0===n?void 0:n[t];return Array.isArray(r)?r:[]}(e,t),s=f(f([],d(i),!1),d(a),!1),u=new Set;return s.forEach(function(e){var t="".concat(e||"").trim();t&&u.add(t)}),Array.from(u)}function Wf(e,t,n,r){if(function(e,t,n){var r=$f(t,n);if(!r)return!1;for(var o=Vf(e,t),i=0;i<o.length;i+=1)if($f(t,o[i])===r)return!0;return!1}(e,t,n))return"class";var o=rf(e),i="preserve-data";"fallback-inline"===o&&(i="inline"),"strict"===o&&(i="throw");var a='[wangeditor] Unsupported class style token "'.concat(t,"=").concat(n,'" in ').concat(r,". policy=").concat(o),s="".concat(t,"|").concat(n,"|").concat(r,"|").concat(i);if(zf.has(s)||(zf.add(s),of(e,{type:t,value:n,scene:r,fallback:i,message:a})),"throw"===i)throw new Error(a);return"inline"===i?"inline":"preserve-data"}function Gf(e){return nf(e)}function qf(e,t,n,r,o,i){var a="".concat(n||"").trim();if(a){e.attr(jf[t],a);var s=Wf(r,t,a,o);"class"!==s?"inline"===s&&i&&i():e.addClass(Uf(t,a))}}function Kf(e,t,n,r,o,i){var a,s="".concat(n||"").trim();if(s){!function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.dataset&&(n.dataset={}),Object.assign(n.dataset,t)}(e,(a={},a[Hf[t]]=s,a));var u=Wf(r,t,s,o);"class"!==u?"inline"===u&&i&&Lf(e,i):function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.props&&(n.props={});var r=String(n.props.className||"").trim(),o=r?r.split(/\s+/):[];o.includes(t)||o.push(t),n.props.className=o.join(" ")}(e,Uf(t,s))}}function Yf(e,t,n){var r=e.attr(jf[t])||"";if(r)return r;for(var o=(e.attr("class")||"").trim().split(/\s+/).filter(Boolean),i="".concat(Mf[t],"-"),a=function(e,t){var n=Vf(e,t),r={};return n.forEach(function(e){r[Uf(t,e)]=e}),r}(n,t),s=0;s<o.length;s+=1){var u=o[s];if(u.startsWith(i)){var l=a[u];if(l)return l}}return""}var Xf={selector:"font",preParseHtml:function(e){var t=Zi(e);if("font"!==hf(t))return e;var n=t.attr("color")||"";return n&&(t.removeAttr("color"),t.css("color",n)),t[0]}};var Zf={renderStyle:function(e,t,n){var r=e,o=r.color,i=r.bgColor,a=t;return"class"===Gf(n)?(o&&Kf(a,"color",o,n,"render",{color:o}),i&&Kf(a,"bgColor",i,n,"render",{backgroundColor:i})):(o&&Lf(a,{color:o}),i&&Lf(a,{backgroundColor:i})),a},styleToHtml:function(e,t,n){if(!Wr.isText(e))return t;var r,o=e,i=o.color,a=o.bgColor;return i||a?((ff(t)||"span"!==hf(r=Zi(t)))&&(r=Zi("<span>".concat(t,"</span>"))),"class"===Gf(n)?(i&&qf(r,"color",i,n,"toHtml",function(){r.css("color",i)}),a&&qf(r,"bgColor",a,n,"toHtml",function(){r.css("background-color",a)})):(i&&r.css("color",i),a&&r.css("background-color",a)),pf(r)):t},preParseHtml:[Xf],parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Wr.isText(t))return t;var o=t,i=gf(r,"color");i||(i=Yf(r,"color",n)),i&&(o.color=i);var a=gf(r,"background-color");return a||(a=gf(r,"background")),a||(a=Yf(r,"bgColor",n)),a&&(o.bgColor=a),o},menus:[_f,Rf]},Jf=function(){function e(){this.title=ac("common.enter"),this.iconSvg='<svg viewBox="0 0 1255 1024"><path d="M1095.111111 731.477333h-625.777778V1024L0 658.318222 469.333333 292.408889v292.636444h625.777778V0h156.444445v731.477333z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||!!Gn.isExpanded(t)},e.prototype.exec=function(e,t){var n=e.selection;if(null!=n){var r=[n.anchor.path[0]];co.insertNodes(e,{type:"paragraph",children:[{text:""}]},{at:r}),e.select(Pr.start(e,r))}},e}(),Qf={menus:[{key:"enter",factory:function(){return new Jf}}]};var ep={type:"divider",elemToHtml:function(e,t){return"<hr/>"}},tp=function(){function e(){this.title=ac("divider.title"),this.iconSvg='<svg viewBox="0 0 1092 1024"><path d="M0 51.2m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M819.2 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M409.6 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 870.4m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!!Ss.getSelectedElems(e).some(function(t){if(e.isVoid(t))return!0;var n=Ss.getNodeType(t);return"table"===n||"pre"===n})},e.prototype.exec=function(e,t){Ss.isSelectedEmptyParagraph(e)&&co.removeNodes(e,{mode:"highest"}),co.insertNodes(e,{type:"divider",children:[{text:""}]},{mode:"highest"})},e}();var np={renderElems:[{type:"divider",renderElem:function(e,t,n){return hd("div",{props:{contentEditable:!1,className:"w-e-textarea-divider"},dataset:{selected:Ss.isNodeSelected(n,e)?"true":""},style:{},on:{mousedown:function(e){return e.preventDefault()}}},[hd("hr")])}}],elemsToHtml:[ep],parseElemsHtml:[{selector:"hr:not([data-w-e-type])",parseElemHtml:function(e,t,n){return{type:"divider",children:[{text:""}]}}}],menus:[{key:"divider",factory:function(){return new tp}}],editorPlugin:function(e){var t=e.isVoid,n=e.normalizeNode,r=e;return r.isVoid=function(e){return"divider"===e.type||t(e)},r.normalizeNode=function(e){var t=d(e,2),o=t[0],i=t[1];if("divider"!==Ss.getNodeType(o))return n([o,i]);Ss.isLastNode(r,o)&&co.insertNodes(r,Ss.genEmptyParagraph(),{at:[i[0]+1]})},r}};var rp=function(){function e(){this.title=ac("emotion.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m0-102.4c226.742857 0 409.6-182.857143 409.6-409.6S738.742857 102.4 512 102.4 102.4 285.257143 102.4 512s182.857143 409.6 409.6 409.6z m-204.8-358.4h409.6c0 113.371429-91.428571 204.8-204.8 204.8s-204.8-91.428571-204.8-204.8z m0-102.4c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8 76.8 32.914286 76.8 76.8-32.914286 76.8-76.8 76.8z m409.6 0c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8c43.885714 0 76.8 32.914286 76.8 76.8s-32.914286 76.8-76.8 76.8z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(e,t){},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=d(Pr.nodes(e,{match:function(t){return"pre"===Ss.getNodeType(t)||!(!Kn.isElement(t)||!Pr.isVoid(e,t))},universal:!0}),1);return!!t[0]},e.prototype.getPanelContentElem=function(e){if(null==this.$content){var t=Zi('<ul class="w-e-panel-content-emotion"></ul>');t.on("click","li",function(t){var n=t.target;if(null!=n){t.preventDefault();var r=Zi(n).text();e.insertText(r)}}),this.$content=t}var n=this.$content;if(null==n)return document.createElement("ul");n.empty();var r=e.getMenuConfig("emotion").emotions;return(void 0===r?[]:r).forEach(function(e){var t=Zi("<li>".concat(e,"</li>"));n.append(t)}),n[0]},e}(),op={menus:[{key:"emotion",factory:function(){return new rp},config:{emotions:"😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 😘 😗 😙 😚 😋 😛 😝 😜 🤓 😎 😏 😒 😞 😔 😟 😕 🙁 😣 😖 😫 😩 😢 😭 😤 😠 😡 😳 😱 😨 🤗 🤔 😶 😑 😬 🙄 😯 😴 😷 🤑 😈 🤡 💩 👻 💀 👀 👣 👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏".split(" ")}}]},ip=function(){function e(){this.tag="select",this.width=80}return e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.mark,n=Pr.marks(e);return n&&n[t]?n[t]:""},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=d(Pr.nodes(e,{match:function(t){return"pre"===Ss.getNodeType(t)||!(!Kn.isElement(t)||!Pr.isVoid(e,t))},universal:!0}),1);return!!t[0]},e.prototype.exec=function(e,t){var n=this.mark;t?e.addMark(n,t):e.removeMark(n)},e}(),ap=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("fontFamily.title"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M956.788364 152.110545h-24.110546l23.924364 9.029819 0.186182 121.018181h-65.070546l-86.574545-130.048H566.551273v650.14691l130.048 64.977454v65.163636h-390.050909v-65.163636l129.954909-64.977454V152.110545H198.283636L111.429818 282.065455H46.545455V69.259636C46.545455 33.792 82.664727 22.062545 98.955636 22.062545h812.683637c23.738182 0 45.056 15.173818 45.056 41.053091V169.425455v-17.221819z"></path></svg>',t.mark="fontFamily",t.selectPanelWidth=150,t}return a(t,e),t.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig(this.mark).fontFamilyList,r=void 0===n?[]:n;t.push({text:ac("fontFamily.default"),value:""}),r.forEach(function(e){if("string"==typeof e)t.push({text:e,value:e,styleForRenderMenuList:{"font-family":e}});else if("object"==typeof e){var n=e.name,r=e.value;t.push({text:n,value:r,styleForRenderMenuList:{"font-family":r}})}});var o=this.getValue(e),i=!1;return t.forEach(function(e){e.value===o?(i=!0,e.selected=!0):e.selected=void 0}),i||"string"!=typeof o||t.push({text:o,value:o,selected:!0}),t},t}(ip),sp=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("fontSize.title"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 512h384v128h-128V1024h-128V640h-128z m896-256H708.2496v768h-136.4992V256H320V128h640z"></path></svg>',t.mark="fontSize",t}return a(t,e),t.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig(this.mark).fontSizeList,r=void 0===n?[]:n;t.push({text:ac("fontSize.default"),value:""}),r.forEach(function(e){if("string"==typeof e)t.push({text:e,value:e});else if("object"==typeof e){var n=e.name,r=e.value;t.push({text:n,value:r})}});var o=this.getValue(e),i=!1;return t.forEach(function(e){e.value===o?(i=!0,e.selected=!0):e.selected=void 0}),i||"string"!=typeof o||t.push({text:o,value:o,selected:!0}),t},t}(ip);var up={1:"12px",2:"14px",3:"16px",4:"19px",5:"24px",6:"32px",7:"48px"};var lp={renderStyle:function(e,t,n){var r=e,o=r.fontSize,i=r.fontFamily,a=t;return"class"===Gf(n)?(o&&Kf(a,"fontSize",o,n,"render",{fontSize:o}),i&&Kf(a,"fontFamily",i,n,"render",{fontFamily:i})):(o&&Lf(a,{fontSize:o}),i&&Lf(a,{fontFamily:i})),a},styleToHtml:function(e,t,n){if(!Wr.isText(e))return t;var r,o=e,i=o.fontSize,a=o.fontFamily;return i||a?((ff(t)||"span"!==hf(r=Zi(t)))&&(r=Zi("<span>".concat(t,"</span>"))),"class"===Gf(n)?(i&&qf(r,"fontSize",i,n,"toHtml",function(){r.css("font-size",i)}),a&&qf(r,"fontFamily",a,n,"toHtml",function(){r.css("font-family",a)})):(i&&r.css("font-size",i),a&&r.css("font-family",a)),pf(r)):t},preParseHtml:[{selector:"font",preParseHtml:function(e){var t=Zi(e);if("font"!==hf(t))return e;var n=t.attr("size")||"";n&&(t.removeAttr("size"),t.css("font-size",up[n]));var r=t.attr("face")||"";return r&&(t.removeAttr("face"),t.css("font-family",r)),t[0]}}],parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Wr.isText(t))return t;var o=t,i=gf(r,"font-size");i||(i=Yf(r,"fontSize",n)),i&&(o.fontSize=i);var a=gf(r,"font-family"),s=Yf(r,"fontFamily",n),u=(a||s).replace(/"/g,"");return u&&(o.fontFamily=u),o},menus:[{key:"fontSize",factory:function(){return new sp},config:{fontSizeList:["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"]}},{key:"fontFamily",factory:function(){return new ap},config:{fontFamilyList:["黑体",{name:"仿宋",value:"仿宋"},"楷体","标楷体","华文仿宋","华文楷体",{name:"宋体",value:"宋体"},"微软雅黑","Arial","Tahoma","Verdana","Times New Roman","Courier New"]}}]};var cp=function(){function e(){this.title=ac("formatPainter.title"),this.iconSvg='<svg viewBox="0 0 24 24"><path d="M8 19.997v-5h2v5h9v-7H5v7zm-4-9h16v-3h-6v-4h-4v4H4zm-1 10v-8H2v-6a1 1 0 0 1 1-1h5v-3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v3h5a1 1 0 0 1 1 1v6h-1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1"/></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(t){return e.attrs.isSelect},e.prototype.isDisabled=function(e){return!1},e.prototype.isSourceBlockType=function(e){return"blockquote"===e||"header1"===e||"header2"===e||"header3"===e||"header4"===e||"header5"===e||"header6"===e||"list-item"===e||"todo"===e},e.prototype.isTargetBlockType=function(e){return"paragraph"===e||this.isSourceBlockType(e)},e.prototype.getTopLevelSelectedBlocks=function(e,t){return Array.from(Pr.nodes(e,{at:e.selection||void 0,match:function(e){return Kn.isElement(e)}})).filter(function(e){var n=d(e,2),r=n[0];return 1===n[1].length&&t(r.type)}).map(function(e){return d(e,2)[1]})},e.prototype.normalizeListOrderType=function(e){return"a"===e||"A"===e||"i"===e||"I"===e?e:"1"===e?"1":void 0},e.prototype.getSelectedBlockStyle=function(e){var t=this,n=d(this.getTopLevelSelectedBlocks(e,function(e){return t.isSourceBlockType(e)}),1)[0];if(!n)return null;var r=d(Pr.node(e,n),1)[0];return Kn.isElement(r)&&this.isSourceBlockType(r.type)?"blockquote"===r.type||"header1"===r.type||"header2"===r.type||"header3"===r.type||"header4"===r.type||"header5"===r.type||"header6"===r.type||"todo"===r.type?{type:r.type}:"list-item"===r.type?{type:"list-item",ordered:"ordered"in r&&!!r.ordered,orderType:"orderType"in r?this.normalizeListOrderType(r.orderType):void 0}:null:null},e.prototype.unsetListAttrs=function(e,t){co.unsetNodes(e,"ordered",{at:t}),co.unsetNodes(e,"level",{at:t}),co.unsetNodes(e,"start",{at:t}),co.unsetNodes(e,"orderType",{at:t})},e.prototype.applyBlockStyle=function(e,t){var n=this,r=this.getTopLevelSelectedBlocks(e,function(e){return n.isTargetBlockType(e)});0!==r.length&&("list-item"!==t.type?"todo"!==t.type?r.forEach(function(r){co.setNodes(e,{type:t.type},{at:r}),n.unsetListAttrs(e,r),co.unsetNodes(e,"checked",{at:r})}):r.forEach(function(t){co.setNodes(e,{type:"todo",checked:!1},{at:t}),n.unsetListAttrs(e,t)}):r.forEach(function(n){co.setNodes(e,{type:"list-item",ordered:t.ordered,orderType:t.orderType,level:0},{at:n}),co.unsetNodes(e,"checked",{at:n}),co.unsetNodes(e,"start",{at:n})}))},e.prototype.setFormatHtml=function(t){var n,r;if(t.getSelectionText().length){if(e.attrs.formatStyle){!function(e){var t=Pr.marks(e);t&&Object.keys(t).forEach(function(t){e.removeMark(t)})}(t);try{for(var o=c(Object.entries(e.attrs.formatStyle)),i=o.next();!i.done;i=o.next()){var a=d(i.value,2),s=a[0],u=a[1];t.addMark(s,u)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}e.attrs.formatBlockStyle&&this.applyBlockStyle(t,e.attrs.formatBlockStyle),e.attrs.formatStyle=null,e.attrs.formatBlockStyle=null,e.attrs.isSelect=!1}},e.prototype.exec=function(t){e.attrs.isSelect?(e.attrs.isSelect=!1,e.attrs.formatStyle=null,e.attrs.formatBlockStyle=null):t.getSelectionText().length&&(e.attrs.formatStyle=Pr.marks(t),e.attrs.formatBlockStyle=this.getSelectedBlockStyle(t),e.attrs.isSelect=!0);t.blur(),t.focus()},e.attrs={isSelect:!1,formatStyle:null,formatBlockStyle:null},e}();var dp={menus:[{key:"formatPainter",factory:function(){return new cp}}],editorPlugin:function(e){var t=new cp,n=e.onChange,r=e,o=function(){t.setFormatHtml(r),document.removeEventListener("mouseup",o)};return r.onChange=function(){n(),cp.attrs.isSelect&&(document.removeEventListener("mouseup",o),document.addEventListener("mouseup",o))},r}},fp=function(){function e(){this.title=ac("fullScreen.title"),this.iconSvg=lf,this.tag="button",this.alwaysEnable=!0}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return e.isFullScreen},e.prototype.isDisabled=function(e){return!1},e.prototype.getIcon=function(e){return e.isFullScreen?'<svg t="1723361745825" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8705" width="200" height="200"><path d="M703.926857 362.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V128a42.642286 42.642286 0 1 1 85.357715 0v149.357714h149.357714c21.211429 0 38.765714 15.433143 42.057143 35.693715l0.585143 6.948571a42.642286 42.642286 0 0 1-42.642286 42.642286H703.926857zM703.926857 938.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V704c0-23.552 19.090286-42.642286 42.642286-42.642286h192.073143a42.642286 42.642286 0 1 1 0 85.284572l-149.357714 0.073143v149.284571c0 21.211429-15.506286 38.765714-35.84 42.130286l-6.875429 0.512zM319.853714 938.642286a42.642286 42.642286 0 0 1-42.642285-42.642286v-149.284571H127.853714a42.642286 42.642286 0 0 1-42.130285-35.84l-0.585143-6.875429c0-23.552 19.163429-42.642286 42.715428-42.642286h192c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286zM127.853714 362.642286a42.642286 42.642286 0 1 1 0-85.284572H277.211429V128c0-21.211429 15.433143-38.765714 35.766857-42.130286l6.875428-0.512c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286H127.853714z" fill="#333333" p-id="8706"></path></svg>':lf},e.prototype.getTitle=function(e){return e.isFullScreen?ac("fullScreen.cancelTitle"):ac("fullScreen.title")},e.prototype.exec=function(e,t){e.isFullScreen?e.unFullScreen():e.fullScreen()},e}(),pp={menus:[{key:"fullScreen",factory:function(){return new fp}}]};function hp(e){return function(t,n){return"<h".concat(e,">").concat(n,"</h").concat(e,">")}}var gp={type:"header1",elemToHtml:hp(1)},vp={type:"header2",elemToHtml:hp(2)},mp={type:"header3",elemToHtml:hp(3)},yp={type:"header4",elemToHtml:hp(4)},bp={type:"header5",elemToHtml:hp(5)},Ep={type:"header6",elemToHtml:hp(6)};function wp(e){var t=d(Pr.nodes(e,{match:function(e){return Ss.getNodeType(e).startsWith("header")},universal:!0}),1),n=t[0];if(null==n)return"paragraph";var r=d(n,1)[0];return Ss.getNodeType(r)}function Cp(e){if(null==e.selection)return!0;var t=d(Pr.nodes(e,{match:function(e){var t=Ss.getNodeType(e);return"paragraph"===t||!!t.startsWith("header")},universal:!0,mode:"highest"}),1);return!t[0]}function Dp(e,t){t&&co.setNodes(e,{type:t})}var Ap=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return wp(e)},e.prototype.isActive=function(e){return this.getValue(e)===this.type},e.prototype.isDisabled=function(e){return Cp(e)},e.prototype.exec=function(e,t){var n=this.type;Dp(e,t===n?"paragraph":n)},e}(),Sp=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H1",t.type="header1",t}return a(t,e),t}(Ap),xp=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H2",t.type="header2",t}return a(t,e),t}(Ap),Np=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H3",t.type="header3",t}return a(t,e),t}(Ap),Bp=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H4",t.type="header4",t}return a(t,e),t}(Ap),Op=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H5",t.type="header5",t}return a(t,e),t}(Ap),Tp=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H6",t.type="header6",t}return a(t,e),t}(Ap),kp=function(){function e(){this.title=ac("header.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M960 960c-51.2 0-102.4-3.2-153.6-3.2-51.2 0-99.2 3.2-150.4 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 57.6-28.8 86.4-48 19.2-12.8 19.2-60.8 19.2-80v-224-19.2c-9.6-3.2-19.2-3.2-28.8-3.2H320c-9.6 0-19.2 0-28.8 3.2V780.8c0 22.4 0 80 22.4 92.8 28.8 19.2 96-6.4 96 44.8 0 16-9.6 41.6-28.8 41.6-54.4 0-105.6-3.2-160-3.2-48 0-96 3.2-147.2 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 51.2-28.8 80-48 19.2-12.8 19.2-60.8 19.2-83.2V294.4c0-28.8 3.2-115.2-22.4-131.2-25.6-16-86.4 9.6-86.4-41.6 0-16 6.4-41.6 28.8-41.6 51.2 0 105.6 3.2 156.8 3.2 48 0 96-3.2 144-3.2 19.2 0 28.8 22.4 28.8 41.6 0 48-57.6 25.6-83.2 41.6-19.2 12.8-19.2 73.6-19.2 92.8v201.6c6.4 3.2 16 3.2 22.4 3.2h400c6.4 0 12.8 0 22.4-3.2V256c0-22.4 0-80-19.2-92.8-28.8-16-86.4 6.4-86.4-41.6 0-16 9.6-41.6 28.8-41.6 51.2 0 99.2 3.2 150.4 3.2 48 0 99.2-3.2 147.2-3.2 19.2 0 28.8 22.4 28.8 41.6 0 51.2-57.6 25.6-86.4 41.6-19.2 12.8-19.2 70.4-19.2 92.8v537.6c0 19.2 0 67.2 19.2 80 28.8 19.2 89.6-6.4 89.6 44.8 0 19.2-6.4 41.6-28.8 41.6z"></path></svg>',this.tag="select",this.width=60}return e.prototype.getOptions=function(e){var t=[{value:"header1",text:"H1",styleForRenderMenuList:{"font-size":"32px","font-weight":"bold"}},{value:"header2",text:"H2",styleForRenderMenuList:{"font-size":"24px","font-weight":"bold"}},{value:"header3",text:"H3",styleForRenderMenuList:{"font-size":"18px","font-weight":"bold"}},{value:"header4",text:"H4",styleForRenderMenuList:{"font-size":"16px","font-weight":"bold"}},{value:"header5",text:"H5",styleForRenderMenuList:{"font-size":"13px","font-weight":"bold"}},{value:"header6",text:"H6",styleForRenderMenuList:{"font-size":"11px","font-weight":"bold"}},{value:"paragraph",text:ac("header.text")}],n=this.getValue(e).toString();return t.forEach(function(e){e.value===n?e.selected=!0:e.selected=void 0}),t},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){return wp(e)},e.prototype.isDisabled=function(e){return Cp(e)},e.prototype.exec=function(e,t){Dp(e,t.toString())},e}(),Fp={key:"headerSelect",factory:function(){return new kp}},Ip={key:"header1",factory:function(){return new Sp}},Pp={key:"header2",factory:function(){return new xp}},_p={key:"header3",factory:function(){return new Np}},Rp={key:"header4",factory:function(){return new Bp}},Lp={key:"header5",factory:function(){return new Op}},Mp={key:"header6",factory:function(){return new Tp}};function jp(e){return function(t,n,r){var o=Zi(t);return 0===(n=n.filter(function(e){return!!Wr.isText(e)||!!r.isInline(e)})).length&&(n=[{text:o.text().replace(/\s+/gm," ")}]),{type:"header".concat(e),children:n}}}var Hp={selector:"h1:not([data-w-e-type])",parseElemHtml:jp(1)},zp={selector:"h2:not([data-w-e-type])",parseElemHtml:jp(2)},$p={selector:"h3:not([data-w-e-type])",parseElemHtml:jp(3)},Up={selector:"h4:not([data-w-e-type])",parseElemHtml:jp(4)},Vp={selector:"h5:not([data-w-e-type])",parseElemHtml:jp(5)},Wp={selector:"h6:not([data-w-e-type])",parseElemHtml:jp(6)};function Gp(e){return function(t,n,r){return Pd("h".concat(e),null,n)}}var qp={renderElems:[{type:"header1",renderElem:Gp(1)},{type:"header2",renderElem:Gp(2)},{type:"header3",renderElem:Gp(3)},{type:"header4",renderElem:Gp(4)},{type:"header5",renderElem:Gp(5)},{type:"header6",renderElem:Gp(6)}],elemsToHtml:[gp,vp,mp,yp,bp,Ep],parseElemsHtml:[Hp,zp,$p,Up,Vp,Wp],menus:[Fp,Ip,Pp,_p,Rp,Lp,Mp],editorPlugin:function(e){var t=e.insertBreak,n=e;return n.insertBreak=function(){var r=d(Pr.nodes(n,{match:function(e){return Ss.getNodeType(e).startsWith("header")},universal:!0}),1),o=r[0];if(o)if(Ss.isSelectionAtLineEnd(e,o[1])){co.insertNodes(n,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}else t();else t()},n}};var Kp={type:"image",elemToHtml:function(e,t,n){var r=e,o=r.src,i=r.alt,a=void 0===i?"":i,s=r.href,u=void 0===s?"":s,l=r.width,c=void 0===l?"":l,d=r.height,f=void 0===d?"":d,p=r.style,h=void 0===p?{}:p,g=h.width,v=void 0===g?"":g,m=h.height,y=void 0===m?"":m;if("class"===nf(n)){var b=c||v,E=f||y,w=v?' data-w-e-style-width="'.concat(v,'"'):"",C=y?' data-w-e-style-height="'.concat(y,'"'):"";return'<img src="'.concat(o,'" alt="').concat(a,'" data-href="').concat(u,'" width="').concat(b,'" height="').concat(E,'"').concat(w).concat(C,"/>")}var D="";return v&&(D+="width: ".concat(v,";")),y&&(D+="height: ".concat(y,";")),'<img src="'.concat(o,'" alt="').concat(a,'" data-href="').concat(u,'" width="').concat(c,'" height="').concat(f,'" style="').concat(D,'"/>')}};var Yp=function(){function e(){this.title=ac("image.delete"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==Ss.getSelectedNodeByType(e,"image")},e.prototype.exec=function(e,t){this.isDisabled(e)||co.removeNodes(e,{match:function(e){return Ss.checkNodeType(e,"image")}})},e}();function Xp(e){return void 0===e&&(e="r"),"".concat(e,"-").concat(wn())}function Zp(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Jp(e){var t=e.selection;if(null==t)return!0;if(!Gn.isCollapsed(t))return!0;var n=d(Pr.nodes(e,{match:function(t){var n=Ss.getNodeType(t);return"code"===n||("pre"===n||("link"===n||(!!n.startsWith("header")||("blockquote"===n||!(!Kn.isElement(t)||!Pr.isVoid(e,t))))))},universal:!0}),1);return!!n[0]}function Qp(e,t,n){return u(this,arguments,void 0,function(e,t,n,r,o){var i,a;return void 0===r&&(r=""),void 0===o&&(o=""),l(this,function(s){switch(s.label){case 0:return(i=t.getMenuConfig(e).checkImage)?[4,i(n,r,o)]:[3,2];case 1:if("string"==typeof(a=s.sent()))return t.alert(a,"error"),[2,!1];if(null==a)return[2,!1];s.label=2;case 2:return[2,!0]}})})}function eh(e,t,n){return u(this,void 0,void 0,function(){var r;return l(this,function(o){switch(o.label){case 0:return(r=t.getMenuConfig(e).parseImageSrc)?[4,r(n)]:[3,2];case 1:return[2,o.sent()];case 2:return[2,n]}})})}function th(e,t){return u(this,arguments,void 0,function(e,t,n,r){var o,i,a,s,u,c;return void 0===n&&(n=""),void 0===r&&(r=""),l(this,function(l){switch(l.label){case 0:return[4,Qp("insertImage",e,t,n,r)];case 1:return l.sent()?[4,eh("insertImage",e,t)]:[2];case 2:return o=l.sent(),i={type:"image",src:Zp(o),href:r,alt:n,style:{},children:[{text:""}]},null===e.selection&&e.restoreSelection(),a=(null===(c=e.getMarks)||void 0===c?void 0:c.call(e))||{},s={},Object.keys(a).forEach(function(e){var t=a[e];null!=t&&!1!==t&&(s[e]=t)}),Ss.getSelectedNodeByType(e,"image")&&e.move(1),Jp(e)?[2]:(co.insertNodes(e,i),Object.keys(s).forEach(function(t){Pr.addMark(e,t,s[t])}),(u=e.getMenuConfig("insertImage").onInsertedImage)&&u(i),[2])}})})}function nh(){return Xp("w-e-edit-image")}var rh=function(){function e(){this.title=ac("image.edit"),this.iconSvg=sf,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=nh(),this.altInputId=nh(),this.hrefInputId=nh(),this.buttonId=nh()}return e.prototype.getValue=function(e){return""},e.prototype.getImageNode=function(e){return Ss.getSelectedNodeByType(e,"image")},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Gn.isCollapsed(t)||null==Ss.getSelectedNodeByType(e,"image"))},e.prototype.getModalPositionNode=function(e){return this.getImageNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.altInputId,i=n.hrefInputId,a=n.buttonId,s=this.getImageNode(e);if(null==s)throw new Error("Not found selected image node");var u=d(mc(ac("image.src"),r),2),l=u[0],c=Zi(u[1]),f=d(mc(ac("image.desc"),o),2),p=f[0],h=Zi(f[1]),g=d(mc(ac("image.link"),i),2),v=g[0],m=Zi(g[1]),y=d(bc(a,ac("common.ok")),1)[0];if(null==this.$content){var b=Zi("<div></div>");b.on("click","#".concat(a),function(n){n.preventDefault();var a=b.find("#".concat(r)).val(),s=b.find("#".concat(o)).val(),u=b.find("#".concat(i)).val();t.updateImage(e,a,s,u),e.hidePanelOrModal()}),this.$content=b}var E=this.$content;E.empty(),E.append(l),E.append(p),E.append(v),E.append(y);var w=s,C=w.src,D=w.alt,A=void 0===D?"":D,S=w.href,x=void 0===S?"":S;return c.val(C),h.val(A),m.val(x),setTimeout(function(){c.focus()}),E[0]},e.prototype.updateImage=function(e,t,n,r,o){void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={}),t&&(e.restoreSelection(),this.isDisabled(e)||function(e,t){u(this,arguments,void 0,function(e,t,n,r,o){var i,a,u,c,d,f;return void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={}),l(this,function(l){switch(l.label){case 0:return[4,Qp("editImage",e,t,n,r)];case 1:return l.sent()?[4,eh("editImage",e,t)]:[2];case 2:return i=l.sent(),null==(a=Ss.getSelectedNodeByType(e,"image"))||(u=a.style,c={src:i,alt:n,href:r,style:s(s({},void 0===u?{}:u),o)},co.setNodes(e,c,{match:function(e){return Ss.checkNodeType(e,"image")}}),d=Ss.getSelectedNodeByType(e,"image"),(f=e.getMenuConfig("editImage").onUpdatedImage)&&f(d)),[2]}})})}(e,t,n,r,o))},e}();function oh(){return Xp("w-e-insert-image")}var ih=function(){function e(){this.title=ac("image.editSize"),this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=oh(),this.heightInputId=oh(),this.buttonId=oh()}return e.prototype.getSelectedImageNode=function(e){return Ss.getSelectedNodeByType(e,"image")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedImageNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedImageNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=t.widthInputId,r=t.heightInputId,o=t.buttonId,i=d(mc(ac("image.width"),n,"auto"),2),a=i[0],u=Zi(i[1]),l=d(mc(ac("image.height"),r,"auto"),2),c=l[0],f=Zi(l[1]),p=d(bc(o,ac("image.ok")),1)[0],h=this.getSelectedImageNode(e);if(null==this.$content){var g=Zi("<div></div>");g.on("click","#".concat(o),function(t){t.preventDefault();var o=g.find("#".concat(n)).val().trim(),i=g.find("#".concat(r)).val().trim(),a=function(e){return/^\d+(\.\d+)?%$/.test(e)},u=function(e){return/^\d+(\.\d+)?$/.test(e)},l=function(e){return/^\d+(\.\d+)?px$/.test(e)},c="auto",d="auto";a(o)?c=o:u(o)?c="".concat(parseInt(o,10),"px"):l(o)&&(c=o),a(i)?d=i:u(i)?d="".concat(parseInt(i,10),"px"):l(i)&&(d=i);var f=h.style,p=void 0===f?{}:f;e.restoreSelection();var v=s(s({},p),{style:{width:c,height:d}});co.setNodes(e,v,{match:function(e){return Ss.checkNodeType(e,"image")}}),e.hidePanelOrModal()}),this.$content=g}var v=this.$content;if(v.empty(),v.append(a),v.append(c),v.append(p),null==h)return v[0];var m=h.style,y=void 0===m?{}:m,b=y.width,E=void 0===b?"auto":b,w=y.height,C=void 0===w?"auto":w;return u.val(E),f.val(C),setTimeout(function(){u.focus()}),v[0]},e}();function ah(){return Xp("w-e-insert-image")}var sh=function(){function e(){this.title=ac("image.netImage"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=ah(),this.altInputId=ah(),this.hrefInputId=ah(),this.buttonId=ah()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return Jp(e)},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.altInputId,i=n.hrefInputId,a=n.buttonId,s=d(mc(ac("image.src"),r),2),u=s[0],l=Zi(s[1]),c=d(mc(ac("image.desc"),o),2),f=c[0],p=Zi(c[1]),h=d(mc(ac("image.link"),i),2),g=h[0],v=Zi(h[1]),m=d(bc(a,ac("common.ok")),1)[0];if(null==this.$content){var y=Zi("<div></div>");y.on("click","#".concat(a),function(n){n.preventDefault();var a=y.find("#".concat(r)).val().trim(),s=y.find("#".concat(o)).val().trim(),u=y.find("#".concat(i)).val().trim();t.insertImage(e,a,s,u),e.hidePanelOrModal()}),this.$content=y}var b=this.$content;return b.empty(),b.append(u),b.append(f),b.append(g),b.append(m),l.val(""),p.val(""),v.val(""),setTimeout(function(){l.focus()}),b[0]},e.prototype.insertImage=function(e,t,n,r){void 0===n&&(n=""),void 0===r&&(r=""),t&&(e.restoreSelection(),this.isDisabled(e)||th(e,t,n,r))},e}(),uh=function(){function e(){this.title=ac("image.preview"),this.iconSvg=uf,this.tag="button"}return e.prototype.getValue=function(e){var t=Ss.getSelectedNodeByType(e,"image");return t&&t.src||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!this.getValue(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("Preview image failed, image.src is '".concat(t,"'"));window.open(t,"_blank")}},e}(),lh=function(){function e(){this.title=ac("image.viewLink"),this.iconSvg=uf,this.tag="button"}return e.prototype.getValue=function(e){var t=Ss.getSelectedNodeByType(e,"image");return t&&t.href||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!this.getValue(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("View image link failed, image.href is '".concat(t,"'"));window.open(t,"_blank")}},e}(),ch=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.getSelectedNode=function(e){return Ss.getSelectedNodeByType(e,"image")},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedNode(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=this.getSelectedNode(e);if(null!=n){var r=Ss.getHoverbar(e);r&&r.hideAndClean();var o=n.style,i={style:s(s({},void 0===o?{}:o),{width:this.value,height:""})};co.setNodes(e,i,{match:function(e){return Ss.checkNodeType(e,"image")}})}}},e}(),dh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="30%",t.value="30%",t}return a(t,e),t}(ch),fh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="50%",t.value="50%",t}return a(t,e),t}(ch),ph=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="100%",t.value="100%",t}return a(t,e),t}(ch),hh={onInsertedImage:function(e){},onUpdatedImage:function(e){},checkImage:function(e,t,n){return!0},parseImageSrc:function(e){return e}};function gh(e,t){var n=Ss.findKey(e,t).id;return"w-e-image-container-".concat(n)}function vh(e,t,n,r){var o=Zi("body"),i=gh(e,t),a=r.width,u=r.height,l=0,c=0,d=0,f=0,p=!1,h=null;var g=Oc(function(e){e.preventDefault();var t=e.clientX,n=c+(p?l-t:t-l),r=d*(n/c);n>f-6||null!=h&&(n<=15||r<=15||(h.css("width","".concat(n,"px")),h.css("height","".concat(r,"px"))))},100);function v(n){if(o.off("mousemove",g),null!=h){var r=h.width().toFixed(2),i=h.height().toFixed(2),a={style:s(s({},t.style),{width:"".concat(r,"px"),height:"".concat(i,"px")})};co.setNodes(e,a,{at:Ss.findPath(e,t)}),o.off("mouseup",v)}}function m(t,n){h=function(){var e=Zi("#".concat(i));if(0===e.length)throw new Error("Cannot find image container elem");return e}(),l=t,f=n;var r=h.find("img");if(0===r.length)throw new Error("Cannot find image elem");c=r.width(),d=r.height(),o.on("mousemove",g),o.on("mouseup",v);var a=Ss.getHoverbar(e);a&&a.hideAndClean()}var y={};return a&&(y.width=a),u&&(y.height=u),y.boxShadow="0 0 0 1px #B4D5FF",Pd("div",{id:i,style:y,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(n){var r=Zi(n.target);if(r.hasClass("w-e-image-dragger")){n.preventDefault(),(r.hasClass("left-top")||r.hasClass("left-bottom"))&&(p=!0);var o=Ss.getParentNode(e,t);if(null!=o){var i=Ss.toDOMNode(e,o),a=i.getBoundingClientRect?i.getBoundingClientRect():{width:0},s=window.getComputedStyle(i),u=parseFloat(s.paddingLeft),l=parseFloat(s.paddingRight),c=parseFloat(s.borderLeftWidth),d=parseFloat(s.borderRightWidth);m(n.clientX,a.width-u-l-c-d)}}}}},n,Pd("div",{className:"w-e-image-dragger left-top"}),Pd("div",{className:"w-e-image-dragger right-top"}),Pd("div",{className:"w-e-image-dragger left-bottom"}),Pd("div",{className:"w-e-image-dragger right-bottom"}))}var mh={type:"image",renderElem:function(e,t,n){var r=e,o=r.src,i=r.alt,a=void 0===i?"":i,s=r.href,u=void 0===s?"":s,l=r.style,c=void 0===l?{}:l,d=c.width,f=void 0===d?"":d,p=c.height,h=void 0===p?"":p,g=Ss.isNodeSelected(n,e),v={maxWidth:"100%"};f&&(v.width="100%"),h&&(v.height="100%");var m=Pd("img",{style:v,src:o,alt:a,"data-href":u}),y=n.isDisabled();return g&&!y?vh(n,e,m,{width:f,height:h}):function(e,t,n,r){var o=r.width,i=r.height,a={};return o&&(a.width=o),i&&(a.height=i),Pd("div",{id:gh(e,t),style:a,className:"w-e-image-container"},n)}(n,e,m,{width:f,height:h})}},yh={renderElems:[mh],elemsToHtml:[Kp],parseElemsHtml:[{selector:"img:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=Zi(e),o=r.attr("data-href")||"",i=r.attr("width")||"",a=r.attr("height")||"",s=gf(r,"width")||r.attr("data-w-e-style-width")||i,u=gf(r,"height")||r.attr("data-w-e-style-height")||a;return o=decodeURIComponent(o),{type:"image",src:r.attr("src")||"",alt:r.attr("alt")||"",href:o,style:{width:s,height:u},width:i,height:a,children:[{text:""}]}}}],menus:[{key:"insertImage",factory:function(){return new sh},config:hh},{key:"deleteImage",factory:function(){return new Yp}},{key:"editImage",factory:function(){return new rh},config:hh},{key:"previewImage",factory:function(){return new uh}},{key:"viewImageLink",factory:function(){return new lh}},{key:"imageWidth30",factory:function(){return new dh}},{key:"imageWidth50",factory:function(){return new fh}},{key:"imageWidth100",factory:function(){return new ph}},{key:"editorImageSizeMenu",factory:function(){return new ih}}],editorPlugin:function(e){var t=e.isInline,n=e.isVoid,r=e;return r.isInline=function(e){return"image"===e.type||t(e)},r.isVoid=function(e){return"image"===e.type||n(e)},r}};function bh(e){if(!Kn.isElement(e))return!1;var t=e.type;return"paragraph"===t||!("string"!=typeof t||!t.startsWith("header"))}var Eh=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){var t=d(Pr.nodes(e,{match:function(e){return!!e.indent},universal:!0}),1),n=t[0];return null==n?"":d(n,1)[0].indent||""},e.prototype.isActive=function(e){return!1},e.prototype.getMatchNode=function(e){var t=d(Pr.nodes(e,{match:bh,universal:!0,mode:"highest"}),1)[0];return null==t?null:t[0]},e}(),wh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("indent.decrease"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m256-512v384l-256-192z"></path></svg>',t}return a(t,e),t.prototype.isDisabled=function(e){var t=this.getMatchNode(e);return null==t||!t.indent},t.prototype.exec=function(e,t){co.setNodes(e,{indent:null},{match:bh,mode:"highest"})},t}(Eh),Ch=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("indent.increase"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',t.DEFAULT_INDENT_VALUE="2em",t}return a(t,e),t.prototype.isDisabled=function(e){var t=this.getMatchNode(e);return null==t||!!t.indent},t.prototype.getIndentValue=function(e){var t=this.getMatchNode(e);if(!t)return this.DEFAULT_INDENT_VALUE;var n=t.children.filter(Wr.isText)[0];if(!n||!n.fontSize)return this.DEFAULT_INDENT_VALUE;var r=n.fontSize,o=parseInt(n.fontSize,10),i=r.replace("".concat(o),"");return"".concat(2*o).concat(i)},t.prototype.exec=function(e,t){var n=this.getIndentValue(e);co.setNodes(e,{indent:n},{match:bh,mode:"highest"})},t}(Eh);var Dh={renderStyle:function(e,t,n){if(!Kn.isElement(e))return t;if(!bh(e))return t;var r=e.indent,o=t;return r&&("class"===Gf(n)?Kf(o,"indent",r,n,"render",{textIndent:r}):Lf(o,{textIndent:r})),o},styleToHtml:function(e,t,n){if(!Kn.isElement(e))return t;if(!bh(e))return t;var r=e.indent;if(!r)return t;var o=Zi(t);return"class"===Gf(n)?qf(o,"indent",r,n,"toHtml",function(){o.css("text-indent",r)}):o.css("text-indent",r),pf(o)},preParseHtml:[{selector:"p,h1,h2,h3,h4,h5",preParseHtml:function(e){var t=Zi(e),n=gf(t,"padding-left");return/^[1-9]\d*em$/.test(n)&&t.css("text-indent","2em"),/^[1-9]\d*px$/.test(n)&&parseInt(n,10)%32==0&&t.css("text-indent","2em"),t[0]}}],parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Kn.isElement(t))return t;if(!bh(t))return t;var o=t,i=gf(r,"text-indent")||Yf(r,"indent",n),a=parseInt(i,10);return i&&a>0&&(o.indent=i),o},menus:[{key:"indent",factory:function(){return new Ch}},{key:"delIndent",factory:function(){return new wh}}]},Ah=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!!Ss.getSelectedElems(e).some(function(t){var n=t.type;return!(!Pr.isVoid(e,t)||!Pr.isBlock(e,t)||"video"===n)||!!["pre","code"].includes(n)})},e}(),Sh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("justify.center"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return a(t,e),t.prototype.exec=function(e,t){co.setNodes(e,{textAlign:"center"},{match:function(t){return Kn.isElement(t)&&!e.isInline(t)}})},t}(Ah),xh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("justify.justify"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>',t}return a(t,e),t.prototype.exec=function(e,t){co.setNodes(e,{textAlign:"justify"},{match:function(t){return Kn.isElement(t)&&!e.isInline(t)}})},t}(Ah),Nh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("justify.left"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return a(t,e),t.prototype.exec=function(e,t){co.setNodes(e,{textAlign:"left"},{match:function(t){return Kn.isElement(t)&&!e.isInline(t)}})},t}(Ah),Bh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("justify.right"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return a(t,e),t.prototype.exec=function(e,t){co.setNodes(e,{textAlign:"right"},{match:function(t){return Kn.isElement(t)&&!e.isInline(t)}})},t}(Ah);var Oh={renderStyle:function(e,t,n){if(!Kn.isElement(e))return t;var r=e.textAlign,o=t;return r&&("class"===Gf(n)?Kf(o,"textAlign",r,n,"render",{textAlign:r}):Lf(o,{textAlign:r})),o},styleToHtml:function(e,t,n){if(!Kn.isElement(e))return t;var r=e.textAlign;if(!r)return t;var o=Zi(t);return"class"===Gf(n)?qf(o,"textAlign",r,n,"toHtml",function(){o.css("text-align",r)}):o.css("text-align",r),pf(o)},parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Kn.isElement(t))return t;var o=t,i=gf(r,"text-align")||Yf(r,"textAlign",n);return i&&(o.textAlign=i),o},menus:[{key:"justifyLeft",factory:function(){return new Nh}},{key:"justifyRight",factory:function(){return new Bh}},{key:"justifyCenter",factory:function(){return new Sh}},{key:"justifyJustify",factory:function(){return new xh}}]},Th=function(){function e(){this.title=ac("lineHeight.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M964 788a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526zM198.93 144.306c6.668-5.798 16.774-5.094 22.573 1.574l122.26 140.582a16 16 0 0 1 3.927 10.5c0 8.836-7.164 16-16 16h-61.8a8 8 0 0 0-8 8v390.077h69.819a16 16 0 0 1 10.502 3.928c6.666 5.8 7.37 15.906 1.57 22.573L221.476 878.123a16 16 0 0 1-1.57 1.57c-6.668 5.8-16.774 5.097-22.574-1.57L75.051 737.538a16 16 0 0 1-3.928-10.5c0-8.837 7.163-16 16-16h69.822V312.96H87.127a16 16 0 0 1-10.502-3.928c-6.666-5.8-7.37-15.906-1.57-22.573l122.303-140.582a16 16 0 0 1 1.572-1.572zM964 465a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z m0-323a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z"></path></svg>',this.tag="select",this.width=80}return e.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig("lineHeight").lineHeightList,r=void 0===n?[]:n;t.push({text:ac("lineHeight.default"),value:""}),r.forEach(function(e){t.push({text:e,value:e})});var o=this.getValue(e);return t.forEach(function(e){e.value===o?e.selected=!0:e.selected=void 0}),t},e.prototype.getMatchNode=function(e){var t=d(Pr.nodes(e,{match:function(e){var t=Ss.getNodeType(e);return!!t.startsWith("header")||!!["paragraph","blockquote","list-item"].includes(t)},universal:!0,mode:"highest"}),1),n=t[0];return null==n?null:n[0]},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.getMatchNode(e);return null==t?"":Kn.isElement(t)&&t.lineHeight||""},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getMatchNode(e)},e.prototype.exec=function(e,t){co.setNodes(e,{lineHeight:t.toString()},{mode:"highest"})},e}();var kh={renderStyle:function(e,t,n){if(!Kn.isElement(e))return t;var r=e.lineHeight,o=t;return r&&("class"===Gf(n)?Kf(o,"lineHeight",r,n,"render",{lineHeight:r}):Lf(o,{lineHeight:r})),o},styleToHtml:function(e,t,n){if(!Kn.isElement(e))return t;var r=e.lineHeight;if(!r)return t;var o=Zi(t);return"class"===Gf(n)?qf(o,"lineHeight",r,n,"toHtml",function(){o.css("line-height",r)}):o.css("line-height",r),pf(o)},parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Kn.isElement(t))return t;var o=t,i=n.getMenuConfig("lineHeight").lineHeightList,a=void 0===i?[]:i,s=gf(r,"line-height")||Yf(r,"lineHeight",n);return s&&a.includes(s)&&(o.lineHeight=s),o},menus:[{key:"lineHeight",factory:function(){return new Th},config:{lineHeightList:["1","1.15","1.5","2","2.5","3"]}}]};var Fh={type:"link",elemToHtml:function(e,t){var n=e,r=n.url,o=n.target,i=void 0===o?"_blank":o;return'<a href="'.concat(r,'" target="').concat(i,'">').concat(t,"</a>")}};var Ih=/[\t\n\f\r]+/g,Ph=/ /g;function _h(e){var t=e.replace(Ih,"").trim();return t.indexOf(" ")<0?t:t.replace(Ph,"%20")}function Rh(e,t,n,r){return u(this,void 0,void 0,function(){var o,i,a;return l(this,function(s){switch(s.label){case 0:return o=_h(r),(i=t.getMenuConfig(e).checkLink)?[4,i(n,o)]:[3,2];case 1:if("string"==typeof(a=s.sent()))return t.alert(a,"error"),[2,!1];if(null==a)return[2,!1];s.label=2;case 2:return[2,!0]}})})}function Lh(e,t,n){return u(this,void 0,void 0,function(){var r,o;return l(this,function(i){switch(i.label){case 0:return r=_h(n),(o=t.getMenuConfig(e).parseLinkUrl)?[4,o(r)]:[3,2];case 1:return[2,_h(i.sent())];case 2:return[2,r]}})})}function Mh(e){return null==e.selection||!!Ss.getSelectedElems(e).some(function(t){var n=t.type;return!!e.isVoid(t)||!!["pre","code","link"].includes(n)})}function jh(e,t){return{type:"link",url:Zp(e),children:t?[{text:t}]:[]}}function Hh(e,t,n){return u(this,void 0,void 0,function(){var r,o,i,a,s;return l(this,function(u){switch(u.label){case 0:return t||(t=n),e.restoreSelection(),Mh(e)?[2]:[4,Rh("insertLink",e,t,n)];case 1:return u.sent()?[4,Lh("insertLink",e,n)]:[2];case 2:if(!(r=u.sent()))return[2];if(null==(o=e.selection))return[2];if(Gn.isCollapsed(o)){if((a=Ss.getLeftLengthOfMaxLength(e))<=0)return[2];e.insertText(" "),a<t.length+1&&(t=t.slice(0,a-1)),s=jh(r,t),co.insertNodes(e,s),e.insertFragment([{text:" "}])}else if((i=Pr.string(e,o))!==t){if((a=Ss.getLeftLengthOfMaxLength(e))<=0)return[2];a<i.length-t.length&&(t=t.slice(0,a)),e.deleteFragment(),s=jh(r,t),co.insertNodes(e,s)}else s=jh(r),co.wrapNodes(e,s,{split:!0}),co.collapse(e,{edge:"end"});return[2]}})})}function zh(){return Xp("w-e-update-link")}var $h=function(){function e(){this.title=ac("link.edit"),this.iconSvg=sf,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.urlInputId=zh(),this.buttonId=zh()}return e.prototype.getSelectedLinkElem=function(e){var t=Ss.getSelectedNodeByType(e,"link");return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectedLinkElem(e);return t&&t.url||""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedLinkElem(e)},e.prototype.getModalPositionNode=function(e){return Ss.getSelectedNodeByType(e,"link")},e.prototype.getModalContentElem=function(e){var t=this.urlInputId,n=this.buttonId,r=d(mc(ac("link.url"),t),2),o=r[0],i=Zi(r[1]),a=d(bc(n,ac("common.ok")),1)[0];if(null==this.$content){var s=Zi("<div></div>");s.on("click","#".concat(n),function(n){n.preventDefault(),e.restoreSelection();var r=Ss.getSelectedNodeByType(e,"link"),o=r?Qn.string(r):"",i=s.find("#".concat(t)).val();!function(e,t,n){u(this,void 0,void 0,function(){var r,o;return l(this,function(i){switch(i.label){case 0:return[4,Rh("editLink",e,t,n)];case 1:return i.sent()?[4,Lh("editLink",e,n)]:[2];case 2:return(r=i.sent())?(o={url:Zp(r)},co.setNodes(e,o,{match:function(e){return Ss.checkNodeType(e,"link")}}),[2]):[2]}})})}(e,o,i),e.hidePanelOrModal()}),this.$content=s}var c=this.$content;c.empty(),c.append(o),c.append(a);var f=this.getValue(e);return i.val(f),setTimeout(function(){i.focus()}),c[0]},e}();function Uh(){return Xp("w-e-insert-link")}var Vh=function(){function e(){this.title=ac("link.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M440.224 635.776a51.84 51.84 0 0 1-36.768-15.232c-95.136-95.136-95.136-249.92 0-345.056l192-192C641.536 37.408 702.816 12.032 768 12.032s126.432 25.376 172.544 71.456c95.136 95.136 95.136 249.92 0 345.056l-87.776 87.776a51.968 51.968 0 1 1-73.536-73.536l87.776-87.776a140.16 140.16 0 0 0 0-197.984c-26.432-26.432-61.6-40.992-99.008-40.992s-72.544 14.56-99.008 40.992l-192 192a140.16 140.16 0 0 0 0 197.984 51.968 51.968 0 0 1-36.768 88.768z"></path><path d="M256 1012a242.4 242.4 0 0 1-172.544-71.456c-95.136-95.136-95.136-249.92 0-345.056l87.776-87.776a51.968 51.968 0 1 1 73.536 73.536l-87.776 87.776a140.16 140.16 0 0 0 0 197.984c26.432 26.432 61.6 40.992 99.008 40.992s72.544-14.56 99.008-40.992l192-192a140.16 140.16 0 0 0 0-197.984 51.968 51.968 0 1 1 73.536-73.536c95.136 95.136 95.136 249.92 0 345.056l-192 192A242.4 242.4 0 0 1 256 1012z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=Uh(),this.urlInputId=Uh(),this.buttonId=Uh()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return Mh(e)},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=e.selection,n=this,r=n.textInputId,o=n.urlInputId,i=n.buttonId,a=d(mc(ac("link.text"),r),2),s=a[0],u=Zi(a[1]),l=d(mc(ac("link.url"),o),2),c=l[0],f=Zi(l[1]),p=d(bc(i,ac("common.ok")),1)[0];if(null==this.$content){var h=Zi("<div></div>");h.on("click","#".concat(i),function(t){t.preventDefault();var n=h.find("#".concat(r)).val(),i=h.find("#".concat(o)).val();Hh(e,n,i),e.hidePanelOrModal()}),this.$content=h}var g=this.$content;if(g.empty(),g.append(s),g.append(c),g.append(p),null==t||Gn.isCollapsed(t))u.val("");else{var v=Pr.string(e,t);u.val(v)}return f.val(""),setTimeout(function(){u.focus()}),g[0]},e}(),Wh=function(){function e(){this.title=ac("link.unLink"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M608.16328 811.815036c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.347563 89.347564c-118.525421 118.523421-311.38448 118.531421-429.919901 0-118.527421-118.529421-118.527421-311.39048 0-429.917901l89.349564-89.349563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.195613 79.195613c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.349563 89.347564c-56.143726 56.145726-56.143726 147.49928 0 203.645005 56.143726 56.143726 147.49928 56.145726 203.647005 0l89.347564-89.347563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.193613 79.195613z m-113.135447-520.429459c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.347564-89.347564c56.143726-56.149726 147.49928-56.145726 203.647006 0 56.143726 56.145726 56.143726 147.49928 0 203.645006l-89.349564 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.195613 79.195613c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.349564-89.349563c118.529421-118.529421 118.529421-311.38848 0-429.917901-118.531421-118.527421-311.38848-118.527421-429.919901 0l-89.347563 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.193613 79.195613z m469.653707 718.556492l45.253779-45.253779c18.745908-18.745908 18.745908-49.13776 0-67.881669L127.195629 14.062931c-18.745908-18.745908-49.13776-18.745908-67.881669 0L14.058181 59.31871c-18.745908 18.745908-18.745908 49.13776 0 67.881669l882.74169 882.74169c18.745908 18.743908 49.13776 18.743908 67.881669 0z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==Ss.getSelectedNodeByType(e,"link")},e.prototype.exec=function(e,t){this.isDisabled(e)||co.unwrapNodes(e,{match:function(e){return Ss.checkNodeType(e,"link")}})},e}(),Gh=function(){function e(){this.title=ac("link.view"),this.iconSvg=uf,this.tag="button"}return e.prototype.getSelectedLinkElem=function(e){var t=Ss.getSelectedNodeByType(e,"link");return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectedLinkElem(e);return t&&t.url||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedLinkElem(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("View link failed, link url is '".concat(t,"'"));window.open(t,"_blank")}},e}(),qh={checkLink:function(e,t){return!0},parseLinkUrl:function(e){return e}},Kh={key:"insertLink",factory:function(){return new Vh},config:qh},Yh={key:"editLink",factory:function(){return new $h},config:qh},Xh={key:"unLink",factory:function(){return new Wh}},Zh={key:"viewLink",factory:function(){return new Gh}};var Jh,Qh,eg={selector:"a:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=Zi(e);return 0===(t=t.filter(function(e){return!!Wr.isText(e)||!!n.isInline(e)})).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"link",url:_h(r.attr("href")||""),target:r.attr("target")||"",children:t}}};var tg=function(){if(Qh)return Jh;Qh=1,Jh=function(r){if("string"!=typeof r)return!1;var o=r.match(e);if(!o)return!1;var i=o[1];if(!i)return!1;if(t.test(i)||n.test(i))return!0;return!1};var e=/^(?:\w+:)?\/\/(\S+)$/,t=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;return Jh}(),ng=g(tg);var rg={type:"link",renderElem:function(e,t,n){var r=e,o=r.url,i=r.target;return Pd("a",{href:o,target:void 0===i?"_blank":i},t)}},og={renderElems:[rg],elemsToHtml:[Fh],parseElemsHtml:[eg],menus:[Kh,Yh,Xh,Zh],editorPlugin:function(e){var t=e.isInline,n=e.insertData,r=e.normalizeNode,o=e;return o.isInline=function(e){return"link"===e.type||t(e)},o.insertData=function(e){var t=e.getData("text/plain");if(ng(t)){if(/<img[^>]+>/.test(e.getData("text/html")))n(e);else if(!Mh(o)){var r=o.selection;if(null!=r){var i=Pr.string(o,r);Hh(o,i,t)}}}else n(e)},o.normalizeNode=function(e){var t=d(e,2),n=t[0],i=t[1];return"link"!==Ss.getNodeType(n)?r([n,i]):""===Qn.string(n)?co.removeNodes(o,{at:i}):r([n,i])},o}};var ig={selector:"p:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=Zi(e);return 0===(t=t.filter(function(e){return!!Wr.isText(e)||!!n.isInline(e)})).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"paragraph",children:t}}};function ag(e){var t=d(Pr.nodes(e,{match:function(t){return e.children[0]===t},mode:"highest"}),1),n=t[0];if(null==n)return!1;var r=n[0];if(!Kn.isElement(r))return!1;if("paragraph"===r.type)return!1;if(""!==Qn.string(r))return!1;var o=r.children,i=void 0===o?[]:o;return!!Wr.isText(i[0])&&(co.setNodes(e,{type:"paragraph"}),!0)}var sg={type:"paragraph",renderElem:function(e,t,n){return Pd("p",null,t)}},ug={renderElems:[sg],elemsToHtml:[{type:"paragraph",elemToHtml:function(e,t){return""===t?"<p><br></p>":"<p>".concat(t,"</p>")}}],parseElemsHtml:[ig],editorPlugin:function(e){var t=e.deleteBackward,n=e.deleteForward,r=e;return r.deleteBackward=function(e){ag(r)||t(e)},r.deleteForward=function(e){ag(r)||n(e)},r}};function lg(e,t){if(null==e.selection)return!0;var n=d(Pr.nodes(e,{match:function(t){return"pre"===Ss.getNodeType(t)||!(!Kn.isElement(t)||!Pr.isVoid(e,t))},universal:!0}),1);return!!n[0]}function cg(e,t){Object.keys(t).forEach(function(t){"text"!==t&&Pr.removeMark(e,t)})}var dg=function(){function e(){this.marksNeedToRemove=[],this.tag="button"}return e.prototype.getValue=function(e){var t=this.mark,n=Pr.marks(e);if(n)return n[t];var r=d(Pr.nodes(e,{match:function(e){return!0===e[t]}}),1);return!!r[0]},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){return lg(e,this.mark)},e.prototype.exec=function(e,t){var n=this.mark,r=this.marksNeedToRemove;t?e.removeMark(n):(e.addMark(n,!0),r&&r.forEach(function(t){return e.removeMark(t)}))},e}(),fg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="bold",t.title=ac("textStyle.bold"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M707.872 484.64A254.88 254.88 0 0 0 768 320c0-141.152-114.848-256-256-256H192v896h384c141.152 0 256-114.848 256-256a256.096 256.096 0 0 0-124.128-219.36zM384 192h101.504c55.968 0 101.504 57.408 101.504 128s-45.536 128-101.504 128H384V192z m159.008 640H384v-256h159.008c58.464 0 106.016 57.408 106.016 128s-47.552 128-106.016 128z"></path></svg>',t.hotkey="mod+b",t}return a(t,e),t}(dg),pg=function(){function e(){this.title=ac("textStyle.clear"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M969.382408 288.738615l-319.401123-270.852152a67.074236 67.074236 0 0 0-96.459139 5.74922l-505.931379 574.922021a68.35184 68.35184 0 0 0-17.886463 47.910169 74.101061 74.101061 0 0 0 24.274486 47.910168l156.50655 132.232065h373.060512L975.131628 383.281347a67.074236 67.074236 0 0 0-5.74922-96.459139z m-440.134747 433.746725H264.144729l-90.071117-78.572676c-5.74922-5.74922-12.137243-12.137243-12.137243-17.886463a36.411728 36.411728 0 0 1 5.749221-24.274485l210.804741-240.828447 265.102932 228.691204z m-439.495945 180.781036h843.218964a60.047411 60.047411 0 1 1 0 120.733624H89.751716a60.047411 60.047411 0 1 1 0-120.733624z m0 0"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return lg(e)},e.prototype.exec=function(e,t){var n,r,o=Pr.nodes(e,{match:function(e){return Wr.isText(e)},universal:!0});try{for(var i=c(o),a=i.next();!a.done;a=i.next()){cg(e,a.value[0])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e}(),hg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="code",t.title=ac("textStyle.code"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M576 736l96 96 320-320L672 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224z"></path></svg>',t.hotkey="mod+e",t}return a(t,e),t}(dg),gg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="italic",t.title=ac("textStyle.italic"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M896 64v64h-128L448 896h128v64H128v-64h128L576 128h-128V64z"></path></svg>',t.hotkey="mod+i",t}return a(t,e),t}(dg),vg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="sub",t.marksNeedToRemove=["sup"],t.title=ac("textStyle.sub"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 910.016v50.016h128v64h-192v-146.016l128-60V768h-128v-64h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',t.hotkey="",t}return a(t,e),t}(dg),mg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="sup",t.marksNeedToRemove=["sub"],t.title=ac("textStyle.sup"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 206.016v50.016h128v64h-192V174.016l128-60V64h-128V0h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',t.hotkey="",t}return a(t,e),t}(dg),yg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="through",t.title=ac("textStyle.through"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M1024 512v64h-234.496c27.52 38.496 42.496 82.688 42.496 128 0 70.88-36.672 139.04-100.576 186.976C672.064 935.488 594.144 960 512 960s-160.064-24.512-219.424-69.024C228.64 843.04 192 774.88 192 704h128c0 69.376 87.936 128 192 128s192-58.624 192-128-87.936-128-192-128H0v-64h299.52a385.984 385.984 0 0 1-6.944-5.024C228.64 459.04 192 390.88 192 320s36.672-139.04 100.576-186.976C351.936 88.512 429.856 64 512 64s160.064 24.512 219.424 69.024C795.328 180.96 832 249.12 832 320h-128c0-69.376-87.936-128-192-128s-192 58.624-192 128 87.936 128 192 128c78.976 0 154.048 22.688 212.48 64H1024z"></path></svg>',t.hotkey="mod+shift+x",t}return a(t,e),t}(dg),bg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="underline",t.title=ac("textStyle.underline"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M704 64l128 0 0 416c0 159.072-143.264 288-320 288s-320-128.928-320-288l0-416 128 0 0 416c0 40.16 18.24 78.688 51.36 108.512 36.896 33.216 86.848 51.488 140.64 51.488s103.744-18.304 140.64-51.488c33.12-29.792 51.36-68.352 51.36-108.512l0-416zM192 832l640 0 0 128-640 0z"></path></svg>',t.hotkey="mod+u",t}return a(t,e),t}(dg);function Eg(e,t){return 0!==e.length&&e[0].matches(t)}function wg(e,t){var n=gf(e,"text-decoration"),r=gf(e,"text-decoration-line");return n.includes(t)||r.includes(t)}function Cg(e,t){var n=t,r=e,o=r.bold,i=r.italic,a=r.underline,s=r.code,u=r.through,l=r.sub,c=r.sup;return o&&(n="<strong>".concat(n,"</strong>")),s&&(n="<code>".concat(n,"</code>")),i&&(n="<em>".concat(n,"</em>")),a&&(n="<u>".concat(n,"</u>")),u&&(n="<s>".concat(n,"</s>")),l&&(n="<sub>".concat(n,"</sub>")),c&&(n="<sup>".concat(n,"</sup>")),n}var Dg={renderStyle:function(e,t){var n=e,r=n.bold,o=n.italic,i=n.underline,a=n.code,s=n.through,u=n.sub,l=n.sup,c=t;return r&&(c=Pd("strong",null,c)),a&&(c=Pd("code",null,c)),o&&(c=Pd("em",null,c)),i&&(c=Pd("u",null,c)),s&&(c=Pd("s",null,c)),u&&(c=Pd("sub",null,c)),l&&(c=Pd("sup",null,c)),c},menus:[{key:"bold",factory:function(){return new fg}},{key:"underline",factory:function(){return new bg}},{key:"italic",factory:function(){return new gg}},{key:"through",factory:function(){return new yg}},{key:"code",factory:function(){return new hg}},{key:"sub",factory:function(){return new vg}},{key:"sup",factory:function(){return new mg}},{key:"clearStyle",factory:function(){return new pg}}],styleToHtml:function(e,t){if(!Wr.isText(e))return t;if(ff(t))return Cg(e,t);var n=Zi(t),r=n.html();return r=Cg(e,r),n.html(r),pf(n)},parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Wr.isText(t))return t;var o=t;return gf(r,"font-weight")?o.bold=function(e){var t=gf(e,"font-weight");if(!t)return!1;if("bold"===t||"bolder"===t)return!0;var n=Number(t);return!Number.isNaN(n)&&n>=600}(r):Eg(r,"b,strong")&&(o.bold=!0),(Eg(r,"i,em")||["italic","oblique"].includes(gf(r,"font-style")))&&(o.italic=!0),(Eg(r,"u")||wg(r,"underline"))&&(o.underline=!0),(Eg(r,"s,strike")||wg(r,"line-through"))&&(o.through=!0),(Eg(r,"sub")||"sub"===gf(r,"vertical-align"))&&(o.sub=!0),(Eg(r,"sup")||"super"===gf(r,"vertical-align"))&&(o.sup=!0),Eg(r,"code")&&(o.code=!0),o}};var Ag={type:"todo",elemToHtml:function(e,t){var n=e.checked;return'<div data-w-e-type="todo"><input type="checkbox" disabled '.concat(n?"checked":"",">").concat(t,"</div>")}},Sg=function(){function e(){this.title=ac("todo.todo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M278.755556 403.911111l-79.644445 79.644445L455.111111 739.555556l568.888889-568.888889-79.644444-79.644445L455.111111 580.266667l-176.355555-176.355556zM910.222222 910.222222H113.777778V113.777778h568.888889V0H113.777778C51.2 0 0 51.2 0 113.777778v796.444444c0 62.577778 51.2 113.777778 113.777778 113.777778h796.444444c62.577778 0 113.777778-51.2 113.777778-113.777778V455.111111h-113.777778v455.111111z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!!Ss.getSelectedNodeByType(e,"todo")},e.prototype.isDisabled=function(e){return null==e.selection||!!Ss.getSelectedElems(e).some(function(t){if(Pr.isVoid(e,t)&&Pr.isBlock(e,t))return!0;var n=t.type;return!!["pre","table","list-item"].includes(n)})},e.prototype.exec=function(e,t){var n=this.isActive(e);co.setNodes(e,{type:n?"paragraph":"todo"})},e}();var xg={selector:'div[data-w-e-type="todo"]',parseElemHtml:function(e,t,n){var r=Zi(e);0===(t=t.filter(function(e){return!!Wr.isText(e)||!!n.isInline(e)})).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]);var o=!1;return null!=r.find('input[type="checkbox"]').attr("checked")&&(o=!0),{type:"todo",checked:o,children:t}}};var Ng={type:"todo",renderElem:function(e,t,n){var r=!1;n.isDisabled()&&(r=!0);var o=Pd("div",{style:{margin:"5px 0"}},Pd("span",{contentEditable:!1,style:{marginRight:"0.5em"}},Pd("input",{type:"checkbox",checked:e.checked,disabled:r,on:{change:function(t){var r=Ss.findPath(n,e),o={checked:t.target.checked};co.setNodes(n,o,{at:r})}}})),Pd("span",null,t));return o}},Bg={renderElems:[Ng],elemsToHtml:[Ag],preParseHtml:[{selector:"ul.w-e-todo",preParseHtml:function(e){var t=Zi(e).find("li"),n=Zi('<div data-w-e-type="todo"></div>'),r=t.find("input[type]");return n.append(r),t.children()[0].remove(),n[0].innerHTML+=t[0].innerHTML,n[0]}}],parseElemsHtml:[xg],menus:[{key:"todo",factory:function(){return new Sg}}],editorPlugin:function(e){var t=e.deleteBackward,n=e;return n.deleteBackward=function(n){var r=e.selection;if(r&&Gn.isCollapsed(r)){var o=Ss.getSelectedNodeByType(e,"todo");if(o&&0===Qn.string(o).length)return void co.setNodes(e,{type:"paragraph"},{mode:"highest"})}t(n)},n}},Og=function(){function e(){this.title=ac("undo.redo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0.00032 576a510.72 510.72 0 0 0 173.344 384l84.672-96A383.136 383.136 0 0 1 128.00032 576C128.00032 363.936 299.93632 192 512.00032 192c106.048 0 202.048 42.976 271.52 112.48L640.00032 448h384V64l-149.984 149.984A510.272 510.272 0 0 0 512.00032 64C229.21632 64 0.00032 293.216 0.00032 576z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection},e.prototype.exec=function(e,t){"function"==typeof e.redo&&e.redo()},e}(),Tg=function(){function e(){this.title=ac("undo.undo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 64A510.272 510.272 0 0 0 149.984 213.984L0.032 64v384h384L240.512 304.48A382.784 382.784 0 0 1 512.032 192c212.064 0 384 171.936 384 384 0 114.688-50.304 217.632-130.016 288l84.672 96a510.72 510.72 0 0 0 173.344-384c0-282.784-229.216-512-512-512z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection},e.prototype.exec=function(e,t){"function"==typeof e.undo&&e.undo()},e}(),kg=[Dg,Zf,lp,Dh,Oh,kh,yh,np,op,og,Of,Ef,qp,ug,Bg,dp,{menus:[{key:"redo",factory:function(){return new Og}},{key:"undo",factory:function(){return new Tg}}]},pp,Qf];nc("en",{highLightModule:{selectLang:"Language"}}),nc("zh-CN",{highLightModule:{selectLang:"选择语言"}});var Fg,Ig={exports:{}};var Pg=(Fg||(Fg=1,function(e){var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},o.util.type(t)){case"Object":if(i=o.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=o.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,o){r[o]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var o=e.classList;if(o.contains(t))return!0;if(o.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=o.util.clone(o.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||o.languages)[e],a={};for(var s in i)if(i.hasOwnProperty(s)){if(s==t)for(var u in n)n.hasOwnProperty(u)&&(a[u]=n[u]);n.hasOwnProperty(s)||(a[s]=i[s])}var l=r[e];return r[e]=a,o.languages.DFS(o.languages,function(t,n){n===l&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,r,i){i=i||{};var a=o.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var u=t[s],l=o.util.type(u);"Object"!==l||i[a(u)]?"Array"!==l||i[a(u)]||(i[a(u)]=!0,e(u,n,s,i)):(i[a(u)]=!0,e(u,n,null,i))}}},plugins:{},highlightAll:function(e,t){o.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),o.hooks.run("before-all-elements-highlight",r);for(var i,a=0;i=r.elements[a++];)o.highlightElement(i,!0===t,r.callback)},highlightElement:function(t,n,r){var i=o.util.getLanguage(t),a=o.languages[i];o.util.setLanguage(t,i);var s=t.parentElement;s&&"pre"===s.nodeName.toLowerCase()&&o.util.setLanguage(s,i);var u={element:t,language:i,grammar:a,code:t.textContent};function l(e){u.highlightedCode=e,o.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,o.hooks.run("after-highlight",u),o.hooks.run("complete",u),r&&r.call(u.element)}if(o.hooks.run("before-sanity-check",u),(s=u.element.parentElement)&&"pre"===s.nodeName.toLowerCase()&&!s.hasAttribute("tabindex")&&s.setAttribute("tabindex","0"),!u.code)return o.hooks.run("complete",u),void(r&&r.call(u.element));if(o.hooks.run("before-highlight",u),u.grammar)if(n&&e.Worker){var c=new Worker(o.filename);c.onmessage=function(e){l(e.data)},c.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else l(o.highlight(u.code,u.grammar,u.language));else l(o.util.encode(u.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(o.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=o.tokenize(r.code,r.grammar),o.hooks.run("after-tokenize",r),i.stringify(o.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new u;return l(o,o.head,e),s(e,o,t,o.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=o.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=o.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function a(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function s(e,t,n,r,u,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var h=0;h<p.length;++h){if(d&&d.cause==f+","+h)return;var g=p[h],v=g.inside,m=!!g.lookbehind,y=!!g.greedy,b=g.alias;if(y&&!g.pattern.global){var E=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,E+"g")}for(var w=g.pattern||g,C=r.next,D=u;C!==t.tail&&!(d&&D>=d.reach);D+=C.value.length,C=C.next){var A=C.value;if(t.length>e.length)return;if(!(A instanceof i)){var S,x=1;if(y){if(!(S=a(w,D,e,m))||S.index>=e.length)break;var N=S.index,B=S.index+S[0].length,O=D;for(O+=C.value.length;N>=O;)O+=(C=C.next).value.length;if(D=O-=C.value.length,C.value instanceof i)continue;for(var T=C;T!==t.tail&&(O<B||"string"==typeof T.value);T=T.next)x++,O+=T.value.length;x--,A=e.slice(D,O),S.index-=D}else if(!(S=a(w,0,A,m)))continue;N=S.index;var k=S[0],F=A.slice(0,N),I=A.slice(N+k.length),P=D+A.length;d&&P>d.reach&&(d.reach=P);var _=C.prev;if(F&&(_=l(t,_,F),D+=F.length),c(t,_,x),C=l(t,_,new i(f,v?o.tokenize(k,v):k,b,k)),I&&l(t,C,I),x>1){var R={cause:f+","+h,reach:P};s(e,t,n,C.prev,D,R),d&&R.reach>d.reach&&(d.reach=R.reach)}}}}}}function u(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function c(e,t,n){for(var r=t.next,o=0;o<n&&r!==e.tail;o++)r=r.next;t.next=r,r.prev=t,e.length-=o}if(e.Prism=o,i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach(function(t){r+=e(t,n)}),r}var i={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},a=t.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(i.classes,a):i.classes.push(a)),o.hooks.run("wrap",i);var s="";for(var u in i.attributes)s+=" "+u+'="'+(i.attributes[u]||"").replace(/"/g,"&quot;")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+s+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,a=n.immediateClose;e.postMessage(o.highlight(i,o.languages[r],r)),a&&e.close()},!1),o):o;var d=o.util.currentScript();function f(){o.manual||o.highlightAll()}if(d&&(o.filename=d.src,d.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});
12
+ */function i(e,t){const n=/\$/g;let r=[e];if(null==t)return r;for(const e of Object.keys(t))if("_"!==e){let i=t[e];"string"==typeof i&&(i=n[Symbol.replace](i,"$$$$")),r=o(r,new RegExp(`%\\{${e}\\}`,"g"),i)}return r}var a=n("apply");function s(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}return _=class{constructor(t){Object.defineProperty(this,a,{value:s}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(t)?t.forEach(e(this,a)[a],this):e(this,a)[a](t)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!r(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return i(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return i(n,t)}},_}function de(){return M||(M=1,L=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,o,i,a,s){var u=function(e){var n=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(t),a=0,s=i.length;for(;a<s;a++){var u=i[a];if("*"===u&&(n=n.concat(t[u])),2===o.length&&o[0]===u){n=n.concat(t[u]);break}}return n}(e);u.length&&function(e,t,n){var r=0,o=t.length;for(;r<o&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,u,[n,r,o,i,a,s])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,function r(){n.apply(this,arguments),e.off(t,r)})},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],o=0,i=r?r.length:0;o<i;o++)r[o]!==t&&n.push(r[o]);n.length?this._fns[e]=n:delete this._fns[e]},e}),L}function fe(){if(H)return j;H=1;var e="Expected a function",t=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,a="object"==typeof h&&h&&h.Object===Object&&h,s="object"==typeof self&&self&&self.Object===Object&&self,u=a||s||Function("return this")(),l=Object.prototype.toString,c=Math.max,d=Math.min,f=function(){return u.Date.now()};function p(t,n,r){var o,i,a,s,u,l,p=0,h=!1,m=!1,y=!0;if("function"!=typeof t)throw new TypeError(e);function b(e){var n=o,r=i;return o=i=void 0,p=e,s=t.apply(r,n)}function E(e){var t=e-l;return void 0===l||t>=n||t<0||m&&e-p>=a}function w(){var e=f();if(E(e))return C(e);u=setTimeout(w,function(e){var t=n-(e-l);return m?d(t,a-(e-p)):t}(e))}function C(e){return u=void 0,y&&o?b(e):(o=i=void 0,s)}function D(){var e=f(),t=E(e);if(o=arguments,i=this,l=e,t){if(void 0===u)return function(e){return p=e,u=setTimeout(w,n),h?b(e):s}(l);if(m)return u=setTimeout(w,n),b(l)}return void 0===u&&(u=setTimeout(w,n)),s}return n=v(n)||0,g(r)&&(h=!!r.leading,a=(m="maxWait"in r)?c(v(r.maxWait)||0,n):a,y="trailing"in r?!!r.trailing:y),D.cancel=function(){void 0!==u&&clearTimeout(u),p=0,o=l=i=u=void 0},D.flush=function(){return void 0===u?s:C(f())},D}function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(g(e)){var a="function"==typeof e.valueOf?e.valueOf():e;e=g(a)?a+"":a}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var s=r.test(e);return s||o.test(e)?i(e.slice(2),s?2:8):n.test(e)?NaN:+e}return j=function(t,n,r){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError(e);return g(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),p(t,n,{leading:o,maxWait:n,trailing:i})}}function pe(){if($)return z;$=1;var e=0;function t(t){return"__private_"+e+++"_"+t}var n=t("publish");class r{constructor(){Object.defineProperty(this,n,{value:o}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},r={...this.state,...e};this.state=r,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,n)[n](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach(e=>{e(...t)})}return r.VERSION="2.1.1",z=function(){return new r}}function he(){if(V)return U;return V=1,U=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}}function ge(){return G?W:(G=1,W={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"})}function ve(){if(oe)return re;oe=1;var e=S(),t=A(),n=ue();let r,o;function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var a=0;function s(e){return"__private_"+a+++"_"+e}const u=ce(),l=de(),c=fe(),d=pe(),f=function(){if(K)return q;K=1;const e=he(),t=ge();return q=function(n){var r;if(n.type)return n.type;const o=n.name?null==(r=e(n.name).extension)?void 0:r.toLowerCase():null;return o&&o in t?t[o]:"application/octet-stream"}}(),p=he(),h=function(){if(X)return Y;function e(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}return X=1,Y=function(t){let n="uppy";return"string"==typeof t.name&&(n+=`-${e(t.name.toLowerCase())}`),void 0!==t.type&&(n+=`-${t.type}`),t.meta&&"string"==typeof t.meta.relativePath&&(n+=`-${e(t.meta.relativePath.toLowerCase())}`),void 0!==t.data.size&&(n+=`-${t.data.size}`),void 0!==t.data.lastModified&&(n+=`-${t.data.lastModified}`),n}}(),g=(J||(J=1,Z=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[r,o]=n.split(".");return r=parseInt(r,10),o=parseInt(o,10),r<15||15===r&&o<15063||r>18||18===r&&o>=18218}),Z),v=ee?Q:(ee=1,Q=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}),m=ne?te:(ne=1,te={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}});var y=s("plugins"),b=s("restricter"),E=s("storeUnsubscribe"),w=s("emitter"),C=s("preProcessors"),D=s("uploaders"),x=s("postProcessors"),N=s("informAndEmit"),B=s("checkRequiredMetaFieldsOnFile"),O=s("checkRequiredMetaFields"),T=s("assertNewUploadAllowed"),k=s("checkAndCreateFileStateObject"),F=s("startIfAutoProceed"),I=s("addListeners"),P=s("updateOnlineStatus"),_=s("createUpload"),R=s("getUpload"),L=s("removeUpload"),M=s("runUpload");r=Symbol.for("uppy test: getPlugins"),o=Symbol.for("uppy test: createUpload");class j{constructor(e){Object.defineProperty(this,M,{value:le}),Object.defineProperty(this,L,{value:se}),Object.defineProperty(this,R,{value:ae}),Object.defineProperty(this,_,{value:ie}),Object.defineProperty(this,I,{value:G}),Object.defineProperty(this,F,{value:W}),Object.defineProperty(this,k,{value:V}),Object.defineProperty(this,T,{value:U}),Object.defineProperty(this,O,{value:$}),Object.defineProperty(this,B,{value:z}),Object.defineProperty(this,N,{value:H}),Object.defineProperty(this,y,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,b,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,w,{writable:!0,value:l()}),Object.defineProperty(this,C,{writable:!0,value:new Set}),Object.defineProperty(this,D,{writable:!0,value:new Set}),Object.defineProperty(this,x,{writable:!0,value:new Set}),Object.defineProperty(this,P,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=m;const r={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:n.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:d(),logger:t.justErrorsLogger,infoTimeout:5e3};this.opts={...r,...e,restrictions:{...r.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=t.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=c(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:g(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),i(this,b)[b]=new n.Restricter(()=>this.opts,this.i18n),i(this,E)[E]=this.store.subscribe((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),i(this,I)[I]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i(this,w)[w].emit(e,...n)}on(e,t){return i(this,w)[w].on(e,t),this}once(e,t){return i(this,w)[w].once(e,t),this}off(e,t){return i(this,w)[w].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new u([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(e=>{e.setOptions()}),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach(r=>{const o={...t[r]};o.progress={...o.progress,...e},n[r]=o}),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){i(this,C)[C].add(e)}removePreProcessor(e){return i(this,C)[C].delete(e)}addPostProcessor(e){i(this,x)[x].add(e)}removePostProcessor(e){return i(this,x)[x].delete(e)}addUploader(e){i(this,D)[D].add(e)}removeUploader(e){return i(this,D)[D].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach(t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const r={...n[e].meta,...t};n[e]={...n[e],meta:r},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=r.filter(e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted}),i=r.filter(e=>!e.progress.uploadStarted),a=r.filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess),s=r.filter(e=>e.progress.uploadStarted),u=r.filter(e=>e.isPaused),l=r.filter(e=>e.progress.uploadComplete),c=r.filter(e=>e.error),d=o.filter(e=>!e.isPaused),f=r.filter(e=>e.progress.preprocess||e.progress.postprocess);return{newFiles:i,startedFiles:a,uploadStartedFiles:s,pausedFiles:u,completeFiles:l,erroredFiles:c,inProgressFiles:o,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:s.length>0,isAllComplete:100===t&&l.length===r.length&&0===f.length,isAllErrored:!!n&&c.length===r.length,isAllPaused:0!==o.length&&u.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(e=>e.isGhost)}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return i(this,b)[b].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){i(this,T)[T](e);const{files:t}=this.getState();let n=i(this,k)[k](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),i(this,F)[F](),n.id}addFiles(e){i(this,T)[T]();const t={...this.getState().files},n=[],r=[];for(let o=0;o<e.length;o++)try{let r=i(this,k)[k](t,e[o]);t[r.id]&&t[r.id].isGhost&&(r={...t[r.id],data:e[o].data,isGhost:!1},this.log(`Replaced blob in a ghost file: ${r.name}, ${r.id}`)),t[r.id]=r,n.push(r)}catch(e){e.isRestriction||r.push(e)}if(this.setState({files:t}),n.forEach(e=>{this.emit("file-added",e)}),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach(e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)}),n.length>0&&i(this,F)[F](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach(t=>{e+=`\n * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}}removeFiles(e,t){const{files:n,currentUploads:r}=this.getState(),o={...n},i={...r},a=Object.create(null);function s(e){return void 0===a[e]}e.forEach(e=>{n[e]&&(a[e]=n[e],delete o[e])}),Object.keys(i).forEach(e=>{const t=r[e].fileIDs.filter(s);if(0===t.length)return void delete i[e];const{capabilities:n}=this.getState();if(t.length!==r[e].fileIDs.length&&!n.individualCancellation)throw new Error("individualCancellation is disabled");i[e]={...r[e],fileIDs:t}});const u={currentUploads:i,files:o};0===Object.keys(o).length&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),this.calculateTotalProgress();const l=Object.keys(a);l.forEach(e=>{this.emit("file-removed",a[e],t)}),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const n={...e[t],isPaused:!0};e[t]=n}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter(t=>e[t].error);if(t.forEach(t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n}),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=i(this,_)[_](t,{forceAllowNewUpload:!0});return i(this,M)[M](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=i(this,_)[_]([e],{forceAllowNewUpload:!0});return i(this,M)[M](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins(e=>{e.provider&&e.provider.logout&&e.provider.logout()})}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter(e=>null!=e.progress.bytesTotal),n=e.filter(e=>null==e.progress.bytesTotal);if(0===t.length){const t=100*e.length,r=n.reduce((e,t)=>e+t.progress.percentage,0),o=Math.round(r/t*100);return void this.setState({totalProgress:o})}let r=t.reduce((e,t)=>e+t.progress.bytesTotal,0);const o=r/t.length;r+=o*n.length;let i=0;t.forEach(e=>{i+=e.progress.bytesUploaded}),n.forEach(e=>{i+=o*(e.progress.percentage||0)/100});let a=0===r?0:Math.round(i/r*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`)}const n=new e(this,t),r=n.id;if(!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(r);if(o){const e=`Already found a plugin named '${o.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in i(this,y)[y]?i(this,y)[y][n.type].push(n):i(this,y)[y][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(i(this,y)[y])){const n=t.find(t=>t.id===e);if(null!=n)return n}}[r](e){return i(this,y)[y][e]}iteratePlugins(e){Object.values(i(this,y)[y]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=i(this,y)[y][e.type],n=t.findIndex(t=>t.id===e.id);-1!==n&&t.splice(n,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),i(this,E)[E](),this.iteratePlugins(e=>{this.removePlugin(e)}),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",i(this,P)[P]),window.removeEventListener("offline",i(this,P)[P]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?i(this,M)[M](e):(i(this,L)[L](e),Promise.reject(new Error("Nonexistent upload")))}[o](){return i(this,_)[_](...arguments)}addResultData(e,t){if(!i(this,R)[R](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),r={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:r}})}upload(){var e;null!=(e=i(this,y)[y].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const r=this.opts.onBeforeUpload(t);return!1===r?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&"object"==typeof r&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>i(this,b)[b].validateMinNumberOfFiles(t)).catch(e=>{throw i(this,N)[N](e),e}).then(()=>{if(!i(this,O)[O](t))throw new n.RestrictionError(this.i18n("missingRequiredMetaField"))}).catch(e=>{throw e}).then(()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap(e=>e.fileIDs),r=[];Object.keys(t).forEach(e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||r.push(t.id)});const o=i(this,_)[_](r);return i(this,M)[M](o)}).catch(e=>{throw this.emit("error",e),this.log(e,"error"),e}))}}function H(e,t){const{message:n,details:r=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:r},"error",this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),"error")}function z(e){const{missingFields:t,error:n}=i(this,b)[b].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),!1)}function $(e){let t=!0;for(const n of Object.values(e))i(this,B)[B](n)||(t=!1);return t}function U(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new n.RestrictionError(this.i18n("noMoreFilesAllowed"));throw i(this,N)[N](t,e),t}}function V(e,t){const r=f(t),o=v(r,t),a=p(o).extension,s=Boolean(t.isRemote),u=h({...t,type:r});if(this.checkIfFileAlreadyExists(u)){const e=new n.RestrictionError(this.i18n("noDuplicates",{fileName:o}));throw i(this,N)[N](e,t),e}const l=t.meta||{};l.name=o,l.type=r;const c=Number.isFinite(t.data.size)?t.data.size:null;let d={source:t.source||"",id:u,name:o,extension:a||"",meta:{...this.getState().meta,...l},type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:c,uploadComplete:!1,uploadStarted:null},size:c,isRemote:s,remote:t.remote||"",preview:t.preview};const g=this.opts.onBeforeFileAdded(d,e);if(!1===g){const e=new n.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof g&&null!==g&&(d=g);try{const t=Object.keys(e).map(t=>e[t]);i(this,b)[b].validate(d,t)}catch(e){throw i(this,N)[N](e,d),e}return d}function W(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function G(){const e=(e,t,n)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on("error",e),this.on("upload-error",(t,n,r)=>{if(e(n,t,r),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),i(this,N)[N](e)}else i(this,N)[N](n)}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-started",e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:i(this,x)[x].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("preprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on("postprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("postprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",e=>{e&&i(this,B)[B](e)}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",i(this,P)[P]),window.addEventListener("offline",i(this,P)[P]),setTimeout(i(this,P)[P],3e3))}function ie(t,n){void 0===n&&(n={});const{forceAllowNewUpload:r=!1}=n,{allowNewUpload:o,currentUploads:i}=this.getState();if(!o&&!r)throw new Error("Cannot create a new upload: already uploading.");const a=(0,e.nanoid)();return this.emit("upload",{id:a,fileIDs:t}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...i,[a]:{fileIDs:t,step:0,result:{}}}}),a}function ae(e){const{currentUploads:t}=this.getState();return t[e]}function se(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function le(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,o=[...i(this,C)[C],...i(this,D)[D],...i(this,x)[x]];try{for(let i=r;i<o.length&&n;i++){const r=o[i],a={...n,step:i};this.setState({currentUploads:{...t,[e]:a}}),await r(a.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw i(this,L)[L](e),t}if(n){n.fileIDs.forEach(e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)});const r=n.fileIDs.map(e=>this.getFile(e)),o=r.filter(e=>!e.error),i=r.filter(e=>e.error);await this.addResultData(e,{successful:o,failed:i,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let a;return n&&(a=n.result,this.emit("complete",a),i(this,L)[L](e)),null==a&&this.log(`Not setting result for an upload that has been removed: ${e}`),a}return j.VERSION="2.3.4",re=j}var me,ye,be,Ee,we,Ce,De,Ae,Se,xe,Ne,Be,Oe,Te={},ke=[],Fe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ie=Array.isArray;function Pe(e,t){for(var n in t)e[n]=t[n];return e}function _e(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Re(e,t,n){var r,o,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?me.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return Le(e,a,r,o,null)}function Le(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++be:o,__i:-1,__u:0};return null==o&&null!=ye.vnode&&ye.vnode(i),i}function Me(e){return e.children}function je(e,t){this.props=e,this.context=t}function He(e,t){if(null==t)return e.__?He(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?He(e):null}function ze(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return ze(e)}}function $e(e){(!e.__d&&(e.__d=!0)&&we.push(e)&&!Ue.__r++||Ce!=ye.debounceRendering)&&((Ce=ye.debounceRendering)||De)(Ue)}function Ue(){for(var e,t,n,r,o,i,a,s=1;we.length;)we.length>s&&we.sort(Ae),e=we.shift(),s=we.length,e.__d&&(n=void 0,r=void 0,o=(r=(t=e).__v).__e,i=[],a=[],t.__P&&((n=Pe({},r)).__v=r.__v+1,ye.vnode&&ye.vnode(n),Ze(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,i,null==o?He(r):o,!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,Qe(i,n,a),r.__e=r.__=null,n.__e!=o&&ze(n)));Ue.__r=0}function Ve(e,t,n,r,o,i,a,s,u,l,c){var d,f,p,h,g,v,m,y=r&&r.__k||ke,b=t.length;for(u=We(n,t,y,u,b),d=0;d<b;d++)null!=(p=n.__k[d])&&(f=-1==p.__i?Te:y[p.__i]||Te,p.__i=d,v=Ze(e,p,f,o,i,a,s,u,l,c),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&nt(f.ref,null,p),c.push(p.ref,p.__c||h,p)),null==g&&null!=h&&(g=h),(m=!!(4&p.__u))||f.__k===p.__k?u=Ge(p,u,e,m):"function"==typeof p.type&&void 0!==v?u=v:h&&(u=h.nextSibling),p.__u&=-7);return n.__e=g,u}function We(e,t,n,r,o){var i,a,s,u,l,c=n.length,d=c,f=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(a=t[i])&&"boolean"!=typeof a&&"function"!=typeof a?(u=i+f,(a=e.__k[i]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?Le(null,a,null,null,null):Ie(a)?Le(Me,{children:a},null,null,null):null==a.constructor&&a.__b>0?Le(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,-1!=(l=a.__i=qe(a,n,u,d))&&(d--,(s=n[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(o>c?f--:o<c&&f++),"function"!=typeof a.type&&(a.__u|=4)):l!=u&&(l==u-1?f--:l==u+1?f++:(l>u?f--:f++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==r&&(r=He(s)),rt(s,s));return r}function Ge(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=Ge(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=He(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function qe(e,t,n,r){var o,i,a,s=e.key,u=e.type,l=t[n],c=null!=l&&!(2&l.__u);if(null===l&&null==e.key||c&&s==l.key&&u==l.type)return n;if(r>(c?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(l=t[a=o>=0?o--:i++])&&!(2&l.__u)&&s==l.key&&u==l.type)return a;return-1}function Ke(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Fe.test(t)?n:n+"px"}function Ye(e,t,n,r,o){var i,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ke(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||Ke(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(Se,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=xe,e.addEventListener(t,i?Be:Ne,i)):e.removeEventListener(t,i?Be:Ne,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function Xe(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=xe++;else if(t.t<n.u)return;return n(ye.event?ye.event(t):t)}}}function Ze(e,t,n,r,o,i,a,s,u,l){var c,d,f,p,h,g,v,m,y,b,E,w,C,D,A,S,x,N=t.type;if(null!=t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=t.__e=n.__e]),(c=ye.__b)&&c(t);e:if("function"==typeof N)try{if(m=t.props,y="prototype"in N&&N.prototype.render,b=(c=N.contextType)&&r[c.__c],E=c?b?b.props.value:c.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:(y?t.__c=d=new N(m,E):(t.__c=d=new je(m,E),d.constructor=N,d.render=ot),b&&b.sub(d),d.props=m,d.state||(d.state={}),d.context=E,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),y&&null==d.__s&&(d.__s=d.state),y&&null!=N.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Pe({},d.__s)),Pe(d.__s,N.getDerivedStateFromProps(m,d.__s))),p=d.props,h=d.state,d.__v=t,f)y&&null==N.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),y&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(y&&null==N.getDerivedStateFromProps&&m!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,E),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,E)||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,E),y&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,h,g)})}if(d.context=E,d.props=m,d.__P=e,d.__e=!1,C=ye.__r,D=0,y){for(d.state=d.__s,d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),A=0;A<d._sb.length;A++)d.__h.push(d._sb[A]);d._sb=[]}else do{d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++D<25);d.state=d.__s,null!=d.getChildContext&&(r=Pe(Pe({},r),d.getChildContext())),y&&!f&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,h)),S=c,null!=c&&c.type===Me&&null==c.key&&(S=et(c.props.children)),s=Ve(e,Ie(S)?S:[S],t,n,r,o,i,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),v&&(d.__E=d.__=null)}catch(e){if(t.__v=null,u||null!=i)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else{for(x=i.length;x--;)_e(i[x]);Je(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Je(t);ye.__e(e,t,n)}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=tt(n.__e,t,n,r,o,i,a,u,l);return(c=ye.diffed)&&c(t),128&t.__u?void 0:s}function Je(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Je)}function Qe(e,t,n){for(var r=0;r<n.length;r++)nt(n[r],n[++r],n[++r]);ye.__c&&ye.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){ye.__e(e,t.__v)}})}function et(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:Ie(e)?e.map(et):Pe({},e)}function tt(e,t,n,r,o,i,a,s,u){var l,c,d,f,p,h,g,v=n.props,m=t.props,y=t.type;if("svg"==y?o="http://www.w3.org/2000/svg":"math"==y?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(l=0;l<i.length;l++)if((p=i[l])&&"setAttribute"in p==!!y&&(y?p.localName==y:3==p.nodeType)){e=p,i[l]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(o,y,m.is&&m),s&&(ye.__m&&ye.__m(t,i),s=!1),i=null}if(null==y)v===m||s&&e.data==m||(e.data=m);else{if(i=i&&me.call(e.childNodes),v=n.props||Te,!s&&null!=i)for(v={},l=0;l<e.attributes.length;l++)v[(p=e.attributes[l]).name]=p.value;for(l in v)if(p=v[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=p;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;Ye(e,l,null,p,o)}for(l in m)p=m[l],"children"==l?f=p:"dangerouslySetInnerHTML"==l?c=p:"value"==l?h=p:"checked"==l?g=p:s&&"function"!=typeof p||v[l]===p||Ye(e,l,p,v[l],o);if(c)s||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Ve("template"==t.type?e.content:e,Ie(f)?f:[f],t,n,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&He(n,0),s,u),null!=i)for(l=i.length;l--;)_e(i[l]);s||(l="value","progress"==y&&null==h?e.removeAttribute("value"):null!=h&&(h!==e[l]||"progress"==y&&!h||"option"==y&&h!=v[l])&&Ye(e,l,h,v[l],o),l="checked",null!=g&&g!=e[l]&&Ye(e,l,g,v[l],o))}return e}function nt(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){ye.__e(e,n)}}function rt(e,t,n){var r,o;if(ye.unmount&&ye.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||nt(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){ye.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&rt(r[o],t,n||"function"!=typeof e.type);n||_e(e.__e),e.__c=e.__=e.__e=void 0}function ot(e,t,n){return this.constructor(e,n)}function it(e,t,n){var r,o,i,a;t==document&&(t=document.documentElement),ye.__&&ye.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],a=[],Ze(t,e=(!r&&n||t).__k=Re(Me,null,[e]),o||Te,Te,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?me.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),Qe(i,e,a)}me=ke.slice,ye={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},be=0,Ee=function(e){return null!=e&&null==e.constructor},je.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Pe({},this.state),"function"==typeof e&&(e=e(Pe({},n),this.props)),e&&Pe(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),$e(this))},je.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$e(this))},je.prototype.render=Me,we=[],De="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ae=function(e,t){return e.__v.__b-t.__v.__b},Ue.__r=0,Se=/(PointerCapture)$|Capture$/i,xe=0,Ne=Xe(!1),Be=Xe(!0),Oe=0;var at,st,ut,lt,ct,dt,ft,pt,ht,gt,vt,mt=Object.freeze({__proto__:null,Component:je,Fragment:Me,cloneElement:function(e,t,n){var r,o,i,a,s=Pe({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=void 0===t[i]&&null!=a?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?me.call(arguments,2):n),Le(e.type,s,r||e.key,o||e.ref,null)},createContext:function(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,$e(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Oe++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createElement:Re,createRef:function(){return{current:null}},h:Re,hydrate:function e(t,n){it(t,n,e)},get isValidElement(){return Ee},get options(){return ye},render:it,toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Ie(t)?t.some(function(t){e(t,n)}):n.push(t)),n}}),yt=v(mt);function bt(){if(lt)return ut;lt=1;const e=st?at:(st=1,at=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE});return ut=function(t,n){return void 0===n&&(n=document),"string"==typeof t?n.querySelector(t):e(t)?t:null}}function Et(){if(pt)return ft;pt=1;const e=ce();return ft=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const t=new e([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}}}function wt(){if(gt)return ht;gt=1;var e=yt;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var n=0;function r(e){return"__private_"+n+++"_"+e}const o=bt(),i=dt?ct:(dt=1,ct=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir}),a=Et();var s=r("updateUI");class u extends a{constructor(){super(...arguments),Object.defineProperty(this,s,{writable:!0,value:void 0})}mount(n,r){const a=r.id,l=o(n);if(l){this.isTargetDOMEl=!0;const r=document.createElement("div");return r.classList.add("uppy-Root"),t(this,s)[s]=function(e){let t=null,n=null;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=o,t||(t=Promise.resolve().then(()=>(t=null,e(...n)))),t}}(t=>{this.uppy.getPlugin(this.id)&&((0,e.render)(this.render(t),r),this.afterUpdate())}),this.uppy.log(`Installing ${a} to a DOM element '${n}'`),this.opts.replaceTargetContent&&(l.innerHTML=""),(0,e.render)(this.render(this.uppy.getState()),r),this.el=r,l.appendChild(r),r.dir=this.opts.direction||i(r)||"ltr",this.onMount(),this.el}let c;if("object"==typeof n&&n instanceof u)c=n;else if("function"==typeof n){const e=n;this.uppy.iteratePlugins(t=>{t instanceof e&&(c=t)})}if(c)return this.uppy.log(`Installing ${a} to ${c.id}`),this.parent=c,this.el=c.addTarget(r),this.onMount(),this.el;this.uppy.log(`Not installing ${a}`);let d=`Invalid target option given to ${a}.`;throw d+="function"==typeof n?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(d)}update(e){var n,r;null!=this.el&&(null==(n=(r=t(this,s))[s])||n.call(r,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}return ht=u}var Ct,Dt,At,St,xt,Nt,Bt,Ot,Tt,kt,Ft=(vt||(vt=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Uppy=t.UIPlugin=t.BasePlugin=void 0,Object.defineProperty(t,"debugLogger",{enumerable:!0,get:function(){return n.debugLogger}});var n=A();e.exports=ve();const r=wt();t.UIPlugin=r;const o=Et();t.BasePlugin=o;const i=ve();t.Uppy=i;const a=wt(),s=Et();i.Uppy=i,i.UIPlugin=a,i.BasePlugin=s,i.debugLogger=n.debugLogger}(C,C.exports)),C.exports),It=g(Ft),Pt={};function _t(){if(Dt)return Ct;Dt=1;class e extends Error{constructor(e,t){void 0===t&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}return Ct=e}function Rt(){if(kt)return Tt;let e;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}kt=1;var n=0;function r(e){return"__private_"+n+++"_"+e}const o=function(){if(St)return At;St=1;const e=_t();return At=function(){return fetch(...arguments).catch(t=>{throw"AbortError"===t.name?t:new e(t)})},At}(),i=function(){if(Nt)return xt;Nt=1;const e=le();class t extends Error{constructor(t,n){void 0===n&&(n={}),super(t),this.cause=n.cause,this.cause&&e(this.cause,"isNetworkError")&&(this.isNetworkError=this.cause.isNetworkError)}}return xt=t}(),a=function(){if(Ot)return Bt;Ot=1;class e extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}return Bt=e}();async function s(e){if(401===e.status)throw new a;const t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{const e=await t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw new Error(n)}}return t}var u=r("companionHeaders"),l=r("getPostResponseFunc"),c=r("getUrl"),d=r("errorHandler");e=Symbol.for("uppy test: getCompanionHeaders");class f{constructor(e,n){Object.defineProperty(this,d,{value:h}),Object.defineProperty(this,c,{value:p}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=n,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1,t(this,u)[u]=null==n?void 0:n.companionHeaders}setCompanionHeaders(e){t(this,u)[u]=e}[e](){return t(this,u)[u]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}headers(){return Promise.resolve({...f.defaultHeaders,...t(this,u)[u]})}onReceiveResponse(e){const t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:r}=e;return r.has("i-am")&&r.get("i-am")!==t[n]&&this.uppy.setState({companion:{...t,[n]:r.get("i-am")}}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(t(this,c)[c](e),{method:"OPTIONS"}).then(e=>(e.headers.has("access-control-allow-headers")&&(this.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map(e=>e.trim().toLowerCase())),this.preflightDone=!0,this.allowedHeaders.slice())).catch(e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,"warning"),this.preflightDone=!0,this.allowedHeaders.slice()))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then(e=>{let[t,n]=e;return Object.keys(n).forEach(e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])}),n})}get(e,n){return this.preflightAndHeaders(e).then(n=>o(t(this,c)[c](e),{method:"get",headers:n,credentials:this.opts.companionCookiesRule||"same-origin"})).then(t(this,l)[l](n)).then(s).catch(t(this,d)[d]("get",e))}post(e,n,r){const i="post";return this.preflightAndHeaders(e).then(r=>o(t(this,c)[c](e),{method:i,headers:r,credentials:this.opts.companionCookiesRule||"same-origin",body:JSON.stringify(n)})).then(t(this,l)[l](r)).then(s).catch(t(this,d)[d](i,e))}delete(e,n,r){const i="delete";return this.preflightAndHeaders(e).then(t=>o(`${this.hostname}/${e}`,{method:i,headers:t,credentials:this.opts.companionCookiesRule||"same-origin",body:n?JSON.stringify(n):null})).then(t(this,l)[l](r)).then(s).catch(t(this,d)[d](i,e))}}function p(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function h(e,n){return r=>{var o;return null!=(o=r)&&o.isAuthError||(r=new i(`Could not ${e} ${t(this,c)[c](n)}`,{cause:r})),Promise.reject(r)}}return f.VERSION="2.2.2",f.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Uppy-Versions":`@uppy/companion-client=${f.VERSION}`},Tt=f}var Lt,Mt,jt,Ht,zt,$t,Ut,Vt,Wt={};function Gt(){if(Lt)return Wt;return Lt=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},Wt.removeItem=function(e){return new Promise(t=>{localStorage.removeItem(e),t()})},Wt.setItem=function(e,t){return new Promise(n=>{localStorage.setItem(e,t),n()})},Wt}function qt(){if(Vt)return Pt;Vt=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.Socket=Pt.SearchProvider=Pt.RequestClient=Pt.Provider=void 0;const e=Rt();Pt.RequestClient=e;const t=function(){if(jt)return Mt;jt=1;var e=Gt();const t=Rt();return Mt=class extends t{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then(e=>{let[t,n]=e;const r={};return n&&(r["uppy-auth-token"]=n),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...r}})}onReceiveResponse(e){e=super.onReceiveResponse(e);const t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authUrl(e){void 0===e&&(e={});const t=new URLSearchParams(e);return this.preAuthToken&&t.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async fetchPreAuthToken(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e){return this.get(`${this.id}/list/${e||""}`)}logout(){return this.get(`${this.id}/logout`).then(e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)])).then(e=>{let[t]=e;return t})}static initPlugin(t,n,r){if(t.type="acquirer",t.files=[],r&&(t.opts={...r,...n}),n.serverUrl||n.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(n.companionAllowedHosts){const e=n.companionAllowedHosts;if(!("string"==typeof e||Array.isArray(e)||e instanceof RegExp))throw new TypeError(`${t.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);t.opts.companionAllowedHosts=e}else/^(?!https?:\/\/).*$/i.test(n.companionUrl)?t.opts.companionAllowedHosts=`https://${n.companionUrl.replace(/^\/\//,"")}`:t.opts.companionAllowedHosts=new URL(n.companionUrl).origin;t.storage=t.opts.storage||e}},Mt}();Pt.Provider=t;const n=function(){if(zt)return Ht;zt=1;const e=Rt();return Ht=class extends e{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}},Ht}();Pt.SearchProvider=n;const r=function(){if(Ut)return $t;let e,t;function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Ut=1;var r=0;function o(e){return"__private_"+r+++"_"+e}const i=de();var a=o("queued"),s=o("emitter"),u=o("isOpen"),l=o("socket"),c=o("handleMessage");return e=Symbol.for("uppy test: getSocket"),t=Symbol.for("uppy test: getQueued"),$t=class{constructor(e){Object.defineProperty(this,a,{writable:!0,value:[]}),Object.defineProperty(this,s,{writable:!0,value:i()}),Object.defineProperty(this,u,{writable:!0,value:!1}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:e=>{try{const t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,e&&!1===e.autoOpen||this.open()}get isOpen(){return n(this,u)[u]}[e](){return n(this,l)[l]}[t](){return n(this,a)[a]}open(){n(this,l)[l]=new WebSocket(this.opts.target),n(this,l)[l].onopen=()=>{for(n(this,u)[u]=!0;n(this,a)[a].length>0&&n(this,u)[u];){const e=n(this,a)[a].shift();this.send(e.action,e.payload)}},n(this,l)[l].onclose=()=>{n(this,u)[u]=!1},n(this,l)[l].onmessage=n(this,c)[c]}close(){var e;null==(e=n(this,l)[l])||e.close()}send(e,t){n(this,u)[u]?n(this,l)[l].send(JSON.stringify({action:e,payload:t})):n(this,a)[a].push({action:e,payload:t})}on(e,t){n(this,s)[s].on(e,t)}emit(e,t){n(this,s)[s].emit(e,t)}once(e,t){n(this,s)[s].once(e,t)}},$t}();return Pt.Socket=r,Pt}var Kt,Yt,Xt,Zt,Jt,Qt,en,tn,nn,rn,on,an,sn,un,ln,cn,dn,fn={};function pn(){if(Kt)return fn;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Kt=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.internalRateLimitedQueue=fn.RateLimitedQueue=void 0;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("activeRequests"),o=n("queuedHandlers"),i=n("paused"),a=n("pauseTimer"),s=n("downLimit"),u=n("upperLimit"),l=n("rateLimitingTimer"),c=n("call"),d=n("queueNext"),f=n("next"),p=n("queue"),h=n("dequeue"),g=n("resume"),v=n("increaseLimit");function m(t){e(this,r)[r]+=1;let n,o=!1;try{n=t()}catch(t){throw e(this,r)[r]-=1,t}return{abort:()=>{o||(o=!0,e(this,r)[r]-=1,n(),e(this,d)[d]())},done:()=>{o||(o=!0,e(this,r)[r]-=1,e(this,d)[d]())}}}function y(){queueMicrotask(()=>e(this,f)[f]())}function b(){if(e(this,i)[i]||e(this,r)[r]>=this.limit)return;if(0===e(this,o)[o].length)return;const t=e(this,o)[o].shift(),n=e(this,c)[c](t.fn);t.abort=n.abort,t.done=n.done}function E(t,n){void 0===n&&(n={});const r={fn:t,priority:n.priority||0,abort:()=>{e(this,h)[h](r)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=e(this,o)[o].findIndex(e=>r.priority>e.priority);return-1===i?e(this,o)[o].push(r):e(this,o)[o].splice(i,0,r),r}function w(t){const n=e(this,o)[o].indexOf(t);-1!==n&&e(this,o)[o].splice(n,1)}fn.RateLimitedQueue=class{constructor(t){Object.defineProperty(this,h,{value:w}),Object.defineProperty(this,p,{value:E}),Object.defineProperty(this,f,{value:b}),Object.defineProperty(this,d,{value:y}),Object.defineProperty(this,c,{value:m}),Object.defineProperty(this,r,{writable:!0,value:0}),Object.defineProperty(this,o,{writable:!0,value:[]}),Object.defineProperty(this,i,{writable:!0,value:!1}),Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,s,{writable:!0,value:1}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,g,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,v,{writable:!0,value:()=>{if(e(this,i)[i])e(this,l)[l]=setTimeout(e(this,v)[v],0);else{e(this,s)[s]=this.limit,this.limit=Math.ceil((e(this,u)[u]+e(this,s)[s])/2);for(let t=e(this,s)[s];t<=this.limit;t++)e(this,d)[d]();e(this,u)[u]-e(this,s)[s]>3?e(this,l)[l]=setTimeout(e(this,v)[v],2e3):e(this,s)[s]=Math.floor(e(this,s)[s]/2)}}}),this.limit="number"!=typeof t||0===t?1/0:t}run(t,n){return!e(this,i)[i]&&e(this,r)[r]<this.limit?e(this,c)[c](t):e(this,p)[p](t,n)}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];let a;const s=new Promise((r,i)=>{a=n.run(()=>{let t,n;try{n=Promise.resolve(e(...o))}catch(e){n=Promise.reject(e)}return n.then(e=>{t?i(t):(a.done(),r(e))},e=>{t?i(t):(a.done(),i(e))}),()=>{t=new Error("Cancelled")}},t)});return s.abort=()=>{a.abort()},s}}resume(){e(this,i)[i]=!1,clearTimeout(e(this,a)[a]);for(let t=0;t<this.limit;t++)e(this,d)[d]()}pause(t){void 0===t&&(t=null),e(this,i)[i]=!0,clearTimeout(e(this,a)[a]),null!=t&&(e(this,a)[a]=setTimeout(e(this,g)[g],t))}rateLimit(t){clearTimeout(e(this,l)[l]),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(e(this,u)[u]=this.limit-1,this.limit=e(this,s)[s],e(this,l)[l]=setTimeout(e(this,v)[v],t))}get isPaused(){return e(this,i)[i]}};const C=Symbol("__queue");return fn.internalRateLimitedQueue=C,fn}function hn(){return ln?un:(ln=1,un={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}})}var gn,vn,mn=function(){if(dn)return cn;dn=1;var e=S(),t=qt(),n=pn();const r=Et(),o=function(){if(Xt)return Yt;Xt=1;const e=fe();return Yt=e(function(e,t,n){const{progress:r,bytesUploaded:o,bytesTotal:i}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",n,{uploader:e,bytesUploaded:o,bytesTotal:i}))},300,{leading:!0,trailing:!0})}(),i=Jt?Zt:(Jt=1,Zt=function(e){const t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return`${/^http:\/\//i.test(e)?"ws":"wss"}://${t}`}),a=en?Qt:(en=1,Qt=function(e){const t=[],n=[];function r(e){t.push(e)}function o(e){n.push(e)}return Promise.all(e.map(e=>e.then(r,o))).then(()=>({successful:t,failed:n}))}),s=function(){if(nn)return tn;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}nn=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("emitter"),o=n("events");return tn=class{constructor(t){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:[]}),e(this,r)[r]=t}on(t,n){return e(this,o)[o].push([t,n]),e(this,r)[r].on(t,n)}remove(){for(const[t,n]of e(this,o)[o].splice(0))e(this,r)[r].off(t,n)}}}(),u=function(){if(on)return rn;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}on=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("aliveTimer"),o=n("isDone"),i=n("onTimedOut"),a=n("timeout");return rn=class{constructor(t,n){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:!1}),Object.defineProperty(this,i,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),e(this,a)[a]=t,e(this,i)[i]=n}progress(){e(this,o)[o]||e(this,a)[a]>0&&(clearTimeout(e(this,r)[r]),e(this,r)[r]=setTimeout(e(this,i)[i],e(this,a)[a]))}done(){e(this,o)[o]||(clearTimeout(e(this,r)[r]),e(this,r)[r]=null,e(this,o)[o]=!0)}}}(),l=_t(),c=sn?an:(sn=1,an=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)}),d=hn();function f(e,t){let n=t;return n||(n=new Error("Upload error")),"string"==typeof n&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),c(e)?(n=new l(n,e),n):(n.request=e,n)}function p(e){return e.data.slice(0,e.data.size,e.meta.type)}class h extends r{constructor(e,t){super(e,t),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.title="XHRUpload",this.defaultLocale=d;const r={formData:!0,fieldName:t.bundle?"files[]":"file",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:"",getResponseData(t){let n={};try{n=JSON.parse(t)}catch(t){e.log(t)}return n},getResponseError(e,t){let n=new Error("Upload error");return c(t)&&(n=new l(n,t)),n},validateStatus:e=>e>=200&&e<300};if(this.opts={...r,...t},this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),n.internalRateLimitedQueue in this.opts?this.requests=this.opts[n.internalRateLimitedQueue]:this.requests=new n.RateLimitedQueue(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:n}=this.opts,r={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof n?r.headers=n(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach(n=>{e.append(n,t[n])})}createFormDataUpload(e,t){const n=new FormData;this.addMetadata(n,e.meta,t);const r=p(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n}createBundledUpload(e,t){const n=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(n,r,t),e.forEach(e=>{const t=this.getOptions(e),r=p(e);e.name?n.append(t.fieldName,r,e.name):n.append(t.fieldName,r)}),n}upload(t,n,r){const o=this.getOptions(t);return this.uppy.log(`uploading ${n} of ${r}`),new Promise((n,r)=>{this.uppy.emit("upload-started",t);const i=o.formData?this.createFormDataUpload(t,o):t.data,a=new XMLHttpRequest;let l;this.uploaderEvents[t.id]=new s(this.uppy);const c=new u(o.timeout,()=>{a.abort(),l.done();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(o.timeout/1e3)}));this.uppy.emit("upload-error",t,e),r(e)}),d=(0,e.nanoid)();a.upload.addEventListener("loadstart",()=>{this.uppy.log(`[XHRUpload] ${d} started`)}),a.upload.addEventListener("progress",e=>{this.uppy.log(`[XHRUpload] ${d} progress: ${e.loaded} / ${e.total}`),c.progress(),e.lengthComputable&&this.uppy.emit("upload-progress",t,{uploader:this,bytesUploaded:e.loaded,bytesTotal:e.total})}),a.addEventListener("load",()=>{if(this.uppy.log(`[XHRUpload] ${d} finished`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null),o.validateStatus(a.status,a.responseText,a)){const e=o.getResponseData(a.responseText,a),r=e[o.responseUrlFieldName],i={status:a.status,body:e,uploadURL:r};return this.uppy.emit("upload-success",t,i),r&&this.uppy.log(`Download ${t.name} from ${r}`),n(t)}const e=o.getResponseData(a.responseText,a),i=f(a,o.getResponseError(a.responseText,a)),s={status:a.status,body:e};return this.uppy.emit("upload-error",t,i,s),r(i)}),a.addEventListener("error",()=>{this.uppy.log(`[XHRUpload] ${d} errored`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null);const e=f(a,o.getResponseError(a.responseText,a));return this.uppy.emit("upload-error",t,e),r(e)}),a.open(o.method.toUpperCase(),o.endpoint,!0),a.withCredentials=o.withCredentials,""!==o.responseType&&(a.responseType=o.responseType),l=this.requests.run(()=>{this.uppy.emit("upload-started",t);const e=this.getOptions(t);return Object.keys(e.headers).forEach(t=>{a.setRequestHeader(t,e.headers[t])}),a.send(i),()=>{c.done(),a.abort()}}),this.onFileRemove(t.id,()=>{l.abort(),r(new Error("File removed"))}),this.onCancelAll(t.id,e=>{let{reason:t}=e;"user"===t&&l.abort(),r(new Error("Upload cancelled"))})})}uploadRemote(e){const n=this.getOptions(e);return new Promise((r,a)=>{this.uppy.emit("upload-started",e);const u={};(Array.isArray(n.metaFields)?n.metaFields:Object.keys(e.meta)).forEach(t=>{u[t]=e.meta[t]});new(e.remote.providerOptions.provider?t.Provider:t.RequestClient)(this.uppy,e.remote.providerOptions).post(e.remote.url,{...e.remote.body,endpoint:n.endpoint,size:e.data.size,fieldname:n.fieldName,metadata:u,httpMethod:n.method,useFormData:n.formData,headers:n.headers}).then(u=>{const{token:l}=u,c=i(e.remote.companionUrl),d=new t.Socket({target:`${c}/api/${l}`,autoOpen:!1});let f;this.uploaderEvents[e.id]=new s(this.uppy),this.onFileRemove(e.id,()=>{d.send("cancel",{}),f.abort(),r(`upload ${e.id} was removed`)}),this.onCancelAll(e.id,function(t){let{reason:n}=void 0===t?{}:t;"user"===n&&(d.send("cancel",{}),f.abort()),r(`upload ${e.id} was canceled`)}),this.onRetry(e.id,()=>{d.send("pause",{}),d.send("resume",{})}),this.onRetryAll(e.id,()=>{d.send("pause",{}),d.send("resume",{})}),d.on("progress",t=>o(this,t,e)),d.on("success",t=>{const o=n.getResponseData(t.response.responseText,t.response),i=o[n.responseUrlFieldName],a={status:t.response.status,body:o,uploadURL:i};return this.uppy.emit("upload-success",e,a),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r()}),d.on("error",t=>{const r=t.response,o=r?n.getResponseError(r.responseText,r):Object.assign(new Error(t.error.message),{cause:t.error});this.uppy.emit("upload-error",e,o),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),a(o)}),f=this.requests.run(()=>(d.open(),e.isPaused&&d.send("pause",{}),()=>d.close()))}).catch(t=>{this.uppy.emit("upload-error",e,t),a(t)})})}uploadBundle(e){return new Promise((t,n)=>{const{endpoint:r}=this.opts,{method:o}=this.opts,i=this.uppy.getState().xhrUpload,a=this.createBundledUpload(e,{...this.opts,...i||{}}),s=new XMLHttpRequest,l=t=>{e.forEach(e=>{this.uppy.emit("upload-error",e,t)})},c=new u(this.opts.timeout,()=>{s.abort();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(this.opts.timeout/1e3)}));l(e),n(e)});s.upload.addEventListener("loadstart",()=>{this.uppy.log("[XHRUpload] started uploading bundle"),c.progress()}),s.upload.addEventListener("progress",t=>{c.progress(),t.lengthComputable&&e.forEach(e=>{this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})})}),s.addEventListener("load",r=>{if(c.done(),this.opts.validateStatus(r.target.status,s.responseText,s)){const n=this.opts.getResponseData(s.responseText,s),o={status:r.target.status,body:n};return e.forEach(e=>{this.uppy.emit("upload-success",e,o)}),t()}const o=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return o.request=s,l(o),n(o)}),s.addEventListener("error",()=>{c.done();const e=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return l(e),n(e)}),this.uppy.on("cancel-all",function(e){let{reason:t}=void 0===e?{}:e;"user"===t&&(c.done(),s.abort())}),s.open(o.toUpperCase(),r,!0),s.withCredentials=this.opts.withCredentials,""!==this.opts.responseType&&(s.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach(e=>{s.setRequestHeader(e,this.opts.headers[e])}),s.send(a),e.forEach(e=>{this.uppy.emit("upload-started",e)})})}uploadFiles(e){const t=e.map((t,n)=>{const r=parseInt(n,10)+1,o=e.length;return t.error?Promise.reject(new Error(t.error)):t.isRemote?this.uploadRemote(t,r,o):this.upload(t,r,o)});return a(t)}onFileRemove(e,t){this.uploaderEvents[e].on("file-removed",n=>{e===n.id&&t(n.id)})}onRetry(e,t){this.uploaderEvents[e].on("upload-retry",n=>{e===n&&t()})}onRetryAll(e,t){this.uploaderEvents[e].on("retry-all",()=>{this.uppy.getFile(e)&&t()})}onCancelAll(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",function(){n.uppy.getFile(e)&&t(...arguments)})}handleUpload(e){if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts[n.internalRateLimitedQueue]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=e.map(e=>this.uppy.getFile(e));if(this.opts.bundle){if(t.some(e=>e.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then(()=>null)}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.handleUpload)}}return h.VERSION="2.1.3",cn=h}(),yn=g(mn);var bn=function(){if(vn)return gn;vn=1;var e=9007199254740991,t="[object Arguments]",n="[object Function]",r="[object GeneratorFunction]",o=/^(?:0|[1-9]\d*)$/;function i(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););return e}var a,s,u=Object.prototype,l=u.hasOwnProperty,c=u.toString,d=u.propertyIsEnumerable,f=(a=Object.keys,s=Object,function(e){return a(s(e))});function p(e,n){var r=b(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&E(e)}(e)&&l.call(e,"callee")&&(!d.call(e,"callee")||c.call(e)==t)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=r.length,i=!!o;for(var a in e)!l.call(e,a)||i&&("length"==a||y(a,o))||r.push(a);return r}var h,g=(h=function(e,t){return e&&v(e,t,w)},function(e,t){if(null==e)return e;if(!E(e))return h(e,t);for(var n=e.length,r=-1,o=Object(e);++r<n&&!1!==t(o[r],r,o););return e}),v=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[++r];if(!1===t(o[s],s,o))break}return e};function m(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||u,t!==r)return f(e);var t,n,r,o=[];for(var i in Object(e))l.call(e,i)&&"constructor"!=i&&o.push(i);return o}function y(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||o.test(t))&&t>-1&&t%1==0&&t<n}var b=Array.isArray;function E(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?c.call(e):"";return t==n||t==r}(t)}function w(e){return E(e)?p(e):m(e)}function C(e){return e}return gn=function(e,t){return(b(e)?i:g)(e,"function"==typeof t?t:C)}}(),En=g(bn);let wn=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};function Cn(e){Promise.resolve().then(e)}function Dn(e){return e.replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&reg;/g,"®").replace(/&copy;/g,"©").replace(/&trade;/g,"™").replace(/&quot;/g,'"')}var An=function(e){return Object.prototype.toString.call(e)};function Sn(e){return e||{name:""}}function xn(e){return Object.keys(e).reduce(function(t,n){return t[n]=String(e[n]),t},{})}function Nn(e){var t=e.server,n=void 0===t?"":t,r=e.fieldName,o=void 0===r?"":r,i=e.maxFileSize,a=void 0===i?10485760:i,u=e.maxNumberOfFiles,l=void 0===u?100:u,f=e.meta,p=void 0===f?{}:f,h=e.metaWithUrl,g=void 0!==h&&h,v=e.headers,m=void 0===v?{}:v,y=e.withCredentials,b=void 0!==y&&y,E=e.timeout,w=void 0===E?1e4:E,C=e.onBeforeUpload,D=void 0===C?function(e){return e}:C,A=e.onSuccess,S=void 0===A?function(e,t){}:A,x=e.onError,N=void 0===x?function(e,t,n){console.error("".concat(e.name," upload error"),t,n)}:x,B=e.onProgress,O=void 0===B?function(e){}:B;if(!n)throw new Error("Cannot get upload server address\n没有配置上传地址");if(!o)throw new Error("Cannot get fieldName\n没有配置 fieldName");var T=n;g&&(T=function(e,t){var n=d(e.split("#"),2),r=n[0],o=n[1],i=r,a=[];En(t,function(e,t){a.push("".concat(t,"=").concat(e))});var s=a.join("&");return i=i.indexOf("?")>0?"".concat(i,"&").concat(s):"".concat(i,"?").concat(s),o?"".concat(i,"#").concat(o):i}(T,p)),function(){if("undefined"!=typeof AbortSignal){var e=AbortSignal;"function"!=typeof e.any&&(e.any=function(e){var t,n,r=new AbortController,o=function(t){e.forEach(function(e){return e.removeEventListener("abort",o)});var n=t.target.reason;r.abort(n)};try{for(var i=c(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.aborted){var u=s.reason;return r.abort(u),r.signal}s.addEventListener("abort",o,{once:!0})}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r.signal})}}();var k=function(e){if(e)return"function"==typeof e?function(t){return xn(e(t))}:xn(e)}(m),F=new It(s({onBeforeUpload:function(e){return D(e)},restrictions:{maxFileSize:a,maxNumberOfFiles:l},meta:p},e.uppyConfig)).use(yn,s({endpoint:T,headers:k,formData:!0,fieldName:o,bundle:!1,withCredentials:b,timeout:w},e.xhrConfig));return F.on("upload-success",function(e,t){var n=(null!=t?t:{}).body,r=void 0===n?{}:n,o=Sn(e);try{S(o,r)}catch(e){console.error("wangEditor upload file - onSuccess error",e)}}),F.on("progress",function(e){e<1||O(e)}),F.on("upload-error",function(e,t,n){var r=Sn(e);try{N(r,t,n)}catch(e){console.error("wangEditor upload file - onError error",e)}}),F.on("restriction-failed",function(e,t){var n=Sn(e);try{N(n,t,void 0)}catch(e){console.error("wangEditor upload file - onError error",e)}}),F}function Bn(e,t){return e.uploadAdapter?e.uploadAdapter({config:e,editor:t}):Nn(e)}var On={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=jn.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},Tn={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Mr.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},kn={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Gn.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},Fn=new WeakMap,In=new WeakMap,Pn=new WeakMap,_n=new WeakMap,Rn=new WeakMap,Ln=new WeakMap,Mn=new WeakMap,jn={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=jn.levels(e,t);return r=n?r.slice(1):r.slice(0,-1)},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r],i=t[r];if("number"!=typeof o||"number"!=typeof i)throw new Error("Got non-numeric path index");if(o!==i)break;n.push(o)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return jn.equals(r,o)&&i>a},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return jn.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return jn.equals(r,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===jn.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===jn.compare(e,t),isBefore:(e,t)=>-1===jn.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===jn.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===jn.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===jn.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===jn.compare(e,t),isPath:e=>Array.isArray(e)&&e.every(e=>"number"==typeof e),isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&jn.equals(n,r)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!jn.isAncestor(t,e)&&!jn.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(0===e.length)return r;switch(t.type){case"insert_node":var{path:i}=t;(jn.equals(i,r)||jn.endsBefore(i,r)||jn.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(jn.equals(a,r)||jn.isAncestor(a,r))return null;jn.endsBefore(a,r)&&(r[a.length-1]-=1);break;case"merge_node":var{path:s,position:u}=t;jn.equals(s,r)||jn.endsBefore(s,r)?r[s.length-1]-=1:jn.isAncestor(s,r)&&(r[s.length-1]-=1,r[s.length]+=u);break;case"split_node":var{path:l,position:c}=t;if(jn.equals(l,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else jn.endsBefore(l,r)?r[l.length-1]+=1:jn.isAncestor(l,r)&&e[l.length]>=c&&(r[l.length-1]+=1,r[l.length]-=c);break;case"move_node":var{path:d,newPath:f}=t;if(jn.equals(d,f))return r;if(jn.isAncestor(d,r)||jn.equals(d,r)){var p=f.slice();return jn.endsBefore(d,f)&&d.length<f.length&&(p[d.length-1]-=1),p.concat(r.slice(d.length))}jn.isSibling(d,f)&&(jn.isAncestor(f,r)||jn.equals(f,r))?jn.endsBefore(d,r)?r[d.length-1]-=1:r[d.length-1]+=1:jn.endsBefore(f,r)||jn.equals(f,r)||jn.isAncestor(f,r)?(jn.endsBefore(d,r)&&(r[d.length-1]-=1),r[f.length-1]+=1):jn.endsBefore(d,r)&&(jn.equals(f,r)&&(r[f.length-1]+=1),r[d.length-1]-=1)}return r}};function Hn(e){return Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hn(e)}function zn(e){var t=function(e,t){if("object"!==Hn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Hn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Hn(t)?t:String(t)}function $n(e,t,n){return(t=zn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Un(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Vn=["anchor","focus"];function Wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var Gn={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return Gn.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=Gn.edges(e);return t},equals:(e,t)=>Mr.equals(e.anchor,t.anchor)&&Mr.equals(e.focus,t.focus),surrounds(e,t){var n=Gn.intersection(e,t);return!!n&&Gn.equals(n,t)},includes(e,t){if(_r.isRange(t)){if(Gn.includes(e,t.anchor)||Gn.includes(e,t.focus))return!0;var[n,r]=Gn.edges(e),[o,i]=Gn.edges(t);return Mr.isBefore(n,o)&&Mr.isAfter(r,i)}var[a,s]=Gn.edges(e),u=!1,l=!1;return _r.isPoint(t)?(u=Mr.compare(t,a)>=0,l=Mr.compare(t,s)<=0):(u=jn.compare(t,a.path)>=0,l=jn.compare(t,s.path)<=0),u&&l},intersection(e,t){var{anchor:n,focus:r}=e,o=Un(e,Vn),[i,a]=Gn.edges(e),[s,u]=Gn.edges(t),l=Mr.isBefore(i,s)?s:i,c=Mr.isBefore(a,u)?a:u;return Mr.isBefore(c,l)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wn(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({anchor:l,focus:c},o)},isBackward(e){var{anchor:t,focus:n}=e;return Mr.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return Mr.equals(t,n)},isExpanded:e=>!Gn.isCollapsed(e),isForward:e=>!Gn.isBackward(e),isRange:e=>or(e)&&Mr.isPoint(e.anchor)&&Mr.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Gn.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var a=Gn.isCollapsed(e);Gn.isForward(e)?(r="forward",o=a?r:"backward"):(r="backward",o=a?r:"forward")}else"outward"===i?Gn.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var s=Mr.transform(e.anchor,t,{affinity:r}),u=Mr.transform(e.focus,t,{affinity:o});return s&&u?{anchor:s,focus:u}:null}},qn=function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!or(e)&&("function"!=typeof e.apply&&(t?Qn.isNodeList(e.children):Array.isArray(e.children)))},Kn={isAncestor(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return or(e)&&Qn.isNodeList(e.children,{deep:t})},isElement:qn,isElementList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>Kn.isElement(e,{deep:t}))},isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return qn(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},Yn=["text"],Xn=["children"];function Zn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zn(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Qn={ancestor(e,t){var n=Qn.get(e,t);if(Qn.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Hr.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of jn.ancestors(t,n)){var o=[Qn.ancestor(e,r),r];yield o}}()},child(e,t){if(Qn.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Hr.stringify(e)));if("number"!=typeof t)throw new Error("Expected index to be a number");var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Hr.stringify(e)));return n},children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=Qn.ancestor(e,t),{children:i}=o,a=r?i.length-1:0;r?a>=0:a<i.length;){var s=Qn.child(o,a),u=t.concat(a);yield[s,u],a=r?a-1:a+1}}()},common(e,t,n){var r=jn.common(t,n);return[Qn.get(e,r),r]},descendant(e,t){var n=Qn.get(e,t);if(Qn.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Hr.stringify(n)));return n},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Qn.nodes(e,t))0!==r.length&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Qn.nodes(e,t))Qn.isElement(n)&&(yield[n,r])}()},extractProps(e){if(Qn.isText(e)){var{text:t}=e;return Un(e,Yn)}var{children:n}=e;return Un(e,Xn)},first(e,t){for(var n=t.slice(),r=Qn.get(e,n);r&&!Qn.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){var n={children:e.children},[r,o]=Gn.edges(t),i=Qn.nodes(n,{reverse:!0,pass:e=>{var[,n]=e;return!Gn.includes(t,n)}}),a=function(){if(!Gn.includes(t,s)){var e=s[s.length-1];Jr(n,jn.parent(s),t=>Xr(t,e,1))}jn.equals(s,o.path)&&Qr(n,s,e=>{var t=e.text.slice(0,o.offset);return Jn(Jn({},e),{},{text:t})}),jn.equals(s,r.path)&&Qr(n,s,e=>{var t=e.text.slice(r.offset);return Jn(Jn({},e),{},{text:t})})};for(var[,s]of i)a();return n.children},get(e,t){var n=Qn.getIf(e,t);if(void 0===n)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Hr.stringify(e)));return n},getIf(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if("number"!=typeof o)throw new Error("Got non-numeric path index");if(Qn.isText(n)||!n.children[o])return;n=n.children[o]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if("number"!=typeof o)throw new Error("Got non-numeric path index");if(Qn.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isAncestor:e=>!Qn.isText(e),isEditor:e=>"function"==typeof e.apply,isElement:e=>Array.isArray(e.children)&&"function"!=typeof e.apply,isNode(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Wr.isText(e)||Kn.isElement(e,{deep:t})||Pr.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>Qn.isNode(e,{deep:t}))},isText:e=>"string"==typeof e.text,last(e,t){for(var n=t.slice(),r=Qn.get(e,n);r&&!Qn.isText(r)&&0!==r.children.length;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=Qn.get(e,t);if(!Qn.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Hr.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of jn.levels(t,n)){var o=Qn.get(e,r);yield[o,r]}}()},matches:(e,t)=>Qn.isElement(e)&&Kn.isElementProps(t)&&Kn.matches(e,t)||Qn.isText(e)&&Wr.isTextProps(t)&&Wr.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,a=new Set,s=[],u=e;!i||!(r?jn.isBefore(s,i):jn.isAfter(s,i));)if(a.has(u)||(yield[u,s]),a.has(u)||Qn.isText(u)||0===u.children.length||null!=n&&!1!==n([u,s])){if(0===s.length)break;if(!r){var l=jn.next(s);if(Qn.has(e,l)){s=l,u=Qn.get(e,s);continue}}if(r&&0!==s[s.length-1])s=jn.previous(s),u=Qn.get(e,s);else s=jn.parent(s),u=Qn.get(e,s),a.add(u)}else{a.add(u);var c=r?u.children.length-1:0;jn.isAncestor(s,o)&&(c=o[s.length]),s=s.concat(c),u=Qn.get(e,s)}}()},parent(e,t){var n=jn.parent(t),r=Qn.get(e,n);if(Qn.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:e=>Qn.isText(e)?e.text:e.children.map(Qn.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Qn.nodes(e,t))Qn.isText(n)&&(yield[n,r])}()}};function er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?er(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):er(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var nr,rr={isNodeOperation:e=>rr.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!or(e))return!1;switch(e.type){case"insert_node":case"remove_node":return jn.isPath(e.path)&&Qn.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&jn.isPath(e.path);case"merge_node":return"number"==typeof e.position&&jn.isPath(e.path)&&or(e.properties);case"move_node":return jn.isPath(e.path)&&jn.isPath(e.newPath);case"set_node":return jn.isPath(e.path)&&or(e.properties)&&or(e.newProperties);case"set_selection":return null===e.properties&&Gn.isRange(e.newProperties)||null===e.newProperties&&Gn.isRange(e.properties)||or(e.properties)&&or(e.newProperties);case"split_node":return jn.isPath(e.path)&&"number"==typeof e.position&&or(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(e=>rr.isOperation(e)),isSelectionOperation:e=>rr.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>rr.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return tr(tr({},e),{},{type:"remove_node"});case"insert_text":return tr(tr({},e),{},{type:"remove_text"});case"merge_node":return tr(tr({},e),{},{type:"split_node",path:jn.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(jn.equals(t,n))return e;if(jn.isSibling(n,t))return tr(tr({},e),{},{path:t,newPath:n});var r=jn.transform(n,e),o=jn.transform(jn.next(n),e);return tr(tr({},e),{},{path:r,newPath:o});case"remove_node":return tr(tr({},e),{},{type:"insert_node"});case"remove_text":return tr(tr({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return tr(tr({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:s,newProperties:u}=e;return tr(tr({},e),{},null==s?{properties:u,newProperties:null}:null==u?{properties:null,newProperties:s}:{properties:u,newProperties:s});case"split_node":return tr(tr({},e),{},{type:"merge_node",path:jn.next(e.path)})}}},or=e=>"object"==typeof e&&null!==e,ir=(e,t)=>{for(var n in e){var r=Object.hasOwn(e,n)?e[n]:void 0,o=Object.hasOwn(t,n)?t[n]:void 0;if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==o[i])return!1}else if(or(r)&&or(o)){if(!ir(r,o))return!1}else if(r!==o)return!1}for(var a in t)if(void 0===e[a]&&void 0!==t[a])return!1;return!0},ar=e=>e.selection?e.selection:e.children.length>0?Pr.end(e,[]):[0],sr=(e,t)=>{var[n]=Pr.node(e,t);return e=>e===n},ur=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!t,r=t?hr(e):e,o=nr.None,i=nr.None,a=0,s=null;for(var u of r){var l=u.codePointAt(0);if(!l)break;var c=xr(u,l);if([o,i]=n?[i,c]:[c,o],Nr(o,nr.ZWJ)&&Nr(i,nr.ExtPict)&&!kr(n?e.substring(0,a):e.substring(0,e.length-a)))break;if(Nr(o,nr.RI)&&Nr(i,nr.RI)&&!(s=null!==s?!s:!!n||Ir(e.substring(0,e.length-a))))break;if(o!==nr.None&&i!==nr.None&&Or(o,i))break;a+=u.length}return a||1},lr=/\s/,cr=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,dr=/['\u2018\u2019]/,fr=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},pr=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(lr.test(t))return!1;if(dr.test(t)){var o=ur(n,r),[i,a]=fr(n,o,r);if(e(i,a,r))return!0}return!cr.test(t)},hr=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var r=e.charAt(t-n);if(vr(r.charCodeAt(0))){var o=e.charAt(t-n-1);if(gr(o.charCodeAt(0))){yield o+r,n++;continue}}yield r}},gr=e=>e>=55296&&e<=56319,vr=e=>e>=56320&&e<=57343;!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(nr||(nr={}));var mr=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,yr=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,br=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,Er=/^[\u1100-\u115F\uA960-\uA97C]$/,wr=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,Cr=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Dr=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,Ar=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,Sr=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,xr=(e,t)=>{var n=nr.Any;return-1!==e.search(mr)&&(n|=nr.Extend),8205===t&&(n|=nr.ZWJ),t>=127462&&t<=127487&&(n|=nr.RI),-1!==e.search(yr)&&(n|=nr.Prepend),-1!==e.search(br)&&(n|=nr.SpacingMark),-1!==e.search(Er)&&(n|=nr.L),-1!==e.search(wr)&&(n|=nr.V),-1!==e.search(Cr)&&(n|=nr.T),-1!==e.search(Dr)&&(n|=nr.LV),-1!==e.search(Ar)&&(n|=nr.LVT),-1!==e.search(Sr)&&(n|=nr.ExtPict),n};function Nr(e,t){return 0!==(e&t)}var Br=[[nr.L,nr.L|nr.V|nr.LV|nr.LVT],[nr.LV|nr.V,nr.V|nr.T],[nr.LVT|nr.T,nr.T],[nr.Any,nr.Extend|nr.ZWJ],[nr.Any,nr.SpacingMark],[nr.Prepend,nr.Any],[nr.ZWJ,nr.ExtPict],[nr.RI,nr.RI]];function Or(e,t){return-1===Br.findIndex(n=>Nr(e,n[0])&&Nr(t,n[1]))}var Tr=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,kr=e=>-1!==e.search(Tr),Fr=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Ir=e=>{var t=e.match(Fr);return null!==t&&t[0].length/2%2==1},Pr={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!or(e))return!1;var n="function"==typeof e.above&&"function"==typeof e.addMark&&"function"==typeof e.after&&"function"==typeof e.apply&&"function"==typeof e.before&&"function"==typeof e.collapse&&"function"==typeof e.delete&&"function"==typeof e.deleteBackward&&"function"==typeof e.deleteForward&&"function"==typeof e.deleteFragment&&"function"==typeof e.deselect&&"function"==typeof e.edges&&"function"==typeof e.elementReadOnly&&"function"==typeof e.end&&"function"==typeof e.first&&"function"==typeof e.fragment&&"function"==typeof e.getDirtyPaths&&"function"==typeof e.getFragment&&"function"==typeof e.getMarks&&"function"==typeof e.hasBlocks&&"function"==typeof e.hasInlines&&"function"==typeof e.hasPath&&"function"==typeof e.hasTexts&&"function"==typeof e.insertBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertNodes&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertText&&"function"==typeof e.isBlock&&"function"==typeof e.isEdge&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isEmpty&&"function"==typeof e.isEnd&&"function"==typeof e.isInline&&"function"==typeof e.isNormalizing&&"function"==typeof e.isSelectable&&"function"==typeof e.isStart&&"function"==typeof e.isVoid&&"function"==typeof e.last&&"function"==typeof e.leaf&&"function"==typeof e.levels&&"function"==typeof e.liftNodes&&"function"==typeof e.markableVoid&&"function"==typeof e.mergeNodes&&"function"==typeof e.move&&"function"==typeof e.moveNodes&&"function"==typeof e.next&&"function"==typeof e.node&&"function"==typeof e.nodes&&"function"==typeof e.normalize&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.parent&&"function"==typeof e.path&&"function"==typeof e.pathRef&&"function"==typeof e.pathRefs&&"function"==typeof e.point&&"function"==typeof e.pointRef&&"function"==typeof e.pointRefs&&"function"==typeof e.positions&&"function"==typeof e.previous&&"function"==typeof e.range&&"function"==typeof e.rangeRef&&"function"==typeof e.rangeRefs&&"function"==typeof e.removeMark&&"function"==typeof e.removeNodes&&"function"==typeof e.select&&"function"==typeof e.setNodes&&"function"==typeof e.setNormalizing&&"function"==typeof e.setPoint&&"function"==typeof e.setSelection&&"function"==typeof e.shouldMergeNodesRemovePrevNode&&"function"==typeof e.shouldNormalize&&"function"==typeof e.splitNodes&&"function"==typeof e.start&&"function"==typeof e.string&&"function"==typeof e.unhangRange&&"function"==typeof e.unsetNodes&&"function"==typeof e.unwrapNodes&&"function"==typeof e.void&&"function"==typeof e.withoutNormalizing&&"function"==typeof e.wrapNodes&&(null===e.marks||or(e.marks))&&(null===e.selection||Gn.isRange(e.selection))&&(t?Qn.isNodeList(e.children)&&rr.isOperationList(e.operations):Array.isArray(e.children)&&Array.isArray(e.operations));return n},isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,n)=>e.shouldMergeNodesRemovePrevNode(t,n)},_r={isLocation:e=>jn.isPath(e)||Mr.isPoint(e)||Gn.isRange(e),isPath:e=>Array.isArray(e),isPoint:e=>"offset"in e,isRange:e=>"anchor"in e,isSpan:e=>Array.isArray(e)&&Array.isArray(e[0])};function Rr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rr(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Mr={compare(e,t){var n=jn.compare(e.path,t.path);return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>1===Mr.compare(e,t),isBefore:(e,t)=>-1===Mr.compare(e,t),equals:(e,t)=>e.offset===t.offset&&jn.equals(e.path,t.path),isPoint:e=>or(e)&&"number"==typeof e.offset&&jn.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var{affinity:r="forward"}=n,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":o=jn.transform(o,t,n);break;case"insert_text":jn.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===r)&&(i+=t.text.length);break;case"merge_node":jn.equals(t.path,o)&&(i+=t.position),o=jn.transform(o,t,n);break;case"remove_text":jn.equals(t.path,o)&&t.offset<=i&&(i-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(jn.equals(t.path,o)||jn.isAncestor(t.path,o))return null;o=jn.transform(o,t,n);break;case"split_node":if(jn.equals(t.path,o)){if(t.position===i&&null==r)return null;(t.position<i||t.position===i&&"forward"===r)&&(i-=t.position,o=jn.transform(o,t,Lr(Lr({},n),{},{affinity:"forward"})))}else o=jn.transform(o,t,n);break;default:return e}return{path:o,offset:i}}},jr=void 0,Hr={setScrubber(e){jr=e},stringify:e=>JSON.stringify(e,jr)},zr=["text"],$r=["anchor","focus","merge"];function Ur(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ur(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ur(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Wr={equals(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){var{text:t}=e;return Un(e,zr)}return ir(r?o(e):e,r?o(t):t)},isText:e=>or(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every(e=>Wr.isText(e)),isTextProps:e=>void 0!==e.text,matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[{leaf:Vr({},e)}];for(var r of t){var{anchor:o,focus:i,merge:a}=r,s=Un(r,$r),[u,l]=Gn.edges(r),c=[],d=0,f=u.offset,p=l.offset,h=null!=a?a:Object.assign;for(var{leaf:g}of n){var{length:v}=g.text,m=d;if(d+=v,f<=m&&d<=p)h(g,s),c.push({leaf:g});else if(f!==p&&(f===d||p===m)||f>d||p<m||p===m&&0!==m)c.push({leaf:g});else{var y=g,b=void 0,E=void 0;if(p<d){var w=p-m;E={leaf:Vr(Vr({},y),{},{text:y.text.slice(w)})},y=Vr(Vr({},y),{},{text:y.text.slice(0,w)})}if(f>m){var C=f-m;b={leaf:Vr(Vr({},y),{},{text:y.text.slice(0,C)})},y=Vr(Vr({},y),{},{text:y.text.slice(C)})}h(y,s),b&&c.push(b),c.push({leaf:y}),E&&c.push(E)}}n=c}if(n.length>1){var D=0;for(var[A,S]of n.entries()){var x=D,N=x+S.leaf.text.length,B={start:x,end:N};0===A&&(B.isFirst=!0),A===n.length-1&&(B.isLast=!0),S.position=B,D=N}}return n}};function Gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Kr=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return[...e.slice(0,t),...r,...e.slice(t)]},Yr=function(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];return[...e.slice(0,t),...o,...e.slice(t+n)]},Xr=Yr,Zr=(e,t,n)=>{if(0===t.length)throw new Error("Cannot modify the editor");for(var r=Qn.get(e,t),o=t.slice(),i=n(r);o.length>1;){var a=o.pop(),s=Qn.get(e,o);i=qr(qr({},s),{},{children:Yr(s.children,a,1,i)})}var u=o.pop();e.children=Yr(e.children,u,1,i)},Jr=(e,t,n)=>{0===t.length?e.children=n(e.children):Zr(e,t,e=>{if(Qn.isText(e))throw new Error("Cannot get the element at path [".concat(t,"] because it refers to a leaf node: ").concat(Hr.stringify(e)));return qr(qr({},e),{},{children:n(e.children)})})},Qr=(e,t,n)=>Zr(e,t,e=>{if(!Qn.isText(e))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Hr.stringify(e)));return n(e)});function eo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function to(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var no=["children","text",...Object.getOwnPropertyNames(Object.prototype)],ro=Object.getOwnPropertyNames(Object.prototype),oo={transform(e,t){var n=!1;switch(t.type){case"insert_node":var{path:r,node:o}=t;Jr(e,jn.parent(r),e=>{var t=r[r.length-1];if(t>e.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));return Kr(e,t,o)}),n=!0;break;case"insert_text":var{path:i,offset:a,text:s}=t;if(0===s.length)break;Qr(e,i,e=>{var t=e.text.slice(0,a),n=e.text.slice(a);return to(to({},e),{},{text:t+s+n})}),n=!0;break;case"merge_node":var{path:u}=t,l=u[u.length-1],c=jn.previous(u),d=c[c.length-1];if(0===u.length)throw new Error('Cannot apply a "merge_node" operation at path ['.concat(u,"] because the root node cannot be merged."));if("number"!=typeof l||"number"!=typeof d)throw new Error("Index must be number");Jr(e,jn.parent(u),e=>{var t,n=e[l],r=e[d];if(Qn.isText(n)&&Qn.isText(r))t=to(to({},r),{},{text:r.text+n.text});else{if(!Qn.isElement(n)||!Qn.isElement(r))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(u,"] to nodes of different interfaces: ").concat(Hr.stringify(n)," ").concat(Hr.stringify(r)));t=to(to({},r),{},{children:r.children.concat(n.children)})}return Yr(e,d,2,t)}),n=!0;break;case"move_node":var{path:f,newPath:p}=t,h=f[f.length-1];if(jn.isAncestor(f,p))throw new Error("Cannot move a path [".concat(f,"] to new path [").concat(p,"] because the destination is inside itself."));var g=Qn.get(e,f);Jr(e,jn.parent(f),e=>Xr(e,h,1));var v=jn.transform(f,t),m=v[v.length-1];Jr(e,jn.parent(v),e=>Kr(e,m,g)),n=!0;break;case"remove_node":var{path:y}=t,b=y[y.length-1];if(Jr(e,jn.parent(y),e=>Xr(e,b,1)),e.selection){var E=to({},e.selection);for(var[w,C]of Gn.points(E)){var D=Mr.transform(w,t);if(null!=E&&null!=D)E[C]=D;else{var A=void 0,S=void 0;for(var[x,N]of Qn.texts(e)){if(-1!==jn.compare(N,y)){S=[x,N];break}A=[x,N]}var B=!1;A&&S&&(B=!jn.isSibling(A[1],y)&&(!!jn.equals(S[1],y)||jn.common(A[1],y).length<jn.common(S[1],y).length)),A&&!B?E[C]={path:A[1],offset:A[0].text.length}:S?E[C]={path:S[1],offset:0}:E=null}}E&&Gn.equals(E,e.selection)||(e.selection=E)}break;case"remove_text":var{path:O,offset:T,text:k}=t;if(0===k.length)break;Qr(e,O,e=>{var t=e.text.slice(0,T),n=e.text.slice(T+k.length);return to(to({},e),{},{text:t+n})}),n=!0;break;case"set_node":var{path:F,properties:I,newProperties:P}=t;if(0===F.length)throw new Error("Cannot set properties on the root node!");Zr(e,F,e=>{var t=to({},e);for(var n in P){if(no.includes(n))throw new Error('Cannot set the "'.concat(n,'" property of nodes!'));var r=P[n];if("then"===n&&"function"==typeof r)throw new Error('Cannot set the "then" property of a node to a function');null==r?delete t[n]:t[n]=r}for(var o in I)Object.hasOwn(P,o)||delete t[o];return t});break;case"set_selection":var{newProperties:_}=t;if(null==_){e.selection=null;break}if(null==e.selection){if(!_.anchor||!_.focus)throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Hr.stringify(_)," when there is no current selection."));e.selection=to({},_);break}var R=to({},e.selection);for(var L in _){if(ro.includes(L))throw new Error('Cannot set the "'.concat(L,'" property of the selection!'));var M=_[L];if("then"===L&&"function"==typeof M)throw new Error('Cannot set the "then" property of the selection to a function');if(null==M){if("anchor"===L||"focus"===L)throw new Error('Cannot remove the "'.concat(L,'" selection property'));delete R[L]}else R[L]=M}e.selection=R;break;case"split_node":var{path:j,position:H,properties:z}=t,$=j[j.length-1];if(0===j.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(j,"] because the root node cannot be split."));if("number"!=typeof $)throw new Error("Index must be number");Jr(e,jn.parent(j),e=>{var t,n,r=e[$];if(Qn.isText(r)){var o=r.text.slice(0,H),i=r.text.slice(H);t=to(to({},r),{},{text:o}),n={text:i}}else{var a=r.children.slice(0,H),s=r.children.slice(H);t=to(to({},r),{},{children:a}),n={children:s}}for(var u in z){if(no.includes(u))throw new Error('Cannot set the "'.concat(u,'" property of nodes!'));var l=z[u];if("then"===u&&"function"==typeof l)throw new Error('Cannot set the "then" property of a node to a function');null!=l&&(n[u]=l)}return Yr(e,$,1,t,n)}),n=!0}if(n&&e.selection){var U=to({},e.selection);for(var[V,W]of Gn.points(U))U[W]=Mr.transform(V,t);Gn.equals(U,e.selection)||(e.selection=U)}}},io={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},ao={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},so={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pr.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:o=ar(e)}=n;if(_r.isPath(o)&&(o=Pr.range(e,o)),_r.isRange(o))if(Gn.isCollapsed(o))o=o.anchor;else{var i=Gn.end(o);if(!r&&Pr.void(e,{at:i}))return;var a=Gn.start(o),s=Pr.pointRef(e,a),u=Pr.pointRef(e,i);co.delete(e,{at:o,voids:r});var l=s.unref(),c=u.unref();o=l||c,co.setSelection(e,{anchor:o,focus:o})}if(!(!r&&Pr.void(e,{at:o})||Pr.elementReadOnly(e,{at:o}))){var{path:d,offset:f}=o;t.length>0&&e.apply({type:"insert_text",path:d,offset:f,text:t})}})}};function uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var co=lo(lo(lo(lo({},oo),io),ao),so),fo=new WeakMap;function po(e,t,n){var r,o,i=Fn.get(e)||[],a=In.get(e)||new Set,s=e=>{if(e){var t=e.join(",");o.has(t)||(o.add(t),r.push(e))}};if(n)for(var u of(r=[],o=new Set,i)){s(n(u))}else r=i,o=a;for(var l of t)s(l);Fn.set(e,r),In.set(e,o)}var ho=(e,t)=>{for(var n of Pr.pathRefs(e))On.transform(n,t);for(var r of Pr.pointRefs(e))Tn.transform(r,t);for(var o of Pr.rangeRefs(e))kn.transform(o,t);if(!(e=>fo.get(e)||!1)(e)){var i=jn.operationCanTransformPath(t)?e=>jn.transform(e,t):void 0;po(e,e.getDirtyPaths(t),i)}co.transform(e,t),e.operations.push(t),Pr.normalize(e,{operation:t}),"set_selection"===t.type&&(e.marks=null),Pn.get(e)||(Pn.set(e,!0),Promise.resolve().then(()=>{Pn.set(e,!1),e.onChange({operation:t}),e.operations=[]}))};function go(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?go(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):go(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Eo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Co(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Do(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ao(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Do(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Do(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function So(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var xo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r,marks:o}=e;if(r){if(o){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?So(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):So(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({text:t},o);co.insertNodes(e,i,{at:n.at,voids:n.voids})}else co.insertText(e,t,n);e.marks=null}};var No=["text"],Bo=["text"];var Oo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{force:n=!1,operation:r}=t,o=e=>Fn.get(e)||[],i=e=>{var t=o(e).pop(),n=t.join(",");return(e=>In.get(e)||new Set)(e).delete(n),t};if(Pr.isNormalizing(e)){if(n){var a=Array.from(Qn.nodes(e),e=>{var[,t]=e;return t}),s=new Set(a.map(e=>e.join(",")));Fn.set(e,a),In.set(e,s)}0!==o(e).length&&Pr.withoutNormalizing(e,()=>{for(var t of o(e))if(Qn.has(e,t)){var a=Pr.node(e,t),[s,u]=a;Qn.isElement(s)&&0===s.children.length&&e.normalizeNode(a,{operation:r,force:n})}for(var l=o(e),c=l.length,d=0;0!==l.length;){if(!e.shouldNormalize({dirtyPaths:l,iteration:d,initialDirtyPathsLength:c,operation:r}))return;var f=i(e);if(Qn.has(e,f)){var p=Pr.node(e,f);e.normalizeNode(p,{operation:r,force:n})}d++,l=o(e)}})}};function To(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:i=!1}=t;if(n){var a=Pr.range(e,n),[s,u]=Gn.edges(a),l=o?u:s,c=!1,d="",f=0,p=0,h=0,g=[],v=function*(t){var n=g.some(e=>jn.isAncestor(e,t));function*a(e){n||(yield e)}if(Qn.isElement(m)){if(!e.isSelectable(m)){if(g.push(t),o)return jn.hasPrevious(t)&&(yield*a(Pr.end(e,jn.previous(t)))),0;var v=jn.next(t);return Pr.hasPath(e,v)&&(yield*a(Pr.start(e,v))),0}if(!i&&(e.isVoid(m)||e.isElementReadOnly(m)))return yield*a(Pr.start(e,t)),0;if(e.isInline(m))return 0;if(Pr.hasInlines(e,m)){var y=jn.isAncestor(t,u.path)?u:Pr.end(e,t),E=jn.isAncestor(t,s.path)?s:Pr.start(e,t);d=Pr.string(e,{anchor:E,focus:y},{voids:i}),c=!0}}if(Qn.isText(m)){var w=jn.equals(t,l.path);for(w?(p=o?l.offset:m.text.length-l.offset,h=l.offset):(p=m.text.length,h=o?p:0),(w||c||"offset"===r)&&(yield*a({path:t,offset:h}),c=!1);;){if(0===f){if(""===d)break;f=b(d,r,o),d=fr(d,f,o)[1]}if(h=o?h-f:h+f,(p-=f)<0){f=-p;break}f=0,yield*a({path:t,offset:h})}}};for(var[m,y]of Pr.nodes(e,{at:n,reverse:o,voids:i}))yield*v(y)}function b(e,t,n){return"character"===t?ur(e,n):"word"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=!1;e.length>0;){var o=ur(e,t),[i,a]=fr(e,o,t);if(pr(i,a,t))r=!0,n+=o;else{if(r)break;n+=o}e=a}return n}(e,n):"line"===t||"block"===t?e.length:1}}()}function ko(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var Fo=(e,t)=>{var{selection:n}=e;if(n){var r=(t,n)=>{if(!Qn.isText(t))return!1;var[r,o]=Pr.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},o=Gn.isExpanded(n),i=!1;if(!o){var[a,s]=Pr.node(e,n);if(a&&r(a,s)){var[u]=Pr.parent(e,s);i=u&&e.markableVoid(u)}}if(o||i)co.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ko(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ko(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},Pr.marks(e)||{});delete l[t],e.marks=l,Pn.get(e)||e.onChange()}}};function Io(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Po(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Io(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Io(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _o(e,t,n){return("anchor"===e||"focus"===e)&&Mr.isPoint(t)&&Mr.isPoint(n)?!Mr.equals(t,n):t!==n}var Ro=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pr.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest",batchDirty:a=!0}=n,{at:s,match:u,select:l}=n;if(Qn.isNode(t)&&(t=[t]),0!==t.length){var[c]=t;if(s||(s=ar(e),!1!==l&&(l=!0)),null==l&&(l=!1),_r.isRange(s))if(r||(s=Pr.unhangRange(e,s,{voids:o})),Gn.isCollapsed(s))s=s.anchor;else{var[,d]=Gn.edges(s),f=Pr.pointRef(e,d);co.delete(e,{at:s}),s=f.unref()}if(_r.isPoint(s)){null==u&&(u=Qn.isText(c)?e=>Qn.isText(e):e.isInline(c)?t=>Qn.isText(t)||Pr.isInline(e,t):t=>Qn.isElement(t)&&Pr.isBlock(e,t));var[p]=Pr.nodes(e,{at:s.path,match:u,mode:i,voids:o});if(!p)return;var[,h]=p,g=Pr.pathRef(e,h),v=Pr.isEnd(e,s,h);co.splitNodes(e,{at:s,match:u,mode:i,voids:o});var m=g.unref();s=v?jn.next(m):m}var y=jn.parent(s),b=s[s.length-1];if(o||!Pr.void(e,{at:y})){if(a){var E=[],w=jn.levels(y);((e,t,n)=>{var r=fo.get(e)||!1;fo.set(e,!0);try{t(),n()}finally{fo.set(e,r)}})(e,()=>{var n=function(){var t=y.concat(b);b++;var n={type:"insert_node",path:t,node:r};e.apply(n),s=jn.next(s),E.push(n),Qn.isText(r)?w.push(t):w.push(...Array.from(Qn.nodes(r),e=>{var[,n]=e;return t.concat(n)}))};for(var r of t)n()},()=>{po(e,w,e=>{var t=e;for(var n of E)if(jn.operationCanTransformPath(n)&&!(t=jn.transform(t,n)))return null;return t})})}else for(var C of t){var D=y.concat(b);b++,e.apply({type:"insert_node",path:D,node:C}),s=jn.next(s)}if(s=jn.previous(s),l){var A=Pr.end(e,s);A&&co.select(e,A)}}}})},Lo=["text"],Mo=["children"],jo=(e,t)=>t!==e&&(Qn.isText(t)||Pr.isVoid(e,t)||1===t.children.length&&jo(e,t.children[0])),Ho=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection,height:a=0,always:s=!1}=t;if(i&&(null==o&&(o=t=>Qn.isElement(t)&&Pr.isBlock(e,t)),!_r.isRange(i)||(i=((e,t)=>{if(Gn.isCollapsed(t))return t.anchor;var[,n]=Gn.edges(t),r=Pr.pointRef(e,n);return co.delete(e,{at:t}),r.unref()})(e,i),i))){if(_r.isPath(i)){var u=i,l=Pr.point(e,u),[c]=Pr.parent(e,u);o=e=>e===c,a=l.path.length-u.length+1,i=l,s=!0}var d,f=Pr.pointRef(e,i,{affinity:"backward"});try{var[p]=Pr.nodes(e,{at:i,match:o,mode:n,voids:r});if(!p)return;var h=Pr.void(e,{at:i,mode:"highest"});if(!r&&h){var[g,v]=h;if(e.isInline(g)){var m=Pr.after(e,v);if(!m){var y=jn.next(v);co.insertNodes(e,{text:""},{at:y,voids:r}),m=Pr.point(e,y)}i=m,s=!0}a=i.path.length-v.length+1,s=!0}d=Pr.pointRef(e,i);var b=i.path.length-a,[,E]=p,w=i.path.slice(0,b),C=0===a?i.offset:i.path[b]+0;for(var[D,A]of Pr.levels(e,{at:w,reverse:!0,voids:r})){var S=!1;if(A.length<E.length||0===A.length||!r&&Qn.isElement(D)&&Pr.isVoid(e,D))break;var x=f.current,N=Pr.isEnd(e,x,A);if(s||!f||!Pr.isEdge(e,x,A)){S=!0;var B=Qn.extractProps(D);e.apply({type:"split_node",path:A,position:C,properties:B})}C=A[A.length-1]+(S||N?1:0)}if(null==t.at){var O=d.current||Pr.end(e,[]);co.select(e,O)}}finally{var T;f.unref(),null===(T=d)||void 0===T||T.unref()}}})};function zo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zo(Object(n),!0).forEach(function(t){$n(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Uo,Vo=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ho(e,...n)},addMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var{selection:r}=e;if(r){var o=(t,n)=>{if(!Qn.isText(t))return!1;var[r,o]=Pr.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},i=Gn.isExpanded(r),a=!1;if(!i){var[s,u]=Pr.node(e,r);if(s&&o(s,u)){var[l]=Pr.parent(e,u);a=l&&e.markableVoid(l)}}if(i||a)co.setNodes(e,{[t]:n},{match:o,split:!0,voids:!0});else{var c=vo(vo({},Pr.marks(e)||{}),{},{[t]:n});e.marks=c,Pn.get(e)||e.onChange()}}})(e,...n)},deleteBackward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&Gn.isCollapsed(n)&&co.delete(e,{unit:t,reverse:!0})})(e,...n)},deleteForward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&Gn.isCollapsed(n)&&co.delete(e,{unit:t})})(e,...n)},deleteFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{direction:t="forward"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e;n&&Gn.isExpanded(n)&&co.delete(e,{reverse:"backward"===t})}(e,...n)},getFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;return t?Qn.fragment(e,t):[]})(e,...n)},insertBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{co.splitNodes(e,{always:!0})})(e,...n)},insertSoftBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{co.splitNodes(e,{always:!0})})(e,...n)},insertFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pr.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1}=n,{at:i=ar(e),batchDirty:a=!0}=n;if(t.length){if(_r.isRange(i))if(r||(i=Pr.unhangRange(e,i,{voids:o})),Gn.isCollapsed(i))i=i.anchor;else{var[,s]=Gn.edges(i);if(!o&&Pr.void(e,{at:s}))return;var u=Pr.pointRef(e,s);co.delete(e,{at:i}),i=u.unref()}else _r.isPath(i)&&(i=Pr.start(e,i));if(o||!Pr.void(e,{at:i})){var l=Pr.above(e,{at:i,match:t=>Qn.isElement(t)&&Pr.isInline(e,t),mode:"highest",voids:o});if(l){var[,c]=l;Pr.isEnd(e,i,c)?i=Pr.after(e,c):Pr.isStart(e,i,c)&&(i=Pr.before(e,c))}var d=Pr.above(e,{match:t=>Qn.isElement(t)&&Pr.isBlock(e,t),at:i,voids:o}),[,f]=d,p=Pr.isStart(e,i,f),h=Pr.isEnd(e,i,f),g=p&&h,[,v]=Qn.first({children:t},[]),[,m]=Qn.last({children:t},[]),y=t=>{var[n,r]=t;return!(0===r.length||!g&&(!p&&jn.isAncestor(r,v)&&Qn.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)||!h&&jn.isAncestor(r,m)&&Qn.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)))},b=!0,E=[],w=[],C=[];for(var D of Qn.nodes({children:t},{pass:y})){var[A,S]=D;b&&Qn.isElement(A)&&!e.isInline(A)&&!jn.isAncestor(S,v)&&(b=!1),y(D)&&(Qn.isElement(A)&&!e.isInline(A)?(b=!1,w.push(A)):b?E.push(A):C.push(A))}var[x]=Pr.nodes(e,{at:i,match:t=>Qn.isText(t)||Pr.isInline(e,t),mode:"highest",voids:o}),[,N]=x,B=Pr.isStart(e,i,N),O=Pr.isEnd(e,i,N),T=Pr.pathRef(e,h&&!C.length?jn.next(f):f),k=Pr.pathRef(e,O?jn.next(N):N),F=C.length>0;co.splitNodes(e,{at:i,match:t=>F?Qn.isElement(t)&&Pr.isBlock(e,t):Qn.isText(t)||Pr.isInline(e,t),mode:F?"lowest":"highest",always:F&&(!p||E.length>0)&&(!h||C.length>0),voids:o});var I,P=Pr.pathRef(e,!B||B&&O?jn.next(N):N);if(co.insertNodes(e,E,{at:P.current,match:t=>Qn.isText(t)||Pr.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),g&&!E.length&&w.length&&!C.length&&co.delete(e,{at:f,voids:o}),co.insertNodes(e,w,{at:T.current,match:t=>Qn.isElement(t)&&Pr.isBlock(e,t),mode:"lowest",voids:o,batchDirty:a}),co.insertNodes(e,C,{at:k.current,match:t=>Qn.isText(t)||Pr.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),!n.at&&(C.length>0&&k.current?I=jn.previous(k.current):w.length>0&&T.current?I=jn.previous(T.current):P.current&&(I=jn.previous(P.current)),I)){var _=Pr.end(e,I);co.select(e,_)}P.unref(),T.unref(),k.unref()}}})}(e,...n)},insertNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{co.insertNodes(e,t,n)})(e,...n)},insertText:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return xo(e,...n)},normalizeNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var[r,o]=t;if(!Qn.isText(r)){"children"in r||(r.children=[]);var i=r;if(i!==e&&0===i.children.length&&(co.insertNodes(e,{text:""},{at:o.concat(0),voids:!0}),i=Qn.get(e,o)),i!==e&&(e.isInline(i)||Qn.isText(i.children[0])||e.isInline(i.children[0])))for(var a=0;a<i.children.length;a++){var s=i.children[a],u=i.children[a-1];Qn.isText(s)?null!=u&&Qn.isText(u)&&(""===s.text?(co.removeNodes(e,{at:o.concat(a),voids:!0}),i=Qn.get(e,o),a--):""===u.text?(co.removeNodes(e,{at:o.concat(a-1),voids:!0}),i=Qn.get(e,o),a--):Wr.equals(s,u,{loose:!0})&&(co.mergeNodes(e,{at:o.concat(a),voids:!0}),i=Qn.get(e,o),a--)):e.isInline(s)?(null!=u&&Qn.isText(u)||(co.insertNodes(e,{text:""},{at:o.concat(a),voids:!0}),i=Qn.get(e,o),a++),a===i.children.length-1&&(co.insertNodes(e,{text:""},{at:o.concat(a+1),voids:!0}),i=Qn.get(e,o),a++)):(co.unwrapNodes(e,{at:o.concat(a),voids:!0}),i=Qn.get(e,o),a--)}else for(var l=0;l<i.children.length;l++){var c=i.children[l];(Qn.isText(c)||e.isInline(c))&&(null!=n&&n.fallbackElement?co.wrapNodes(e,n.fallbackElement(),{at:o.concat(l),voids:!0}):co.removeNodes(e,{at:o.concat(l),voids:!0}),i=Qn.get(e,o),l--)}}})(e,...n)},removeMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fo(e,...n)},getDirtyPaths:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":var{path:n}=t;return jn.levels(n);case"insert_node":var{node:r,path:o}=t,i=jn.levels(o),a=Qn.isText(r)?[]:Array.from(Qn.nodes(r),e=>{var[,t]=e;return o.concat(t)});return[...i,...a];case"merge_node":var{path:s}=t;return[...jn.ancestors(s),jn.previous(s)];case"move_node":var{path:u,newPath:l}=t;if(jn.equals(u,l))return[];var c=[],d=[];for(var f of jn.ancestors(u)){var p=jn.transform(f,t);c.push(p)}for(var h of jn.ancestors(l)){var g=jn.transform(h,t);d.push(g)}var v=d[d.length-1],m=l[l.length-1],y=v.concat(m);return[...c,...d,y];case"remove_node":var{path:b}=t;return[...jn.ancestors(b)];case"split_node":var{path:E}=t;return[...jn.levels(E),jn.next(E)];default:return[]}})(e,...n)},shouldNormalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,o=42*r;if(n>o)throw new Error("Could not completely normalize the editor after ".concat(o," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0})(e,...n)},above:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{voids:n=!1,mode:r="lowest",at:o=e.selection,match:i}=t;if(o){var a=Pr.path(e,o);if(!_r.isRange(o)||jn.equals(o.focus.path,o.anchor.path)){if(0===a.length)return;a=jn.parent(a)}var s="lowest"===r,[u]=Pr.levels(e,{at:a,voids:n,match:i,reverse:s});return u}}(e,...n)},after:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:Pr.point(e,t,{edge:"end"}),focus:Pr.end(e,[])},{distance:i=1}=r,a=0;for(var s of Pr.positions(e,yo(yo({},r),{},{at:o}))){if(a>i)break;0!==a&&(n=s),a++}return n}(e,...n)},before:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:Pr.start(e,[]),focus:Pr.point(e,t,{edge:"start"})},{distance:i=1}=r,a=0;for(var s of Pr.positions(e,Eo(Eo({},r),{},{at:o,reverse:!0}))){if(a>i)break;0!==a&&(n=s),a++}return n}(e,...n)},collapse:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{edge:n="anchor"}=t,{selection:r}=e;if(r)if("anchor"===n)co.select(e,r.anchor);else if("focus"===n)co.select(e,r.focus);else if("start"===n){var[o]=Gn.edges(r);co.select(e,o)}else if("end"===n){var[,i]=Gn.edges(r);co.select(e,i)}}(e,...n)},delete:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var n,r,{reverse:o=!1,unit:i="character",distance:a=1,voids:s=!1}=t,{at:u=e.selection,hanging:l=!1}=t;if(u){var c=!1;if(_r.isRange(u)&&Gn.isCollapsed(u)&&(c=!0,u=u.anchor),_r.isPoint(u)){var d=Pr.void(e,{at:u,mode:"highest"});if(!s&&d){var[,f]=d;u=f}else{var p={unit:i,distance:a};u={anchor:u,focus:o?Pr.before(e,u,p)||Pr.start(e,[]):Pr.after(e,u,p)||Pr.end(e,[])},l=!0}}if(_r.isPath(u))co.removeNodes(e,{at:u,voids:s});else if(!Gn.isCollapsed(u)){if(!l){var[,h]=Gn.edges(u),g=Pr.end(e,[]);Mr.equals(h,g)||(u=Pr.unhangRange(e,u,{voids:s}))}var[v,m]=Gn.edges(u),y=Pr.above(e,{match:t=>Qn.isElement(t)&&Pr.isBlock(e,t),at:v,voids:s}),b=Pr.above(e,{match:t=>Qn.isElement(t)&&Pr.isBlock(e,t),at:m,voids:s}),E=y&&b&&!jn.equals(y[1],b[1]),w=jn.equals(v.path,m.path),C=s?null:null!==(n=Pr.void(e,{at:v,mode:"highest"}))&&void 0!==n?n:Pr.elementReadOnly(e,{at:v,mode:"highest"}),D=s?null:null!==(r=Pr.void(e,{at:m,mode:"highest"}))&&void 0!==r?r:Pr.elementReadOnly(e,{at:m,mode:"highest"});if(C){var A=Pr.before(e,v);A&&y&&jn.isAncestor(y[1],A.path)&&(v=A)}if(D){var S=Pr.after(e,m);S&&b&&jn.isAncestor(b[1],S.path)&&(m=S)}var x,N=[];for(var B of Pr.nodes(e,{at:u,voids:s})){var[O,T]=B;x&&0===jn.compare(T,x)||(!s&&Qn.isElement(O)&&(Pr.isVoid(e,O)||Pr.isElementReadOnly(e,O))||!jn.isCommon(T,v.path)&&!jn.isCommon(T,m.path))&&(N.push(B),x=T)}var k=Array.from(N,t=>{var[,n]=t;return Pr.pathRef(e,n)}),F=Pr.pointRef(e,v),I=Pr.pointRef(e,m),P="";if(!w&&!C){var _=F.current,[R]=Pr.leaf(e,_),{path:L}=_,{offset:M}=v,j=R.text.slice(M);j.length>0&&(e.apply({type:"remove_text",path:L,offset:M,text:j}),P=j)}if(k.reverse().map(e=>e.unref()).filter(e=>null!==e).forEach(t=>co.removeNodes(e,{at:t,voids:s})),!D){var H=I.current,[z]=Pr.leaf(e,H),{path:$}=H,U=w?v.offset:0,V=z.text.slice(U,m.offset);V.length>0&&(e.apply({type:"remove_text",path:$,offset:U,text:V}),P=V)}!w&&E&&I.current&&F.current&&co.mergeNodes(e,{at:I.current,hanging:!0,voids:s}),c&&o&&"character"===i&&P.length>1&&P.match(/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/)&&co.insertText(e,P.slice(0,P.length-a));var W=F.unref(),G=I.unref(),q=o?W||G:G||W;null==t.at&&q&&co.select(e,q)}}})}(e,...n)},deselect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})})(e,...n)},edges:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>[Pr.start(e,t),Pr.end(e,t)])(e,...n)},elementReadOnly:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Pr.above(e,Co(Co({},t),{},{match:t=>Qn.isElement(t)&&Pr.isElementReadOnly(e,t)}))}(e,...n)},end:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Pr.point(e,t,{edge:"end"}))(e,...n)},first:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Pr.path(e,t,{edge:"start"});return Pr.node(e,n)})(e,...n)},fragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Pr.range(e,t);return Qn.fragment(e,n)})(e,...n)},getMarks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{marks:t,selection:n}=e;if(!n)return null;var{anchor:r,focus:o}=n;if(t)return t;if(Gn.isExpanded(n)){if(Gn.isBackward(n)&&([o,r]=[r,o]),Pr.isEnd(e,r,r.path)){var i=Pr.after(e,r);i&&(r=i)}var[a]=Pr.nodes(e,{match:Qn.isText,at:{anchor:r,focus:o}});if(a){var[s]=a,{text:u}=s;return Un(s,No)}return{}}var{path:l}=r,[c]=Pr.leaf(e,l);if(0===r.offset){var d=Pr.previous(e,{at:l,match:Qn.isText}),f=Pr.above(e,{match:t=>Qn.isElement(t)&&Pr.isVoid(e,t)&&e.markableVoid(t)});if(!f){var p=Pr.above(e,{match:t=>Qn.isElement(t)&&Pr.isBlock(e,t)});if(d&&p){var[h,g]=d,[,v]=p;jn.isAncestor(v,g)&&(c=h)}}}var{text:m}=c;return Un(c,Bo)}(e,...n)},hasBlocks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some(t=>Qn.isElement(t)&&Pr.isBlock(e,t)))(e,...n)},hasInlines:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some(t=>Qn.isText(t)||Pr.isInline(e,t)))(e,...n)},hasPath:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Qn.has(e,t))(e,...n)},hasTexts:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.every(e=>Qn.isText(e)))(e,...n)},insertNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ro(e,...n)},isBlock:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>!e.isInline(t))(e,...n)},isEdge:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>Pr.isStart(e,t,n)||Pr.isEnd(e,t,n))(e,...n)},isEmpty:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{children:n}=t,[r]=n;return 0===n.length||1===n.length&&Qn.isText(r)&&""===r.text&&!e.isVoid(t)})(e,...n)},isEnd:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var r=Pr.end(e,n);return Mr.equals(t,r)})(e,...n)},isNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=_n.get(e);return void 0===t||t})(e,...n)},isStart:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{if(0!==t.offset)return!1;var r=Pr.start(e,n);return Mr.equals(t,r)})(e,...n)},last:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Pr.path(e,t,{edge:"end"});return Pr.node(e,n)})(e,...n)},leaf:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Pr.path(e,t,n);return[Qn.leaf(e,r),r]}(e,...n)},levels:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:o=!1}=t,{match:i}=t;if(null==i&&(i=()=>!0),n){var a=[],s=Pr.path(e,n);for(var[u,l]of Qn.levels(e,s))if(i(u,l)&&(a.push([u,l]),!o&&Qn.isElement(u)&&Pr.isVoid(e,u)))break;r&&a.reverse(),yield*a}}()}(e,...n)},liftNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var{at:n=e.selection,mode:r="lowest",voids:o=!1}=t,{match:i}=t;if(n){null==i&&(i=_r.isPath(n)?sr(e,n):t=>Qn.isElement(t)&&Pr.isBlock(e,t));var a=Pr.nodes(e,{at:n,match:i,mode:r,voids:o}),s=Array.from(a,t=>{var[,n]=t;return Pr.pathRef(e,n)});for(var u of s){var l=u.unref();if(l.length<2)throw new Error("Cannot lift node at a path [".concat(l,"] because it has a depth of less than `2`."));var c=Pr.node(e,jn.parent(l)),[d,f]=c,p=l[l.length-1],{length:h}=d.children;if(1===h){var g=jn.next(f);co.moveNodes(e,{at:l,to:g,voids:o}),co.removeNodes(e,{at:f,voids:o})}else if(0===p)co.moveNodes(e,{at:l,to:f,voids:o});else if(p===h-1){var v=jn.next(f);co.moveNodes(e,{at:l,to:v,voids:o})}else{var m=jn.next(l),y=jn.next(f);co.splitNodes(e,{at:m,voids:o}),co.moveNodes(e,{at:l,to:y,voids:o})}}}})}(e,...n)},mergeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var{match:n,at:r=e.selection}=t,{hanging:o=!1,voids:i=!1,mode:a="lowest"}=t;if(r){var s=_r.isPath(r),u=s?r:null,l=null==n&&s;if(null==n)if(s){var[c]=Pr.parent(e,r);n=e=>c.children.includes(e)}else n=t=>Qn.isElement(t)&&Pr.isBlock(e,t);if(!o&&_r.isRange(r)&&(r=Pr.unhangRange(e,r,{voids:i})),_r.isRange(r))if(Gn.isCollapsed(r))r=r.anchor;else{var[,d]=Gn.edges(r),f=Pr.pointRef(e,d);co.delete(e,{at:r}),r=f.unref(),null==t.at&&co.select(e,r)}var[p]=Pr.nodes(e,{at:r,match:n,voids:i,mode:a}),h=l&&u&&jn.hasPrevious(u)?jn.previous(u):null,g=h?Pr.node(e,h):Pr.previous(e,{at:r,match:n,voids:i,mode:a});if(p&&g){var[v,m]=p,[y,b]=g;if(0!==m.length&&0!==b.length){var E,w,C=jn.next(b),D=jn.common(m,b),A=jn.isSibling(m,b),S=Array.from(Pr.levels(e,{at:m}),e=>{var[t]=e;return t}).slice(D.length).slice(0,-1),x=Pr.above(e,{at:m,mode:"highest",match:t=>S.includes(t)&&jo(e,t)}),N=x&&Pr.pathRef(e,x[1]);if(Qn.isText(v)&&Qn.isText(y)){var{text:B}=v,O=Un(v,Lo);w=y.text.length,E=O}else{if(!Qn.isElement(v)||!Qn.isElement(y))throw new Error("Cannot merge the node at path [".concat(m,"] with the previous sibling because it is not the same kind: ").concat(Hr.stringify(v)," ").concat(Hr.stringify(y)));var{children:T}=v;O=Un(v,Mo),w=y.children.length,E=O}A||co.moveNodes(e,{at:m,to:C,voids:i}),N&&co.removeNodes(e,{at:N.current,voids:i}),Pr.shouldMergeNodesRemovePrevNode(e,g,p)?co.removeNodes(e,{at:b,voids:i}):e.apply({type:"merge_node",path:C,position:w,properties:E}),N&&N.unref()}}}})}(e,...n)},move:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:o="character",reverse:i=!1}=t,{edge:a=null}=t;if(n){"start"===a&&(a=Gn.isBackward(n)?"focus":"anchor"),"end"===a&&(a=Gn.isBackward(n)?"anchor":"focus");var{anchor:s,focus:u}=n,l={distance:r,unit:o},c={};if(null==a||"anchor"===a){var d=i?Pr.before(e,s,l):Pr.after(e,s,l);d&&(c.anchor=d)}if(null==a||"focus"===a){var f=i?Pr.before(e,u,l):Pr.after(e,u,l);f&&(c.focus=f)}co.setSelection(e,c)}}(e,...n)},moveNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{Pr.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:o="lowest",voids:i=!1}=t,{match:a}=t;if(r){null==a&&(a=_r.isPath(r)?sr(e,r):t=>Qn.isElement(t)&&Pr.isBlock(e,t));var s=Pr.pathRef(e,n),u=Pr.nodes(e,{at:r,match:a,mode:o,voids:i}),l=Array.from(u,t=>{var[,n]=t;return Pr.pathRef(e,n)});for(var c of l){var d=c.unref(),f=s.current;0!==d.length&&e.apply({type:"move_node",path:d,newPath:f}),s.current&&jn.isSibling(f,d)&&jn.isAfter(f,d)&&(s.current=jn.next(s.current))}s.unref()}})})(e,...n)},next:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=Pr.after(e,i,{voids:r});if(a){var[,s]=Pr.last(e,[]),u=[a.path,s];if(_r.isPath(i)&&0===i.length)throw new Error("Cannot get the next node from the root node!");if(null==o)if(_r.isPath(i)){var[l]=Pr.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=Pr.nodes(e,{at:u,match:o,mode:n,voids:r});return c}}}(e,...n)},node:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Pr.path(e,t,n),o=Qn.get(e,r);return[o,r]}(e,...n)},nodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:o=!1,reverse:i=!1,voids:a=!1,pass:s}=t,{match:u}=t;if(u||(u=()=>!0),n){var l,c;if(_r.isSpan(n))l=n[0],c=n[1];else{var d=Pr.path(e,n,{edge:"start"}),f=Pr.path(e,n,{edge:"end"});l=i?f:d,c=i?d:f}var p,h=Qn.nodes(e,{reverse:i,from:l,to:c,pass:t=>{var[n,r]=t;return!(!s||!s([n,r]))||!!Qn.isElement(n)&&!(a||!Pr.isVoid(e,n)&&!Pr.isElementReadOnly(e,n))}}),g=[];for(var[v,m]of h){var y=p&&0===jn.compare(m,p[1]);if("highest"!==r||!y)if(u(v,m))if("lowest"===r&&y)p=[v,m];else{var b="lowest"===r?p:[v,m];b&&(o?g.push(b):yield b),p=[v,m]}else if(o&&!y&&Qn.isText(v))return}"lowest"===r&&p&&(o?g.push(p):yield p),o&&(yield*g)}}()}(e,...n)},normalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Oo(e,...n)},parent:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Pr.path(e,t,n),o=jn.parent(r);return Pr.node(e,o)}(e,...n)},path:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{depth:r,edge:o}=n;if(_r.isPath(t))if("start"===o){var[,i]=Qn.first(e,t);t=i}else if("end"===o){var[,a]=Qn.last(e,t);t=a}return _r.isRange(t)&&(t="start"===o?Gn.start(t):"end"===o?Gn.end(t):jn.common(t.anchor.path,t.focus.path)),_r.isPoint(t)&&(t=t.path),null!=r&&(t=t.slice(0,r)),t}(e,...n)},pathRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Pr.pathRefs(e).delete(o),o.current=null,t}};return Pr.pathRefs(e).add(o),o}(e,...n)},pathRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Rn.get(e);return t||(t=new Set,Rn.set(e,t)),t})(e,...n)},point:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{edge:r="start"}=n;if(_r.isPath(t)){var o;if("end"===r){var[,i]=Qn.last(e,t);o=i}else{var[,a]=Qn.first(e,t);o=a}var s=Qn.get(e,o);if(!Qn.isText(s))throw new Error("Cannot get the ".concat(r," point in the node at path [").concat(t,"] because it has no ").concat(r," text node."));return{path:o,offset:"end"===r?s.text.length:0}}if(_r.isRange(t)){var[u,l]=Gn.edges(t);return"start"===r?u:l}return t}(e,...n)},pointRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Pr.pointRefs(e).delete(o),o.current=null,t}};return Pr.pointRefs(e).add(o),o}(e,...n)},pointRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Ln.get(e);return t||(t=new Set,Ln.set(e,t)),t})(e,...n)},positions:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return To(e,...n)},previous:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=Pr.before(e,i,{voids:r});if(a){var[,s]=Pr.first(e,[]),u=[a.path,s];if(_r.isPath(i)&&0===i.length)throw new Error("Cannot get the previous node from the root node!");if(null==o)if(_r.isPath(i)){var[l]=Pr.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=Pr.nodes(e,{reverse:!0,at:u,match:o,mode:n,voids:r});return c}}}(e,...n)},range:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>_r.isRange(t)&&!n?t:{anchor:Pr.start(e,t),focus:Pr.end(e,n||t)})(e,...n)},rangeRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return Pr.rangeRefs(e).delete(o),o.current=null,t}};return Pr.rangeRefs(e).add(o),o}(e,...n)},rangeRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Mn.get(e);return t||(t=new Set,Mn.set(e,t)),t})(e,...n)},removeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:r=!1,mode:o="lowest"}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=_r.isPath(i)?sr(e,i):t=>Qn.isElement(t)&&Pr.isBlock(e,t)),!n&&_r.isRange(i)&&(i=Pr.unhangRange(e,i,{voids:r}));var s=Pr.nodes(e,{at:i,match:a,mode:o,voids:r}),u=Array.from(s,t=>{var[,n]=t;return Pr.pathRef(e,n)});for(var l of u){var c=l.unref();if(c){var[d]=Pr.node(e,c);e.apply({type:"remove_node",path:c,node:d})}}}})}(e,...n)},select:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;if(t=Pr.range(e,t),n)co.setSelection(e,t);else{if(!_r.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Hr.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})}})(e,...n)},setNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pr.withoutNormalizing(e,()=>{var{match:r,at:o=e.selection,compare:i,merge:a}=n,{hanging:s=!1,mode:u="lowest",split:l=!1,voids:c=!1}=n;if(o){if(null==r&&(r=_r.isPath(o)?sr(e,o):t=>Qn.isElement(t)&&Pr.isBlock(e,t)),!s&&_r.isRange(o)&&(o=Pr.unhangRange(e,o,{voids:c})),l&&_r.isRange(o)){if(Gn.isCollapsed(o)&&Pr.leaf(e,o.anchor)[0].text.length>0)return;var d=Pr.rangeRef(e,o,{affinity:"inward"}),[f,p]=Gn.edges(o),h="lowest"===u?"lowest":"highest",g=Pr.isEnd(e,p,p.path);co.splitNodes(e,{at:p,match:r,mode:h,voids:c,always:!g});var v=Pr.isStart(e,f,f.path);co.splitNodes(e,{at:f,match:r,mode:h,voids:c,always:!v}),o=d.unref(),null==n.at&&co.select(e,o)}for(var[m,y]of(i||(i=(e,t)=>e!==t),Pr.nodes(e,{at:o,match:r,mode:u,voids:c}))){var b={},E={};if(0!==y.length){var w=!1;for(var C in t)if(!no.includes(C)){var D=Object.hasOwn(m,C)?m[C]:void 0,A=t[C];i(A,D)&&(w=!0,Object.hasOwn(m,C)&&(b[C]=D),a?null!=A&&(E[C]=a(D,A)):null!=A&&(E[C]=A))}w&&e.apply({type:"set_node",path:y,properties:b,newProperties:E})}}}})}(e,...n)},setNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{_n.set(e,t)})(e,...n)},setPoint:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r}=e,{edge:o="both"}=n;if(r){"start"===o&&(o=Gn.isBackward(r)?"focus":"anchor"),"end"===o&&(o=Gn.isBackward(r)?"anchor":"focus");var{anchor:i,focus:a}=r,s="anchor"===o?i:a;co.setSelection(e,{["anchor"===o?"anchor":"focus"]:Po(Po({},s),t)})}}(e,...n)},setSelection:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e,r={},o={};if(n){for(var i in t)ro.includes(i)||_o(i,Object.hasOwn(n,i)?n[i]:void 0,t[i])&&(r[i]=n[i],o[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}})(e,...n)},splitNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ho(e,...n)},start:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Pr.point(e,t,{edge:"start"}))(e,...n)},string:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,o=Pr.range(e,t),[i,a]=Gn.edges(o),s="";for(var[u,l]of Pr.nodes(e,{at:o,match:Qn.isText,voids:r})){var c=u.text;jn.equals(l,a.path)&&(c=c.slice(0,a.offset)),jn.equals(l,i.path)&&(c=c.slice(i.offset)),s+=c}return s}(e,...n)},unhangRange:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,[o,i]=Gn.edges(t);if(0!==o.offset||0!==i.offset||Gn.isCollapsed(t)||jn.hasPrevious(i.path))return t;var a=Pr.above(e,{at:i,match:t=>Qn.isElement(t)&&Pr.isBlock(e,t),voids:r}),s=a?a[1]:[],u={anchor:Pr.start(e,o),focus:i},l=!0;for(var[c,d]of Pr.nodes(e,{at:u,match:Qn.isText,reverse:!0,voids:r}))if(l)l=!1;else if(""!==c.text||jn.isBefore(d,s)){i={path:d,offset:c.text.length};break}return{anchor:o,focus:i}}(e,...n)},unsetNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var o of t)r[o]=null;co.setNodes(e,r,n)}(e,...n)},unwrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Pr.withoutNormalizing(e,()=>{var{mode:n="lowest",split:r=!1,voids:o=!1}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=_r.isPath(i)?sr(e,i):t=>Qn.isElement(t)&&Pr.isBlock(e,t)),_r.isPath(i)&&(i=Pr.range(e,i));var s=_r.isRange(i)?Pr.rangeRef(e,i):null,u=Pr.nodes(e,{at:i,match:a,mode:n,voids:o}),l=Array.from(u,t=>{var[,n]=t;return Pr.pathRef(e,n)}).reverse(),c=function(){var t=d.unref(),[n]=Pr.node(e,t),i=Pr.range(e,t);r&&s&&(i=Gn.intersection(s.current,i)),co.liftNodes(e,{at:i,match:e=>!Qn.isText(n)&&n.children.includes(e),voids:o})};for(var d of l)c();s&&s.unref()}})}(e,...n)},void:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Pr.above(e,Ao(Ao({},t),{},{match:t=>Qn.isElement(t)&&Pr.isVoid(e,t)}))}(e,...n)},withoutNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=Pr.isNormalizing(e);Pr.setNormalizing(e,!1);try{t()}finally{Pr.setNormalizing(e,n)}Pr.normalize(e)})(e,...n)},wrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pr.withoutNormalizing(e,()=>{var{mode:r="lowest",split:o=!1,voids:i=!1}=n,{match:a,at:s=e.selection}=n;if(s){if(null==a&&(a=_r.isPath(s)?sr(e,s):e.isInline(t)?t=>Qn.isElement(t)&&Pr.isInline(e,t)||Qn.isText(t):t=>Qn.isElement(t)&&Pr.isBlock(e,t)),o&&_r.isRange(s)){var[u,l]=Gn.edges(s),c=Pr.rangeRef(e,s,{affinity:"inward"}),d=t=>{var n=Pr.above(e,{at:t,match:t=>Qn.isElement(t)&&Pr.isBlock(e,t)});return n&&Pr.isEdge(e,t,n[1])};co.splitNodes(e,{at:l,match:a,voids:i,always:!d(l)}),co.splitNodes(e,{at:u,match:a,voids:i,always:!d(u)}),s=c.unref(),null==n.at&&co.select(e,s)}var f=Array.from(Pr.nodes(e,{at:s,match:e.isInline(t)?t=>Qn.isElement(t)&&Pr.isBlock(e,t):e=>Qn.isEditor(e),mode:"lowest",voids:i})),p=function(){var n=_r.isRange(s)?Gn.intersection(s,Pr.range(e,h)):s;if(!n)return 0;var o=Array.from(Pr.nodes(e,{at:n,match:a,mode:r,voids:i}));if(o.length>0){var[u]=o,l=o[o.length-1],[,c]=u,[,d]=l;if(0===c.length&&0===d.length)return 0;var f=jn.equals(c,d)?jn.parent(c):jn.common(c,d),p=Pr.range(e,c,d),g=Pr.node(e,f),[v]=g,m=f.length+1,y=jn.next(d.slice(0,m)),b=$o($o({},t),{},{children:[]});co.insertNodes(e,b,{at:y,voids:i}),co.moveNodes(e,{at:p,match:e=>!Qn.isText(v)&&v.children.includes(e),to:y.concat(0),voids:i})}};for(var[,h]of f)p()}})}(e,...n)},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var[r,o]=t,[i,a]=n;return Qn.isElement(r)&&Pr.isEmpty(e,r)||Qn.isText(r)&&""===r.text&&0!==o[o.length-1]})(e,...n)}};return e},Wo={exports:{}};var Go=(Uo||(Uo=1,function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Boolean]",a="[object Date]",s="[object Function]",u="[object GeneratorFunction]",l="[object Map]",c="[object Number]",d="[object Object]",f="[object Promise]",p="[object RegExp]",g="[object Set]",v="[object String]",m="[object Symbol]",y="[object WeakMap]",b="[object ArrayBuffer]",E="[object DataView]",w="[object Float32Array]",C="[object Float64Array]",D="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",x="[object Uint8Array]",N="[object Uint8ClampedArray]",B="[object Uint16Array]",O="[object Uint32Array]",T=/\w*$/,k=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,I={};I[o]=I["[object Array]"]=I[b]=I[E]=I[i]=I[a]=I[w]=I[C]=I[D]=I[A]=I[S]=I[l]=I[c]=I[d]=I[p]=I[g]=I[v]=I[m]=I[x]=I[N]=I[B]=I[O]=!0,I["[object Error]"]=I[s]=I[y]=!1;var P="object"==typeof h&&h&&h.Object===Object&&h,_="object"==typeof self&&self&&self.Object===Object&&self,R=P||_||Function("return this")(),L=t&&!t.nodeType&&t,M=L&&e&&!e.nodeType&&e,j=M&&M.exports===L;function H(e,t){return e.set(t[0],t[1]),e}function z(e,t){return e.add(t),e}function $(e,t,n,r){for(var o=-1,i=e?e.length:0;++o<i;)n=t(n,e[o],o,e);return n}function U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function W(e,t){return function(n){return e(t(n))}}function G(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var q,K=Array.prototype,Y=Function.prototype,X=Object.prototype,Z=R["__core-js_shared__"],J=(q=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"",Q=Y.toString,ee=X.hasOwnProperty,te=X.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=j?R.Buffer:void 0,oe=R.Symbol,ie=R.Uint8Array,ae=W(Object.getPrototypeOf,Object),se=Object.create,ue=X.propertyIsEnumerable,le=K.splice,ce=Object.getOwnPropertySymbols,de=re?re.isBuffer:void 0,fe=W(Object.keys,Object),pe=Me(R,"DataView"),he=Me(R,"Map"),ge=Me(R,"Promise"),ve=Me(R,"Set"),me=Me(R,"WeakMap"),ye=Me(Object,"create"),be=Ue(pe),Ee=Ue(he),we=Ue(ge),Ce=Ue(ve),De=Ue(me),Ae=oe?oe.prototype:void 0,Se=Ae?Ae.valueOf:void 0;function xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ne(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Be(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){this.__data__=new Ne(e)}function Te(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ge(e)}(e)&&ee.call(e,"callee")&&(!ue.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!ee.call(e,a)||i&&("length"==a||ze(a,r))||n.push(a);return n}function ke(e,t,n){var r=e[t];ee.call(e,t)&&Ve(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Fe(e,t){for(var n=e.length;n--;)if(Ve(e[n][0],t))return n;return-1}function Ie(e,t,n,r,f,h,y){var k;if(r&&(k=h?r(e,f,h,y):r(e)),void 0!==k)return k;if(!Ye(e))return e;var F=We(e);if(F){if(k=function(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!t)return function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,k)}else{var P=He(e),_=P==s||P==u;if(qe(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(P==d||P==o||_&&!h){if(U(e))return h?e:{};if(k=function(e){return"function"!=typeof e.constructor||$e(e)?{}:Ye(t=ae(e))?se(t):{};var t}(_?{}:e),!t)return function(e,t){return Re(e,je(e),t)}(e,function(e,t){return e&&Re(t,Xe(t),e)}(k,e))}else{if(!I[P])return h?e:{};k=function(e,t,n,r){var o,s=e.constructor;switch(t){case b:return _e(e);case i:case a:return new s(+e);case E:return function(e,t){var n=t?_e(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case w:case C:case D:case A:case S:case x:case N:case B:case O:return function(e,t){var n=t?_e(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case l:return function(e,t,n){var r=t?n(V(e),!0):V(e);return $(r,H,new e.constructor)}(e,r,n);case c:case v:return new s(e);case p:return function(e){var t=new e.constructor(e.source,T.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return function(e,t,n){var r=t?n(G(e),!0):G(e);return $(r,z,new e.constructor)}(e,r,n);case m:return o=e,Se?Object(Se.call(o)):{}}}(e,P,Ie,t)}}y||(y=new Oe);var R=y.get(e);if(R)return R;if(y.set(e,k),!F)var L=n?function(e){return function(e,t,n){var r=t(e);return We(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Xe,je)}(e):Xe(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(L||e,function(o,i){L&&(o=e[i=o]),ke(k,i,Ie(o,t,n,r,i,e,y))}),k}function Pe(e){return!(!Ye(e)||(t=e,J&&J in t))&&(Ke(e)||U(e)?ne:k).test(Ue(e));var t}function _e(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Re(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o];ke(n,a,e[a])}return n}function Le(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Me(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Pe(n)?n:void 0}xe.prototype.clear=function(){this.__data__=ye?ye(null):{}},xe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},xe.prototype.get=function(e){var t=this.__data__;if(ye){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},xe.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:ee.call(t,e)},xe.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?n:t,this},Ne.prototype.clear=function(){this.__data__=[]},Ne.prototype.delete=function(e){var t=this.__data__,n=Fe(t,e);return!(n<0||(n==t.length-1?t.pop():le.call(t,n,1),0))},Ne.prototype.get=function(e){var t=this.__data__,n=Fe(t,e);return n<0?void 0:t[n][1]},Ne.prototype.has=function(e){return Fe(this.__data__,e)>-1},Ne.prototype.set=function(e,t){var n=this.__data__,r=Fe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Be.prototype.clear=function(){this.__data__={hash:new xe,map:new(he||Ne),string:new xe}},Be.prototype.delete=function(e){return Le(this,e).delete(e)},Be.prototype.get=function(e){return Le(this,e).get(e)},Be.prototype.has=function(e){return Le(this,e).has(e)},Be.prototype.set=function(e,t){return Le(this,e).set(e,t),this},Oe.prototype.clear=function(){this.__data__=new Ne},Oe.prototype.delete=function(e){return this.__data__.delete(e)},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ne){var r=n.__data__;if(!he||r.length<199)return r.push([e,t]),this;n=this.__data__=new Be(r)}return n.set(e,t),this};var je=ce?W(ce,Object):function(){return[]},He=function(e){return te.call(e)};function ze(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||F.test(e))&&e>-1&&e%1==0&&e<t}function $e(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||X)}function Ue(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ve(e,t){return e===t||e!=e&&t!=t}(pe&&He(new pe(new ArrayBuffer(1)))!=E||he&&He(new he)!=l||ge&&He(ge.resolve())!=f||ve&&He(new ve)!=g||me&&He(new me)!=y)&&(He=function(e){var t=te.call(e),n=t==d?e.constructor:void 0,r=n?Ue(n):void 0;if(r)switch(r){case be:return E;case Ee:return l;case we:return f;case Ce:return g;case De:return y}return t});var We=Array.isArray;function Ge(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Ke(e)}var qe=de||function(){return!1};function Ke(e){var t=Ye(e)?te.call(e):"";return t==s||t==u}function Ye(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Xe(e){return Ge(e)?Te(e):function(e){if(!$e(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Ie(e,!0,!0)}}(Wo,Wo.exports)),Wo.exports),qo=g(Go),Ko=new Set(["base","embed","math","meta","object","script","svg"]),Yo=new Set(["href","poster","src","xlink:href"]),Xo=["java","script:"].join("");function Zo(e,t,n){var r=function(e){return Array.from(e).filter(function(e){return e>" "}).join("").toLowerCase()}(n);return!r||!r.startsWith(Xo)&&!r.startsWith("vbscript:")&&(!r.startsWith("data:")||"href"!==t&&"xlink:href"!==t&&(("img"===e||"poster"===t)&&r.startsWith("data:image/")))}function Jo(e){if(void 0===e&&(e=""),!e)return"";var t=document.createElement("div");t.innerHTML=e;var n=function(e){Array.from(e.childNodes).forEach(function(e){if(e instanceof Element){var t=e,r=t.tagName.toLowerCase();if("template"===r){var o=t,i=Jo(o.innerHTML);return i?(o.insertAdjacentHTML("beforebegin",i),void o.remove()):void o.remove()}Ko.has(r)?t.remove():(Array.from(t.attributes).forEach(function(e){var n=e.name.toLowerCase(),o=e.value||"";("srcdoc"===n||n.startsWith("on")||Yo.has(n)&&!Zo(r,n,o))&&t.removeAttribute(e.name)}),n(t))}})};return n(t),t.innerHTML}var Qo={};var ei="created",ti="destroyed",ni="change",ri="scroll",oi="fullscreen",ii="unFullScreen",ai="modalOrPanelShow",si="modalOrPanelHide",ui={};function li(e,t){var n=e.key,r=e.factory,o=e.config,i=s(s({},o),t||{});if(null!=ui[n])throw new Error("Duplicated key '".concat(n,"' in menu items"));ui[n]=r,function(e,t){null!=t&&(Qo[e]=t)}(n,i)}var ci=new WeakMap,di=new WeakMap,fi=new WeakMap,pi=new WeakMap,hi=new WeakMap,gi=new WeakMap,vi=new WeakMap,mi=new WeakMap,yi=new WeakMap,bi=new WeakMap,Ei=new WeakMap,wi=new WeakMap,Ci=new WeakMap,Di=new WeakMap,Ai=new WeakMap,Si=new WeakMap,xi=new WeakMap,Ni=new WeakMap,Bi=new WeakMap,Oi=new WeakMap,Ti=new WeakMap,ki=new WeakMap,Fi=new WeakMap,Ii=new WeakMap,Pi=new WeakMap,_i=new WeakMap,Ri=new WeakMap,Li=new WeakMap,Mi=new WeakMap,ji=function(e){var t=e;return t.getAllMenuKeys=function(){var e=[];for(var t in ui)e.push(t);return e},t.getConfig=function(){var e=bi.get(t);if(null==e)throw new Error("Can not get editor config");return e},t.getMenuConfig=function(e){var n=t.getConfig().MENU_CONF;return(void 0===n?{}:n)[e]||{}},t.alert=function(e,n){void 0===n&&(n="info");var r=t.getConfig().customAlert;r&&r(e,n)},t},Hi=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function zi(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function $i(e={},t={}){Object.keys(t).forEach(n=>{void 0===e[n]?e[n]=t[n]:zi(t[n])&&zi(e[n])&&Object.keys(t[n]).length>0&&$i(e[n],t[n])})}const Ui={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Vi(){const e="undefined"!=typeof document?document:{};return $i(e,Ui),e}const Wi={document:Ui,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function Gi(){const e="undefined"!=typeof window?window:{};return $i(e,Wi),e}class qi extends Array{constructor(e){"number"==typeof e?super(e):(super(...e||[]),function(e){const t=e.__proto__;Object.defineProperty(e,"__proto__",{get:()=>t,set(e){t.__proto__=e}})}(this))}}function Ki(e=[]){const t=[];return e.forEach(e=>{Array.isArray(e)?t.push(...Ki(e)):t.push(e)}),t}function Yi(e,t){return Array.prototype.filter.call(e,t)}function Xi(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Zi(e,t){const n=Gi(),r=Vi();let o=[];if(!t&&e instanceof qi)return e;if(!e)return new qi(o);if("string"==typeof e){const n=e.trim();if(n.indexOf("<")>=0&&n.indexOf(">")>=0){let e="div";0===n.indexOf("<li")&&(e="ul"),0===n.indexOf("<tr")&&(e="tbody"),0!==n.indexOf("<td")&&0!==n.indexOf("<th")||(e="tr"),0===n.indexOf("<tbody")&&(e="table"),0===n.indexOf("<option")&&(e="select");const t=r.createElement(e);t.innerHTML=n;for(let e=0;e<t.childNodes.length;e+=1)o.push(t.childNodes[e])}else o=function(e,t){if("string"!=typeof e)return[e];const n=[],r=t.querySelectorAll(e);for(let e=0;e<r.length;e+=1)n.push(r[e]);return n}(e.trim(),t||r)}else if(e.nodeType||e===n||e===r)o.push(e);else if(Array.isArray(e)){if(e instanceof qi)return e;o=e}return new qi(function(e){const t=[];for(let n=0;n<e.length;n+=1)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(o))}function Ji(...e){const t=Ki(e.map(e=>e.split(" ")));return this.forEach(e=>{e.classList.add(...t)}),this}function Qi(...e){const t=Ki(e.map(e=>e.split(" ")));return this.forEach(e=>{e.classList.remove(...t)}),this}function ea(...e){const t=Ki(e.map(e=>e.split(" ")));return Yi(this,e=>t.filter(t=>e.classList.contains(t)).length>0).length>0}function ta(e,t){if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(let n=0;n<this.length;n+=1)if(2===arguments.length)this[n].setAttribute(e,t);else for(const t in e)this[n][t]=e[t],this[n].setAttribute(t,e[t]);return this}function na(e){for(let t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this}function ra(e,t){let n;if(void 0===t){if(n=this[0],!n)return;if(n.dom7ElementDataStorage&&e in n.dom7ElementDataStorage)return n.dom7ElementDataStorage[e];const t=n.getAttribute(`data-${e}`);return t||void 0}for(let r=0;r<this.length;r+=1)n=this[r],n.dom7ElementDataStorage||(n.dom7ElementDataStorage={}),n.dom7ElementDataStorage[e]=t;return this}function oa(){const e=this[0];if(!e)return;const t={};if(e.dataset)for(const n in e.dataset)t[n]=e.dataset[n];else for(let n=0;n<e.attributes.length;n+=1){const r=e.attributes[n];r.name.indexOf("data-")>=0&&(t[Xi(r.name.split("data-")[1])]=r.value)}for(const e in t)"false"===t[e]?t[e]=!1:"true"===t[e]?t[e]=!0:parseFloat(t[e])===1*t[e]&&(t[e]*=1);return t}function ia(e){if(void 0===e){const e=this[0];if(!e)return;if(e.multiple&&"select"===e.nodeName.toLowerCase()){const t=[];for(let n=0;n<e.selectedOptions.length;n+=1)t.push(e.selectedOptions[n].value);return t}return e.value}for(let t=0;t<this.length;t+=1){const n=this[t];if(Array.isArray(e)&&n.multiple&&"select"===n.nodeName.toLowerCase())for(let t=0;t<n.options.length;t+=1)n.options[t].selected=e.indexOf(n.options[t].value)>=0;else n.value=e}return this}function aa(...e){let[t,n,r,o]=e;function i(e){const t=e.target;if(!t)return;const o=e.target.dom7EventData||[];if(o.indexOf(e)<0&&o.unshift(e),Zi(t).is(n))r.apply(t,o);else{const e=Zi(t).parents();for(let t=0;t<e.length;t+=1)Zi(e[t]).is(n)&&r.apply(e[t],o)}}function a(e){const t=e&&e.target&&e.target.dom7EventData||[];t.indexOf(e)<0&&t.unshift(e),r.apply(this,t)}"function"==typeof e[1]&&([t,r,o]=e,n=void 0),o||(o=!1);const s=t.split(" ");let u;for(let e=0;e<this.length;e+=1){const t=this[e];if(n)for(u=0;u<s.length;u+=1){const e=s[u];t.dom7LiveListeners||(t.dom7LiveListeners={}),t.dom7LiveListeners[e]||(t.dom7LiveListeners[e]=[]),t.dom7LiveListeners[e].push({listener:r,proxyListener:i}),t.addEventListener(e,i,o)}else for(u=0;u<s.length;u+=1){const e=s[u];t.dom7Listeners||(t.dom7Listeners={}),t.dom7Listeners[e]||(t.dom7Listeners[e]=[]),t.dom7Listeners[e].push({listener:r,proxyListener:a}),t.addEventListener(e,a,o)}}return this}function sa(...e){let[t,n,r,o]=e;"function"==typeof e[1]&&([t,r,o]=e,n=void 0),o||(o=!1);const i=t.split(" ");for(let e=0;e<i.length;e+=1){const t=i[e];for(let e=0;e<this.length;e+=1){const i=this[e];let a;if(!n&&i.dom7Listeners?a=i.dom7Listeners[t]:n&&i.dom7LiveListeners&&(a=i.dom7LiveListeners[t]),a&&a.length)for(let e=a.length-1;e>=0;e-=1){const n=a[e];r&&n.listener===r||r&&n.listener&&n.listener.dom7proxy&&n.listener.dom7proxy===r?(i.removeEventListener(t,n.proxyListener,o),a.splice(e,1)):r||(i.removeEventListener(t,n.proxyListener,o),a.splice(e,1))}}}return this}function ua(){const e=Gi();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}function la(){const e=Gi();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null}function ca(){if(this.length>0){const e=Gi(),t=Vi(),n=this[0],r=n.getBoundingClientRect(),o=t.body,i=n.clientTop||o.clientTop||0,a=n.clientLeft||o.clientLeft||0,s=n===e?e.scrollY:n.scrollTop,u=n===e?e.scrollX:n.scrollLeft;return{top:r.top+s-i,left:r.left+u-a}}return null}function da(){for(let e=0;e<this.length;e+=1)this[e].style.display="none";return this}function fa(){const e=Gi();for(let t=0;t<this.length;t+=1){const n=this[t];"none"===n.style.display&&(n.style.display=""),"none"===e.getComputedStyle(n,null).getPropertyValue("display")&&(n.style.display="block")}return this}function pa(e,t){const n=Gi();let r;if(1===arguments.length){if("string"!=typeof e){for(r=0;r<this.length;r+=1)for(const t in e)this[r].style[t]=e[t];return this}if(this[0])return n.getComputedStyle(this[0],null).getPropertyValue(e)}if(2===arguments.length&&"string"==typeof e){for(r=0;r<this.length;r+=1)this[r].style[e]=t;return this}return this}function ha(e){return e?(this.forEach((t,n)=>{e.apply(t,[t,n])}),this):this}function ga(e){return Zi(Yi(this,e))}function va(e){if(void 0===e)return this[0]?this[0].innerHTML:null;for(let t=0;t<this.length;t+=1)this[t].innerHTML=e;return this}function ma(e){if(void 0===e)return this[0]?this[0].textContent.trim():null;for(let t=0;t<this.length;t+=1)this[t].textContent=e;return this}function ya(e){const t=Gi(),n=Vi(),r=this[0];let o,i;if(!r||void 0===e)return!1;if("string"==typeof e){if(r.matches)return r.matches(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);for(o=Zi(e),i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}if(e===n)return r===n;if(e===t)return r===t;if(e.nodeType||e instanceof qi){for(o=e.nodeType?[e]:e,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function ba(...e){let t;const n=Vi();for(let r=0;r<e.length;r+=1){t=e[r];for(let e=0;e<this.length;e+=1)if("string"==typeof t){const r=n.createElement("div");for(r.innerHTML=t;r.firstChild;)this[e].appendChild(r.firstChild)}else if(t instanceof qi)for(let n=0;n<t.length;n+=1)this[e].appendChild(t[n]);else this[e].appendChild(t)}return this}function Ea(e){const t=Vi();let n,r;for(n=0;n<this.length;n+=1)if("string"==typeof e){const o=t.createElement("div");for(o.innerHTML=e,r=o.childNodes.length-1;r>=0;r-=1)this[n].insertBefore(o.childNodes[r],this[n].childNodes[0])}else if(e instanceof qi)for(r=0;r<e.length;r+=1)this[n].insertBefore(e[r],this[n].childNodes[0]);else this[n].insertBefore(e,this[n].childNodes[0]);return this}function wa(e){const t=[];for(let n=0;n<this.length;n+=1)null!==this[n].parentNode&&(e?Zi(this[n].parentNode).is(e)&&t.push(this[n].parentNode):t.push(this[n].parentNode));return Zi(t)}function Ca(e){const t=[];for(let n=0;n<this.length;n+=1){let r=this[n].parentNode;for(;r;)e?Zi(r).is(e)&&t.push(r):t.push(r),r=r.parentNode}return Zi(t)}function Da(e){const t=[];for(let n=0;n<this.length;n+=1){const r=this[n].querySelectorAll(e);for(let e=0;e<r.length;e+=1)t.push(r[e])}return Zi(t)}function Aa(e){const t=[];for(let n=0;n<this.length;n+=1){const r=this[n].children;for(let n=0;n<r.length;n+=1)e&&!Zi(r[n]).is(e)||t.push(r[n])}return Zi(t)}function Sa(){for(let e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this}function xa(){for(let e=0;e<this.length;e+=1){const t=this[e];if(1===t.nodeType){for(let e=0;e<t.childNodes.length;e+=1)t.childNodes[e].parentNode&&t.childNodes[e].parentNode.removeChild(t.childNodes[e]);t.textContent=""}}return this}Zi.fn=qi.prototype;const Na="resize scroll".split(" ");function Ba(e){return function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)Na.indexOf(e)<0&&(e in this[t]?this[t][e]():Zi(this[t]).trigger(e));return this}return this.on(e,...t)}}const Oa=Ba("click"),Ta=Ba("focus"),ka=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Fa,Ia=globalThis.Node;pa&&(Zi.fn.css=pa),ba&&(Zi.fn.append=ba),Ji&&(Zi.fn.addClass=Ji),Qi&&(Zi.fn.removeClass=Qi),ea&&(Zi.fn.hasClass=ea),aa&&(Zi.fn.on=aa),Ta&&(Zi.fn.focus=Ta),ta&&(Zi.fn.attr=ta),na&&(Zi.fn.removeAttr=na),da&&(Zi.fn.hide=da),fa&&(Zi.fn.show=fa),ca&&(Zi.fn.offset=ca),ua&&(Zi.fn.width=ua),la&&(Zi.fn.height=la),wa&&(Zi.fn.parent=wa),Ca&&(Zi.fn.parents=Ca),ya&&(Zi.fn.is=ya),oa&&(Zi.fn.dataset=oa),ia&&(Zi.fn.val=ia),ma&&(Zi.fn.text=ma),va&&(Zi.fn.html=va),Aa&&(Zi.fn.children=Aa),Sa&&(Zi.fn.remove=Sa),Da&&(Zi.fn.find=Da),ha&&(Zi.fn.each=ha),xa&&(Zi.fn.empty=xa),function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(Fa||(Fa={}));var Pa=/\[object HTML([A-Z][a-z]*)*Element\]/,_a=function(e){return Pa.test(An(e))},Ra=function(e){return null!=e&&"number"==typeof e.nodeType},La=function(e){return Ra(e)&&e.nodeType===Fa.COMMENT_NODE},Ma=function(e){return Ra(e)&&e.nodeType===Fa.ELEMENT_NODE},ja=function(e){return"[object Selection]"===An(e)},Ha=function(e){return Ra(e)&&e.nodeType===Fa.TEXT_NODE},za=function(e,t,n){for(var r=e.childNodes,o=r[t],i=t,a=!1,s=!1;(La(o)||Ma(o)&&0===o.childNodes.length||Ma(o)&&"false"===o.getAttribute("contenteditable"))&&(!a||!s);)i>=r.length?(a=!0,i=t-1,n="backward"):i<0?(s=!0,i=t+1,n="forward"):(o=r[i],t=i,i+="forward"===n?1:-1);return[o,t]},$a=function(e,t,n){return d(za(e,t,n),1)[0]},Ua=function(e){var t,n,r="";if(Ha(e)&&e.nodeValue)return e.nodeValue;if(Ma(e)){try{for(var o=c(Array.from(e.childNodes)),i=o.next();!i.done;i=o.next()){var a=i.value;r+=Ua(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}var s=getComputedStyle(e).getPropertyValue("display");"block"!==s&&"list"!==s&&"table-row"!==s&&"BR"!==e.tagName||(r+="\n")}return r};function Va(e,t){if(!_a(e)||"true"!==e.dataset.slateVoid)for(var n=e.childNodes,r=n.length;r-=1;){var o=n[r],i=o.nodeType;Ha(o)?t(o,e):[Fa.ELEMENT_NODE,Fa.DOCUMENT_NODE,Fa.DOCUMENT_FRAGMENT_NODE].includes(i)&&Va(o,t)}}function Wa(e){if(0===e.length)return"";var t=e[0];return t.nodeType!==Fa.ELEMENT_NODE?"":t.tagName.toLowerCase()}var Ga=new RegExp(String.fromCharCode(160),"g");function qa(e){return e.replace(Ga," ")}var Ka=["span","b","strong","i","em","s","strike","u","font","sub","sup"],Ya=[];var Xa=[];var Za,Ja,Qa={};function es(e,t){var n=e.length;if(n){var r=e[n-1];if(Wr.isText(r)){var o=Object.keys(r);if(1===o.length&&"text"===o[0])return r.text+=t,!0}}return!1}function ts(e,t,n){return{type:"paragraph",children:[{text:Zi(e).text().replace(/\s+/gm," ")}]}}function ns(e,t){var n=function(e,t){var n=[];if(null!=e.attr("data-w-e-is-void"))return n;var r=e[0].childNodes;return 1===r.length&&"BR"===r[0].nodeName?(n.push({text:""}),n):(r.forEach(function(e){if(Ma(e)){if("BR"===e.nodeName)return void(es(n,"\n")||n.push({text:"\n"}));var r=us(Zi(e),t);Array.isArray(r)?r.forEach(function(e){return n.push(e)}):n.push(r)}else if(Ha(e)){var o=e.textContent||"";if(""===o.trim()&&o.indexOf("\n")>=0)return;o&&(o=qa(o),es(n,o)||n.push({text:o}))}}),n)}(e,t),r=function(e){for(var t in Qa)if(e[0].matches(t))return Qa[t];return ts}(e),o=r(e[0],n,t);return Array.isArray(o)||(o=[o]),o.forEach(function(r){Pr.isVoid(t,r)||(0===n.length&&(r.children=[{text:e.text().replace(/\s+/gm," ")}]),Xa.forEach(function(n){r=n(e[0],r,t)}))}),o}function rs(e,t){0===e.parents("pre").length&&(e[0].innerHTML=e[0].innerHTML.replace(/[\r\n\t]+/g,"").replace(/<br>/g,"\n"));var n=e[0].textContent||"",r={text:n=qa(n=Dn(n))};return Xa.forEach(function(n){r=n(e[0],r,t)}),r}function os(e,t){var n={text:""};return Xa.forEach(function(r){n=r(e[0],n,t)}),n}function is(e,t){var n=t.parentElement;return null==n?e:(null==n.closest("pre")&&(e=e.replace(/[\r\n\t]+/g,"")),e=qa(e=Dn(e)))}function as(e,t){var n=s(s({},e),t);return Object.keys(t).forEach(function(e){!1===t[e]&&delete n[e]}),n}function ss(e,t,n){var r=e[0];if(Ma(r)){var o=us(e,n),i=s({},t);return delete i.text,Array.isArray(o)?o.map(function(e){return as(i,e)}):[as(i,o)]}return La(r)?null:[as(t,Ha(r)?{text:is(r.textContent||"",r)}:rs(e,n))]}function us(e,t){Ya.forEach(function(t){var n=t.selector,r=t.preParseHtml;e[0].matches(n)&&(e=Zi(r(e[0])))});var n=Wa(e);if("span"===n){if(e.attr("data-w-e-type"))return ns(e,t);if((o=Array.from(e[0].childNodes)).some(function(e){return!Ha(e)&&!La(e)})){var r=os(Zi(e[0]),t);return o.flatMap(function(e){return ss(Zi(e),r,t)||[]})}return rs(e,t)}if("code"===n)return"pre"===Wa(e.parent())?ns(e,t):rs(e,t);if(Ka.includes(n)){var o;if((o=Array.from(e[0].childNodes)).some(function(e){return!Ha(e)&&!La(e)})){var i=os(Zi(e[0]),t);return o.flatMap(function(e){return ss(Zi(e),i,t)||[]})}return rs(e,t)}return ns(e,t)}function ls(e,t,n){var r=Zi(n);return!!r.attr(t)||(r.attr(t,"true"),e.on(ti,function(){r.removeAttr(t)}),!1)}function cs(e,t){void 0===t&&(t="");var n=[],r=e.getConfig().sanitizeHtml;""===t&&(t="<p><br></p>"),0!==t.indexOf("<")&&(t=t.split(/\n/).map(function(e){return"<p>".concat(e,"</p>")}).join("")),t=r?r(t):t;var o=Zi("<div>".concat(t,"</div>"));return Array.from(o.children()).forEach(function(t){var r=us(Zi(t),e);Array.isArray(r)?r.forEach(function(e){return n.push(e)}):n.push(r)}),n}function ds(e,t){return"w-e-element-".concat(e,"-").concat(t)}var fs=function(){if(Ja)return Za;Ja=1;var e=9007199254740991,t="[object Arguments]",n="[object Map]",r="[object Promise]",o="[object Set]",i="[object WeakMap]",a="[object DataView]",s=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l="\\ud800-\\udfff",c="\\u0300-\\u036f\\ufe20-\\ufe23",d="\\u20d0-\\u20f0",f="\\ufe0e\\ufe0f",p="["+l+"]",g="["+c+d+"]",v="\\ud83c[\\udffb-\\udfff]",m="[^"+l+"]",y="(?:\\ud83c[\\udde6-\\uddff]){2}",b="[\\ud800-\\udbff][\\udc00-\\udfff]",E="\\u200d",w="(?:"+g+"|"+v+")"+"?",C="["+f+"]?",D=C+w+("(?:"+E+"(?:"+[m,y,b].join("|")+")"+C+w+")*"),A="(?:"+[m+g+"?",g,y,b,p].join("|")+")",S=RegExp(v+"(?="+v+")|"+A+D,"g"),x=RegExp("["+E+l+c+d+f+"]"),N="object"==typeof h&&h&&h.Object===Object&&h,B="object"==typeof self&&self&&self.Object===Object&&self,O=N||B||Function("return this")();function T(e,t){return function(e,t){for(var n=-1,r=e?e.length:0,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(t,function(t){return e[t]})}function k(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function F(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function I(e){return function(e){return x.test(e)}(e)?function(e){return e.match(S)||[]}(e):function(e){return e.split("")}(e)}var P,_,R,L=Function.prototype,M=Object.prototype,j=O["__core-js_shared__"],H=(P=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"",z=L.toString,$=M.hasOwnProperty,U=M.toString,V=RegExp("^"+z.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=O.Symbol,G=W?W.iterator:void 0,q=M.propertyIsEnumerable,K=(_=Object.keys,R=Object,function(e){return _(R(e))}),Y=ue(O,"DataView"),X=ue(O,"Map"),Z=ue(O,"Promise"),J=ue(O,"Set"),Q=ue(O,"WeakMap"),ee=de(Y),te=de(X),ne=de(Z),re=de(J),oe=de(Q);function ie(e,n){var r=fe(e)||function(e){return function(e){return ve(e)&&pe(e)}(e)&&$.call(e,"callee")&&(!q.call(e,"callee")||U.call(e)==t)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=r.length,i=!!o;for(var a in e)!$.call(e,a)||i&&("length"==a||ce(a,o))||r.push(a);return r}function ae(e){if(!ge(e)||function(e){return!!H&&H in e}(e))return!1;var t=he(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?V:s;return t.test(de(e))}function se(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||M,t!==r)return K(e);var t,n,r,o=[];for(var i in Object(e))$.call(e,i)&&"constructor"!=i&&o.push(i);return o}function ue(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ae(n)?n:void 0}var le=function(e){return U.call(e)};function ce(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<n}function de(e){if(null!=e){try{return z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(Y&&le(new Y(new ArrayBuffer(1)))!=a||X&&le(new X)!=n||Z&&le(Z.resolve())!=r||J&&le(new J)!=o||Q&&le(new Q)!=i)&&(le=function(e){var t=U.call(e),s="[object Object]"==t?e.constructor:void 0,u=s?de(s):void 0;if(u)switch(u){case ee:return a;case te:return n;case ne:return r;case re:return o;case oe:return i}return t});var fe=Array.isArray;function pe(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!he(t)}function he(e){var t=ge(e)?U.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ve(e){return!!e&&"object"==typeof e}function me(e){return e?T(e,function(e){return pe(e)?ie(e):se(e)}(e)):[]}return Za=function(e){if(!e)return[];if(pe(e))return function(e){return"string"==typeof e||!fe(e)&&ve(e)&&"[object String]"==U.call(e)}(e)?I(e):function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e);if(G&&e[G])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[G]());var t=le(e);return(t==n?k:t==o?F:me)(e)},Za}(),ps=g(fs),hs=0,gs=function(){this.id="".concat(hs),hs+=1},vs="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),ms="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ys="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bs="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),Es="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),ws="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent),Cs=!Es&&!bs&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,Ds=function(e,t){return Boolean(e.compareDocumentPosition(t)&Ia.DOCUMENT_POSITION_PRECEDING)},As=function(e,t){return Boolean(e.compareDocumentPosition(t)&Ia.DOCUMENT_POSITION_FOLLOWING)},Ss={getWindow:function(e){var t=Fi.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},findKey:function(e,t){var n=ki.get(t);return n||(n=new gs,ki.set(t,n)),n},setNewKey:function(e){var t=new gs;ki.set(e,t)},findPath:function(e,t){for(var n=[],r=t;;){var o=xi.get(r);if(null==o){if(Pr.isEditor(r))return n;break}var i=Si.get(r);if(null==i)break;n.unshift(i),r=o}throw new Error("Unable to find the path for Slate node: ".concat(JSON.stringify(t)))},findDocumentOrShadowRoot:function(e){if(e.isDestroyed)return window.document;var t=Ss.toDOMNode(e,e),n=t.getRootNode();return"[object HTMLDocument]"!==An(n)&&!function(e){return"[object ShadowRoot]"===An(e)}(n)||null==Reflect.get(n,"getSelection")?t.ownerDocument:n},getParentNode:function(e,t){return xi.get(t)||null},getParentsNodes:function(e,t){for(var n=[],r=t;r!==e&&null!=r;){var o=Ss.getParentNode(e,r);if(null==o)break;n.push(o),r=o}return n},getTopNode:function(e,t){var n=[Ss.findPath(e,t)[0]];return Qn.get(e,n)},toDOMNode:function(e,t){var n;if(Pr.isEditor(t))n=Ni.get(e);else{var r=Ss.findKey(e,t);n=Oi.get(r)}if(!n)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(JSON.stringify(t)));return n},hasDOMNodeBySlateNode:function(e,t){if(Pr.isEditor(t))return!!Ni.get(e);var n=Ss.findKey(e,t);return!!Oi.get(n)},canResolveDOMRange:function(e,t){try{var n=d(Pr.node(e,t.anchor.path),1)[0],r=d(Gn.isCollapsed(t)?[n]:Pr.node(e,t.focus.path),1)[0];return Ss.hasDOMNodeBySlateNode(e,n)&&Ss.hasDOMNodeBySlateNode(e,r)}catch(e){return!1}},hasDOMNode:function(e,t,n){void 0===n&&(n={});var r,o=n.editable,i=void 0!==o&&o,a=Ss.toDOMNode(e,e);try{r=Ma(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes('Permission denied to access property "nodeType"'))throw e}return!!r&&(r.closest("[data-slate-editor]")===a&&(!i||r.isContentEditable||r.closest('[contenteditable="false"]')===a||!!r.getAttribute("data-slate-zero-width"))||!!r.getAttribute("data-slate-string"))},toDOMRange:function(e,t){var n=t.anchor,r=t.focus,o=Gn.isBackward(t),i=Ss.toDOMPoint(e,n),a=Gn.isCollapsed(t)?i:Ss.toDOMPoint(e,r),s=Ss.getWindow(e).document.createRange(),u=d(o?a:i,2),l=u[0],c=u[1],f=d(o?i:a,2),p=f[0],h=f[1],g=!!(Ma(l)?l:l.parentElement).getAttribute("data-slate-zero-width"),v=!!(Ma(p)?p:p.parentElement).getAttribute("data-slate-zero-width");return s.setStart(l,g?1:c),s.setEnd(p,v?1:h),s},toDOMPoint:function(e,t){var n,r,o,i=d(Pr.node(e,t.path),1)[0],a=Ss.toDOMNode(e,i);Pr.void(e,{at:t})&&(t={path:t.path,offset:0});var s=Array.from(a.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),u=0;try{for(var l=c(s),f=l.next();!f.done;f=l.next()){var p=f.value,h=p.childNodes[0];if(null!=h&&null!=h.textContent){var g=h.textContent.length,v=p.getAttribute("data-slate-length"),m=u+(null==v?g:parseInt(v,10));if(t.offset<=m){o=[h,Math.min(g,Math.max(0,t.offset-u))];break}u=m}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}if(!o)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(JSON.stringify(t)));return o},toSlateNode:function(e,t){var n=Ma(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Bi.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},findEventRange:function(e,t){"nativeEvent"in t&&(t=t.nativeEvent);var n=t.clientX,r=t.clientY,o=t.target;if(null==n||null==r)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var i,a=Ss.toSlateNode(e,t.target),s=Ss.findPath(e,a);if(Kn.isElement(a)&&Pr.isVoid(e,a)){var u=o.getBoundingClientRect(),l=e.isInline(a)?n-u.left<u.left+u.width-n:r-u.top<u.top+u.height-r,c=Pr.point(e,s,{edge:l?"start":"end"}),d=l?Pr.before(e,c):Pr.after(e,c);if(d)return Pr.range(e,d)}var f=this.getWindow(e).document;if(f.caretRangeFromPoint)i=f.caretRangeFromPoint(n,r);else{var p=f.caretPositionFromPoint(n,r);p&&((i=f.createRange()).setStart(p.offsetNode,p.offset),i.setEnd(p.offsetNode,p.offset))}if(!i)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));return Ss.toSlateRange(e,i,{exactMatch:!1,suppressThrow:!1})},toSlateRange:function(e,t,n){var r,o,i,a,s,u=n.exactMatch,l=n.suppressThrow;if((ja(t)?t.anchorNode:t.startContainer)&&(ja(t)?(r=t.anchorNode,o=t.anchorOffset,i=t.focusNode,a=t.focusOffset,s=ws&&window.document.activeElement&&window.document.activeElement.shadowRoot?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed):(r=t.startContainer,o=t.startOffset,i=t.endContainer,a=t.endOffset,s=t.collapsed)),null==r||null==i||null==o||null==a){if(l)return null;throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t))}var c=Ss.toSlatePoint(e,[r,o],{exactMatch:u,suppressThrow:l});if(!c)return null;var d=s?c:Ss.toSlatePoint(e,[i,a],{exactMatch:u,suppressThrow:l,searchDirection:Ds(r,i)||r===i&&a<o?"forward":"backward"});if(!d)return null;var f={anchor:c,focus:d};return Gn.isExpanded(f)&&Gn.isForward(f)&&Ma(i)&&Pr.void(e,{at:f.focus,mode:"highest"})&&(f=Pr.unhangRange(e,f,{voids:!0})),f},toSlatePoint:function(e,t,n){var r,o,i,a,s=n.exactMatch,u=n.suppressThrow,l=d(s?t:function(e){var t,n=d(e,2),r=n[0],o=n[1];if(Ma(r)&&r.childNodes.length){var i=o===r.childNodes.length,a=i?o-1:o;for(r=(t=d(za(r,a,i?"backward":"forward"),2))[0],i=(a=t[1])<o;Ma(r)&&r.childNodes.length;){var s=i?r.childNodes.length-1:0;r=$a(r,s,i?"backward":"forward")}o=i&&null!=r.textContent?r.textContent.length:0}return[r,o]}(t),2),p=l[0],h=l[1],g=p.parentNode,v=n.searchDirection,m=null,y=0;if(g){var b=Ss.toDOMNode(e,e),E=g.closest('[data-slate-void="true"]'),w=E&&b.contains(E)?E:null,C=g.closest('[contenteditable="false"]'),D=C&&b.contains(C)?C:null,A=g.closest("[data-slate-leaf]"),S=null,x=Ss.getWindow(e);if(A&&x.document.createRange){m=A.closest('[data-slate-node="text"]');var N=x.document.createRange();N.setStart(m,0),N.setEnd(p,h);var B=N.cloneContents();f(f([],d(ps(B.querySelectorAll("[data-slate-zero-width]"))),!1),d(ps(B.querySelectorAll("[contenteditable=false]"))),!1).forEach(function(e){e.parentNode.removeChild(e)}),y=B.textContent.length,S=m}else if(w)A=Array.from(w.querySelectorAll("[data-slate-leaf]")).find(function(t){return Ss.hasDOMNode(e,t)})||null,A?(m=A.closest('[data-slate-node="text"]'),y=(S=A).textContent.length,S.querySelectorAll("[data-slate-zero-width]").forEach(function(e){y-=e.textContent.length})):y=1;else if(D){var O=Boolean(D.closest("[data-w-e-reserve]"));!v&&O&&(v="forward");var T=v,k=function(t){return t?Array.from(t.querySelectorAll("[data-slate-leaf]")).filter(function(t){return Ss.hasDOMNode(e,t)}):[]},F=D.closest('[data-slate-node="element"]');if("backward"===v||!v)for(var I=(_=f(f([],d(k(null==F?void 0:F.previousElementSibling)),!1),d(k(F)),!1)).length-1;I>=0;I-=1){var P=_[I];if(Ds(D,P)){A=P,v="backward";break}}if(!A&&("forward"===v||!v||O)){var _=f(f([],d(k(F)),!1),d(k(null==F?void 0:F.nextElementSibling)),!1);try{for(var R=c(_),L=R.next();!L.done;L=R.next()){P=L.value;if(As(D,P)){A=P,T="backward"===v&&O?"backward":"forward";break}}}catch(e){r={error:e}}finally{try{L&&!L.done&&(o=R.return)&&o.call(R)}finally{if(r)throw r.error}}}A&&(m=A.closest('[data-slate-node="text"]'),S=A,"forward"===T?y=0:(y=S.textContent.length,S.querySelectorAll("[data-slate-zero-width]").forEach(function(e){y-=e.textContent.length})))}S&&y===S.textContent.length&&(g.hasAttribute("data-slate-zero-width")||ms&&(null===(i=S.textContent)||void 0===i?void 0:i.endsWith("\n")))&&(y-=1)}if(!m){if(u)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}try{var M=Ss.toSlateNode(e,m);a=Ss.findPath(e,M)}catch(e){if(u)return null;throw e}return{path:a,offset:y}},hasRange:function(e,t){var n=t.anchor,r=t.focus;return Pr.hasPath(e,n.path)&&Pr.hasPath(e,r.path)},getNodeType:function(e){return Kn.isElement(e)?e.type:""},checkNodeType:function(e,t){return this.getNodeType(e)===t},getNodesStr:function(e){return e.map(function(e){return Qn.string(e)}).join("")},getSelectedElems:function(e){var t,n,r=[],o=Pr.nodes(e,{universal:!0});try{for(var i=c(o),a=i.next();!a.done;a=i.next()){var s=d(a.value,1)[0];Kn.isElement(s)&&r.push(s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},getSelectedNodeByType:function(e,t){var n=this,r=d(Pr.nodes(e,{match:function(e){return n.checkNodeType(e,t)},universal:!0}),1),o=r[0];return null==o?null:o[0]},getSelectedTextNode:function(e){var t=d(Pr.nodes(e,{match:function(e){return Wr.isText(e)},universal:!0}),1),n=t[0];return null==n?null:n[0]},isNodeSelected:function(e,t){var n=d(Pr.nodes(e,{match:function(e){return e===t},universal:!0}),1),r=n[0];return null!=r&&d(r,1)[0]===t},isSelectionAtLineEnd:function(e,t){var n=e.selection;return!!n&&(Pr.isEnd(e,n.anchor,t)||Pr.isEnd(e,n.focus,t))},getTextarea:function(e){var t=ci.get(e);if(null==t)throw new Error("Cannot find textarea instance by editor");return t},getToolbar:function(e){return pi.get(e)||null},getHoverbar:function(e){return gi.get(e)||null},normalizeContent:function(e){e.children.forEach(function(t,n){e.normalizeNode([t,[n]])})},getLeftLengthOfMaxLength:function(e){var t=e.getConfig(),n=t.maxLength,r=t.onMaxLength;if("number"!=typeof n||n<=0)return 1/0;var o=n-e.getText().replace(/\r|\n|(\r\n)|(\n\r)/g,"").length;return o<=0&&r&&r(e),o},cleanExposedTexNodeInSelectionBlock:function(e){var t,n,r,o,i=Ss.getTextarea(e).$textArea,a=null==i?void 0:i[0].childNodes;if(a)try{for(var s=c(Array.from(a)),u=s.next();!u.done;u=s.next()){var l=u.value;if(!Ha(l))break;l.remove()}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}var d=Pr.nodes(e,{match:function(t){return!(!Kn.isElement(t)||e.isInline(t))},universal:!0});try{for(var f=c(d),p=f.next();!p.done;p=f.next()){var h=p.value;if(null!=h){var g=h[0];if(!Ss.hasDOMNodeBySlateNode(e,g))continue;Va(Ss.toDOMNode(e,g),function(e,t){var n=Zi(t);n.attr("data-slate-string")||n.attr("data-slate-zero-width")||n.attr("data-w-e-reserve")||t.removeChild(e)})}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}},isLastNode:function(e,t){var n=e.children||[];return n[n.length-1]===t},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(e){var t,n,r=Pr.nodes(e,{match:function(t){return e.isVoid(t)}}),o=0;try{for(var i=c(r),a=i.next();!a.done;a=i.next()){a.value&&(o+=1)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o>0},isSelectedEmptyParagraph:function(e){var t=e.selection;if(null==t)return!1;if(Gn.isExpanded(t))return!1;var n=Ss.getSelectedNodeByType(e,"paragraph");if(null===n)return!1;var r=n.children;return 1===r.length&&(""===r[0].text||void 0)},isEmptyPath:function(e,t){var n=Pr.node(e,t);if(null==n)return!1;var r=d(n,1)[0].children;if(1===r.length&&""===r[0].text)return!0;return!1}},xs=[];var Ns={};function Bs(e,t,n){var r=n.isInline(e)?"span":"div";return"<".concat(r,">").concat(t,"</").concat(r,">")}var Os="data-w-e-id",Ts=/^[A-Za-z_:-][A-Za-z0-9_:.-]*$/;function ks(e,t,n,r){if(!r.includeId)return e;var o=function(e){return e&&Ts.test(e)?e:Os}(r.idKey),i=Ss.findKey(n,t);return function(e,t,n){if(!e)return e;var r=e.match(/^<([A-Za-z][A-Za-z0-9-]*)([^>]*)>/);if(!r)return e;var o=d(r,3),i=o[0],a=o[1],s=o[2],u=void 0===s?"":s;if(new RegExp("\\s".concat(t,"=")).test(u))return e;var l=/\/\s*$/.test(u),c=u.replace(/\s*\/\s*$/,""),f=c.trim()?" ".concat(c.trim()):"",p=l?" /":"";return"<".concat(a).concat(f," ").concat(t,'="').concat(n,'"').concat(p,">")+e.slice(i.length)}(e,o,ds(Ss.getNodeType(t),i.id))}function Fs(e,t,n){void 0===n&&(n={});var r=e.type,o=void 0===r?"":r,i=e.children,a=void 0===i?[]:i,s=Pr.isVoid(t,e),u="";s||(u=a.map(function(e){return Is(e,t,n)}).join(""));var l=function(e){return Ns[e]||Bs}(o),c=l(e,u,t),d="";if(d="string"==typeof c?c:c.html||"",s||xs.forEach(function(n){return d=n(e,d,t)}),d=ks(d,e,t,n),"string"==typeof c)return d;var f=c.prefix,p=void 0===f?"":f,h=c.suffix,g=void 0===h?"":h;return p&&(d=p+d),g&&(d+=g),d}function Is(e,t,n){return void 0===n&&(n={}),Kn.isElement(e)?Fs(e,t,n):function(e,t){var n=e.text;if(null==n)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=n;r=function(e){return e.replace(/ {2}/g," &nbsp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/®/g,"&reg;").replace(/©/g,"&copy;").replace(/™/g,"&trade;")}(r);var o=Ss.getParentsNodes(t,e).some(function(e){return"pre"===Ss.getNodeType(e)});if(o||(r=r.replace(/\n\r|\r\n|\r|\n/g,"<br>")),o&&(r=r.replace(/&nbsp;/g," ")),""===r){var i=Ss.getParentNode(null,e);if(!i||0!==i.children.length)return r;r="<br>"}return xs.forEach(function(n){return r=n(e,r,t)}),r}(e,t)}var Ps=function(e,t){var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},_s=function(e,t,n){var r=Ss.toDOMRange(e,t).getBoundingClientRect(),o=Ss.toDOMRange(e,n).getBoundingClientRect();return Ps(r,o)&&Ps(o,r)},Rs=function(e,t){var n,r,o=[];try{for(var i=c(Pr.levels(e,{at:t})),a=i.next();!a.done;a=i.next()){var s=d(a.value,2),u=s[0],l=s[1],f=Ss.findKey(e,u);o.push([l,f])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o};var Ls,Ms,js,Hs,zs,$s,Us,Vs,Ws,Gs,qs,Ks,Ys,Xs,Zs,Js,Qs,eu,tu,nu,ru,ou,iu,au,su,uu,lu,cu,du,fu,pu,hu,gu,vu,mu,yu,bu,Eu,wu,Cu,Du=function(e){var t=e,n=t.onChange,r=t.insertText,o=t.apply,i=t.deleteBackward,a=t.deleteFragment;return t.insertText=function(e){t.getConfig().readOnly||r(e)},t.apply=function(e){var n,r,i,a,s,u,l,p,h=[];switch(e.type){case"insert_text":case"remove_text":case"set_node":case"split_node":h.push.apply(h,f([],d(Rs(t,e.path)),!1));break;case"insert_node":case"remove_node":h.push.apply(h,f([],d(Rs(t,jn.parent(e.path))),!1));break;case"merge_node":var g=jn.previous(e.path);h.push.apply(h,f([],d(Rs(t,g)),!1));break;case"move_node":var v=jn.common(jn.parent(e.path),jn.parent(e.newPath));h.push.apply(h,f([],d(Rs(t,v)),!1));break;case"set_selection":(null===(a=null===(i=e.newProperties)||void 0===i?void 0:i.focus)||void 0===a?void 0:a.path)&&(h.push.apply(h,f([],d(Rs(t,null===(u=null===(s=e.newProperties)||void 0===s?void 0:s.focus)||void 0===u?void 0:u.path)),!1)),h.push.apply(h,f([],d(Rs(t,null===(p=null===(l=e.properties)||void 0===l?void 0:l.focus)||void 0===p?void 0:p.path)),!1)))}o(e);try{for(var m=c(h),y=m.next();!y.done;y=m.next()){var b=d(y.value,2),E=b[0],w=b[1],C=d(Pr.node(t,E),1)[0];ki.set(C,w),"type"in C&&(Di.has(C)&&Di.delete(C),Ai.has(C)&&Ai.delete(C))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}},t.deleteBackward=function(n){if("line"!==n)return i(n);if(e.selection&&Gn.isCollapsed(e.selection)){var r=Pr.above(e,{match:function(t){return Kn.isElement(t)&&Pr.isBlock(e,t)},at:e.selection});if(r){var o=d(r,2)[1],a=Pr.range(e,o,e.selection.anchor),s=function(e,t){var n=Pr.range(e,Gn.end(t)),r=Array.from(Pr.positions(e,{at:t})),o=0,i=r.length,a=Math.floor(i/2);if(_s(e,Pr.range(e,r[o]),n))return Pr.range(e,r[o],n);if(r.length<2)return Pr.range(e,r[r.length-1],n);for(;a!==r.length&&a!==o;)_s(e,Pr.range(e,r[a]),n)?i=a:o=a,a=Math.floor((o+i)/2);return Pr.range(e,r[i],n)}(t,a);Gn.isCollapsed(s)||co.delete(e,{at:s})}}},t.deleteFragment=function(e){var n=function(e){var t=e.selection;if(null==t||Gn.isCollapsed(t))return!1;var n=d(Gn.edges(t),2),r=n[0],o=n[1],i=d(Pr.edges(e,[]),2),a=i[0],s=i[1];return Mr.equals(r,a)&&Mr.equals(o,s)}(t);a(e),n&&(!function(e){var t=[{type:"paragraph",children:[{text:""}]}];Pr.withoutNormalizing(e,function(){for(var n=e.children.length-1;n>=0;n-=1)co.removeNodes(e,{at:[n]});co.insertNodes(e,t,{at:[0]})})}(t),t.children.length>0&&co.select(t,Pr.start(t,[])))},t.onChange=function(){var e=t.selection;null!=e&&Pi.set(t,e),t.emit(ni),n()},t.handleTab=function(){t.insertText(" ")},t.getHtml=function(){var e=t.children,n=void 0===e?[]:e,r=t.getConfig().skipCacheTypes,o=void 0===r?["list-item"]:r;return n.map(function(e){var n=Ss.getNodeType(e);if(o.includes(n))return Is(e,t);var r=Ai.get(e);if(r)return r;var i=Is(e,t);return Ai.set(e,i),i}).join("")},t.getHtmlWithId=function(e){void 0===e&&(e="data-w-e-id");var n=t.children;return(void 0===n?[]:n).map(function(n){return Is(n,t,{includeId:!0,idKey:e})}).join("")},t.getText=function(){var e=t.children;return(void 0===e?[]:e).map(function(e){return Qn.string(e)}).join("\n")},t.getSelectionText=function(){var n=t.selection;return null==n?"":Pr.string(e,n)},t.getElemsByType=function(e,n){var r,o;void 0===n&&(n=!1);var i=[],a=Pr.nodes(t,{at:[],universal:!0});try{for(var u=c(a),l=u.next();!l.done;l=u.next()){var f=d(l.value,1)[0];if(Kn.isElement(f))if(n?f.type.indexOf(e)>=0:f.type===e){var p=Ss.findKey(t,f),h=ds(f.type,p.id);i.push(s(s({},f),{id:h}))}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return i},t.getElemsByTypePrefix=function(e){return t.getElemsByType(e,!0)},t.isEmpty=function(){var e=t.children,n=void 0===e?[]:e;if(n.length>1)return!1;var r=n[0];if(null==r)return!0;if(!Kn.isElement(r)||"paragraph"!==r.type)return!1;var o=r.children,i=void 0===o?[]:o;if(i.length>1)return!1;var a=i[0];return null==a||Wr.isText(a)&&""===a.text},t.clear=function(){for(var e=t.children.length-1;e>=0;e-=1)co.removeNodes(t,{at:[e]});0!==t.children.length?function(e){var t=e.children[0];if(1===e.children.length&&Kn.isElement(t)&&("paragraph"!==t.type||""!==Qn.string(t))&&""===Qn.string(t)){var n=[{type:"paragraph",children:[{text:""}]}];Pr.withoutNormalizing(e,function(){co.removeNodes(e,{at:[0]}),co.insertNodes(e,n,{at:[0]})})}}(t):co.insertNodes(t,[{type:"paragraph",children:[{text:""}]}])},t.getParentNode=function(e){return Ss.getParentNode(t,e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e){var r=document.createElement("div");r.innerHTML=e;var o=Array.from(r.childNodes);if(o=o.filter(function(e){var t=e.nodeName;return!!Ha(e)||!!Ma(e)&&!Hi.has(t.toLowerCase())}),0!==o.length){var i=t.selection;if(null!=i){var a=null;if(Ss.isSelectedEmptyParagraph(t)&&!n)a=[i.focus.path[0]];r.setAttribute("hidden","true"),document.body.appendChild(r);var s=0;o.forEach(function(e,n){var r=e.nodeName,i=e.textContent,a=void 0===i?"":i;if(Ha(e)){if(!a||!a.trim())return;t.insertNode({text:a})}else if("BR"!==r){var u=e,l=!1;if(Ka.includes(r.toLowerCase()))l=!0;else for(var c in Qa)if(u.matches(c)){l=!0;break}if(l){var f=us(Zi(u),t),p=Array.isArray(f)?f:[f];if(p.forEach(function(e){return function(e,t){e.isInline(t)?(e.insertNode(t),"link"===t.type&&e.insertFragment([{text:""}])):co.insertNodes(e,t,{mode:"highest"})}(t,e)}),s+=p.length,Ss.isSelectedVoidNode(t)&&t.move(1),p.some(function(e){return!!Kn.isElement(e)&&(!!t.isInline(e)||e.children.some(function(e){return Kn.isElement(e)&&t.isInline(e)}))})&&t.selection){var h=Pr.nodes(t,{at:t.selection,match:function(e){return Kn.isElement(e)&&t.isInline(e)},universal:!0}),g=h.next().value;if(g){var v=d(g,2)[1],m=jn.next(v);Pr.hasPath(t,m)?co.select(t,{anchor:{path:m,offset:0},focus:{path:m,offset:0}}):t.move(1)}}}else{var y=window.getComputedStyle(u).display;if(!Ss.isSelectedEmptyParagraph(t)&&y.indexOf("inline")<0){if(n>=1)(function(e){return"matches"in e&&/^[ou]l$/i.test(e.tagName)&&!e.hasAttribute("data-w-e-type")})(o[n-1])&&t.insertBreak();t.insertBreak()}t.dangerouslyInsertHtml(u.innerHTML,!0)}}else t.insertText("\n")}),s&&a&&Ss.isEmptyPath(t,a)&&co.removeNodes(t,{at:a}),r.remove()}}}},t.setHtml=function(e){void 0===e&&(e="");var n=t.isDisabled(),r=t.isFocused(),o=JSON.stringify(t.selection);t.enable(),Pi.delete(t),t.focus(),t.clear();var i=cs(t,null==e?"":e);if(co.insertFragment(t,i),r||(t.deselect(),t.blur()),n&&(t.deselect(),t.disable()),t.isFocused())try{var a=JSON.parse(o);Gn.isRange(a)&&Ss.hasRange(t,a)?t.select(a):t.select(Pr.start(t,[]))}catch(e){t.select(Pr.start(t,[]))}},t},Au=1,Su=function(e){var t=e;return t.id="wangEditor-".concat(Au),Au+=1,t.isDestroyed=!1,t.isFullScreen=!1,t.focus=function(e){if(Ss.toDOMNode(t,t).focus({preventScroll:!0}),Ii.set(t,!0),e){var n=Pr.end(t,[]);co.select(t,n)}else{var r=Pi.get(t);r?co.select(t,r):co.select(t,Pr.start(t,[]))}},t.isFocused=function(){return!!Ii.get(t)},t.blur=function(){Ss.toDOMNode(t,t).blur(),co.deselect(t),Ii.set(t,!1)},t.updateView=function(){Ss.getTextarea(t).changeViewState();var e=Ss.getToolbar(t);e&&e.changeToolbarState();var n=Ss.getHoverbar(t);n&&n.changeHoverbarState()},t.destroy=function(){if(!t.isDestroyed){var e=Ss.getTextarea(t);e.destroy(),ci.delete(t),di.delete(e);var n=Ss.getToolbar(t);n&&(n.destroy(),pi.delete(t),fi.delete(n));var r=Ss.getHoverbar(t);r&&(r.destroy(),gi.delete(t),hi.delete(r)),t.isDestroyed=!0,t.emit(ti)}},t.scrollToElem=function(e){if(!t.getConfig().scroll){var n="编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能";return n+="\nYou has disabled editor scroll, please do this yourself",void console.warn(n)}var r=Zi("#".concat(e));if(0!==r.length){var o=r[0];if(!Ss.hasDOMNode(t,o)){n="Element (found by id is '".concat(e,"') is not in editor DOM");return n+="\n 通过 id '".concat(e,"' 找到的 element 不在 editor DOM 之内"),void console.error(n,o)}var i=Ss.getTextarea(t),a=i.$textAreaContainer,s=i.$scroll,u=r.offset().top,l=a.offset().top;s[0].scrollBy({top:u-l,behavior:"smooth"})}},t.showProgressBar=function(e){e<1||Ss.getTextarea(t).changeProgress(e)},t.hidePanelOrModal=function(){var e=mi.get(t);null!=e&&e.forEach(function(e){return e.hide()})},t.enable=function(){t.getConfig().readOnly=!1,t.updateView()},t.disable=function(){t.getConfig().readOnly=!0,t.updateView()},t.isDisabled=function(){return t.getConfig().readOnly},t.toDOMNode=function(e){return Ss.toDOMNode(t,e)},t.fullScreen=function(){if(!t.isFullScreen){var e=null,n=Ss.getToolbar(t);n&&(e=n.$box);var r=Ss.getTextarea(t).$box.parent();if(e&&e.parent()[0]!==r[0]){throw new Error("Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent\n不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致")}r.addClass("w-e-full-screen-container");var o=r.css("z-index");r.attr("data-z-index",o.toString()),t.isFullScreen=!0,t.emit(oi)}},t.unFullScreen=function(){if(t.isFullScreen){var e=Ss.getTextarea(t).$box.parent();setTimeout(function(){e.removeClass("w-e-full-screen-container"),t.isFullScreen=!1,t.emit(ii)},200)}},t.getEditableContainer=function(){return Ss.getTextarea(t).$textAreaContainer[0]},t},xu={exports:{}},Nu={exports:{}};function Bu(){if(Ms)return Ls;Ms=1;return Ls=function(e){return null!=e}}function Ou(){if($s)return zs;$s=1;var e=function(){if(Hs)return js;Hs=1;var e=Bu(),t={object:!0,function:!0,undefined:!0};return js=function(n){return!!e(n)&&hasOwnProperty.call(t,typeof n)}}();return zs=function(t){if(!e(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(e){return!1}}}function Tu(){if(Gs)return Ws;Gs=1;var e=function(){if(Vs)return Us;Vs=1;var e=Ou();return Us=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(e){return!1}return!e(t)}}(),t=/^\s*class[\s{/}]/,n=Function.prototype.toString;return Ws=function(r){return!!e(r)&&!t.test(n.call(r))}}function ku(){if(eu)return Qs;eu=1;var e=(Js?Zs:(Js=1,Zs=function(){}))();return Qs=function(t){return t!==e&&null!==t},Qs}function Fu(){return ou||(ou=1,ru=(Xs?Ys:(Xs=1,Ys=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}))()?Object.keys:function(){if(nu)return tu;nu=1;var e=ku(),t=Object.keys;return tu=function(n){return t(e(n)?Object(n):n)}}()),ru}function Iu(){if(uu)return su;uu=1;var e=Fu(),t=function(){if(au)return iu;au=1;var e=ku();return iu=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t}}(),n=Math.max;return su=function(r,o){var i,a,s,u=n(arguments.length,2);for(r=Object(t(r)),s=function(e){try{r[e]=o[e]}catch(e){i||(i=e)}},a=1;a<u;++a)e(o=arguments[a]).forEach(s);if(void 0!==i)throw i;return r},su}function Pu(){return cu?lu:(cu=1,lu=(Ks||(Ks=1,qs=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}),qs)()?Object.assign:Iu())}function _u(){return yu||(yu=1,mu=function(){if(hu)return pu;hu=1;var e="razdwatrzy";return pu=function(){return"function"==typeof e.contains&&!0===e.contains("dwa")&&!1===e.contains("foo")}}()()?String.prototype.contains:function(){if(vu)return gu;vu=1;var e=String.prototype.indexOf;return gu=function(t){return e.call(this,t,arguments[1])>-1},gu}()),mu}function Ru(){if(bu)return Nu.exports;bu=1;var e=Bu(),t=Tu(),n=Pu(),r=function(){if(fu)return du;fu=1;var e=ku(),t=Array.prototype.forEach,n=Object.create;return du=function(r){var o=n(null);return t.call(arguments,function(t){e(t)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(t),o)}),o},du}(),o=_u(),i=Nu.exports=function(t,i){var a,s,u,l,c;return arguments.length<2||"string"!=typeof t?(l=i,i=t,t=null):l=arguments[2],e(t)?(a=o.call(t,"c"),s=o.call(t,"e"),u=o.call(t,"w")):(a=u=!0,s=!1),c={value:i,configurable:a,enumerable:s,writable:u},l?n(r(l),c):c};return i.gs=function(i,a,s){var u,l,c,d;return"string"!=typeof i?(c=s,s=a,a=i,i=null):c=arguments[3],e(a)?t(a)?e(s)?t(s)||(c=s,s=void 0):s=void 0:(c=a,a=s=void 0):a=void 0,e(i)?(u=o.call(i,"c"),l=o.call(i,"e")):(u=!0,l=!1),d={get:a,set:s,configurable:u,enumerable:l},c?n(r(c),d):d},Nu.exports}var Lu=(Cu||(Cu=1,function(e,t){var n,r,o,i,a,s,u,l=Ru(),c=wu?Eu:(wu=1,Eu=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}),d=Function.prototype.apply,f=Function.prototype.call,p=Object.create,h=Object.defineProperty,g=Object.defineProperties,v=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};n=function(e,t){var n;return c(t),v.call(this,"__ee__")?n=this.__ee__:(n=m.value=p(null),h(this,"__ee__",m),m.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},r=function(e,t){var r,i;return c(t),i=this,n.call(this,e,r=function(){o.call(i,e,r),d.call(t,this,arguments)}),r.__eeOnceListener__=t,this},o=function(e,t){var n,r,o,i;if(c(t),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},i=function(e){var t,n,r,o,i;if(v.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)d.call(r,this,i)}else switch(arguments.length){case 1:f.call(o,this);break;case 2:f.call(o,this,arguments[1]);break;case 3:f.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];d.call(o,this,i)}},a={on:n,once:r,off:o,emit:i},s={on:l(n),once:l(r),off:l(o),emit:l(i)},u=g({},s),e.exports=t=function(e){return null==e?p(u):g(Object(e),s)},t.methods=a}(xu,xu.exports)),xu.exports),Mu=g(Lu);function ju(e){var t=_i.get(e);return null==t&&(t=Mu(),_i.set(e,t)),t}var Hu=new WeakMap;function zu(e,t){var n=Hu.get(e);null==n&&(n=new Set,Hu.set(e,n)),n.add(t)}var $u=function(e){var t=e;return t.on=function(e,n){var r=ju(t);if(r.on(e,n),"destroyed"===e&&zu(t,n),"destroyed"!==e){var o=function(){return r.off(e,n)};r.on("destroyed",o),zu(t,o)}},t.once=function(e,n){ju(t).once(e,n)},t.off=function(e,n){ju(t).off(e,n)},t.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=ju(t);if(o.emit.apply(o,f([e],d(n),!1)),"destroyed"===e){var i=function(e){return Hu.get(e)||new Set}(t);i.forEach(function(e){return o.off("destroyed",e)}),function(e){Hu.set(e,new Set)}(t)}},t};var Uu=function(e){var t=e;return t.setFragmentData=function(e){var n=t.selection;if(n){var r=d(Gn.edges(n),2),o=r[0],i=r[1],a=Pr.void(t,{at:o.path}),s=Pr.void(t,{at:i.path});if(!Gn.isCollapsed(n)||a){var u=Ss.toDOMRange(t,n),l=u.cloneContents(),c=l.childNodes[0];if(l.childNodes.forEach(function(e){e.textContent&&""!==e.textContent.trim()&&(c=e)}),s){var f=d(s,1)[0],p=u.cloneRange(),h=Ss.toDOMNode(t,f);p.setEndAfter(h),l=p.cloneContents()}if(a&&(c=l.querySelector("[data-slate-spacer]")),Array.from(l.querySelectorAll("[data-slate-zero-width]")).forEach(function(e){var t="n"===e.getAttribute("data-slate-zero-width");e.textContent=t?"\n":""}),Ha(c)){var g=c.ownerDocument.createElement("span");g.style.whiteSpace="pre",g.appendChild(c),l.appendChild(g),c=g}var v=t.getFragment(),m=JSON.stringify(v),y=window.btoa(encodeURIComponent(m));c.setAttribute("data-slate-fragment",y),e.setData("application/x-slate-fragment",y);var b=l.ownerDocument.createElement("div");return b.appendChild(l),b.setAttribute("hidden","true"),l.ownerDocument.body.appendChild(b),e.setData("text/html",b.innerHTML),e.setData("text/plain",Ua(b)),l.ownerDocument.body.removeChild(b),e}}},t.insertData=function(e){var n=e.getData("application/x-slate-fragment");if(n){var r=decodeURIComponent(window.atob(n)),o=JSON.parse(r);t.insertFragment(o)}else{var i=e.getData("text/plain"),a=e.getData("text/html");if(a){var s=t.getConfig().sanitizeHtml;t.dangerouslyInsertHtml(s?s(a):a)}else if(i){if(!/[\r\n]/.test(i))return void t.insertText(i);var u=function(e){return e.replace(/\n\r|\r\n|\r/g,"\n").split("\n").map(function(e){return{type:"paragraph",children:[{text:e}]}})}(i);t.insertFragment(u)}}},t},Vu={isHistory:e=>or(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||rr.isOperationList(e.redos[0].operations))&&(0===e.undos.length||rr.isOperationList(e.undos[0].operations))},Wu=new WeakMap,Gu=new WeakMap,qu=new WeakMap,Ku={isHistoryEditor:e=>Vu.isHistory(e.history)&&Pr.isEditor(e),isMerging:e=>Gu.get(e),isSplittingOnce:e=>qu.get(e),setSplittingOnce(e,t){qu.set(e,t)},isSaving:e=>Wu.get(e),redo(e){e.redo()},undo(e){e.undo()},withMerging(e,t){var n=Ku.isMerging(e);Gu.set(e,!0),t(),Gu.set(e,n)},withNewBatch(e,t){var n=Ku.isMerging(e);Gu.set(e,!0),qu.set(e,!0),t(),Gu.set(e,n),qu.delete(e)},withoutMerging(e,t){var n=Ku.isMerging(e);Gu.set(e,!1),t(),Gu.set(e,n)},withoutSaving(e,t){var n=Ku.isSaving(e);Wu.set(e,!1);try{t()}finally{Wu.set(e,n)}}},Yu=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!jn.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!jn.equals(e.path,t.path)),Xu=(e,t)=>"set_selection"!==e.type,Zu=function(e){var t=(e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];r.selectionBefore&&co.setSelection(t,r.selectionBefore),Ku.withoutSaving(t,()=>{Pr.withoutNormalizing(t,()=>{for(var e of r.operations)t.apply(e)})}),e.redos.pop(),t.writeHistory("undos",r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];Ku.withoutSaving(t,()=>{Pr.withoutNormalizing(t,()=>{var e=r.operations.map(rr.inverse).reverse();for(var n of e)t.apply(n);r.selectionBefore&&co.setSelection(t,r.selectionBefore)})}),t.writeHistory("redos",r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:o}=t,{undos:i}=o,a=i[i.length-1],s=a&&a.operations[a.operations.length-1],u=Ku.isSaving(t),l=Ku.isMerging(t);if(null==u&&(u=Xu(e)),u){if(null==l&&(l=null!=a&&(!!r.includes(s)||Yu(e,s))),Ku.isSplittingOnce(t)&&(l=!1,Ku.setSplittingOnce(t,void 0)),a&&l)a.operations.push(e);else{var c={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",c)}for(;i.length>100;)i.shift();o.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t})(e);return t.clearHistory=function(){t.history.undos=[],t.history.redos=[]},t};function Ju(e){return e.replace(/\n\r|\r\n|\r|\n/g,"").length}function Qu(e,t){var n,r;if(t<=0)return"";var o=t,i="";try{for(var a=c(e),s=a.next();!s.done;s=a.next()){var u=s.value;if(/\r|\n/.test(u))i+=u;else{if(o<=0)break;i+=u,o-=1}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}var el=function(e){var t=e,n=t.insertText,r=t.insertNode,o=t.insertFragment,i=t.dangerouslyInsertHtml;return t.insertText=function(e){if(t.getConfig().maxLength){var r=Ss.getLeftLengthOfMaxLength(t);r<=0||(r<e.length?n(e.slice(0,r)):n(e))}else n(e)},t.insertNode=function(e){if(t.getConfig().maxLength){var n=Ss.getLeftLengthOfMaxLength(t);if(!(n<=0))n<Qn.string(e).length||r(e)}else r(e)},t.insertFragment=function(e){if(t.getConfig().maxLength){if(e.length>0){var n=e[0];if(Ss.getLeftLengthOfMaxLength(t)<Qn.string(n).length)return;o([n]);for(var r=1;r<e.length;r+=1)t.insertNode(e[r])}}else o(e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e)if(t.getConfig().maxLength){var r=Ss.getLeftLengthOfMaxLength(t);if(!(r<=0)){var o=function(e,t){if(t<=0)return"";var n=document.createElement("div");n.innerHTML=e;var r=function(e){e.forEach(function(e){return e.remove()})},o=function(e){for(var n=Array.from(e.childNodes),i=0;i<n.length;i+=1){var a=n[i];if(Ha(a)){var s=a.textContent||"",u=Ju(s);if(u<=t){t-=u;continue}return a.textContent=Qu(s,t),t=0,r(n.slice(i+1)),!1}if(Ma(a)){if(Hi.has(a.nodeName.toLowerCase())){a.remove();continue}if(!o(a))return r(n.slice(i+1)),!1}else a.remove()}return t>0};return o(n),n.innerHTML}(e,r);o&&i(o,n)}}else i(e,n)},t};function tl(e){return e<0?0:e}function nl(e){var t=Ss.getTextarea(e).$textAreaContainer,n=t.width(),r=t.height(),o=t.offset();return{top:o.top,left:o.left,width:n,height:r}}function rl(e){var t={top:"0",left:"0"},n=e.selection;if(null==n)return t;var r=nl(e);if(null==r)return t;var o=r.top,i=r.left,a=r.width,s=r.height,u=Ss.toDOMRange(e,n).getClientRects(),l=u?u[0]:null;if(null==l)return t;var c={},d=l.top-o,f=l.left-i;if(f>a/2){var p=tl(a-f);c.right="".concat(p+5,"px")}else{var h=tl(f);c.left="".concat(h+5,"px")}if(d>s/2){var g=tl(s-d);c.bottom="".concat(g+5,"px")}else{var v=u[u.length-1],m=v.top-o+v.height;m<0&&(m=0),c.top="".concat(m+5,"px")}return c}function ol(e,t,n){void 0===n&&(n="modal");var r={top:"0",left:"0"};if(null==e.selection)return r;var o=Kn.isElement(t)&&e.isVoid(t),i=Kn.isElement(t)&&e.isInline(t),a=Ti.get(t);if(null==a)return r;var s=a.getBoundingClientRect(),u=s.top,l=s.left,c=s.height,d=s.width;if(o){var f=function(e){var t=[];t.push(e);for(var n=0;t.length>0;){var r=t.pop();if(null==r)break;if((n+=1)>1e4)break;var o=r.nodeName;if(r.nodeType===Fa.ELEMENT_NODE){var i=o.toLowerCase();if(ka.includes(i)||"iframe"===i||"video"===i)return r;var a=r.children||[],s=a.length;if(s)for(var u=s-1;u>=0;u-=1)t.push(a[u])}}return null}(a);if(null!=f){var p=f.getBoundingClientRect();u=p.top,c=p.height}}var h=nl(e);if(null==h)return r;var g=h.top,v=h.left,m=h.width,y=h.height,b={},E=u-g,w=l-v;if("bar"===n){if(b.left="".concat(tl(w),"px"),E>40){var C=tl(y-E);b.bottom="".concat(C+5,"px")}else b.top="".concat(E+c+5,"px");return b}if("modal"===n){if(o)if(i)if(w>(m-d)/2){var D=tl(m-w);b.right="".concat(D+5,"px")}else{var A=tl(w+d);b.left="".concat(A+5,"px")}else b.left="20px";else b.left="".concat(tl(w),"px");if(o)(S=E)<0&&(S=0),b.top="".concat(S,"px");else if(E>(y-c)/2){C=tl(y-E);b.bottom="".concat(C+5,"px")}else{var S;(S=E+c)<0&&(S=0),b.top="".concat(S+5,"px")}return b}throw new Error("type '".concat(n,"' is invalid"))}function il(e,t){Cn(function(){var n=nl(e);if(null!=n){var r,o=n.top,i=n.left,a=n.width,s=n.height,u=t.offset(),l=u.top,c=u.left,d=t.width(),f=t.height(),p=l-o,h=c-i,g=t.attr("style");if(g.indexOf("top")>=0)if((r=p+f-s)>0){var v=t.css("top"),m=parseInt(v.toString(),10)-r;m<0&&(m=0),t.css("top","".concat(m,"px"))}if(g.indexOf("bottom")>=0&&l<0){var y=t.css("bottom"),b=parseInt(y.toString(),10)-Math.abs(l);t.css("bottom","".concat(b,"px"))}if(g.indexOf("left")>=0)if((r=h+d-a)>0){var E=t.css("left"),w=parseInt(E.toString(),10)-r;w<0&&(w=0),t.css("left","".concat(w,"px"))}if(g.indexOf("right")>=0&&c<0){var C=t.css("right"),D=parseInt(C.toString(),10)-Math.abs(c);t.css("right","".concat(D,"px"))}}})}var al,sl,ul=function(e){var t=e,n=t.select,r=t.deselect,o=t.move;return t.select=function(e){n(e)},t.deselect=function(){var e=t.selection,n=Ss.findDocumentOrShadowRoot(t).getSelection();n&&n.rangeCount>0&&Ss.hasDOMNode(t,n.anchorNode)&&Ss.hasDOMNode(t,n.focusNode)&&n.removeAllRanges(),e&&r()},t.move=function(e,t){void 0===t&&(t=!1),"number"==typeof e?e&&(e<0||o({distance:e,unit:"character",reverse:t})):o(e)},t.moveReverse=function(e){t.move(e,!0)},t.restoreSelection=function(){var e=Pi.get(t);null!=e&&(t.focus(),n(e))},t.getSelectionPosition=function(){return rl(t)},t.getNodePosition=function(e){return ol(t,e)},t.isSelectedAll=function(){var e=t.selection;if(null==e)return!1;var n=d(Gn.edges(e),2),r=n[0],o=n[1],i=d(Pr.edges(t,[]),2),a=i[0],s=i[1];return!(!Mr.equals(r,a)||!Mr.equals(o,s))},t.selectAll=function(){var e=Pr.start(t,[]),r=Pr.end(t,[]);n({anchor:e,focus:r})},t};var ll=function(){if(sl)return al;sl=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,o=parseInt,i="object"==typeof h&&h&&h.Object===Object&&h,a="object"==typeof self&&self&&self.Object===Object&&self,s=i||a||Function("return this")(),u=Object.prototype.toString,l=Math.max,c=Math.min,d=function(){return s.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function p(i){if("number"==typeof i)return i;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(i))return NaN;if(f(i)){var a="function"==typeof i.valueOf?i.valueOf():i;i=f(a)?a+"":a}if("string"!=typeof i)return 0===i?i:+i;i=i.replace(e,"");var s=n.test(i);return s||r.test(i)?o(i.slice(2),s?2:8):t.test(i)?NaN:+i}return al=function(e,t,n){var r,o,i,a,s,u,h=0,g=!1,v=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,h=t,a=e.apply(i,n)}function b(e){var n=e-u;return void 0===u||n>=t||n<0||v&&e-h>=i}function E(){var e=d();if(b(e))return w(e);s=setTimeout(E,function(e){var n=t-(e-u);return v?c(n,i-(e-h)):n}(e))}function w(e){return s=void 0,m&&r?y(e):(r=o=void 0,a)}function C(){var e=d(),n=b(e);if(r=arguments,o=this,u=e,n){if(void 0===s)return function(e){return h=e,s=setTimeout(E,t),g?y(e):a}(u);if(v)return s=setTimeout(E,t),y(u)}return void 0===s&&(s=setTimeout(E,t)),a}return t=p(t)||0,f(n)&&(g=!!n.leading,i=(v="maxWait"in n)?l(p(n.maxWait)||0,t):i,m="trailing"in n?!!n.trailing:m),C.cancel=function(){void 0!==s&&clearTimeout(s),h=0,r=u=o=s=void 0},C.flush=function(){return void 0===s?a:w(d())},C},al}(),cl=g(ll);const dl=e=>"string"==typeof e,fl=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},pl=e=>null==e?"":""+e,hl=/###/g,gl=e=>e&&e.indexOf("###")>-1?e.replace(hl,"."):e,vl=e=>!e||dl(e),ml=(e,t,n)=>{const r=dl(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(vl(e))return{};const t=gl(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return vl(e)?{}:{obj:e,k:gl(r[o])}},yl=(e,t,n)=>{const{obj:r,k:o}=ml(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],a=t.slice(0,t.length-1),s=ml(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=ml(e,a,Object),s&&s.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},bl=(e,t)=>{const{obj:n,k:r}=ml(e,t);if(n)return n[r]},El=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?dl(e[r])||e[r]instanceof String||dl(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):El(e[r],t[r],n):e[r]=t[r]);return e},wl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Cl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Dl=e=>dl(e)?e.replace(/[&<>"'\/]/g,e=>Cl[e]):e;const Al=[" ",",","?","!",";"],Sl=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),xl=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let e=0;e<r.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let a=e;a<r.length;++a)if(a!==e&&(i+=n),i+=r[a],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<r.length-1)continue;e+=a-e+1;break}o=t}return o},Nl=e=>e&&e.replace("_","-"),Bl={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Ol{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Bl,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(dl(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ol(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Ol(this.logger,e)}}var Tl=new Ol;class kl{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(e=>{let[t,r]=e;for(let e=0;e<r;e++)t(...n)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(t=>{let[r,o]=t;for(let t=0;t<o;t++)r.apply(r,[e,...n])})}}}class Fl extends kl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):dl(n)&&o?a.push(...n.split(o)):a.push(n)));const s=bl(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&i&&dl(n)?xl(this.data&&this.data[e]&&this.data[e][t],n,o):s}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),yl(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const r in n)(dl(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=bl(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?El(s,n,o):s={...s,...n},yl(this.data,a,s),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Il={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))}),t}};const Pl={};class _l extends kl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Tl.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=Al.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=Sl.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:dl(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:dl(o)?[o]:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],t),s=a[a.length-1],u=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(l){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:`${s}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:i}const c=this.resolve(e,t);let d=c&&c.res;const f=c&&c.usedKey||i,p=c&&c.exactUsedKey||i,h=Object.prototype.toString.apply(d),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,m=!dl(d)&&"boolean"!=typeof d&&"number"!=typeof d;if(!(v&&d&&m&&["[object Number]","[object Function]","[object RegExp]"].indexOf(h)<0)||dl(g)&&Array.isArray(d))if(v&&dl(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,t,n));else{let r=!1,a=!1;const l=void 0!==t.count&&!dl(t.count),f=_l.hasDefaultValue(t),p=l?this.pluralResolver.getSuffix(u,t.count,t):"",h=t.ordinal&&l?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",g=l&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),v=g&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(d)&&f&&(r=!0,d=v),this.isValidLookup(d)||(a=!0,d=i);const m=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:d,y=f&&v!==d&&this.options.updateMissing;if(a||r||y){if(this.logger.log(y?"updateKey":"missingKey",u,s,i,y?v:d),o){const e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,n,r)=>{const o=f&&r!==d?r:m;this.options.missingKeyHandler?this.options.missingKeyHandler(e,s,n,o,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,s,n,o,y,t),this.emit("missingKey",e,s,n,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&l?e.forEach(e=>{const n=this.pluralResolver.getSuffixes(e,t);g&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach(n=>{r([e],i+n,t[`defaultValue${n}`]||v)})}):r(e,i,v))}d=this.extendTranslation(d,e,t,c,n),a&&d===i&&this.options.appendNamespaceToMissingKey&&(d=`${s}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${i}`:i,r?d:void 0):this.options.parseMissingKeyHandler(d))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,d,{...t,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(o){const e=Array.isArray(d),n=e?[]:{},r=e?p:f;for(const e in d)if(Object.prototype.hasOwnProperty.call(d,e)){const i=`${r}${o}${e}`;n[e]=this.translate(i,{...t,joinArrays:!1,ns:a}),n[e]===i&&(n[e]=d[e])}d=n}}return r?(c.res=d,c.usedParams=this.getUsedParamsDetails(t),c):d}extendTranslation(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a=dl(e)&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(a){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let u=n.replace&&!dl(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,n.lng||this.language||r.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null):i.translate(...r,t)},n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,s=dl(a)?[a]:a;return null!=e&&s&&s.length&&!1!==n.applyPostProcessor&&(e=Il.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,r,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return dl(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;const s=this.extractFromKey(e,a),u=s.key;n=u;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==a.count&&!dl(a.count),d=c&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),f=void 0!==a.context&&(dl(a.context)||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);l.forEach(e=>{this.isValidLookup(t)||(i=e,!Pl[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(Pl[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(n=>{if(this.isValidLookup(t))return;o=n;const i=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(i,u,n,e,a);else{let e;c&&(e=this.pluralResolver.getSuffix(n,a.count,a));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(i.push(u+e),a.ordinal&&0===e.indexOf(r)&&i.push(u+e.replace(r,this.options.pluralSeparator)),d&&i.push(u+t)),f){const n=`${u}${this.options.contextSeparator}${a.context}`;i.push(n),c&&(i.push(n+e),a.ordinal&&0===e.indexOf(r)&&i.push(n+e.replace(r,this.options.pluralSeparator)),d&&i.push(n+t))}}let s;for(;s=i.pop();)this.isValidLookup(t)||(r=s,t=this.getResource(n,e,s,a))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!dl(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}const Rl=e=>e.charAt(0).toUpperCase()+e.slice(1);class Ll{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Tl.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Nl(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Nl(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(dl(e)&&e.indexOf("-")>-1){if("undefined"!=typeof Intl&&void 0!==Intl.getCanonicalLocales)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(e){}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Rl(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Rl(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Rl(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),dl(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return dl(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):dl(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}let Ml=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],jl={1:e=>Number(e>1),2:e=>Number(1!=e),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)};const Hl=["v1","v2","v3"],zl=["v4"],$l={zero:0,one:1,two:2,few:3,many:4,other:5};class Ul{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Tl.create("pluralResolver"),this.options.compatibilityJSON&&!zl.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const e={};return Ml.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:jl[t.fc]}})}),e})(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi()){const n=Nl("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(n){if(!e.match(/-|_/))return;const r=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(r,t)}return this.pluralRulesCache[o]=i,i}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>$l[e]-$l[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!Hl.includes(this.options.compatibilityJSON)}}const Vl=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=((e,t,n)=>{const r=bl(e,n);return void 0!==r?r:bl(t,n)})(e,t,n);return!i&&o&&dl(n)&&(i=xl(e,n,r),void 0===i&&(i=xl(t,n,r))),i},Wl=e=>e.replace(/\$/g,"$$$$");class Gl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Tl.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:u,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:m}=e.interpolation;this.escape=void 0!==t?t:Dl,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?wl(o):i||"{{",this.suffix=a?wl(a):s||"}}",this.formatSeparator=u||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=d?wl(d):f||wl("$t("),this.nestingSuffix=p?wl(p):h||wl(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(e.indexOf(this.formatSeparator)<0){const o=Vl(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(Vl(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,d=[{regex:this.regexpUnescape,safeValue:e=>Wl(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Wl(this.escape(e)):Wl(e)}];return d.forEach(t=>{for(a=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=u(n),void 0===i)if("function"==typeof l){const t=l(e,o,r);i=dl(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(c){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else dl(i)||this.useRawValueToEscape||(i=pl(i));const s=t.safeValue(i);if(e=e.replace(o[0],s),c?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];o={...i},o=o.replace&&!dl(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),s=e,u=!0}if(r=t(a.call(this,n[1].trim(),o),o),r&&n[0]===e&&!dl(r))return r;dl(r)||(r=pl(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),u&&(r=s.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const ql=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=t[a];return s||(s=e(Nl(r),o),t[a]=s),s(n)}};class Kl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Tl.create("formatter"),this.options=e,this.formats={number:ql((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:ql((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:ql((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:ql((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:ql((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ql(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class Yl extends kl{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Tl.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const o={},i={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=ml(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();dl(e)&&(e=this.languageUtils.toResolveHierarchy(e)),dl(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const s={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let o;o=5===u.length?u(e,t,n,r,s):u(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else u(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}const Xl=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),dl(e[1])&&(t.defaultValue=e[1]),dl(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Zl=e=>(dl(e.ns)&&(e.ns=[e.ns]),dl(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),dl(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Jl=()=>{};class Ql extends kl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=Zl(e),this.services={},this.logger=Tl,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(dl(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Xl();this.options={...r,...this.options,...Zl(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?Tl.init(o(this.modules.logger),this.options):Tl.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=Kl);const n=new Ll(this.options);this.store=new Fl(this.options.resources,this.options);const i=this.services;i.logger=Tl,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new Ul(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=o(t),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Gl(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Yl(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)}),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new _l(this.services,this.options),this.translator.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Jl),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});const i=fl(),a=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),i}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jl;const n=dl(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>r(e))}this.options.preload&&this.options.preload.forEach(e=>r(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,n){const r=fl();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Jl),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Il.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=fl();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=dl(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{i(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const o=function(e,t){let i;if("object"!=typeof t){for(var a=arguments.length,s=new Array(a>2?a-2:0),u=2;u<a;u++)s[u-2]=arguments[u];i=r.options.overloadTranslationOptionHandler([e,t].concat(s))}else i={...t};i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const l=r.options.keySeparator||".";let c;return c=i.keyPrefix&&Array.isArray(e)?e.map(e=>`${i.keyPrefix}${l}${e}`):i.keyPrefix?`${i.keyPrefix}${l}${e}`:e,r.t(c,i)};return dl(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=fl();return this.options.ns?(dl(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=fl();dl(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new Ll(Xl());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Ql(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jl;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new Ql(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));return["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new Fl(this.store.data,r),o.services.resourceStore=o.store),o.translator=new _l(o.services,r),o.translator.on("*",function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit(e,...n)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ec=Ql.createInstance();ec.createInstance=Ql.createInstance,ec.createInstance,ec.dir,ec.init,ec.loadResources,ec.reloadResources,ec.use,ec.changeLanguage,ec.getFixedT,ec.t,ec.exists,ec.setDefaultNamespace,ec.hasLoadedNamespace,ec.loadNamespaces,ec.loadLanguages;var tc="translation";function nc(e,t){ec.addResourceBundle(e,tc,t,!0,!0)}function rc(e){ec.changeLanguage(e)}function oc(e){return ec.getResourceBundle(e,tc)}function ic(e){return ec.on("languageChanged",e),function(){return ec.off("languageChanged",e)}}ec.init({lng:"zh-CN",resources:{}});var ac=ec.t.bind(ec);function sc(e){if(e.removeAttr){e.removeAttr("width"),e.removeAttr("height"),e.removeAttr("fill"),e.removeAttr("class"),e.removeAttr("t"),e.removeAttr("p-id");var t=e.children();t.length&&sc(t)}}function uc(){return Zi('<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>')}function lc(){return Zi('<div class="w-e-bar-divider"></div>')}var cc=function(){function e(e){this.isShow=!1,this.showTime=0,this.record(e)}return e.prototype.record=function(e){var t=mi.get(e);null==t&&(t=new Set,mi.set(e,t)),t.add(this),yi.set(this,e)},e.prototype.renderContent=function(e){var t=this.$elem;t.empty(),t.append(e);var n=this.genSelfElem();n&&t.append(n)},e.prototype.appendTo=function(e){var t=this.$elem;e.append(t)},e.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var e=yi.get(this);e&&e.emit(ai,this)}},e.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var e=yi.get(this);e&&e.emit(si)}},e}(),dc=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.type="dropPanel",t.$elem=Zi('<div class="w-e-drop-panel"></div>'),t}return a(t,e),t.prototype.genSelfElem=function(){return null},t}(cc);function fc(e,t,n,r,o){if(void 0===r&&(r=""),void 0===o&&(o=!1),t){if(r){var i=vs?"cmd":"ctrl";r=r.replace("mod",i)}if(o)r&&(e.attr("data-tooltip",r),e.addClass("w-e-menu-tooltip-v5"),e.addClass("tooltip-right"));else{var a=r?"".concat(n,"\n").concat(r):n;e.attr("data-tooltip",a),e.addClass("w-e-menu-tooltip-v5")}}}var pc=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=Zi('<div class="w-e-bar-item"></div>'),this.$button=Zi('<button type="button"></button>'),this.disabled=!1,this.menu=t;var o=t.tag,i=t.width;if("button"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'button'"));var a=t.title,s=t.hotkey,u=void 0===s?"":s,l=t.iconSvg,c=void 0===l?"":l,d=this.$button;if(c){var f=Zi(c);sc(f),d.append(f)}else d.text(a);fc(d,c,a,u,n),n&&c&&d.append(Zi('<span class="title">'.concat(a,"</span>"))),i&&d.css("width","".concat(i,"px")),d.attr("data-menu-key",e),this.$elem.append(d),Cn(function(){return r.init()})}return e.prototype.init=function(){var e=this;this.setActive(),this.setDisabled(),this.$button.on("click",function(t){t.preventDefault(),Sc(e).hidePanelOrModal(),e.disabled||(e.exec(),e.onButtonClick())})},e.prototype.exec=function(){var e=Sc(this),t=this.menu,n=t.getValue(e);t.exec(e,n),this.changeMenuState()},e.prototype.setActive=function(){var e=Sc(this),t=this.$button,n="active";this.menu.isActive(e)?t.addClass(n):t.removeClass(n)},e.prototype.setDisabled=function(){var e=Sc(this),t=this.$button,n=this.menu.isDisabled(e);(null==e.selection||e.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var r="disabled";n?t.addClass(r):t.removeClass(r),this.disabled=n},e.prototype.setIcon=function(){var e=Sc(this),t=this.$button;if(this.menu.getIcon){var n=this.menu.getIcon(e);if(n){t.find("svg").remove();var r=Zi(n);sc(r),t.append(r)}}},e.prototype.setTooltip=function(){var e=Sc(this),t=this.$button;if(this.menu.getTitle){var n=this.menu.getTitle(e),r=this.menu.iconSvg;n&&r&&fc(t,r,n)}},e.prototype.changeMenuState=function(){this.setActive(),this.setDisabled(),this.setIcon(),this.setTooltip()},e}(),hc=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var i=uc();o.$button.append(i)}return o}return a(t,e),t.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},t.prototype.handleDropPanel=function(){var e=this.menu;if(null!=e.getPanelContentElem){var t=Sc(this);if(null==this.dropPanel){var n=new dc(t),r=e.getPanelContentElem(t);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{var o=this.dropPanel;if(o.isShow)o.hide();else{r=e.getPanelContentElem(t);o.renderContent(r),o.show()}}var i=this.dropPanel;if(i.isShow){var a=this.$elem,s=a.offset().left,u=a.parents(".w-e-bar");s-u.offset().left>=u.width()/2?i.$elem.css({left:"none",right:"0"}):i.$elem.css({left:"0",right:"none"})}}},t}(pc),gc=function(){function e(e){this.$elem=Zi('<div class="w-e-bar-item w-e-bar-item-group"></div>'),this.$container=Zi('<div class="w-e-bar-item-menus-container"></div>'),this.$button=Zi('<button type="button"></button>');var t=e.key,n=e.iconSvg,r=e.title,o=this.$elem,i=this.$button;if(n){var a=Zi(n);sc(a),i.append(a)}else i.text(r);i.attr("data-menu-key",t);var s=uc();i.append(s),o.append(i);var u=this.$container;o.append(u);var l=this.createObserver();this.observe(l)}return e.prototype.appendBarItem=function(e){var t=e.$elem;this.$container.append(t)},e.prototype.observe=function(e){var t=this.$container;e.observe(t[0],{childList:!0,subtree:!0,attributes:!0})},e.prototype.createObserver=function(){var e=this,t=this.$container,n=this.$button,r=new MutationObserver(function(){var o=t.find("button"),i=o.length;if(0!==i){var a=0;o.each(function(e){Zi(e).hasClass("disabled")&&(a+=1)}),r.disconnect(),a===i?n.addClass("disabled"):n.removeClass("disabled"),e.observe(r)}});return r},e}(),vc=function(e){function t(t,n){void 0===n&&(n=0);var r=e.call(this,t)||this;r.type="modal",r.$elem=Zi('<div class="w-e-modal"></div>'),r.width=0,n&&(r.width=n);var o=r.$elem;return o.on("click",function(e){return e.stopPropagation()}),o.on("keyup",function(e){"Escape"===e.code&&(r.hide(),t.restoreSelection())}),r}return a(t,e),t.prototype.genSelfElem=function(){var e=this,t=Zi('<span class="btn-close">'.concat('<svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg>',"</span>")),n=yi.get(this);return t.on("click",function(){e.hide(),null==n||n.restoreSelection()}),t},t.prototype.setStyle=function(e){var t=this.width,n=this.$elem;n.attr("style",""),t&&n.css("width","".concat(t,"px")),n.css(e)},t}(cc);function mc(e,t,n){var r=Zi('<label class="babel-container"></label>');r.append("<span>".concat(e,"</span>"));var o=Zi('<input type="text" id="'.concat(t,'" placeholder="').concat(n||"",'">'));return r.append(o),[r[0],o[0]]}function yc(e,t,n){var r=Zi('<label class="babel-container"></label>');r.append("<span>".concat(e,"</span>"));var o=Zi('<textarea type="text" id="'.concat(t,'" placeholder="').concat(n||"",'"></textarea>'));return r.append(o),[r[0],o[0]]}function bc(e,t){var n=Zi('<div class="button-container"></div>'),r=Zi('<button type="button" id="'.concat(e,'">').concat(t,"</button>"));return n.append(r),[n[0],r[0]]}var Ec=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;return o.$body=Zi("body"),o.modal=null,o.menu=n,o}return a(t,e),t.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},t.prototype.getPosition=function(){var e=Sc(this),t=this.menu.getModalPositionNode(e);return Kn.isElement(t)?ol(e,t,"modal"):rl(e)},t.prototype.handleModal=function(){var e=Sc(this),t=this.menu;if(null==this.modal){var n=new vc(e,t.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else{(n=this.modal).isShow?n.hide():this.renderAndShowModal(n,!1)}},t.prototype.renderAndShowModal=function(e,t){void 0===t&&(t=!1);var n=Sc(this),r=this.menu;if(null!=r.getModalContentElem){var o=Ss.getTextarea(n),i=Ss.getToolbar(n),a=((null==i?void 0:i.getConfig())||{}).modalAppendToBody,s=r.getModalContentElem(n);if(e.renderContent(s),a)e.setStyle({left:"0",right:"0"});else{var u=this.getPosition();e.setStyle(u)}t&&(a?e.appendTo(this.$body):e.appendTo(o.$textAreaContainer)),e.show(),a||il(n,e.$elem),setTimeout(function(){n.blur()})}},t}(pc);var wc=function(e){function t(t,n){var r=e.call(this,t)||this;return r.type="selectList",r.$elem=Zi('<div class="w-e-select-list"></div>'),n&&r.$elem.css("width","".concat(n,"px")),r.$elem.on("click",function(e){e.stopPropagation()}),r}return a(t,e),t.prototype.renderList=function(e){var t=this.$elem;t.empty();var n=Zi("<ul></ul>");e.forEach(function(e){var t=e.value,r=e.text,o=e.selected,i=e.styleForRenderMenuList,a=Zi('<li data-value="'.concat(t,'"></li>'));if(i&&a.css(i),o){var s=Zi('<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>');a.append(s),a.addClass("selected")}a.append(Zi('<span data-value="'.concat(t,'">').concat(r,"</span>"))),a.attr("title",r),n.append(a)}),t.append(n)},t.prototype.genSelfElem=function(){return null},t}(cc);var Cc=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=Zi('<div class="w-e-bar-item"></div>'),this.$button=Zi('<button type="button" class="select-button"></button>'),this.disabled=!1,this.selectList=null;var o=t.tag,i=t.title,a=t.width,s=t.iconSvg,u=void 0===s?"":s,l=t.hotkey,c=void 0===l?"":l;if("select"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'select'"));var d=this.$button;a&&d.css("width","".concat(a,"px")),d.attr("data-menu-key",e),fc(d,u,i,c,n),this.$elem.append(d),this.menu=t,Cn(function(){return r.init()})}return e.prototype.init=function(){var e=this;this.setSelectedValue(),this.$button.on("click",function(t){t.preventDefault(),Sc(e).hidePanelOrModal(),e.trigger()})},e.prototype.trigger=function(){var e=this,t=Sc(this);if(!t.isDisabled()&&!this.disabled){var n=this.menu;if(null==this.selectList){this.selectList=new wc(t,n.selectPanelWidth);var r=this.selectList,o=n.getOptions(t);r.renderList(o),r.appendTo(this.$elem),r.show(),r.$elem.on("click","li",function(t){var n=t.target;if(null!=n){t.preventDefault();var r=Zi(n).attr("data-value");e.onChange(r)}})}else{if((r=this.selectList).isShow)r.hide();else{o=n.getOptions(t);r.renderList(o),r.show()}}}},e.prototype.onChange=function(e){var t=Sc(this),n=this.menu;null!=n.exec&&n.exec(t,e)},e.prototype.setSelectedValue=function(){var e=Sc(this),t=this.menu,n=t.getValue(e),r=function(e,t){for(var n=e.length,r="",o=0;o<n;o+=1){var i=e[o];if(i.value===t){r=i.text;break}}return r}(t.getOptions(e),n.toString()),o=this.$button,i=uc();o.empty(),o.text(r),o.append(i)},e.prototype.setDisabled=function(){var e=Sc(this),t=this.menu.isDisabled(e),n=this.$button;(null==e.selection||e.isDisabled())&&(t=!0);var r="disabled";t?n.addClass(r):n.removeClass(r),this.disabled=t},e.prototype.changeMenuState=function(){this.setSelectedValue(),this.setDisabled()},e}(),Dc=function(e){function t(t,n,r){return void 0===r&&(r=!1),e.call(this,t,n,r)||this}return a(t,e),t.prototype.onButtonClick=function(){},t}(pc),Ac=new WeakMap;function Sc(e){var t=vi.get(e);if(null==t)throw new Error("Can not get editor instance");return t}function xc(e,t,n){void 0===n&&(n=!1);var r=Ac.get(t);if(r)return r;var o=t.tag;if("button"===o){var i=t.showDropPanel,a=t.showModal;r=i?new hc(e,t,n):a?new Ec(e,t,n):new Dc(e,t,n)}if("select"===o&&(r=new Cc(e,t,n)),null==r)throw new Error("Invalid tag in menu ".concat(JSON.stringify(t)));return Ac.set(t,r),r}function Nc(e,t){var n=e.selection;return null!=n&&(!Gn.isCollapsed(n)&&(!Ss.getSelectedElems(e).some(function(t){if(e.isVoid(t))return!0;var n=t.type;return!!["pre","code","table"].includes(n)})&&!!Wr.isText(t)))}var Bc=function(){function e(){var e=this;this.$elem=Zi('<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>'),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=function(){},this.changeHoverbarState=cl(function(){var t=e.isShow,n=e.getSelectedNodeAndMenuKeys()||{},r=n.node,o=void 0===r?null:r,i=n.menuKeys,a=void 0===i?[]:i,s=e.getEditorInstance();if(null!=o&&e.changeItemsState(),o&&Kn.isElement(o)&&t){var u=e.isSamePath(o,e.prevSelectedNode);if(!Pr.isBlock(s,o)&&u)return}e.hideAndClean(),null!=o&&(e.registerItems(a),e.setPosition(o),e.show()),e.prevSelectedNode=o},200),Cn(function(){var t=e.getEditorInstance(),n=e.$elem;n.on("mousedown",function(e){return e.preventDefault()},{passive:!1}),Ss.getTextarea(t).$textAreaContainer.append(n),t.on(ni,e.changeHoverbarState);var r=e.hideAndClean.bind(e);t.on(ri,r),t.on(oi,r),t.on(ii,r)}),this.lngListen=ic(function(){e.menus={},e.hideAndClean(),e.getEditorInstance().deselect()})}return e.prototype.getMenus=function(){return this.menus},e.prototype.hideAndClean=function(){var e=this.$elem;e.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],e.empty(),this.isShow=!1},e.prototype.checkPositionBottom=function(){var e=this.$elem,t=!1,n="undefined"!=typeof window?window.innerHeight:null;n&&n>=360&&(n-e[0].getBoundingClientRect().bottom<360&&(t=!0));t?e.addClass("w-e-bar-bottom"):e.removeClass("w-e-bar-bottom")},e.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},e.prototype.changeItemsState=function(){var e=this;Cn(function(){e.hoverbarItems.forEach(function(e){e.changeMenuState()})})},e.prototype.registerItems=function(e){var t=this,n=this.$elem;e.forEach(function(e){if("|"!==e)t.registerSingleItem(e);else{var r=lc();n.append(r)}})},e.prototype.registerSingleItem=function(e){var t=this.getEditorInstance(),n=this.menus,r=n[e];if(null==r){var o=ui[e];if(null==o)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof o)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));r=o(),n[e]=r}var i=t.getMenuConfig(e);i&&void 0!==i.iconSvg&&(r.iconSvg=i.iconSvg);var a=xc(e,r);this.hoverbarItems.push(a),vi.set(a,t),this.$elem.append(a.$elem)},e.prototype.setPosition=function(e){var t=this.getEditorInstance(),n=this.$elem;if(n.attr("style",""),Kn.isElement(e)){var r=ol(t,e,"bar");return n.css(r),void il(t,n)}if(Wr.isText(e)){r=rl(t);return n.css(r),void il(t,n)}throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},e.prototype.getSelectedNodeAndMenuKeys=function(){var e=this.getEditorInstance();if(null==e.selection)return null;var t=this.getHoverbarKeysConf(),n=null,r=[],o=function(o){var i=t[o],a=i.match,s=i.menuKeys,u=void 0===s?[]:s,l=a||function(e,t){return Ss.checkNodeType(t,o)},c=d(Pr.nodes(e,{match:function(t){return l(e,t)},universal:!0}),1),f=c[0];if(null!=f)return n=f[0],r=u,"break"};for(var i in t){if("break"===o(i))break}return null==n||0===r.length?null:{node:n,menuKeys:r}},e.prototype.getEditorInstance=function(){var e=hi.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.getHoverbarKeysConf=function(){var e=this.getEditorInstance().getConfig().hoverbarKeys,t=void 0===e?{}:e,n=t.text;return n&&null==n.match&&(n.match=Nc),t},e.prototype.isSamePath=function(e,t){if(null==e||null==t)return!1;var n=Ss.findPath(null,e),r=Ss.findPath(null,t);return jn.equals(n,r)},e.prototype.destroy=function(){var e;this.changeHoverbarState.cancel(),this.$elem.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},e}(),Oc=g(fe());function Tc(e,t){return Ra(t)&&Ss.hasDOMNode(e,t,{editable:!0})}function kc(e,t){return Ra(t)&&Ss.hasDOMNode(e,t)}function Fc(e,t){if(Tc(e,t))return!0;if(!kc(e,t))return!1;var n=null;return Ma(t)?n=t:Ha(t)&&(n=t.parentElement),!!(null==n?void 0:n.closest("[data-w-e-reserve]"))||function(e,t){if(e.getConfig().readOnly)return!1;var n=kc(e,t)&&Ss.toSlateNode(e,t);return!!n&&Kn.isElement(n)&&Pr.isVoid(e,n)}(e,t)}const Ic=e=>"object"==typeof e&&null!=e&&1===e.nodeType,Pc=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,_c=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Pc(n.overflowY,t)||Pc(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Rc=(e,t,n,r,o,i,a,s)=>i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0,Lc=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},Mc=(e,t)=>{var n,r,o,i;if("undefined"==typeof document)return[];const{scrollMode:a,block:s,inline:u,boundary:l,skipOverflowHiddenElements:c}=t,d="function"==typeof l?l:e=>e!==l;if(!Ic(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,p=[];let h=e;for(;Ic(h)&&d(h);){if(h=Lc(h),h===f){p.push(h);break}null!=h&&h===document.body&&_c(h)&&!_c(document.documentElement)||null!=h&&_c(h,c)&&p.push(h)}const g=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,{scrollX:m,scrollY:y}=window,{height:b,width:E,top:w,right:C,bottom:D,left:A}=e.getBoundingClientRect(),{top:S,right:x,bottom:N,left:B}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let O="start"===s||"nearest"===s?w-S:"end"===s?D+N:w+b/2-S+N,T="center"===u?A+E/2-B+x:"end"===u?C+x:A-B;const k=[];for(let e=0;e<p.length;e++){const t=p[e],{height:n,width:r,top:o,right:i,bottom:l,left:c}=t.getBoundingClientRect();if("if-needed"===a&&w>=0&&A>=0&&D<=v&&C<=g&&(t===f&&!_c(t)||w>=o&&D<=l&&A>=c&&C<=i))return k;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),S=parseInt(d.borderTopWidth,10),x=parseInt(d.borderRightWidth,10),N=parseInt(d.borderBottomWidth,10);let B=0,F=0;const I="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-x:0,P="offsetHeight"in t?t.offsetHeight-t.clientHeight-S-N:0,_="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,R="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(f===t)B="start"===s?O:"end"===s?O-v:"nearest"===s?Rc(y,y+v,v,S,N,y+O,y+O+b,b):O-v/2,F="start"===u?T:"center"===u?T-g/2:"end"===u?T-g:Rc(m,m+g,g,h,x,m+T,m+T+E,E),B=Math.max(0,B+y),F=Math.max(0,F+m);else{B="start"===s?O-o-S:"end"===s?O-l+N+P:"nearest"===s?Rc(o,l,n,S,N+P,O,O+b,b):O-(o+n/2)+P/2,F="start"===u?T-c-h:"center"===u?T-(c+r/2)+I/2:"end"===u?T-i+x+I:Rc(c,i,r,h,x+I,T,T+E,E);const{scrollLeft:e,scrollTop:a}=t;B=0===R?0:Math.max(0,Math.min(a+B/R,t.scrollHeight-n/R+P)),F=0===_?0:Math.max(0,Math.min(e+F/_,t.scrollWidth-r/_+I)),O+=a-B,T+=e-F}k.push({el:t,top:B,left:F})}return k};function jc(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(Mc(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:o,top:i,left:a}of Mc(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=i-n.top+n.bottom,t=a-n.left+n.right;o.scroll({top:e,left:t,behavior:r})}}function Hc(e){null!=e.selection&&(e.selection=null,e.onChange())}function zc(e,t,n){void 0===n&&(n=!1);var r=t.selection,o=t.getConfig(),i=Ss.findDocumentOrShadowRoot(t).getSelection();if(i&&(!e.isComposing||n)&&t.isFocused()){var a="None"!==i.type;if(r||a){var s=Ni.get(t),u=!1;if(s.contains(i.anchorNode)&&s.contains(i.focusNode)&&(u=!0),a&&u&&r){var l=Ss.toSlateRange(t,i,{exactMatch:!0,suppressThrow:!0});if(l&&Gn.equals(l,r)){var c=!0;if(Gn.isCollapsed(r)){var d=i.anchorNode,f=i.anchorOffset;if(d===s){var p=s.childNodes,h=void 0;(h=p[f])&&h.matches("table")&&(c=!1),(h=p[f-1])&&h.matches("table")&&(c=!1)}}if(c)return}}if(!r||Ss.hasRange(t,r)){e.isUpdatingSelection=!0;var g=null;try{g=r&&Ss.toDOMRange(t,r)}catch(e){g=null}if(g){Gn.isBackward(r)?i.setBaseAndExtent(g.endContainer,g.endOffset,g.startContainer,g.startOffset):i.setBaseAndExtent(g.startContainer,g.startOffset,g.endContainer,g.endOffset);var v=g.startContainer.parentElement;if(!v.closest("[data-slate-spacer]")&&g.getBoundingClientRect){var m=g.getBoundingClientRect.bind(g)();0===m.top&&0===m.right&&0===m.bottom&&0===m.left&&0===m.height&&0===m.width||(v.getBoundingClientRect=g.getBoundingClientRect.bind(g));var y=document.body;if(jc(v,{scrollMode:"if-needed",boundary:o.scroll&&s.parentElement||y,block:"end",behavior:"auto"}),o.scroll){var b=s.parentElement;if(b){var E=function(){var e=g.getBoundingClientRect(),t=b.getBoundingClientRect(),n=e.bottom-t.bottom,r=t.top-e.top;n>0?b.scrollTop+=n+1:r>0&&(b.scrollTop-=r+1)};E(),requestAnimationFrame(E)}}delete v.getBoundingClientRect}}else i.removeAllRanges();setTimeout(function(){g&&ms&&s.focus(),e.isUpdatingSelection=!1})}else t.selection=Ss.toSlateRange(t,i,{exactMatch:!1,suppressThrow:!0})}}}var $c=new WeakMap,Uc=new WeakMap;function Vc(e){var t;try{t=Ss.findDocumentOrShadowRoot(e)}catch(e){return null}var n=t.getSelection();if(!n||n.rangeCount<=0)return null;try{return n.getRangeAt(0).startContainer}catch(e){return null}}var Wc,Gc={};var qc=function(){if(Wc)return Gc;Wc=1,Object.defineProperty(Gc,"__esModule",{value:!0});for(var e="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},n={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:e?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},r={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)r["f"+o]=111+o;function i(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(e){return a(e,t)}),o=function(e){return r.some(function(t){return s(t,e)})};return null==n?o:o(n)}function a(e,o){var i=o&&o.byKey,a={},s=(e=e.replace("++","+add")).split("+"),c=s.length;for(var d in t)a[t[d]]=!1;var f=!0,p=!1,h=void 0;try{for(var g,v=s[Symbol.iterator]();!(f=(g=v.next()).done);f=!0){var m=g.value,y=m.endsWith("?")&&m.length>1;y&&(m=m.slice(0,-1));var b=l(m),E=t[b];if(m.length>1&&!E&&!n[m]&&!r[b])throw new TypeError('Unknown modifier: "'+m+'"');1!==c&&E||(i?a.key=b:a.which=u(m)),E&&(a[E]=!y||null)}}catch(e){p=!0,h=e}finally{try{!f&&v.return&&v.return()}finally{if(p)throw h}}return a}function s(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function u(e){return e=l(e),r[e]||e.toUpperCase().charCodeAt(0)}function l(e){return e=e.toLowerCase(),e=n[e]||e}return Gc.default=i,Gc.isHotkey=i,Gc.isCodeHotkey=function(e,t){return i(e,t)},Gc.isKeyHotkey=function(e,t){return i(e,{byKey:!0},t)},Gc.parseHotkey=a,Gc.compareHotkey=s,Gc.toKeyCode=u,Gc.toKeyName=l,Gc}(),Kc={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},Yc={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Xc={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Zc=function(e){var t=Kc[e],n=Yc[e],r=Xc[e],o=t&&qc.isKeyHotkey(t),i=n&&qc.isKeyHotkey(n),a=r&&qc.isKeyHotkey(r);return function(e){return!(!o||!o(e))||(!!(vs&&i&&i(e))||!(vs||!a||!a(e)))}},Jc={isBold:Zc("bold"),isCompose:Zc("compose"),isMoveBackward:Zc("moveBackward"),isMoveForward:Zc("moveForward"),isDeleteBackward:Zc("deleteBackward"),isDeleteForward:Zc("deleteForward"),isDeleteLineBackward:Zc("deleteLineBackward"),isDeleteLineForward:Zc("deleteLineForward"),isDeleteWordBackward:Zc("deleteWordBackward"),isDeleteWordForward:Zc("deleteWordForward"),isExtendBackward:Zc("extendBackward"),isExtendForward:Zc("extendForward"),isExtendLineBackward:Zc("extendLineBackward"),isExtendLineForward:Zc("extendLineForward"),isItalic:Zc("italic"),isMoveLineBackward:Zc("moveLineBackward"),isMoveLineForward:Zc("moveLineForward"),isMoveWordBackward:Zc("moveWordBackward"),isMoveWordForward:Zc("moveWordForward"),isRedo:Zc("redo"),isSplitBlock:Zc("splitBlock"),isTransposeCharacter:Zc("transposeCharacter"),isUndo:Zc("undo"),isTab:Zc("tab"),isSelectAll:Zc("selectAll")};function Qc(e){e.preventDefault()}var ed={beforeinput:function(e,t,n){var r,o,i=e,a=n.getConfig().readOnly;if(Cs&&!a&&Tc(n,i.target)){null===(r=t.flushDOMSelectionChange)||void 0===r||r.call(t);var s=n.selection,u=i.inputType,l=i.dataTransfer||i.data||void 0;if("insertCompositionText"!==u&&"deleteCompositionText"!==u){if(i.preventDefault(),!u.startsWith("delete")||u.startsWith("deleteBy")){var c=d(i.getTargetRanges(),1)[0];if(c){var f=null;try{f=Ss.toSlateRange(n,c,{exactMatch:!1,suppressThrow:!0})}catch(e){f=null}!f||s&&Gn.equals(s,f)||(co.select(n,f),s=f)}}if(s&&Gn.isExpanded(s)){var p=Ss.getSelectedElems(n),h="table"===p[0].type,g="table-cell"!==p[p.length-1].type;if(h&&g)return;if(u.startsWith("delete")){var v=u.endsWith("Backward")?"backward":"forward";return void Pr.deleteFragment(n,{direction:v})}}if(null==s&&u.startsWith("insert")){var m=Ss.findDocumentOrShadowRoot(n).getSelection();if(m){var y=Ss.toSlateRange(n,m,{exactMatch:!1,suppressThrow:!0});y&&(co.select(n,y),s=y)}if(null==s){try{null===(o=n.restoreSelection)||void 0===o||o.call(n)}catch(e){}s=n.selection}if(null==s){var b=Pr.end(n,[]),E={anchor:b,focus:b};co.select(n,E),s=E}}switch(u){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":Pr.deleteFragment(n);break;case"deleteContent":case"deleteContentForward":Pr.deleteForward(n);break;case"deleteContentBackward":Pr.deleteBackward(n);break;case"deleteEntireSoftLine":Pr.deleteBackward(n,{unit:"line"}),Pr.deleteForward(n,{unit:"line"});break;case"deleteHardLineBackward":Pr.deleteBackward(n,{unit:"block"});break;case"deleteSoftLineBackward":Pr.deleteBackward(n,{unit:"line"});break;case"deleteHardLineForward":Pr.deleteForward(n,{unit:"block"});break;case"deleteSoftLineForward":Pr.deleteForward(n,{unit:"line"});break;case"deleteWordBackward":Pr.deleteBackward(n,{unit:"word"});break;case"deleteWordForward":Pr.deleteForward(n,{unit:"word"});break;case"insertLineBreak":Pr.insertText(n,"\n");break;case"insertParagraph":Pr.insertBreak(n);break;case"insertFromDrop":case"insertFromComposition":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("insertFromComposition"===u&&(t.isComposing=!1,Li.set(n,!0)),"insertFromPaste"===u&&!Ri.get(n))break;"[object DataTransfer]"===An(l)?n.insertData(l):"string"==typeof l&&Pr.insertText(n,l)}}}},blur:function(e,t,n){var r=e,o=t.isUpdatingSelection,i=t.latestElement;if(!n.getConfig().readOnly&&!o&&Tc(n,r.target)){var a=Ss.findDocumentOrShadowRoot(n);if(i!==a.activeElement){var s=r.relatedTarget;if(!(s===Ss.toDOMNode(n,n)||Ma(s)&&s.hasAttribute("data-slate-spacer"))){if(null!=s&&Ra(s)&&Ss.hasDOMNode(n,s)){var u=Ss.toSlateNode(n,s);if(Kn.isElement(u)&&!n.isVoid(u))return}if(ys){var l=a.getSelection();null==l||l.removeAllRanges()}Ii.delete(n)}}}},focus:function(e,t,n){var r=Ss.toDOMNode(n,n),o=Ss.findDocumentOrShadowRoot(n);t.latestElement=o.activeElement,ms&&e.target!==r?r.focus():Ii.set(n,!0)},click:function(e,t,n){if(!n.getConfig().readOnly&&kc(n,e.target)&&Ra(e.target)){var r=Ss.toSlateNode(n,e.target),o=Ss.findPath(n,r);if(Pr.hasPath(n,o))if(Qn.get(n,o)===r){var i=Pr.start(n,o),a=Pr.end(n,o),s=Pr.void(n,{at:i}),u=Pr.void(n,{at:a});if(s&&u&&jn.equals(s[1],u[1])){var l=Pr.range(n,i);co.select(n,l)}}}},compositionstart:function(e,t,n){if(Tc(n,e.target)){Mi.delete(n);var r=n.selection;if(r&&Gn.isCollapsed(r)){var o=Vc(n);if(o){var i=o.textContent||"";$c.set(n,i),Uc.set(n,o)}}r&&Gn.isExpanded(r)&&(Pr.deleteFragment(n),Promise.resolve().then(function(){zc(t,n,!0)})),t.isComposing=!0,function(e,t){var n;t.getConfig().placeholder&&t.isEmpty()&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}(t,n)}},compositionend:function(e,t,n){var r=e;if(Tc(n,r.target)){t.isComposing=!1;var o=!0===Li.get(n);o?(Li.delete(n),Mi.delete(n)):Mi.delete(n);var i=n.selection;if(null!=i){(ws||ms)&&Ss.cleanExposedTexNodeInSelectionBlock(n);for(var a=Gn.isBackward(i)?i.focus:i.anchor,s=d(Pr.node(n,[a.path[0]]),1)[0],u=0;u<a.path.length;u+=1){var l=d(Pr.node(n,a.path.slice(0,u+1)),1)[0];if(Kn.isElement(l)&&((ys||ms)&&"link"===l.type||"code"===l.type)){Ss.setNewKey(s);break}}var c=r.data;if(c&&!o){if(n.getConfig().maxLength){var f=Ss.getLeftLengthOfMaxLength(n);if(f<c.length){var p=Vc(n);p&&p.nodeType===Node.TEXT_NODE&&(p.textContent=$c.get(n)||""),f>0&&Pr.insertText(n,c.slice(0,f)),t.changeViewState()}else Pr.insertText(n,c)}else{var h=Ss.findDocumentOrShadowRoot(n).getSelection();if(h&&function(e,t){if(Gn.isCollapsed(t)){var n=t.anchor,r=t.focus;if([2,3].includes(n.path.length)&&[2,3].includes(r.path.length)&&(0===n.offset||0===r.offset)){var o=Pr.node(e,n.path),i=0===n.offset?n.path:r.path,a=[i[0],i[1]-1];if(0===i[1])return!1;var s=Pr.node(e,a);if(Wr.isText(s[0])&&Wr.isText(o[0]))return!0}}}(n,i)){var g=Ss.toSlateRange(n,h,{exactMatch:!1,suppressThrow:!1});g&&(n.selection=g)}Pr.insertText(n,c)}ys||setTimeout(function(){if(null!=n.selection){var e=Uc.get(n);if(null!=e&&e.nodeType===Node.TEXT_NODE){var t=Vc(n);null!=t&&t.nodeType===Node.TEXT_NODE&&t!==e&&(e.textContent=$c.get(n)||"")}}})}}}},compositionupdate:function(e,t,n){Tc(n,e.target)&&(t.isComposing=!0)},keydown:function(e,t,n){var r=e,o=n.selection;if(!n.getConfig().readOnly&&!t.isComposing&&Tc(n,r.target)){if(function(e,t){var n,r,o=pi.get(e),i=o&&o.getMenus(),a=gi.get(e),u=a&&a.getMenus(),l=s(s({},i),u);try{for(var d=c(Object.keys(l)),f=d.next();!f.done;f=d.next()){var p=l[f.value],h=p.hotkey;if(h&&qc.isHotkey(h,t)&&!p.isDisabled(e)){var g=p.getValue(e);p.exec(e,g)}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}(n,r),Jc.isTab(r))return Qc(r),void n.handleTab();if(Jc.isRedo(r))return Qc(r),void("function"==typeof n.redo&&n.redo());if(Jc.isUndo(r))return Qc(r),void("function"==typeof n.undo&&n.undo());if(Jc.isMoveLineBackward(r))return Qc(r),void co.move(n,{unit:"line",reverse:!0});if(Jc.isMoveLineForward(r))return Qc(r),void co.move(n,{unit:"line"});if(Jc.isExtendLineBackward(r))return Qc(r),void co.move(n,{unit:"line",edge:"focus",reverse:!0});if(Jc.isExtendLineForward(r))return Qc(r),void co.move(n,{unit:"line",edge:"focus"});if(Jc.isMoveBackward(r))return Qc(r),void(o&&Gn.isCollapsed(o)?co.move(n,{reverse:!0}):co.collapse(n,{edge:"start"}));if(Jc.isMoveForward(r))return Qc(r),void(o&&Gn.isCollapsed(o)?co.move(n):co.collapse(n,{edge:"end"}));if(Jc.isMoveWordBackward(r))return Qc(r),o&&Gn.isExpanded(o)&&co.collapse(n,{edge:"focus"}),void co.move(n,{unit:"word",reverse:!0});if(Jc.isMoveWordForward(r))return Qc(r),o&&Gn.isExpanded(o)&&co.collapse(n,{edge:"focus"}),void co.move(n,{unit:"word"});if(Jc.isSelectAll(r))return Qc(r),void n.selectAll();if(Cs){if((ws||ys)&&o&&(Jc.isDeleteBackward(r)||Jc.isDeleteForward(r))&&Gn.isCollapsed(o)){var i=Qn.parent(n,o.anchor.path);Kn.isElement(i)&&Pr.isVoid(n,i)&&Pr.isInline(n,i)&&(r.preventDefault(),co.delete(n,{unit:"block"}))}}else{if(Jc.isBold(r)||Jc.isItalic(r)||Jc.isTransposeCharacter(r))return void Qc(r);if(Jc.isSplitBlock(r))return Qc(r),void(r.shiftKey?Pr.insertText(n,"\n"):Pr.insertBreak(n));if(Jc.isDeleteBackward(r))return Qc(r),void(o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"backward"}):Pr.deleteBackward(n));if(Jc.isDeleteForward(r))return Qc(r),void(o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"forward"}):Pr.deleteForward(n));if(Jc.isDeleteLineBackward(r))return Qc(r),void(o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"backward"}):Pr.deleteBackward(n,{unit:"line"}));if(Jc.isDeleteLineForward(r))return Qc(r),void(o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"forward"}):Pr.deleteForward(n,{unit:"line"}));if(Jc.isDeleteWordBackward(r))return Qc(r),void(o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"backward"}):Pr.deleteBackward(n,{unit:"word"}));Jc.isDeleteWordForward(r)&&(Qc(r),o&&Gn.isExpanded(o)?Pr.deleteFragment(n,{direction:"forward"}):Pr.deleteForward(n,{unit:"word"}))}}},keypress:function(e,t,n){if(!Cs&&!n.getConfig().readOnly&&Tc(n,e.target)){e.preventDefault();var r=e.key;Pr.insertText(n,r)}},copy:function(e,t,n){var r=e;if(Tc(n,r.target)){n.getConfig().readOnly||r.preventDefault();var o=r.clipboardData;if(null!=o){n.setFragmentData(o);var i=n.getConfig().customCopy;i&&i(n,r)}}},cut:function(e,t,n){var r=e,o=n.selection;if(!n.getConfig().readOnly&&(r.preventDefault(),Tc(n,r.target))){var i=r.clipboardData;if(null!=i&&(n.setFragmentData(i),o))if(Gn.isExpanded(o))Pr.deleteFragment(n);else{var a=Qn.parent(n,o.anchor.path);Kn.isElement(a)&&Pr.isVoid(n,a)&&co.delete(n)}}},paste:function(e,t,n){Ri.set(n,!0);var r=e;if(!n.getConfig().readOnly&&Tc(n,r.target)){var o=n.getConfig().customPaste;if(o)if(!1===o(n,r))return Ri.set(n,!1),void r.preventDefault();if(ys||!Cs||function(e){return e.clipboardData&&""!==e.clipboardData.getData("text/plain")&&1===e.clipboardData.types.length}(r)){r.preventDefault();var i=r.clipboardData;null!=i&&n.insertData(i)}}},dragover:function(e,t,n){if(kc(n,e.target)){var r=Ss.toSlateNode(n,e.target);Kn.isElement(r)&&Pr.isVoid(n,r)&&e.preventDefault()}},dragstart:function(e,t,n){var r=e;if(kc(n,r.target)&&!n.getConfig().readOnly){var o=Ss.toSlateNode(n,r.target),i=Ss.findPath(n,o);if(Kn.isElement(o)&&Pr.isVoid(n,o)||Pr.void(n,{at:i,voids:!0})){var a=Pr.range(n,i);co.select(n,a)}var s=r.dataTransfer;if(null!=s)Ss.getSelectedNodeByType(n,"table")||(t.isDraggingInternally=!0,n.setFragmentData(s))}},dragend:function(e,t,n){var r=e;n.getConfig().readOnly||t.isDraggingInternally&&kc(n,r.target)&&(t.isDraggingInternally=!1)},drop:function(e,t,n){var r=e,o=r.dataTransfer;if(!n.getConfig().readOnly&&kc(n,r.target)&&null!=o&&!(Cs&&ys&&o.files.length>0)){r.preventDefault();var i=n.selection,a=Ss.findEventRange(n,r);co.select(n,a),t.isDraggingInternally&&(i&&co.delete(n,{at:i}),t.isDraggingInternally=!1),n.insertData(o),n.isFocused()||n.focus()}}};function td(e){if(nd(e)){for(;e&&nd(e);){e=rd(e).parent}return null!=e?e:null}return e.parentNode}function nd(e){return 11===e.nodeType}function rd(e,t){var n,r,o;const i=e;return null!==(n=i.parent)&&void 0!==n||(i.parent=null!=t?t:null),null!==(r=i.firstChildNode)&&void 0!==r||(i.firstChildNode=e.firstChild),null!==(o=i.lastChildNode)&&void 0!==o||(i.lastChildNode=e.lastChild),i}const od={createElement:function(e,t){return document.createElement(e,t)},createElementNS:function(e,t,n){return document.createElementNS(e,t,n)},createTextNode:function(e){return document.createTextNode(e)},createDocumentFragment:function(){return rd(document.createDocumentFragment())},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){if(nd(e)){let t=e;for(;t&&nd(t);){t=rd(t).parent}e=null!=t?t:e}nd(t)&&(t=rd(t,e)),n&&nd(n)&&(n=rd(n).firstChildNode),e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){nd(t)&&(t=rd(t,e)),e.appendChild(t)},parentNode:td,nextSibling:function(e){var t;if(nd(e)){const n=rd(e),r=td(n);if(r&&n.lastChildNode){const e=Array.from(r.childNodes),o=e.indexOf(n.lastChildNode);return null!==(t=e[o+1])&&void 0!==t?t:null}return null}return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return 1===e.nodeType},isText:function(e){return 3===e.nodeType},isComment:function(e){return 8===e.nodeType},isDocumentFragment:nd};function id(e,t,n,r,o){return{sel:e,data:t,children:n,text:r,elm:o,key:void 0===t?void 0:t.key}}const ad=Array.isArray;function sd(e){return"string"==typeof e||"number"==typeof e||e instanceof String||e instanceof Number}const ud=id("",{},[],void 0,void 0);function ld(e,t){var n,r;const o=e.key===t.key,i=(null===(n=e.data)||void 0===n?void 0:n.is)===(null===(r=t.data)||void 0===r?void 0:r.is),a=e.sel===t.sel,s=!(!e.sel&&e.sel===t.sel)||typeof e.text==typeof t.text;return a&&o&&i&&s}function cd(e,t,n){var r;const o={};for(let i=t;i<=n;++i){const t=null===(r=e[i])||void 0===r?void 0:r.key;void 0!==t&&(o[t]=i)}return o}const dd=["create","update","remove","destroy","pre","post"];function fd(e,t,n){const r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},o=od;for(const t of dd)for(const n of e){const e=n[t];void 0!==e&&r[t].push(e)}function i(e){const t=e.id?"#"+e.id:"",n=e.getAttribute("class"),r=n?"."+n.split(" ").join("."):"";return id(o.tagName(e).toLowerCase()+t+r,{},[],void 0,e)}function a(e){return id(void 0,{},[],void 0,e)}function s(e,t){return function(){if(0===--t){const t=o.parentNode(e);null!==t&&o.removeChild(t,e)}}}function u(e,t){var n,i,a;let s;const l=e.data,c=null==l?void 0:l.hook;null===(n=null==c?void 0:c.init)||void 0===n||n.call(c,e);const d=e.children,f=e.sel;if("!"===f)null!==(i=e.text)&&void 0!==i||(e.text=""),e.elm=o.createComment(e.text);else if(""===f)e.elm=o.createTextNode(e.text);else if(void 0!==f){const n=f.indexOf("#"),i=f.indexOf(".",n),p=n>0?n:f.length,h=i>0?i:f.length,g=-1!==n||-1!==i?f.slice(0,Math.min(p,h)):f,v=null==l?void 0:l.ns,m=void 0===v?o.createElement(g,l):o.createElementNS(v,g,l);for(e.elm=m,p<h&&m.setAttribute("id",f.slice(p+1,h)),i>0&&m.setAttribute("class",f.slice(h+1).replace(/\./g," ")),s=0;s<r.create.length;++s)r.create[s](ud,e);if(!sd(e.text)||ad(d)&&0!==d.length||o.appendChild(m,o.createTextNode(e.text)),ad(d))for(s=0;s<d.length;++s){const e=d[s];null!=e&&o.appendChild(m,u(e,t))}void 0!==c&&(null===(a=c.create)||void 0===a||a.call(c,ud,e),void 0!==c.insert&&t.push(e))}else e.elm=o.createTextNode(e.text);return e.elm}function l(e,t,n,r,i,a){for(;r<=i;++r){const i=n[r];null!=i&&o.insertBefore(e,u(i,a),t)}}function c(e){var t,n;const o=e.data;if(void 0!==o){null===(n=null===(t=null==o?void 0:o.hook)||void 0===t?void 0:t.destroy)||void 0===n||n.call(t,e);for(let t=0;t<r.destroy.length;++t)r.destroy[t](e);if(void 0!==e.children)for(let t=0;t<e.children.length;++t){const n=e.children[t];null!=n&&"string"!=typeof n&&c(n)}}}function d(e,t,n,i){for(var a,u;n<=i;++n){let i;const l=t[n];if(null!=l)if(void 0!==l.sel){c(l),i=r.remove.length+1;const e=s(l.elm,i);for(let t=0;t<r.remove.length;++t)r.remove[t](l,e);const t=null===(u=null===(a=null==l?void 0:l.data)||void 0===a?void 0:a.hook)||void 0===u?void 0:u.remove;void 0!==t?t(l,e):e()}else l.children?(c(l),d(e,l.children,0,l.children.length-1)):o.removeChild(e,l.elm)}}function f(e,t,n){var i,a,s,c,p,h,g,v;const m=null===(i=t.data)||void 0===i?void 0:i.hook;null===(a=null==m?void 0:m.prepatch)||void 0===a||a.call(m,e,t);const y=t.elm=e.elm;if(e===t)return;if(void 0!==t.data||void 0!==t.text&&t.text!==e.text){null!==(s=t.data)&&void 0!==s||(t.data={}),null!==(c=e.data)&&void 0!==c||(e.data={});for(let n=0;n<r.update.length;++n)r.update[n](e,t);null===(g=null===(h=null===(p=t.data)||void 0===p?void 0:p.hook)||void 0===h?void 0:h.update)||void 0===g||g.call(h,e,t)}const b=e.children,E=t.children;void 0===t.text?void 0!==b&&void 0!==E?b!==E&&function(e,t,n,r){let i,a,s,c,p=0,h=0,g=t.length-1,v=t[0],m=t[g],y=n.length-1,b=n[0],E=n[y];for(;p<=g&&h<=y;)null==v?v=t[++p]:null==m?m=t[--g]:null==b?b=n[++h]:null==E?E=n[--y]:ld(v,b)?(f(v,b,r),v=t[++p],b=n[++h]):ld(m,E)?(f(m,E,r),m=t[--g],E=n[--y]):ld(v,E)?(f(v,E,r),o.insertBefore(e,v.elm,o.nextSibling(m.elm)),v=t[++p],E=n[--y]):ld(m,b)?(f(m,b,r),o.insertBefore(e,m.elm,v.elm),m=t[--g],b=n[++h]):(void 0===i&&(i=cd(t,p,g)),a=i[b.key],void 0===a?(o.insertBefore(e,u(b,r),v.elm),b=n[++h]):void 0===i[E.key]?(o.insertBefore(e,u(E,r),o.nextSibling(m.elm)),E=n[--y]):(s=t[a],s.sel!==b.sel?o.insertBefore(e,u(b,r),v.elm):(f(s,b,r),t[a]=void 0,o.insertBefore(e,s.elm,v.elm)),b=n[++h]));h<=y&&(c=null==n[y+1]?null:n[y+1].elm,l(e,c,n,h,y,r)),p<=g&&d(e,t,p,g)}(y,b,E,n):void 0!==E?(void 0!==e.text&&o.setTextContent(y,""),l(y,null,E,0,E.length-1,n)):void 0!==b?d(y,b,0,b.length-1):void 0!==e.text&&o.setTextContent(y,""):e.text!==t.text&&(void 0!==b&&d(y,b,0,b.length-1),o.setTextContent(y,t.text)),null===(v=null==m?void 0:m.postpatch)||void 0===v||v.call(m,e,t)}return function(e,t){let n,s,l;const c=[];for(n=0;n<r.pre.length;++n)r.pre[n]();for(!function(e,t){return e.isElement(t)}(o,e)?function(e,t){return e.isDocumentFragment(t)}(o,e)&&(e=a(e)):e=i(e),ld(e,t)?f(e,t,c):(s=e.elm,l=o.parentNode(s),u(t,c),null!==l&&(o.insertBefore(l,t.elm,o.nextSibling(s)),d(l,[e],0,0))),n=0;n<c.length;++n)c[n].data.hook.insert(c[n]);for(n=0;n<r.post.length;++n)r.post[n]();return t}}function pd(e,t,n){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==n&&void 0!==t)for(let e=0;e<t.length;++e){const n=t[e];if("string"==typeof n)continue;const r=n.data;void 0!==r&&pd(r,n.children,n.sel)}}function hd(e,t,n){let r,o,i,a={};if(void 0!==n?(null!==t&&(a=t),ad(n)?r=n:sd(n)?o=n.toString():n&&n.sel&&(r=[n])):null!=t&&(ad(t)?r=t:sd(t)?o=t.toString():t&&t.sel?r=[t]:a=t),void 0!==r)for(i=0;i<r.length;++i)sd(r[i])&&(r[i]=id(void 0,void 0,void 0,r[i],void 0));return!e.startsWith("svg")||3!==e.length&&"."!==e[3]&&"#"!==e[3]||pd(a,r,e),id(e,a,r,o,void 0)}function gd(e,t){let n;const r=t.elm;let o=e.data.attrs,i=t.data.attrs;if((o||i)&&o!==i){for(n in o=o||{},i=i||{},i){const e=i[n];o[n]!==e&&(!0===e?r.setAttribute(n,""):!1===e?r.removeAttribute(n):120!==n.charCodeAt(0)?r.setAttribute(n,e):58===n.charCodeAt(3)?r.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,e):58===n.charCodeAt(5)?109===n.charCodeAt(1)?r.setAttributeNS("http://www.w3.org/2000/xmlns/",n,e):r.setAttributeNS("http://www.w3.org/1999/xlink",n,e):r.setAttribute(n,e))}for(n in o)n in i||r.removeAttribute(n)}}const vd={create:gd,update:gd};function md(e,t){let n,r;const o=t.elm;let i=e.data.class,a=t.data.class;if((i||a)&&i!==a){for(r in i=i||{},a=a||{},i)i[r]&&!Object.prototype.hasOwnProperty.call(a,r)&&o.classList.remove(r);for(r in a)n=a[r],n!==i[r]&&o.classList[n?"add":"remove"](r)}}const yd={create:md,update:md},bd=/[A-Z]/g;function Ed(e,t){const n=t.elm;let r,o=e.data.dataset,i=t.data.dataset;if(!o&&!i)return;if(o===i)return;o=o||{},i=i||{};const a=n.dataset;for(r in o)r in i||(a?r in a&&delete a[r]:n.removeAttribute("data-"+r.replace(bd,"-$&").toLowerCase()));for(r in i)o[r]!==i[r]&&(a?a[r]=i[r]:n.setAttribute("data-"+r.replace(bd,"-$&").toLowerCase(),i[r]))}const wd={create:Ed,update:Ed};function Cd(e,t,n){if("function"==typeof e)e.call(t,n,t);else if("object"==typeof e)for(let r=0;r<e.length;r++)Cd(e[r],t,n)}function Dd(e,t){const n=e.type,r=t.data.on;r&&r[n]&&Cd(r[n],t,e)}function Ad(e,t){const n=e.data.on,r=e.listener,o=e.elm,i=t&&t.data.on,a=t&&t.elm;let s;if(n!==i){if(n&&r)if(i)for(s in n)i[s]||o.removeEventListener(s,r,!1);else for(s in n)o.removeEventListener(s,r,!1);if(i){const r=t.listener=e.listener||function e(t){Dd(t,e.vnode)};if(r.vnode=t,n)for(s in i)n[s]||a.addEventListener(s,r,!1);else for(s in i)a.addEventListener(s,r,!1)}}}const Sd={create:Ad,update:Ad,destroy:Ad};function xd(e,t){let n,r,o;const i=t.elm;let a=e.data.props,s=t.data.props;if((a||s)&&a!==s)for(n in a=a||{},s=s||{},s)r=s[n],o=a[n],o===r||"value"===n&&i[n]===r||(i[n]=r)}const Nd={create:xd,update:xd},Bd="function"==typeof(null===window||void 0===window?void 0:window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):setTimeout;let Od=!1;function Td(e,t,n){var r;r=()=>{e[t]=n},Bd(()=>{Bd(r)})}function kd(e,t){let n,r;const o=t.elm;let i=e.data.style,a=t.data.style;if(!i&&!a)return;if(i===a)return;i=i||{},a=a||{};const s="delayed"in i;for(r in i)r in a||("-"===r[0]&&"-"===r[1]?o.style.removeProperty(r):o.style[r]="");for(r in a)if(n=a[r],"delayed"===r&&a.delayed)for(const e in a.delayed)n=a.delayed[e],s&&n===i.delayed[e]||Td(o.style,e,n);else"remove"!==r&&n!==i[r]&&("-"===r[0]&&"-"===r[1]?o.style.setProperty(r,n):o.style[r]=n)}const Fd={pre:function(){Od=!1},create:kd,update:kd,destroy:function(e){let t,n;const r=e.elm,o=e.data.style;if(o&&(t=o.destroy))for(n in t)r.style[n]=t[n]},remove:function(e,t){const n=e.data.style;if(!n||!n.remove)return void t();let r;Od||(e.elm.offsetLeft,Od=!0);const o=e.elm;let i=0;const a=n.remove;let s=0;const u=[];for(r in a)u.push(r),o.style[r]=a[r];const l=getComputedStyle(o)["transition-property"].split(", ");for(;i<l.length;++i)-1!==u.indexOf(l[i])&&s++;o.addEventListener("transitionend",e=>{e.target===o&&--s,0===s&&t()})}};function Id(e,t){for(const n of e)null!=n&&!1!==n&&""!==n&&(Array.isArray(n)?Id(n,t):"string"==typeof n||"number"==typeof n||"boolean"==typeof n?t.push(id(void 0,void 0,void 0,String(n),void 0)):t.push(n));return t}function Pd(e,t,...n){const r=Id(n,[]);return"function"==typeof e?e(t,r):1===r.length&&!r[0].sel&&r[0].text?hd(e,t,r[0].text):hd(e,t,r)}var _d=[];var Rd,Ld,Md={};function jd(e,t,n){return Pd(n.isInline(e)?"span":"div",null,t)}function Hd(e,t){var n,r=Ss.findKey(t,e),o=t.isInline(e),i=Pr.isVoid(t,e),a=ds(e.type,r.id),s={id:a,key:r.id,"data-slate-node":"element","data-slate-inline":o},u=e.type,l=e.children,c=void 0===l?[]:l,f=function(e){return Md[e]||jd}(u);n=i?null:c.map(function(n,r){return Vd(n,r,e,t)});var p=f(e,n,t);if(i){s["data-slate-void"]=!0;var h=o?"span":"div",g=d(Qn.texts(e),1),v=d(g[0],1)[0],m=Pd(h,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},Vd(v,0,e,t));p=Pd(h,{style:{position:"relative"}},p,m),Si.set(v,0),xi.set(v,e)}return null==p.data&&(p.data={}),Object.assign(p.data,s),i||o||(p=function(e,t,n){var r=t;return _d.forEach(function(t){r=t(e,r,n)}),r}(e,p,t)),Cn(function(){var n=Ni.get(t),o=null==n?void 0:n.querySelector("#".concat(a));null!=o&&(Oi.set(r,o),Ti.set(e,o),Bi.set(o,e))}),p}function zd(e,t){return void 0===t&&(t=!1),Pd("span",{"data-slate-string":!0},t?"".concat(e,"\n"):e)}function $d(e,t){return void 0===e&&(e=0),void 0===t&&(t=!1),Pd("span",{"data-slate-zero-width":t?"n":"z","data-slate-length":e},"\ufeff",t?Pd("br",null):null)}function Ud(e,t,n){if(null==e.text)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=Ss.findKey(n,e),o=n.getConfig().decorate;if(null==o)throw new Error("Can not get config.decorate");var i,a=Ss.findPath(n,e),s=o([e,a]),u=Wr.decorations(e,s),l=u.map(function(r){var o,i=r.leaf,a=r.position,s=null!==(o=null==a?void 0:a.isLast)&&void 0!==o?o:1===u.length,l=function(e,t,n,r,o){void 0===o&&(o=!1);var i=e.text,a=Ss.findPath(r,t),s=jn.parent(a);if(Pr.isEditor(n))throw new Error("Text node ".concat(JSON.stringify(t)," parent is Editor"));return r.isVoid(n)?$d(Qn.string(n).length):""!==i||n.children[n.children.length-1]!==t||r.isInline(n)||""!==Pr.string(r,s)?""===i?$d():o&&"\n"===i.slice(-1)?zd(i,!0):zd(i):$d(0,!0)}(i,e,t,n,s);return l=function(e,t,n){var r=t;return _d.forEach(function(t){r=t(e,r,n)}),r}(i,l,n),Pd("span",{"data-slate-leaf":!0},l)}),c=(i=r.id,"w-e-text-".concat(i)),d=Pd("span",{"data-slate-node":"text",id:c,key:r.id},l);return Cn(function(){var t=Ni.get(n),o=null==t?void 0:t.querySelector("#".concat(c));null!=o&&(Oi.set(r,o),Ti.set(e,o),Bi.set(o,e))}),d}function Vd(e,t,n,r){return Si.set(e,t),xi.set(e,n),Kn.isElement(e)?Hd(e,r):Ud(e,n,r)}var Wd=function(){if(Ld)return Rd;Ld=1;var e,t="[object Symbol]",n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",a="\\u20d0-\\u20f0",s="\\u2700-\\u27bf",u="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",c="\\ufe0e\\ufe0f",d="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",f="['’]",p="["+o+"]",g="["+d+"]",v="["+i+a+"]",m="\\d+",y="["+s+"]",b="["+u+"]",E="[^"+o+d+m+s+u+l+"]",w="\\ud83c[\\udffb-\\udfff]",C="[^"+o+"]",D="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",S="["+l+"]",x="\\u200d",N="(?:"+b+"|"+E+")",B="(?:"+S+"|"+E+")",O="(?:['’](?:d|ll|m|re|s|t|ve))?",T="(?:['’](?:D|LL|M|RE|S|T|VE))?",k="(?:"+v+"|"+w+")"+"?",F="["+c+"]?",I=F+k+("(?:"+x+"(?:"+[C,D,A].join("|")+")"+F+k+")*"),P="(?:"+[y,D,A].join("|")+")"+I,_="(?:"+[C+v+"?",v,D,A,p].join("|")+")",R=RegExp(f,"g"),L=RegExp(v,"g"),M=RegExp(w+"(?="+w+")|"+_+I,"g"),j=RegExp([S+"?"+b+"+"+O+"(?="+[g,S,"$"].join("|")+")",B+"+"+T+"(?="+[g,S+N,"$"].join("|")+")",S+"?"+N+"+"+O,S+"+"+T,m,P].join("|"),"g"),H=RegExp("["+x+o+i+a+c+"]"),z=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$="object"==typeof h&&h&&h.Object===Object&&h,U="object"==typeof self&&self&&self.Object===Object&&self,V=$||U||Function("return this")(),W=(e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(t){return null==e?void 0:e[t]});function G(e){return H.test(e)}function q(e){return G(e)?function(e){return e.match(M)||[]}(e):function(e){return e.split("")}(e)}var K=Object.prototype.toString,Y=V.Symbol,X=Y?Y.prototype:void 0,Z=X?X.toString:void 0;function J(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&K.call(e)==t}(e))return Z?Z.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}function Q(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(e,t,n)}function ee(e){return null==e?"":J(e)}var te,ne,re=(te=function(e,t,n){return t=t.toLowerCase(),e+(n?function(e){return oe(ee(e).toLowerCase())}(t):t)},function(e){return function(e,t,n){for(var r=-1,o=e?e.length:0;++r<o;)n=t(n,e[r],r,e);return n}(function(e,t){return e=ee(e),void 0===t?function(e){return z.test(e)}(e)?function(e){return e.match(j)||[]}(e):function(e){return e.match(n)||[]}(e):e.match(t)||[]}(function(e){return(e=ee(e))&&e.replace(r,W).replace(L,"")}(e).replace(R,"")),te,"")}),oe=(ne="toUpperCase",function(e){var t=G(e=ee(e))?q(e):void 0,n=t?t[0]:e.charAt(0),r=t?Q(t,1).join(""):e.slice(1);return n[ne]()+r});return Rd=re}(),Gd=g(Wd);var qd=["props","attrs","style","dataset","on","hook","ns"];function Kd(e){var t=e.data,n=void 0===t?{}:t,r=e.children,o=void 0===r?[]:r;Object.keys(n).forEach(function(t){var r,o,i=n[t];if("key"!==t){if(!qd.includes(t)){if(t.startsWith("data-")){var a=t.slice(5);return a=Gd(a),function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.dataset&&(n.dataset={}),Object.assign(n.dataset,t)}(e,((r={})[a]=i,r)),void delete n[t]}!function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.props&&(n.props={}),Object.assign(n.props,t)}(e,(o={},o[t]=i,o)),delete n[t]}}else e.key=i}),o.length>0&&o.forEach(function(e){"string"!=typeof e&&Kd(e)})}function Yd(e,t){var n,r,o=e.$scroll,i=(n=e.id,"w-e-textarea-".concat(n)),a=t.getConfig(),s=a.readOnly,u=a.autoFocus,l=function(e,t){return void 0===t&&(t=!1),hd("div#".concat(e),{props:{contentEditable:!t}})}(i,s),c=t.children||[];l.children=c.map(function(e,n){if(Di.has(e)){var r=Di.get(e);if(r){var o=d(r,2),i=o[0],a=o[1];if(a)return i!==n&&(Si.set(e,n),Di.set(e,[n,a])),a}}var s=Vd(e,n,t,t);Kd(s);var u=t.getConfig().skipCacheTypes,l=void 0===u?["list-item"]:u;return Kn.isElement(e)&&l.includes(e.type)||Di.set(e,[n,s]),s});var f,p=Ei.get(e);if(null==p&&(p=!0),p){var h=function(e){return Zi('<div\n id="'.concat(e,'"\n data-slate-editor\n data-slate-node="value"\n suppressContentEditableWarning\n role="textarea"\n spellCheck="true"\n autoCorrect="true"\n autoCapitalize="true"\n ></div>'))}(i);o.append(h),e.$textArea=h,r=h[0],Ni.set(t,r),Ti.set(t,r),Bi.set(r,t),(v=fd([yd,Nd,Fd,wd,Sd,vd]))(r,l),Ei.set(e,!1),wi.set(e,v)}else{var g=Ci.get(e),v=wi.get(e);if(null==g||null==v)return;r=g.elm,v(g,l)}if(null==r){var m=o[0];if(r=(null==m?void 0:m.querySelector("#".concat(i)))||function(e){var t,n,r;return null!==(t=window&&window.document.getElementById(e))&&void 0!==t?t:window&&(null===(r=null===(n=window.document.activeElement)||void 0===n?void 0:n.shadowRoot)||void 0===r?void 0:r.getElementById(e))||null}(i),null==r)return}if((p?u:t.isFocused())&&r.focus({preventScroll:!0}),p){var y=(f=r)&&f.ownerDocument&&f.ownerDocument.defaultView||null;y&&Fi.set(t,y)}Ni.set(t,r),Ti.set(t,r),Bi.set(r,t),Ci.set(e,l)}var Xd=1,Zd=function(){function e(e){var t=this;this.selectionChangeRoot=null,this.destroyed=!1,this.id=Xd++,this.$textArea=null,this.$progressBar=Zi('<div class="w-e-progress-bar"></div>'),this.$maxLengthInfo=Zi('<div class="w-e-max-length-info"></div>'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=Oc(function(e){var n=Ma(null==e?void 0:e.target)?e.target:null,r=null==n?void 0:n.tagName;if("INPUT"!==r&&"TEXTAREA"!==r){var o=t.getActiveEditor();null!=o&&function(e,t){var n=e.isComposing,r=e.isUpdatingSelection,o=e.isDraggingInternally,i=t.getConfig();if(!r&&!o){var a=Ss.findDocumentOrShadowRoot(t),s=a.activeElement,u=Ss.toDOMNode(t,t),l=a.getSelection();if(s!==u)return Ii.delete(t),void Hc(t);if(e.latestElement=s,Ii.set(t,!0),!l)return Hc(t);var c=l.anchorNode,d=l.focusNode,f=Fc(t,c),p=kc(t,d);if(!n)if(f&&p){var h=Ss.toSlateRange(t,l,{exactMatch:!1,suppressThrow:!0});h&&co.select(t,h)}else i.readOnly&&Hc(t)}}(t,o)}},100);var n=Zi(e);if(0===n.length)throw new Error("Cannot find textarea DOM by selector '".concat(e,"'"));this.$box=n;var r=Zi('<div class="w-e-text-container"></div>');r.append(this.$progressBar),r.append(this.$maxLengthInfo),n.append(r);var o=Zi('<div class="w-e-scroll"></div>');r.append(o),this.$scroll=o,this.$textAreaContainer=r,Cn(function(){var e=t.getActiveEditor();if(null!=e){t.bindSelectionChange(e),r.on("click",function(){return e.hidePanelOrModal()}),e.on(ni,t.changeViewState.bind(t));var o=e.getConfig(),i=o.onChange,a=o.scroll;i&&e.on(ni,function(){return i(e)}),a||(n.css("position","relative"),r.addClass("no-scroll")),t.onFocusAndOnBlur(),e.on(ni,t.changeMaxLengthInfo.bind(t)),t.bindEvent()}})}return Object.defineProperty(e.prototype,"editorInstance",{get:function(){var e=di.get(this);if(null==e)throw new Error("Can not get editor instance");return e},enumerable:!1,configurable:!0}),e.prototype.getActiveEditor=function(){if(this.destroyed)return null;var e=di.get(this);return null==e||e.isDestroyed?null:e},e.prototype.bindSelectionChange=function(e,t){var n=this;if(void 0===t&&(t=5),null==this.selectionChangeRoot&&!e.isDestroyed){try{var r=Ss.findDocumentOrShadowRoot(e);r.addEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=r}catch(r){if(t>0)return void setTimeout(function(){return n.bindSelectionChange(e,t-1)},0);window.document.addEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=window.document}e.on(ti,function(){var e;null===(e=n.selectionChangeRoot)||void 0===e||e.removeEventListener("selectionchange",n.onDOMSelectionChange),n.selectionChangeRoot=null})}},e.prototype.flushDOMSelectionChange=function(){this.onDOMSelectionChange.flush()},e.prototype.bindEvent=function(){var e=this,t=this.$textArea,n=this.$scroll,r=this.editorInstance;null!=t&&(En(ed,function(n,o){t.on(o,function(t){n(t,e,r)})}),r.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",Oc(function(){r.emit(ri)},100))))},e.prototype.onFocusAndOnBlur=function(){var e=this,t=this.getActiveEditor();if(null!=t){var n=t.getConfig(),r=n.onBlur,o=n.onFocus;this.latestEditorSelection=t.selection,t.on(ni,function(){null==e.latestEditorSelection&&null!=t.selection?setTimeout(function(){e.destroyed||t.isDestroyed||o&&o(t)}):null!=e.latestEditorSelection&&null==t.selection&&setTimeout(function(){e.destroyed||t.isDestroyed||r&&r(t)}),e.latestEditorSelection=t.selection})}},e.prototype.changeMaxLengthInfo=function(){var e=this.getActiveEditor();if(null!=e){var t=e.getConfig().maxLength;if(t){var n=t-Ss.getLeftLengthOfMaxLength(e);this.$maxLengthInfo[0].innerHTML="".concat(n,"/").concat(t)}}},e.prototype.changeProgress=function(e){var t=this.$progressBar;t.css("width","".concat(e,"%")),e>=100&&setTimeout(function(){t.hide(),t.css("width","0"),t.show()},1e3)},e.prototype.changeViewState=function(){var e=this,t=this.getActiveEditor();null!=t&&(Yd(this,t),function(e,t){var n,r=t.getConfig().placeholder;if(r){var o=t.isEmpty();if(o&&!e.showPlaceholder&&!e.isComposing){if(null==e.$placeholder){var i=Zi('<div class="w-e-text-placeholder">'.concat(r,"</div>"));e.$textAreaContainer.append(i),e.$placeholder=i}return e.$placeholder.show(),void(e.showPlaceholder=!0)}!o&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}}(this,t),Cn(function(){e.destroyed||t.isDestroyed||zc(e,t)}))},e.prototype.destroy=function(){var e;this.destroyed=!0,this.onDOMSelectionChange.cancel(),null===(e=this.selectionChangeRoot)||void 0===e||e.removeEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=null,this.$textAreaContainer.remove()},e}();function Jd(e,t,n,r){if(Si.set(e,t),xi.set(e,n),Kn.isElement(e)){var o=e.children;if((void 0===o?[]:o).forEach(function(t,n){return Jd(t,n,e,r)}),Pr.isVoid(r,e)){var i=d(Qn.texts(e),1),a=d(i[0],1)[0];Si.set(a,0),xi.set(a,e)}}}function Qd(e){var t=e.selector,n=void 0===t?"":t,r=e.config,o=void 0===r?{}:r,i=e.content,a=e.html,u=e.plugins,l=void 0===u?[]:u,c=function(e){return[Uu,Su,ji,Du,ul,$u,el,Zu].reduce(function(e,t){return t(e)},e)}(Vo());if(n&&function(e,t){return ls(e,"data-w-e-textarea",t)}(c,n))throw new Error("Repeated create editor by selector '".concat(n,"'"));var d=function(e){void 0===e&&(e={});var t=qo(Qo),n={},r=e.MENU_CONF,o=void 0===r?{}:r;return En(t,function(e,t){n[t]=s(s({},e),o[t]||{})}),delete e.MENU_CONF,s({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:n,hoverbarKeys:{},textStyleMode:"inline",classStylePolicy:"preserve-data",sanitizeHtml:Jo,customAlert:function(e,t){window.alert("".concat(t,":\n").concat(e))}},e)}(o);bi.set(c,d);var f=d.hoverbarKeys,p=void 0===f?{}:f;if(l.forEach(function(e){c=e(c)}),function(e,t){var n=t.html,r=t.content;null!=n?e.children=cs(e,n):r&&r.length&&(e.children=r),0===e.children.length&&(e.children=[{type:"paragraph",children:[{text:""}]}])}(c,{html:a,content:i}),n){var h=new Zd(n);ci.set(c,h),di.set(h,c),h.changeViewState();var g=void 0;Object.keys(p).length>0&&(g=new Bc,hi.set(g,c),gi.set(c,g)),c.on(ni,function(){c.hidePanelOrModal()}),c.on(ri,function(){c.hidePanelOrModal()})}else c.children.forEach(function(e,t){return Jd(e,t,c,c)});var v=d.onCreated,m=d.onDestroyed;return v&&c.on(ei,function(){return v(c)}),m&&c.on(ti,function(){return m(c)}),Cn(function(){return c.emit(ei)}),c}var ef=function(){function e(e,t){var n=this;this.$toolbar=Zi('<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>'),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=function(){},this.syncToolbarState=function(){n.toolbarItems.forEach(function(e){e.changeMenuState()})},this.changeToolbarState=cl(function(){n.syncToolbarState()},200),this.config=t;var r=Zi(e);if(0===r.length)throw new Error("Cannot find toolbar DOM by selector '".concat(e,"'"));this.$box=r;var o=this.$toolbar;o.on("mousedown",function(e){return e.preventDefault()},{passive:!1}),r.append(o),Cn(function(){n.initToolbar(),n.lngListen=ic(function(){return n.initToolbar()});var e=n.getEditorInstance();e.on(ni,n.changeToolbarState),e.on(oi,n.syncToolbarState),e.on(ii,n.syncToolbarState)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.getConfig=function(){return this.config},e.prototype.initToolbar=function(){this.menus={};var e=this.$toolbar;null==e||e.empty(),this.registerItems(),this.changeToolbarState()},e.prototype.registerItems=function(){var e=this,t="",n=this.$toolbar,r=this.config,o=r.toolbarKeys,i=void 0===o?[]:o,a=r.insertKeys,s=void 0===a?{index:0,keys:[]}:a,u=r.excludeKeys,l=void 0===u?[]:u,c=qo(i),d=[];d=Array.isArray(s)?s:[s];var f=0;d.forEach(function(e){var t=e.index+f;if(e.replaceFn&&c[t]){var n=e.replaceFn(c[t]);if(!n)throw new Error("This function needs to return the menu configuration: IToolbarMenuKey");c[t]=n}e.keys.length>0&&("string"==typeof e.keys&&(e.keys=[e.keys]),e.keys.forEach(function(e,n){c.splice(t+n,0,e)}),f+=e.keys.length)});var p=c.filter(function(e){var t="string"==typeof e?e:e.key;return!l.includes(t)}),h=p.length;p.forEach(function(r,o){if("|"===r){if(0===o)return;if(o+1===h)return;if("|"===t)return;var i=lc();return n.append(i),void(t=r)}return"string"==typeof r?(e.registerSingleItem(r,e),void(t=r)):e.isMenuGroup(r)?(e.registerGroup(r),void(t="group")):(e.registerSingleMenuByConf(r),void(t=r.key))})},e.prototype.isMenuGroup=function(e){return"string"!=typeof e&&Array.isArray(e.menuKeys)},e.prototype.registerSingleMenuByConf=function(e){var t=e.key,n=e.title,r=e.iconSvg;this.registerSingleItem(t,this,{title:n,iconSvg:r})},e.prototype.registerGroup=function(e){var t=this,n=this.$toolbar,r=function(e){return new gc(e)}(e),o=e.menuKeys,i=void 0===o?[]:o,a=this.config.excludeKeys,s=void 0===a?[]:a;i.forEach(function(e){s.includes(e)||t.registerSingleItem(e,r)}),n.append(r.$elem)},e.prototype.registerSingleItem=function(e,t,n){void 0===n&&(n={});var r=this.getEditorInstance(),o=t instanceof gc,i=this.menus,a=i[e];if(null==a){var s=ui[e];if(null==s)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof s)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));a=s(),i[e]=a}else console.warn("Duplicated toolbar menu key '".concat(e,"'\n重复注册了菜单栏 menu '").concat(e,"'"));var u=r.getMenuConfig(e);u&&void 0!==u.iconSvg&&(a.iconSvg=u.iconSvg),void 0!==n.iconSvg&&(a.iconSvg=n.iconSvg),void 0!==n.title&&(a.title=n.title);var l=xc(e,a,o);(this.toolbarItems.push(l),vi.set(l,r),o)?t.appendBarItem(l):t.$toolbar.append(l.$elem)},e.prototype.getEditorInstance=function(){var e=fi.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.destroy=function(){var e;this.$toolbar.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.toolbarItems=[]},e}();function tf(e,t){if(null==e)throw new Error("Cannot create toolbar, because editor is null");var n=t.selector,r=t.config,o=void 0===r?{}:r;if(function(e,t){return ls(e,"data-w-e-toolbar",t)}(e,n))throw new Error("Repeated create toolbar by selector '".concat(n,"'"));var i=s({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},o||{}),a=new ef(n,i);return fi.set(a,e),pi.set(e,a),a}function nf(e){return e&&"class"===e.getConfig().textStyleMode?"class":"inline"}function rf(e){if(!e)return"preserve-data";var t=e.getConfig().classStylePolicy;return"fallback-inline"===t?"fallback-inline":"strict"===t?"strict":"preserve-data"}function of(e,t){var n=null==e?void 0:e.getConfig().onClassStyleUnsupported;n?n(t):console.warn(t.message)}nc("en",{editor:{more:"More",justify:"Justify",indent:"Indent",image:"Image",video:"Video"}}),nc("zh-CN",{editor:{more:"更多",justify:"对齐",indent:"缩进",image:"图片",video:"视频"}});nc("en",{common:{ok:"OK",delete:"Delete",enter:"Enter"},blockQuote:{title:"Quote"},codeBlock:{title:"Code block",copy:"Copy",copied:"Copied",copyFailed:"Copy failed"},color:{color:"Font color",bgColor:"Back color",default:"Default color",clear:"Clear back color"},divider:{title:"Divider"},emotion:{title:"Emotion"},fontSize:{title:"Font size",default:"Default"},fontFamily:{title:"Font family",default:"Default"},fullScreen:{title:"Full screen",cancelTitle:"Cancel full screen"},header:{title:"Header",text:"Text"},image:{netImage:"Net image",delete:"Delete image",edit:"Edit image",editSize:"Edit size",preview:"Preview image",viewLink:"View link",src:"Image src",desc:"Description",link:"Image link",ok:"Ok",width:"Width",height:"Height"},indent:{decrease:"Decrease",increase:"Increase"},justify:{left:"Left",right:"Right",center:"Center",justify:"Justify"},lineHeight:{title:"Line height",default:"Default"},link:{insert:"Insert link",text:"Link text",url:"Link source",unLink:"Unlink",edit:"Edit link",view:"View link"},textStyle:{bold:"Bold",clear:"Clear styles",code:"Inline code",italic:"Italic",sub:"Sub",sup:"Sup",through:"Through",underline:"Underline"},undo:{undo:"undo",redo:"Redo"},todo:{todo:"Todo"},formatPainter:{title:"Format Painter"}}),nc("zh-CN",{common:{ok:"确定",delete:"删除",enter:"回车"},blockQuote:{title:"引用"},codeBlock:{title:"代码块",copy:"复制",copied:"已复制",copyFailed:"复制失败"},color:{color:"文字颜色",bgColor:"背景色",default:"默认颜色",clear:"清除背景色"},divider:{title:"分割线"},emotion:{title:"表情"},fontSize:{title:"字号",default:"默认字号"},fontFamily:{title:"字体",default:"默认字体"},fullScreen:{title:"全屏",cancelTitle:"取消全屏"},header:{title:"标题",text:"正文"},image:{netImage:"网络图片",delete:"删除图片",edit:"编辑图片",editSize:"修改尺寸",preview:"预览图片",viewLink:"查看链接",src:"图片地址",desc:"图片描述",link:"图片链接",ok:"确定",width:"宽度",height:"高度"},indent:{decrease:"减少缩进",increase:"增加缩进"},justify:{left:"左对齐",right:"右对齐",center:"居中对齐",justify:"两端对齐"},lineHeight:{title:"行高",default:"默认行高"},link:{insert:"插入链接",text:"链接文本",url:"链接地址",unLink:"取消链接",edit:"修改链接",view:"查看链接"},textStyle:{bold:"粗体",clear:"清除格式",code:"行内代码",italic:"斜体",sub:"下标",sup:"上标",through:"删除线",underline:"下划线"},undo:{undo:"撤销",redo:"重做"},todo:{todo:"待办"},formatPainter:{title:"格式刷"}});var af={type:"blockquote",elemToHtml:function(e,t){return"<blockquote>".concat(t,"</blockquote>")}},sf='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',uf='<svg viewBox="0 0 1024 1024"><path d="M924.402464 1023.068211H0.679665V99.345412h461.861399v98.909208H99.596867v725.896389h725.896389V561.206811h98.909208z" p-id="10909"></path><path d="M930.805104 22.977336l69.965436 69.965436-453.492405 453.492404-69.965435-69.901489z" p-id="10910"></path><path d="M1022.464381 304.030081h-98.917201V99.345412H709.230573V0.428211h313.233808z"></path></svg>',lf='<svg viewBox="0 0 1024 1024"><path d="M133.705143 335.433143V133.851429h201.581714a29.622857 29.622857 0 0 0 29.622857-29.549715V68.754286a29.622857 29.622857 0 0 0-29.622857-29.622857H61.732571A22.893714 22.893714 0 0 0 38.765714 62.025143V335.725714c0 16.310857 13.238857 29.622857 29.622857 29.622857h35.547429a29.842286 29.842286 0 0 0 29.696-29.842285zM690.980571 133.851429h201.581715v201.654857c0 16.310857 13.238857 29.549714 29.622857 29.549714h35.547428a29.622857 29.622857 0 0 0 29.549715-29.549714V61.952a22.893714 22.893714 0 0 0-22.820572-22.893714h-273.554285a29.622857 29.622857 0 0 0-29.549715 29.622857v35.547428c0 16.310857 13.238857 29.696 29.622857 29.696zM335.286857 892.781714H133.705143V691.2a29.622857 29.622857 0 0 0-29.622857-29.622857H68.534857a29.622857 29.622857 0 0 0-29.549714 29.622857v273.554286c0 12.653714 10.24 22.893714 22.820571 22.893714h273.554286a29.622857 29.622857 0 0 0 29.696-29.622857v-35.547429a29.769143 29.769143 0 0 0-29.769143-29.696z m557.348572-201.581714v201.581714H690.907429a29.622857 29.622857 0 0 0-29.622858 29.622857v35.547429c0 16.310857 13.238857 29.622857 29.622858 29.622857h273.554285c12.580571 0 22.893714-10.313143 22.893715-22.893714V691.2a29.622857 29.622857 0 0 0-29.622858-29.622857h-35.547428a29.622857 29.622857 0 0 0-29.696 29.622857z"></path></svg>',cf=function(){function e(){this.title=ac("blockQuote.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M894.6 907.1H605.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C752.7 180.4 711.3 315.8 711.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z m-472 0H133.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C280.7 180.4 239.3 315.8 239.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!!Ss.getSelectedNodeByType(e,"blockquote")},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=d(Pr.nodes(e,{match:function(e){var t=Ss.getNodeType(e);return"paragraph"===t||"blockquote"===t},universal:!0,mode:"highest"}),1);return!t[0]},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=this.isActive(e)?"paragraph":"blockquote";co.setNodes(e,{type:n},{mode:"highest"})}},e}(),df={key:"blockquote",factory:function(){return new cf}};function ff(e){return 0===Zi("<div>".concat(e,"</div>")).children().filter(function(e){return"BR"!==e.tagName}).length}function pf(e){return 0===e.length?"":e[0].outerHTML}function hf(e){return e.length?e[0].tagName.toLowerCase():""}function gf(e,t){for(var n="",r=(e.attr("style")||"").split(";"),o=r.length,i=0;i<o;i+=1){var a=r[i];if(a){var s=a.split(":");s[0].trim()===t&&(n=s[1].trim())}}return n}function vf(e,t){return!!Wr.isText(e)||!!t.isInline(e)}pa&&(Zi.fn.css=pa),ba&&(Zi.fn.append=ba),Ea&&(Zi.fn.prepend=Ea),Ji&&(Zi.fn.addClass=Ji),Qi&&(Zi.fn.removeClass=Qi),ea&&(Zi.fn.hasClass=ea),aa&&(Zi.fn.on=aa),sa&&(Zi.fn.off=sa),Ta&&(Zi.fn.focus=Ta),ta&&(Zi.fn.attr=ta),na&&(Zi.fn.removeAttr=na),da&&(Zi.fn.hide=da),fa&&(Zi.fn.show=fa),Ca&&(Zi.fn.parents=Ca),oa&&(Zi.fn.dataset=oa),ia&&(Zi.fn.val=ia),ma&&(Zi.fn.text=ma),va&&(Zi.fn.html=va),Aa&&(Zi.fn.children=Aa),Sa&&(Zi.fn.remove=Sa),Da&&(Zi.fn.find=Da),ua&&(Zi.fn.width=ua),la&&(Zi.fn.height=la),ga&&(Zi.fn.filter=ga),xa&&(Zi.fn.empty=xa);var mf={selector:"blockquote:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=Zi(e),o=[];return t.forEach(function(e,r){vf(e,n)?o.push(e):Kn.isElement(e)&&(o.push.apply(o,f([],d(function(e,t){var n=e.children.filter(function(e){return vf(e,t)});if(n.length>0)return n;var r=Qn.string(e);return r?[{text:r}]:[]}(e,n)),!1)),function(e,t,n){for(var r=t+1;r<e.length;r+=1){var o=e[r];if(Kn.isElement(o)&&!n.isInline(o))return!0}return!1}(t,r,n)&&function(e){var t=e[e.length-1];Wr.isText(t)&&t.text.endsWith("\n")||e.push({text:"\n"})}(o))}),0===(t=o).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"blockquote",children:t}}};function yf(e){e.deleteBackward("character");co.insertNodes(e,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}var bf={type:"blockquote",renderElem:function(e,t,n){return Pd("blockquote",null,t)}},Ef={renderElems:[bf],elemsToHtml:[af],parseElemsHtml:[mf],menus:[df],editorPlugin:function(e){var t=e.insertBreak,n=e.insertText,r=e;return r.insertBreak=function(){var o=r.selection;if(null==o)return t();var i=d(Pr.nodes(e,{match:function(e){return Ss.checkNodeType(e,"blockquote")},universal:!0}),1),a=i[0];if(!a)return t();var s=a[0];if(Ss.getParentNode(e,s)){var u=Ss.findPath(e,s),l=Pr.end(e,u);if(Mr.equals(l,o.focus)){var c=Pr.last(e,l.path),f=Qn.string(c[0]);if(f&&"\n"===f.slice(-1))return void yf(r)}n("\n")}else yf(r)},r}};var wf={type:"code",elemToHtml:function(e,t){return"<code>".concat(t,"</code>")}};var Cf={type:"pre",elemToHtml:function(e,t){return"<pre>".concat(t,"</pre>")}},Df=function(){function e(){this.title=ac("codeBlock.title"),this.iconSvg='<svg viewBox="0 0 1280 1024"><path d="M832 736l96 96 320-320L928 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224zM701.312 150.528l69.472 18.944-192 704.032-69.472-18.944 192-704.032z"></path></svg>',this.tag="button"}return e.prototype.getSelectCodeElem=function(e){var t=Ss.getSelectedNodeByType(e,"code");if(null==t)return null;var n=Ss.getParentNode(e,t);return null==n||"pre"!==Ss.getNodeType(n)?null:t},e.prototype.getValue=function(e){var t=this.getSelectCodeElem(e);if(null==t){var n=e.getMenuConfig("codeSelectLang").codeLangs,r=(void 0===n?[]:n).find(function(e){return e.selected});return(null==r?void 0:r.value)||""}return t.language||""},e.prototype.isActive=function(e){return!!this.getSelectCodeElem(e)},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=Ss.getSelectedElems(e);return!!t.some(function(t){return e.isVoid(t)})||!t.some(function(e){var t=Ss.getNodeType(e);return"pre"===t||"paragraph"===t})},e.prototype.exec=function(e,t){this.isActive(e)?this.changeToPlainText(e):this.changeToCodeBlock(e,t.toString())},e.prototype.changeToPlainText=function(e){var t=this.getSelectCodeElem(e);if(null!=t){var n=Qn.string(t);co.removeNodes(e,{mode:"highest"});var r=n.split("\n").map(function(e){return{type:"paragraph",children:[{text:e}]}});co.insertNodes(e,r,{mode:"highest"})}},e.prototype.changeToCodeBlock=function(e,t){var n,r,o=[],i=Pr.nodes(e,{match:function(t){return e.children.includes(t)},universal:!0});try{for(var a=c(i),s=a.next();!s.done;s=a.next()){var u=d(s.value,1)[0];u&&o.push(Qn.string(u))}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}co.removeNodes(e,{mode:"highest"});var l={type:"pre",children:[{type:"code",language:t,children:[{text:o.join("\n")}]}]};co.insertNodes(e,l,{mode:"highest"})},e}();var Af={selector:"pre:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=Zi(e);return 0===(t=t.filter(function(e){return"code"===Ss.getNodeType(e)})).length&&(t=[{type:"code",language:"",children:[{text:r[0].textContent||""}]}]),{type:"pre",children:t.filter(function(e){return"code"===Ss.getNodeType(e)})}}};function Sf(e){var t=document.createElement("textarea");t.value=e,t.setAttribute("readonly","readonly"),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",document.body.appendChild(t),t.select(),t.setSelectionRange(0,t.value.length);var n=document.execCommand("copy");return document.body.removeChild(t),n}function xf(e){return u(this,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:if(""===e)return[2,!0];n.label=1;case 1:return n.trys.push([1,4,,5]),"undefined"!=typeof navigator&&(null===(t=navigator.clipboard)||void 0===t?void 0:t.writeText)?[4,navigator.clipboard.writeText(e)]:[3,3];case 2:return n.sent(),[2,!0];case 3:return[3,5];case 4:return n.sent(),[3,5];case 5:try{return[2,Sf(e)]}catch(e){return[2,!1]}return[2]}})})}var Nf={type:"pre",renderElem:function(e,t,n){var r=this,o=(n.getMenuConfig("codeBlock")||{}).showCopyButton;if(!(void 0!==o&&o))return Pd("pre",null,t);var i=function(e){var t=e.children;return(void 0===t?[]:t).map(function(e){return(e.children||[]).map(function(e){return e.text||""}).join("")}).join("\n")}(e),a=ac("codeBlock.copy"),s=ac("codeBlock.copied"),c=ac("codeBlock.copyFailed"),d=Pd("pre",{className:"w-e-code-block"},Pd("button",{className:"w-e-code-block-copy-button",contentEditable:!1,on:{mousedown:function(e){e.preventDefault(),e.stopPropagation()},click:function(e){return u(r,void 0,void 0,function(){var t,n;return l(this,function(r){switch(r.label){case 0:return e.preventDefault(),e.stopPropagation(),null==(t=e.currentTarget||e.target)?[2]:[4,xf(i)];case 1:return n=r.sent(),function(e,t,n){var r=Number(e.dataset.copyResetTimer||0);r&&window.clearTimeout(r),e.textContent=t;var o=window.setTimeout(function(){e.textContent=n,delete e.dataset.copyResetTimer},1200);e.dataset.copyResetTimer="".concat(o)}(t,n?s:c,a),[2]}})})}}},a),t);return d}},Bf={type:"code",renderElem:function(e,t,n){return Pd("code",null,t)}},Of={menus:[{key:"codeBlock",config:{showCopyButton:!1},factory:function(){return new Df}}],editorPlugin:function(e){var t=e.insertBreak,n=e.normalizeNode,r=e.insertData,o=e.handleTab,i=e;return i.insertBreak=function(){var e=Ss.getSelectedNodeByType(i,"code");if(null!=e){var n=function(e,t){var n=t.selection;if(null==n)return"";var r=Qn.string(e),o=n.anchor.offset,i=r.slice(0,o).split("\n"),a=i.length;return 0===a?"":i[a-1]}(e,i);if(n){var r=n.match(/^\s+/);if(null!=r&&null!=r[0]){var o=r[0];return void i.insertText("\n".concat(o))}}i.insertText("\n")}else t()},e.handleTab=function(){var t=e.selection;if(t){var n=Ss.getSelectedNodeByType(e,"code");if(n&&!Gn.isCollapsed(t)){var r=d([t.anchor,t.focus].sort(function(e,t){return e.offset-t.offset}),2),i=r[0],a=r[1],s=n.children[0].text,u=s.split("\n"),l=s.slice(0,i.offset).split("\n").length-1,c=s.slice(0,a.offset).split("\n").length-1,f=u.map(function(e,t){return t>=l&&t<=c?" ".concat(e):e}),p=f.join("\n"),h={anchor:{path:i.path,offset:i.offset+2},focus:{path:a.path,offset:a.offset+2}};co.insertText(e,p,{at:{anchor:{path:i.path,offset:0},focus:{path:a.path,offset:s.length}}}),co.select(e,h)}else o()}},i.normalizeNode=function(e){var t=d(e,2),r=t[0],o=t[1],a=Ss.getNodeType(r);("code"===a&&o.length<=1&&co.setNodes(i,{type:"paragraph"},{at:o}),"pre"===a)&&(Ss.isLastNode(i,r)&&co.insertNodes(i,Ss.genEmptyParagraph(),{at:[o[0]+1]}),"code"!==Ss.getNodeType(r.children[0])&&(co.unwrapNodes(i),co.setNodes(i,{type:"paragraph"},{mode:"highest"})));return n([r,o])},i.insertData=function(e){if(null!=Ss.getSelectedNodeByType(i,"code")){var t=e.getData("text/plain");Pr.insertText(i,t)}else r(e)},i},renderElems:[Nf,Bf],elemsToHtml:[wf,Cf],preParseHtml:[{selector:"pre>code",preParseHtml:function(e){var t=Zi(e);if("code"!==hf(t))return e;var n=t.find("xmp");if(0===n.length)return e;var r=n.text();return n.remove(),t.text(r),t[0]}}],parseElemsHtml:[{selector:"pre:not([data-w-e-type])>code",parseElemHtml:function(e,t,n){return{type:"code",language:"",children:[{text:Zi(e)[0].textContent||""}]}}},Af]},Tf=function(){function e(){this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(e,t){},e.prototype.getValue=function(e){var t=this.mark,n=Pr.marks(e);return n&&n[t]?n[t]:""},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=d(Pr.nodes(e,{match:function(t){return"pre"===Ss.getNodeType(t)||!(!Kn.isElement(t)||!Pr.isVoid(e,t))},universal:!0}),1);return!!t[0]},e.prototype.getPanelContentElem=function(e){var t=this.mark;if(null==this.$content){var n=Zi('<ul class="w-e-panel-content-color"></ul>');n.on("click","li",function(n){var r=n.target;if(null!=r&&(n.preventDefault(),null!=e.selection)){var o=Zi(r).attr("data-value");"0"===o?Pr.removeMark(e,t):Pr.addMark(e,t,o)}}),this.$content=n}var r=this.$content;if(null==r)return document.createElement("ul");r.empty();var o=this.getValue(e),i=e.getMenuConfig(t).colors;(void 0===i?[]:i).forEach(function(e){var t=Zi('<div class="color-block" data-value="'.concat(e,'"></div>'));t.css("background-color",e);var n=Zi('<li data-value="'.concat(e,'"></li>'));o===e&&n.addClass("active"),n.append(t),r.append(n)});var a="";"color"===t&&(a=ac("color.default")),"bgColor"===t&&(a=ac("color.clear"));var s=Zi('\n <li data-value="0" class="clear">\n '.concat('<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>',"\n ").concat(a,"\n </li>\n "));return r.prepend(s),r[0]},e}(),kf=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("color.bgColor"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M510.030769 315.076923l84.676923 196.923077h-177.230769l76.8-196.923077h15.753846zM945.230769 157.538462v708.923076c0 43.323077-35.446154 78.769231-78.769231 78.769231H157.538462c-43.323077 0-78.769231-35.446154-78.769231-78.769231V157.538462c0-43.323077 35.446154-78.769231 78.769231-78.769231h708.923076c43.323077 0 78.769231 35.446154 78.769231 78.769231z m-108.307692 643.938461L600.615385 216.615385c-5.907692-11.815385-15.753846-19.692308-29.538462-19.692308h-139.815385c-11.815385 0-23.630769 7.876923-27.56923 19.692308l-216.615385 584.861538c-3.938462 11.815385 3.938462 25.6 17.723077 25.6h80.738462c11.815385 0 23.630769-9.846154 27.56923-21.661538l63.015385-175.261539h263.876923l68.923077 175.261539c3.938462 11.815385 15.753846 21.661538 27.569231 21.661538h80.738461c13.784615 0 23.630769-13.784615 19.692308-25.6z"></path></svg>',t.mark="bgColor",t}return a(t,e),t}(Tf),Ff=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("color.color"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 864h896v96H64zM360.58 576h302.85l81.53 224h102.16L579.24 64H444.77L176.89 800h102.16l81.53-224zM512 159.96L628.49 480H395.52L512 159.96z"></path></svg>',t.mark="color",t}return a(t,e),t}(Tf),If=["rgb(0, 0, 0)","rgb(38, 38, 38)","rgb(89, 89, 89)","rgb(140, 140, 140)","rgb(191, 191, 191)","rgb(217, 217, 217)","rgb(233, 233, 233)","rgb(245, 245, 245)","rgb(250, 250, 250)","rgb(255, 255, 255)","rgb(225, 60, 57)","rgb(231, 95, 51)","rgb(235, 144, 58)","rgb(245, 219, 77)","rgb(114, 192, 64)","rgb(89, 191, 192)","rgb(66, 144, 247)","rgb(54, 88, 226)","rgb(106, 57, 201)","rgb(216, 68, 147)","rgb(251, 233, 230)","rgb(252, 237, 225)","rgb(252, 239, 212)","rgb(252, 251, 207)","rgb(231, 246, 213)","rgb(218, 244, 240)","rgb(217, 237, 250)","rgb(224, 232, 250)","rgb(237, 225, 248)","rgb(246, 226, 234)","rgb(255, 163, 158)","rgb(255, 187, 150)","rgb(255, 213, 145)","rgb(255, 251, 143)","rgb(183, 235, 143)","rgb(135, 232, 222)","rgb(145, 213, 255)","rgb(173, 198, 255)","rgb(211, 173, 247)","rgb(255, 173, 210)","rgb(255, 77, 79)","rgb(255, 122, 69)","rgb(255, 169, 64)","rgb(255, 236, 61)","rgb(115, 209, 61)","rgb(54, 207, 201)","rgb(64, 169, 255)","rgb(89, 126, 247)","rgb(146, 84, 222)","rgb(247, 89, 171)","rgb(207, 19, 34)","rgb(212, 56, 13)","rgb(212, 107, 8)","rgb(212, 177, 6)","rgb(56, 158, 13)","rgb(8, 151, 156)","rgb(9, 109, 217)","rgb(29, 57, 196)","rgb(83, 29, 171)","rgb(196, 29, 127)","rgb(130, 0, 20)","rgb(135, 20, 0)","rgb(135, 56, 0)","rgb(97, 71, 0)","rgb(19, 82, 0)","rgb(0, 71, 79)","rgb(0, 58, 140)","rgb(6, 17, 120)","rgb(34, 7, 94)","rgb(120, 6, 80)"];function Pf(){return If}var _f={key:"color",factory:function(){return new Ff},config:{colors:Pf()}},Rf={key:"bgColor",factory:function(){return new kf},config:{colors:If}};function Lf(e,t){null==e.data&&(e.data={});var n=e.data;null==n.style&&(n.style={}),Object.assign(n.style,t)}var Mf={color:"w-e-color",bgColor:"w-e-bg-color",fontSize:"w-e-font-size",fontFamily:"w-e-font-family",textAlign:"w-e-text-align",lineHeight:"w-e-line-height",indent:"w-e-indent"},jf={color:"data-w-e-color",bgColor:"data-w-e-bg-color",fontSize:"data-w-e-font-size",fontFamily:"data-w-e-font-family",textAlign:"data-w-e-text-align",lineHeight:"data-w-e-line-height",indent:"data-w-e-indent"},Hf={color:"wEColor",bgColor:"wEBgColor",fontSize:"wEFontSize",fontFamily:"wEFontFamily",textAlign:"wETextAlign",lineHeight:"wELineHeight",indent:"wEIndent"},zf=new Set;function $f(e,t){var n=(t||"").trim();return n?"fontFamily"===e?n.replace(/"/g,"").replace(/\s+/g," ").toLowerCase():n.replace(/\s+/g,"").toLowerCase():""}function Uf(e,t){var n=$f(e,t),r=function(e){var t,n,r=7;try{for(var o=c(e),i=o.next();!i.done;i=o.next())r=(31*r+(i.value.codePointAt(0)||0))%2147483647}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.toString(36)}("".concat(e,":").concat(n));return"".concat(Mf[e],"-").concat(r)}function Vf(e,t){var n,r,o,i=(o=["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"].map(function(e){return"string"==typeof e?e:e.value}),{color:Pf(),bgColor:Pf(),fontSize:o,fontFamily:["黑体",{name:"仿宋",value:"仿宋"},"楷体","标楷体","华文仿宋","华文楷体",{name:"宋体",value:"宋体"},"微软雅黑","Arial","Tahoma","Verdana","Times New Roman","Courier New"].map(function(e){return"string"==typeof e?e:e.value}),textAlign:["left","center","right","justify"],lineHeight:["1","1.15","1.5","2","2.5","3"],indent:(n=o,r=new Set(["2em"]),n.forEach(function(e){var t="".concat(e||"").trim().match(/^(-?\d+(\.\d+)?)([a-z%]+)$/i);if(t){var n=parseFloat(t[1]),o=t[3];!Number.isFinite(n)||n<=0||!o||r.add("".concat(2*n).concat(o))}}),Array.from(r))})[t],a=function(e,t){var n,r=null===(n=null==e?void 0:e.getConfig().styleClassTokens)||void 0===n?void 0:n[t];return Array.isArray(r)?r:[]}(e,t),s=f(f([],d(i),!1),d(a),!1),u=new Set;return s.forEach(function(e){var t="".concat(e||"").trim();t&&u.add(t)}),Array.from(u)}function Wf(e,t,n,r){if(function(e,t,n){var r=$f(t,n);if(!r)return!1;for(var o=Vf(e,t),i=0;i<o.length;i+=1)if($f(t,o[i])===r)return!0;return!1}(e,t,n))return"class";var o=rf(e),i="preserve-data";"fallback-inline"===o&&(i="inline"),"strict"===o&&(i="throw");var a='[wangeditor] Unsupported class style token "'.concat(t,"=").concat(n,'" in ').concat(r,". policy=").concat(o),s="".concat(t,"|").concat(n,"|").concat(r,"|").concat(i);if(zf.has(s)||(zf.add(s),of(e,{type:t,value:n,scene:r,fallback:i,message:a})),"throw"===i)throw new Error(a);return"inline"===i?"inline":"preserve-data"}function Gf(e){return nf(e)}function qf(e,t,n,r,o,i){var a="".concat(n||"").trim();if(a){e.attr(jf[t],a);var s=Wf(r,t,a,o);"class"!==s?"inline"===s&&i&&i():e.addClass(Uf(t,a))}}function Kf(e,t,n,r,o,i){var a,s="".concat(n||"").trim();if(s){!function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.dataset&&(n.dataset={}),Object.assign(n.dataset,t)}(e,(a={},a[Hf[t]]=s,a));var u=Wf(r,t,s,o);"class"!==u?"inline"===u&&i&&Lf(e,i):function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.props&&(n.props={});var r=String(n.props.className||"").trim(),o=r?r.split(/\s+/):[];o.includes(t)||o.push(t),n.props.className=o.join(" ")}(e,Uf(t,s))}}function Yf(e,t,n){var r=e.attr(jf[t])||"";if(r)return r;for(var o=(e.attr("class")||"").trim().split(/\s+/).filter(Boolean),i="".concat(Mf[t],"-"),a=function(e,t){var n=Vf(e,t),r={};return n.forEach(function(e){r[Uf(t,e)]=e}),r}(n,t),s=0;s<o.length;s+=1){var u=o[s];if(u.startsWith(i)){var l=a[u];if(l)return l}}return""}var Xf={selector:"font",preParseHtml:function(e){var t=Zi(e);if("font"!==hf(t))return e;var n=t.attr("color")||"";return n&&(t.removeAttr("color"),t.css("color",n)),t[0]}};var Zf={renderStyle:function(e,t,n){var r=e,o=r.color,i=r.bgColor,a=t;return"class"===Gf(n)?(o&&Kf(a,"color",o,n,"render",{color:o}),i&&Kf(a,"bgColor",i,n,"render",{backgroundColor:i})):(o&&Lf(a,{color:o}),i&&Lf(a,{backgroundColor:i})),a},styleToHtml:function(e,t,n){if(!Wr.isText(e))return t;var r,o=e,i=o.color,a=o.bgColor;return i||a?((ff(t)||"span"!==hf(r=Zi(t)))&&(r=Zi("<span>".concat(t,"</span>"))),"class"===Gf(n)?(i&&qf(r,"color",i,n,"toHtml",function(){r.css("color",i)}),a&&qf(r,"bgColor",a,n,"toHtml",function(){r.css("background-color",a)})):(i&&r.css("color",i),a&&r.css("background-color",a)),pf(r)):t},preParseHtml:[Xf],parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Wr.isText(t))return t;var o=t,i=gf(r,"color");i||(i=Yf(r,"color",n)),i&&(o.color=i);var a=gf(r,"background-color");return a||(a=gf(r,"background")),a||(a=Yf(r,"bgColor",n)),a&&(o.bgColor=a),o},menus:[_f,Rf]},Jf=function(){function e(){this.title=ac("common.enter"),this.iconSvg='<svg viewBox="0 0 1255 1024"><path d="M1095.111111 731.477333h-625.777778V1024L0 658.318222 469.333333 292.408889v292.636444h625.777778V0h156.444445v731.477333z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||!!Gn.isExpanded(t)},e.prototype.exec=function(e,t){var n=e.selection;if(null!=n){var r=[n.anchor.path[0]];co.insertNodes(e,{type:"paragraph",children:[{text:""}]},{at:r}),e.select(Pr.start(e,r))}},e}(),Qf={menus:[{key:"enter",factory:function(){return new Jf}}]};var ep={type:"divider",elemToHtml:function(e,t){return"<hr/>"}},tp=function(){function e(){this.title=ac("divider.title"),this.iconSvg='<svg viewBox="0 0 1092 1024"><path d="M0 51.2m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M819.2 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M409.6 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 870.4m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!!Ss.getSelectedElems(e).some(function(t){if(e.isVoid(t))return!0;var n=Ss.getNodeType(t);return"table"===n||"pre"===n})},e.prototype.exec=function(e,t){Ss.isSelectedEmptyParagraph(e)&&co.removeNodes(e,{mode:"highest"}),co.insertNodes(e,{type:"divider",children:[{text:""}]},{mode:"highest"})},e}();var np={renderElems:[{type:"divider",renderElem:function(e,t,n){return hd("div",{props:{contentEditable:!1,className:"w-e-textarea-divider"},dataset:{selected:Ss.isNodeSelected(n,e)?"true":""},style:{},on:{mousedown:function(e){return e.preventDefault()}}},[hd("hr")])}}],elemsToHtml:[ep],parseElemsHtml:[{selector:"hr:not([data-w-e-type])",parseElemHtml:function(e,t,n){return{type:"divider",children:[{text:""}]}}}],menus:[{key:"divider",factory:function(){return new tp}}],editorPlugin:function(e){var t=e.isVoid,n=e.normalizeNode,r=e;return r.isVoid=function(e){return"divider"===e.type||t(e)},r.normalizeNode=function(e){var t=d(e,2),o=t[0],i=t[1];if("divider"!==Ss.getNodeType(o))return n([o,i]);Ss.isLastNode(r,o)&&co.insertNodes(r,Ss.genEmptyParagraph(),{at:[i[0]+1]})},r}};var rp=function(){function e(){this.title=ac("emotion.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m0-102.4c226.742857 0 409.6-182.857143 409.6-409.6S738.742857 102.4 512 102.4 102.4 285.257143 102.4 512s182.857143 409.6 409.6 409.6z m-204.8-358.4h409.6c0 113.371429-91.428571 204.8-204.8 204.8s-204.8-91.428571-204.8-204.8z m0-102.4c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8 76.8 32.914286 76.8 76.8-32.914286 76.8-76.8 76.8z m409.6 0c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8c43.885714 0 76.8 32.914286 76.8 76.8s-32.914286 76.8-76.8 76.8z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(e,t){},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=d(Pr.nodes(e,{match:function(t){return"pre"===Ss.getNodeType(t)||!(!Kn.isElement(t)||!Pr.isVoid(e,t))},universal:!0}),1);return!!t[0]},e.prototype.getPanelContentElem=function(e){if(null==this.$content){var t=Zi('<ul class="w-e-panel-content-emotion"></ul>');t.on("click","li",function(t){var n=t.target;if(null!=n){t.preventDefault();var r=Zi(n).text();e.insertText(r)}}),this.$content=t}var n=this.$content;if(null==n)return document.createElement("ul");n.empty();var r=e.getMenuConfig("emotion").emotions;return(void 0===r?[]:r).forEach(function(e){var t=Zi("<li>".concat(e,"</li>"));n.append(t)}),n[0]},e}(),op={menus:[{key:"emotion",factory:function(){return new rp},config:{emotions:"😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 😘 😗 😙 😚 😋 😛 😝 😜 🤓 😎 😏 😒 😞 😔 😟 😕 🙁 😣 😖 😫 😩 😢 😭 😤 😠 😡 😳 😱 😨 🤗 🤔 😶 😑 😬 🙄 😯 😴 😷 🤑 😈 🤡 💩 👻 💀 👀 👣 👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏".split(" ")}}]},ip=function(){function e(){this.tag="select",this.width=80}return e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.mark,n=Pr.marks(e);return n&&n[t]?n[t]:""},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=d(Pr.nodes(e,{match:function(t){return"pre"===Ss.getNodeType(t)||!(!Kn.isElement(t)||!Pr.isVoid(e,t))},universal:!0}),1);return!!t[0]},e.prototype.exec=function(e,t){var n=this.mark;t?e.addMark(n,t):e.removeMark(n)},e}(),ap=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("fontFamily.title"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M956.788364 152.110545h-24.110546l23.924364 9.029819 0.186182 121.018181h-65.070546l-86.574545-130.048H566.551273v650.14691l130.048 64.977454v65.163636h-390.050909v-65.163636l129.954909-64.977454V152.110545H198.283636L111.429818 282.065455H46.545455V69.259636C46.545455 33.792 82.664727 22.062545 98.955636 22.062545h812.683637c23.738182 0 45.056 15.173818 45.056 41.053091V169.425455v-17.221819z"></path></svg>',t.mark="fontFamily",t.selectPanelWidth=150,t}return a(t,e),t.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig(this.mark).fontFamilyList,r=void 0===n?[]:n;t.push({text:ac("fontFamily.default"),value:""}),r.forEach(function(e){if("string"==typeof e)t.push({text:e,value:e,styleForRenderMenuList:{"font-family":e}});else if("object"==typeof e){var n=e.name,r=e.value;t.push({text:n,value:r,styleForRenderMenuList:{"font-family":r}})}});var o=this.getValue(e),i=!1;return t.forEach(function(e){e.value===o?(i=!0,e.selected=!0):e.selected=void 0}),i||"string"!=typeof o||t.push({text:o,value:o,selected:!0}),t},t}(ip),sp=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("fontSize.title"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 512h384v128h-128V1024h-128V640h-128z m896-256H708.2496v768h-136.4992V256H320V128h640z"></path></svg>',t.mark="fontSize",t}return a(t,e),t.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig(this.mark).fontSizeList,r=void 0===n?[]:n;t.push({text:ac("fontSize.default"),value:""}),r.forEach(function(e){if("string"==typeof e)t.push({text:e,value:e});else if("object"==typeof e){var n=e.name,r=e.value;t.push({text:n,value:r})}});var o=this.getValue(e),i=!1;return t.forEach(function(e){e.value===o?(i=!0,e.selected=!0):e.selected=void 0}),i||"string"!=typeof o||t.push({text:o,value:o,selected:!0}),t},t}(ip);var up={1:"12px",2:"14px",3:"16px",4:"19px",5:"24px",6:"32px",7:"48px"};var lp={renderStyle:function(e,t,n){var r=e,o=r.fontSize,i=r.fontFamily,a=t;return"class"===Gf(n)?(o&&Kf(a,"fontSize",o,n,"render",{fontSize:o}),i&&Kf(a,"fontFamily",i,n,"render",{fontFamily:i})):(o&&Lf(a,{fontSize:o}),i&&Lf(a,{fontFamily:i})),a},styleToHtml:function(e,t,n){if(!Wr.isText(e))return t;var r,o=e,i=o.fontSize,a=o.fontFamily;return i||a?((ff(t)||"span"!==hf(r=Zi(t)))&&(r=Zi("<span>".concat(t,"</span>"))),"class"===Gf(n)?(i&&qf(r,"fontSize",i,n,"toHtml",function(){r.css("font-size",i)}),a&&qf(r,"fontFamily",a,n,"toHtml",function(){r.css("font-family",a)})):(i&&r.css("font-size",i),a&&r.css("font-family",a)),pf(r)):t},preParseHtml:[{selector:"font",preParseHtml:function(e){var t=Zi(e);if("font"!==hf(t))return e;var n=t.attr("size")||"";n&&(t.removeAttr("size"),t.css("font-size",up[n]));var r=t.attr("face")||"";return r&&(t.removeAttr("face"),t.css("font-family",r)),t[0]}}],parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Wr.isText(t))return t;var o=t,i=gf(r,"font-size");i||(i=Yf(r,"fontSize",n)),i&&(o.fontSize=i);var a=gf(r,"font-family"),s=Yf(r,"fontFamily",n),u=(a||s).replace(/"/g,"");return u&&(o.fontFamily=u),o},menus:[{key:"fontSize",factory:function(){return new sp},config:{fontSizeList:["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"]}},{key:"fontFamily",factory:function(){return new ap},config:{fontFamilyList:["黑体",{name:"仿宋",value:"仿宋"},"楷体","标楷体","华文仿宋","华文楷体",{name:"宋体",value:"宋体"},"微软雅黑","Arial","Tahoma","Verdana","Times New Roman","Courier New"]}}]};var cp=function(){function e(){this.title=ac("formatPainter.title"),this.iconSvg='<svg viewBox="0 0 24 24"><path d="M8 19.997v-5h2v5h9v-7H5v7zm-4-9h16v-3h-6v-4h-4v4H4zm-1 10v-8H2v-6a1 1 0 0 1 1-1h5v-3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v3h5a1 1 0 0 1 1 1v6h-1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1"/></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(t){return e.attrs.isSelect},e.prototype.isDisabled=function(e){return!1},e.prototype.isSourceBlockType=function(e){return"blockquote"===e||"header1"===e||"header2"===e||"header3"===e||"header4"===e||"header5"===e||"header6"===e||"list-item"===e||"todo"===e},e.prototype.isTargetBlockType=function(e){return"paragraph"===e||this.isSourceBlockType(e)},e.prototype.getTopLevelSelectedBlocks=function(e,t){return Array.from(Pr.nodes(e,{at:e.selection||void 0,match:function(e){return Kn.isElement(e)}})).filter(function(e){var n=d(e,2),r=n[0];return 1===n[1].length&&t(r.type)}).map(function(e){return d(e,2)[1]})},e.prototype.normalizeListOrderType=function(e){return"a"===e||"A"===e||"i"===e||"I"===e?e:"1"===e?"1":void 0},e.prototype.getSelectedBlockStyle=function(e){var t=this,n=d(this.getTopLevelSelectedBlocks(e,function(e){return t.isSourceBlockType(e)}),1)[0];if(!n)return null;var r=d(Pr.node(e,n),1)[0];return Kn.isElement(r)&&this.isSourceBlockType(r.type)?"blockquote"===r.type||"header1"===r.type||"header2"===r.type||"header3"===r.type||"header4"===r.type||"header5"===r.type||"header6"===r.type||"todo"===r.type?{type:r.type}:"list-item"===r.type?{type:"list-item",ordered:"ordered"in r&&!!r.ordered,orderType:"orderType"in r?this.normalizeListOrderType(r.orderType):void 0}:null:null},e.prototype.unsetListAttrs=function(e,t){co.unsetNodes(e,"ordered",{at:t}),co.unsetNodes(e,"level",{at:t}),co.unsetNodes(e,"start",{at:t}),co.unsetNodes(e,"orderType",{at:t})},e.prototype.applyBlockStyle=function(e,t){var n=this,r=this.getTopLevelSelectedBlocks(e,function(e){return n.isTargetBlockType(e)});0!==r.length&&("list-item"!==t.type?"todo"!==t.type?r.forEach(function(r){co.setNodes(e,{type:t.type},{at:r}),n.unsetListAttrs(e,r),co.unsetNodes(e,"checked",{at:r})}):r.forEach(function(t){co.setNodes(e,{type:"todo",checked:!1},{at:t}),n.unsetListAttrs(e,t)}):r.forEach(function(n){co.setNodes(e,{type:"list-item",ordered:t.ordered,orderType:t.orderType,level:0},{at:n}),co.unsetNodes(e,"checked",{at:n}),co.unsetNodes(e,"start",{at:n})}))},e.prototype.setFormatHtml=function(t){var n,r;if(t.getSelectionText().length){if(e.attrs.formatStyle){!function(e){var t=Pr.marks(e);t&&Object.keys(t).forEach(function(t){e.removeMark(t)})}(t);try{for(var o=c(Object.entries(e.attrs.formatStyle)),i=o.next();!i.done;i=o.next()){var a=d(i.value,2),s=a[0],u=a[1];t.addMark(s,u)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}e.attrs.formatBlockStyle&&this.applyBlockStyle(t,e.attrs.formatBlockStyle),e.attrs.formatStyle=null,e.attrs.formatBlockStyle=null,e.attrs.isSelect=!1}},e.prototype.exec=function(t){e.attrs.isSelect?(e.attrs.isSelect=!1,e.attrs.formatStyle=null,e.attrs.formatBlockStyle=null):t.getSelectionText().length&&(e.attrs.formatStyle=Pr.marks(t),e.attrs.formatBlockStyle=this.getSelectedBlockStyle(t),e.attrs.isSelect=!0);t.blur(),t.focus()},e.attrs={isSelect:!1,formatStyle:null,formatBlockStyle:null},e}();var dp={menus:[{key:"formatPainter",factory:function(){return new cp}}],editorPlugin:function(e){var t=new cp,n=e.onChange,r=e,o=function(){t.setFormatHtml(r),document.removeEventListener("mouseup",o)};return r.onChange=function(){n(),cp.attrs.isSelect&&(document.removeEventListener("mouseup",o),document.addEventListener("mouseup",o))},r}},fp=function(){function e(){this.title=ac("fullScreen.title"),this.iconSvg=lf,this.tag="button",this.alwaysEnable=!0}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return e.isFullScreen},e.prototype.isDisabled=function(e){return!1},e.prototype.getIcon=function(e){return e.isFullScreen?'<svg t="1723361745825" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8705" width="200" height="200"><path d="M703.926857 362.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V128a42.642286 42.642286 0 1 1 85.357715 0v149.357714h149.357714c21.211429 0 38.765714 15.433143 42.057143 35.693715l0.585143 6.948571a42.642286 42.642286 0 0 1-42.642286 42.642286H703.926857zM703.926857 938.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V704c0-23.552 19.090286-42.642286 42.642286-42.642286h192.073143a42.642286 42.642286 0 1 1 0 85.284572l-149.357714 0.073143v149.284571c0 21.211429-15.506286 38.765714-35.84 42.130286l-6.875429 0.512zM319.853714 938.642286a42.642286 42.642286 0 0 1-42.642285-42.642286v-149.284571H127.853714a42.642286 42.642286 0 0 1-42.130285-35.84l-0.585143-6.875429c0-23.552 19.163429-42.642286 42.715428-42.642286h192c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286zM127.853714 362.642286a42.642286 42.642286 0 1 1 0-85.284572H277.211429V128c0-21.211429 15.433143-38.765714 35.766857-42.130286l6.875428-0.512c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286H127.853714z" fill="#333333" p-id="8706"></path></svg>':lf},e.prototype.getTitle=function(e){return e.isFullScreen?ac("fullScreen.cancelTitle"):ac("fullScreen.title")},e.prototype.exec=function(e,t){e.isFullScreen?e.unFullScreen():e.fullScreen()},e}(),pp={menus:[{key:"fullScreen",factory:function(){return new fp}}]};function hp(e){return function(t,n){return"<h".concat(e,">").concat(n,"</h").concat(e,">")}}var gp={type:"header1",elemToHtml:hp(1)},vp={type:"header2",elemToHtml:hp(2)},mp={type:"header3",elemToHtml:hp(3)},yp={type:"header4",elemToHtml:hp(4)},bp={type:"header5",elemToHtml:hp(5)},Ep={type:"header6",elemToHtml:hp(6)};function wp(e){var t=d(Pr.nodes(e,{match:function(e){return Ss.getNodeType(e).startsWith("header")},universal:!0}),1),n=t[0];if(null==n)return"paragraph";var r=d(n,1)[0];return Ss.getNodeType(r)}function Cp(e){if(null==e.selection)return!0;var t=d(Pr.nodes(e,{match:function(e){var t=Ss.getNodeType(e);return"paragraph"===t||!!t.startsWith("header")},universal:!0,mode:"highest"}),1);return!t[0]}function Dp(e,t){t&&co.setNodes(e,{type:t})}var Ap=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return wp(e)},e.prototype.isActive=function(e){return this.getValue(e)===this.type},e.prototype.isDisabled=function(e){return Cp(e)},e.prototype.exec=function(e,t){var n=this.type;Dp(e,t===n?"paragraph":n)},e}(),Sp=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H1",t.type="header1",t}return a(t,e),t}(Ap),xp=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H2",t.type="header2",t}return a(t,e),t}(Ap),Np=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H3",t.type="header3",t}return a(t,e),t}(Ap),Bp=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H4",t.type="header4",t}return a(t,e),t}(Ap),Op=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H5",t.type="header5",t}return a(t,e),t}(Ap),Tp=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="H6",t.type="header6",t}return a(t,e),t}(Ap),kp=function(){function e(){this.title=ac("header.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M960 960c-51.2 0-102.4-3.2-153.6-3.2-51.2 0-99.2 3.2-150.4 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 57.6-28.8 86.4-48 19.2-12.8 19.2-60.8 19.2-80v-224-19.2c-9.6-3.2-19.2-3.2-28.8-3.2H320c-9.6 0-19.2 0-28.8 3.2V780.8c0 22.4 0 80 22.4 92.8 28.8 19.2 96-6.4 96 44.8 0 16-9.6 41.6-28.8 41.6-54.4 0-105.6-3.2-160-3.2-48 0-96 3.2-147.2 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 51.2-28.8 80-48 19.2-12.8 19.2-60.8 19.2-83.2V294.4c0-28.8 3.2-115.2-22.4-131.2-25.6-16-86.4 9.6-86.4-41.6 0-16 6.4-41.6 28.8-41.6 51.2 0 105.6 3.2 156.8 3.2 48 0 96-3.2 144-3.2 19.2 0 28.8 22.4 28.8 41.6 0 48-57.6 25.6-83.2 41.6-19.2 12.8-19.2 73.6-19.2 92.8v201.6c6.4 3.2 16 3.2 22.4 3.2h400c6.4 0 12.8 0 22.4-3.2V256c0-22.4 0-80-19.2-92.8-28.8-16-86.4 6.4-86.4-41.6 0-16 9.6-41.6 28.8-41.6 51.2 0 99.2 3.2 150.4 3.2 48 0 99.2-3.2 147.2-3.2 19.2 0 28.8 22.4 28.8 41.6 0 51.2-57.6 25.6-86.4 41.6-19.2 12.8-19.2 70.4-19.2 92.8v537.6c0 19.2 0 67.2 19.2 80 28.8 19.2 89.6-6.4 89.6 44.8 0 19.2-6.4 41.6-28.8 41.6z"></path></svg>',this.tag="select",this.width=60}return e.prototype.getOptions=function(e){var t=[{value:"header1",text:"H1",styleForRenderMenuList:{"font-size":"32px","font-weight":"bold"}},{value:"header2",text:"H2",styleForRenderMenuList:{"font-size":"24px","font-weight":"bold"}},{value:"header3",text:"H3",styleForRenderMenuList:{"font-size":"18px","font-weight":"bold"}},{value:"header4",text:"H4",styleForRenderMenuList:{"font-size":"16px","font-weight":"bold"}},{value:"header5",text:"H5",styleForRenderMenuList:{"font-size":"13px","font-weight":"bold"}},{value:"header6",text:"H6",styleForRenderMenuList:{"font-size":"11px","font-weight":"bold"}},{value:"paragraph",text:ac("header.text")}],n=this.getValue(e).toString();return t.forEach(function(e){e.value===n?e.selected=!0:e.selected=void 0}),t},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){return wp(e)},e.prototype.isDisabled=function(e){return Cp(e)},e.prototype.exec=function(e,t){Dp(e,t.toString())},e}(),Fp={key:"headerSelect",factory:function(){return new kp}},Ip={key:"header1",factory:function(){return new Sp}},Pp={key:"header2",factory:function(){return new xp}},_p={key:"header3",factory:function(){return new Np}},Rp={key:"header4",factory:function(){return new Bp}},Lp={key:"header5",factory:function(){return new Op}},Mp={key:"header6",factory:function(){return new Tp}};function jp(e){return function(t,n,r){var o=Zi(t);return 0===(n=n.filter(function(e){return!!Wr.isText(e)||!!r.isInline(e)})).length&&(n=[{text:o.text().replace(/\s+/gm," ")}]),{type:"header".concat(e),children:n}}}var Hp={selector:"h1:not([data-w-e-type])",parseElemHtml:jp(1)},zp={selector:"h2:not([data-w-e-type])",parseElemHtml:jp(2)},$p={selector:"h3:not([data-w-e-type])",parseElemHtml:jp(3)},Up={selector:"h4:not([data-w-e-type])",parseElemHtml:jp(4)},Vp={selector:"h5:not([data-w-e-type])",parseElemHtml:jp(5)},Wp={selector:"h6:not([data-w-e-type])",parseElemHtml:jp(6)};function Gp(e){return function(t,n,r){return Pd("h".concat(e),null,n)}}var qp={renderElems:[{type:"header1",renderElem:Gp(1)},{type:"header2",renderElem:Gp(2)},{type:"header3",renderElem:Gp(3)},{type:"header4",renderElem:Gp(4)},{type:"header5",renderElem:Gp(5)},{type:"header6",renderElem:Gp(6)}],elemsToHtml:[gp,vp,mp,yp,bp,Ep],parseElemsHtml:[Hp,zp,$p,Up,Vp,Wp],menus:[Fp,Ip,Pp,_p,Rp,Lp,Mp],editorPlugin:function(e){var t=e.insertBreak,n=e;return n.insertBreak=function(){var r=d(Pr.nodes(n,{match:function(e){return Ss.getNodeType(e).startsWith("header")},universal:!0}),1),o=r[0];if(o)if(Ss.isSelectionAtLineEnd(e,o[1])){co.insertNodes(n,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}else t();else t()},n}};var Kp={type:"image",elemToHtml:function(e,t,n){var r=e,o=r.src,i=r.alt,a=void 0===i?"":i,s=r.href,u=void 0===s?"":s,l=r.width,c=void 0===l?"":l,d=r.height,f=void 0===d?"":d,p=r.style,h=void 0===p?{}:p,g=h.width,v=void 0===g?"":g,m=h.height,y=void 0===m?"":m;if("class"===nf(n)){var b=c||v,E=f||y,w=v?' data-w-e-style-width="'.concat(v,'"'):"",C=y?' data-w-e-style-height="'.concat(y,'"'):"";return'<img src="'.concat(o,'" alt="').concat(a,'" data-href="').concat(u,'" width="').concat(b,'" height="').concat(E,'"').concat(w).concat(C,"/>")}var D="";return v&&(D+="width: ".concat(v,";")),y&&(D+="height: ".concat(y,";")),'<img src="'.concat(o,'" alt="').concat(a,'" data-href="').concat(u,'" width="').concat(c,'" height="').concat(f,'" style="').concat(D,'"/>')}};var Yp=function(){function e(){this.title=ac("image.delete"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==Ss.getSelectedNodeByType(e,"image")},e.prototype.exec=function(e,t){this.isDisabled(e)||co.removeNodes(e,{match:function(e){return Ss.checkNodeType(e,"image")}})},e}();function Xp(e){return void 0===e&&(e="r"),"".concat(e,"-").concat(wn())}function Zp(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Jp(e){var t=e.selection;if(null==t)return!0;if(!Gn.isCollapsed(t))return!0;var n=d(Pr.nodes(e,{match:function(t){var n=Ss.getNodeType(t);return"code"===n||("pre"===n||("link"===n||(!!n.startsWith("header")||("blockquote"===n||!(!Kn.isElement(t)||!Pr.isVoid(e,t))))))},universal:!0}),1);return!!n[0]}function Qp(e,t,n){return u(this,arguments,void 0,function(e,t,n,r,o){var i,a;return void 0===r&&(r=""),void 0===o&&(o=""),l(this,function(s){switch(s.label){case 0:return(i=t.getMenuConfig(e).checkImage)?[4,i(n,r,o)]:[3,2];case 1:if("string"==typeof(a=s.sent()))return t.alert(a,"error"),[2,!1];if(null==a)return[2,!1];s.label=2;case 2:return[2,!0]}})})}function eh(e,t,n){return u(this,void 0,void 0,function(){var r;return l(this,function(o){switch(o.label){case 0:return(r=t.getMenuConfig(e).parseImageSrc)?[4,r(n)]:[3,2];case 1:return[2,o.sent()];case 2:return[2,n]}})})}function th(e,t){return u(this,arguments,void 0,function(e,t,n,r){var o,i,a,s,u,c;return void 0===n&&(n=""),void 0===r&&(r=""),l(this,function(l){switch(l.label){case 0:return[4,Qp("insertImage",e,t,n,r)];case 1:return l.sent()?[4,eh("insertImage",e,t)]:[2];case 2:return o=l.sent(),i={type:"image",src:Zp(o),href:r,alt:n,style:{},children:[{text:""}]},null===e.selection&&e.restoreSelection(),a=(null===(c=e.getMarks)||void 0===c?void 0:c.call(e))||{},s={},Object.keys(a).forEach(function(e){var t=a[e];null!=t&&!1!==t&&(s[e]=t)}),Ss.getSelectedNodeByType(e,"image")&&e.move(1),Jp(e)?[2]:(co.insertNodes(e,i),Object.keys(s).forEach(function(t){Pr.addMark(e,t,s[t])}),(u=e.getMenuConfig("insertImage").onInsertedImage)&&u(i),[2])}})})}function nh(){return Xp("w-e-edit-image")}var rh=function(){function e(){this.title=ac("image.edit"),this.iconSvg=sf,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=nh(),this.altInputId=nh(),this.hrefInputId=nh(),this.buttonId=nh()}return e.prototype.getValue=function(e){return""},e.prototype.getImageNode=function(e){return Ss.getSelectedNodeByType(e,"image")},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Gn.isCollapsed(t)||null==Ss.getSelectedNodeByType(e,"image"))},e.prototype.getModalPositionNode=function(e){return this.getImageNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.altInputId,i=n.hrefInputId,a=n.buttonId,s=this.getImageNode(e);if(null==s)throw new Error("Not found selected image node");var u=d(mc(ac("image.src"),r),2),l=u[0],c=Zi(u[1]),f=d(mc(ac("image.desc"),o),2),p=f[0],h=Zi(f[1]),g=d(mc(ac("image.link"),i),2),v=g[0],m=Zi(g[1]),y=d(bc(a,ac("common.ok")),1)[0];if(null==this.$content){var b=Zi("<div></div>");b.on("click","#".concat(a),function(n){n.preventDefault();var a=b.find("#".concat(r)).val(),s=b.find("#".concat(o)).val(),u=b.find("#".concat(i)).val();t.updateImage(e,a,s,u),e.hidePanelOrModal()}),this.$content=b}var E=this.$content;E.empty(),E.append(l),E.append(p),E.append(v),E.append(y);var w=s,C=w.src,D=w.alt,A=void 0===D?"":D,S=w.href,x=void 0===S?"":S;return c.val(C),h.val(A),m.val(x),setTimeout(function(){c.focus()}),E[0]},e.prototype.updateImage=function(e,t,n,r,o){void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={}),t&&(e.restoreSelection(),this.isDisabled(e)||function(e,t){u(this,arguments,void 0,function(e,t,n,r,o){var i,a,u,c,d,f;return void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={}),l(this,function(l){switch(l.label){case 0:return[4,Qp("editImage",e,t,n,r)];case 1:return l.sent()?[4,eh("editImage",e,t)]:[2];case 2:return i=l.sent(),null==(a=Ss.getSelectedNodeByType(e,"image"))||(u=a.style,c={src:i,alt:n,href:r,style:s(s({},void 0===u?{}:u),o)},co.setNodes(e,c,{match:function(e){return Ss.checkNodeType(e,"image")}}),d=Ss.getSelectedNodeByType(e,"image"),(f=e.getMenuConfig("editImage").onUpdatedImage)&&f(d)),[2]}})})}(e,t,n,r,o))},e}();function oh(){return Xp("w-e-insert-image")}var ih=function(){function e(){this.title=ac("image.editSize"),this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=oh(),this.heightInputId=oh(),this.buttonId=oh()}return e.prototype.getSelectedImageNode=function(e){return Ss.getSelectedNodeByType(e,"image")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedImageNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedImageNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=t.widthInputId,r=t.heightInputId,o=t.buttonId,i=d(mc(ac("image.width"),n,"auto"),2),a=i[0],u=Zi(i[1]),l=d(mc(ac("image.height"),r,"auto"),2),c=l[0],f=Zi(l[1]),p=d(bc(o,ac("image.ok")),1)[0],h=this.getSelectedImageNode(e);if(null==this.$content){var g=Zi("<div></div>");g.on("click","#".concat(o),function(t){t.preventDefault();var o=g.find("#".concat(n)).val().trim(),i=g.find("#".concat(r)).val().trim(),a=function(e){return/^\d+(\.\d+)?%$/.test(e)},u=function(e){return/^\d+(\.\d+)?$/.test(e)},l=function(e){return/^\d+(\.\d+)?px$/.test(e)},c="auto",d="auto";a(o)?c=o:u(o)?c="".concat(parseInt(o,10),"px"):l(o)&&(c=o),a(i)?d=i:u(i)?d="".concat(parseInt(i,10),"px"):l(i)&&(d=i);var f=h.style,p=void 0===f?{}:f;e.restoreSelection();var v=s(s({},p),{style:{width:c,height:d}});co.setNodes(e,v,{match:function(e){return Ss.checkNodeType(e,"image")}}),e.hidePanelOrModal()}),this.$content=g}var v=this.$content;if(v.empty(),v.append(a),v.append(c),v.append(p),null==h)return v[0];var m=h.style,y=void 0===m?{}:m,b=y.width,E=void 0===b?"auto":b,w=y.height,C=void 0===w?"auto":w;return u.val(E),f.val(C),setTimeout(function(){u.focus()}),v[0]},e}();function ah(){return Xp("w-e-insert-image")}var sh=function(){function e(){this.title=ac("image.netImage"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=ah(),this.altInputId=ah(),this.hrefInputId=ah(),this.buttonId=ah()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return Jp(e)},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.altInputId,i=n.hrefInputId,a=n.buttonId,s=d(mc(ac("image.src"),r),2),u=s[0],l=Zi(s[1]),c=d(mc(ac("image.desc"),o),2),f=c[0],p=Zi(c[1]),h=d(mc(ac("image.link"),i),2),g=h[0],v=Zi(h[1]),m=d(bc(a,ac("common.ok")),1)[0];if(null==this.$content){var y=Zi("<div></div>");y.on("click","#".concat(a),function(n){n.preventDefault();var a=y.find("#".concat(r)).val().trim(),s=y.find("#".concat(o)).val().trim(),u=y.find("#".concat(i)).val().trim();t.insertImage(e,a,s,u),e.hidePanelOrModal()}),this.$content=y}var b=this.$content;return b.empty(),b.append(u),b.append(f),b.append(g),b.append(m),l.val(""),p.val(""),v.val(""),setTimeout(function(){l.focus()}),b[0]},e.prototype.insertImage=function(e,t,n,r){void 0===n&&(n=""),void 0===r&&(r=""),t&&(e.restoreSelection(),this.isDisabled(e)||th(e,t,n,r))},e}(),uh=function(){function e(){this.title=ac("image.preview"),this.iconSvg=uf,this.tag="button"}return e.prototype.getValue=function(e){var t=Ss.getSelectedNodeByType(e,"image");return t&&t.src||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!this.getValue(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("Preview image failed, image.src is '".concat(t,"'"));window.open(t,"_blank")}},e}(),lh=function(){function e(){this.title=ac("image.viewLink"),this.iconSvg=uf,this.tag="button"}return e.prototype.getValue=function(e){var t=Ss.getSelectedNodeByType(e,"image");return t&&t.href||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!this.getValue(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("View image link failed, image.href is '".concat(t,"'"));window.open(t,"_blank")}},e}(),ch=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.getSelectedNode=function(e){return Ss.getSelectedNodeByType(e,"image")},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedNode(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=this.getSelectedNode(e);if(null!=n){var r=Ss.getHoverbar(e);r&&r.hideAndClean();var o=n.style,i={style:s(s({},void 0===o?{}:o),{width:this.value,height:""})};co.setNodes(e,i,{match:function(e){return Ss.checkNodeType(e,"image")}})}}},e}(),dh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="30%",t.value="30%",t}return a(t,e),t}(ch),fh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="50%",t.value="50%",t}return a(t,e),t}(ch),ph=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title="100%",t.value="100%",t}return a(t,e),t}(ch),hh={onInsertedImage:function(e){},onUpdatedImage:function(e){},checkImage:function(e,t,n){return!0},parseImageSrc:function(e){return e}};function gh(e,t){var n=Ss.findKey(e,t).id;return"w-e-image-container-".concat(n)}function vh(e,t,n,r){var o=Zi("body"),i=gh(e,t),a=r.width,u=r.height,l=0,c=0,d=0,f=0,p=!1,h=null;var g=Oc(function(e){e.preventDefault();var t=e.clientX,n=c+(p?l-t:t-l),r=d*(n/c);n>f-6||null!=h&&(n<=15||r<=15||(h.css("width","".concat(n,"px")),h.css("height","".concat(r,"px"))))},100);function v(n){if(o.off("mousemove",g),null!=h){var r=h.width().toFixed(2),i=h.height().toFixed(2),a={style:s(s({},t.style),{width:"".concat(r,"px"),height:"".concat(i,"px")})};co.setNodes(e,a,{at:Ss.findPath(e,t)}),o.off("mouseup",v)}}function m(t,n){h=function(){var e=Zi("#".concat(i));if(0===e.length)throw new Error("Cannot find image container elem");return e}(),l=t,f=n;var r=h.find("img");if(0===r.length)throw new Error("Cannot find image elem");c=r.width(),d=r.height(),o.on("mousemove",g),o.on("mouseup",v);var a=Ss.getHoverbar(e);a&&a.hideAndClean()}var y={};return a&&(y.width=a),u&&(y.height=u),y.boxShadow="0 0 0 1px #B4D5FF",Pd("div",{id:i,style:y,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(n){var r=Zi(n.target);if(r.hasClass("w-e-image-dragger")){n.preventDefault(),(r.hasClass("left-top")||r.hasClass("left-bottom"))&&(p=!0);var o=Ss.getParentNode(e,t);if(null!=o){var i=Ss.toDOMNode(e,o),a=i.getBoundingClientRect?i.getBoundingClientRect():{width:0},s=window.getComputedStyle(i),u=parseFloat(s.paddingLeft),l=parseFloat(s.paddingRight),c=parseFloat(s.borderLeftWidth),d=parseFloat(s.borderRightWidth);m(n.clientX,a.width-u-l-c-d)}}}}},n,Pd("div",{className:"w-e-image-dragger left-top"}),Pd("div",{className:"w-e-image-dragger right-top"}),Pd("div",{className:"w-e-image-dragger left-bottom"}),Pd("div",{className:"w-e-image-dragger right-bottom"}))}var mh={type:"image",renderElem:function(e,t,n){var r=e,o=r.src,i=r.alt,a=void 0===i?"":i,s=r.href,u=void 0===s?"":s,l=r.style,c=void 0===l?{}:l,d=c.width,f=void 0===d?"":d,p=c.height,h=void 0===p?"":p,g=Ss.isNodeSelected(n,e),v={maxWidth:"100%"};f&&(v.width="100%"),h&&(v.height="100%");var m=Pd("img",{style:v,src:o,alt:a,"data-href":u}),y=n.isDisabled();return g&&!y?vh(n,e,m,{width:f,height:h}):function(e,t,n,r){var o=r.width,i=r.height,a={};return o&&(a.width=o),i&&(a.height=i),Pd("div",{id:gh(e,t),style:a,className:"w-e-image-container"},n)}(n,e,m,{width:f,height:h})}},yh={renderElems:[mh],elemsToHtml:[Kp],parseElemsHtml:[{selector:"img:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=Zi(e),o=r.attr("data-href")||"",i=r.attr("width")||"",a=r.attr("height")||"",s=gf(r,"width")||r.attr("data-w-e-style-width")||i,u=gf(r,"height")||r.attr("data-w-e-style-height")||a;return o=decodeURIComponent(o),{type:"image",src:r.attr("src")||"",alt:r.attr("alt")||"",href:o,style:{width:s,height:u},width:i,height:a,children:[{text:""}]}}}],menus:[{key:"insertImage",factory:function(){return new sh},config:hh},{key:"deleteImage",factory:function(){return new Yp}},{key:"editImage",factory:function(){return new rh},config:hh},{key:"previewImage",factory:function(){return new uh}},{key:"viewImageLink",factory:function(){return new lh}},{key:"imageWidth30",factory:function(){return new dh}},{key:"imageWidth50",factory:function(){return new fh}},{key:"imageWidth100",factory:function(){return new ph}},{key:"editorImageSizeMenu",factory:function(){return new ih}}],editorPlugin:function(e){var t=e.isInline,n=e.isVoid,r=e;return r.isInline=function(e){return"image"===e.type||t(e)},r.isVoid=function(e){return"image"===e.type||n(e)},r}};function bh(e){if(!Kn.isElement(e))return!1;var t=e.type;return"paragraph"===t||!("string"!=typeof t||!t.startsWith("header"))}var Eh=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){var t=d(Pr.nodes(e,{match:function(e){return!!e.indent},universal:!0}),1),n=t[0];return null==n?"":d(n,1)[0].indent||""},e.prototype.isActive=function(e){return!1},e.prototype.getMatchNode=function(e){var t=d(Pr.nodes(e,{match:bh,universal:!0,mode:"highest"}),1)[0];return null==t?null:t[0]},e}(),wh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("indent.decrease"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m256-512v384l-256-192z"></path></svg>',t}return a(t,e),t.prototype.isDisabled=function(e){var t=this.getMatchNode(e);return null==t||!t.indent},t.prototype.exec=function(e,t){co.setNodes(e,{indent:null},{match:bh,mode:"highest"})},t}(Eh),Ch=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("indent.increase"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',t.DEFAULT_INDENT_VALUE="2em",t}return a(t,e),t.prototype.isDisabled=function(e){var t=this.getMatchNode(e);return null==t||!!t.indent},t.prototype.getIndentValue=function(e){var t=this.getMatchNode(e);if(!t)return this.DEFAULT_INDENT_VALUE;var n=t.children.filter(Wr.isText)[0];if(!n||!n.fontSize)return this.DEFAULT_INDENT_VALUE;var r=n.fontSize,o=parseInt(n.fontSize,10),i=r.replace("".concat(o),"");return"".concat(2*o).concat(i)},t.prototype.exec=function(e,t){var n=this.getIndentValue(e);co.setNodes(e,{indent:n},{match:bh,mode:"highest"})},t}(Eh);var Dh={renderStyle:function(e,t,n){if(!Kn.isElement(e))return t;if(!bh(e))return t;var r=e.indent,o=t;return r&&("class"===Gf(n)?Kf(o,"indent",r,n,"render",{textIndent:r}):Lf(o,{textIndent:r})),o},styleToHtml:function(e,t,n){if(!Kn.isElement(e))return t;if(!bh(e))return t;var r=e.indent;if(!r)return t;var o=Zi(t);return"class"===Gf(n)?qf(o,"indent",r,n,"toHtml",function(){o.css("text-indent",r)}):o.css("text-indent",r),pf(o)},preParseHtml:[{selector:"p,h1,h2,h3,h4,h5",preParseHtml:function(e){var t=Zi(e),n=gf(t,"padding-left");return/^[1-9]\d*em$/.test(n)&&t.css("text-indent","2em"),/^[1-9]\d*px$/.test(n)&&parseInt(n,10)%32==0&&t.css("text-indent","2em"),t[0]}}],parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Kn.isElement(t))return t;if(!bh(t))return t;var o=t,i=gf(r,"text-indent")||Yf(r,"indent",n),a=parseInt(i,10);return i&&a>0&&(o.indent=i),o},menus:[{key:"indent",factory:function(){return new Ch}},{key:"delIndent",factory:function(){return new wh}}]},Ah=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!!Ss.getSelectedElems(e).some(function(t){var n=t.type;return!(!Pr.isVoid(e,t)||!Pr.isBlock(e,t)||"video"===n)||!!["pre","code"].includes(n)})},e}(),Sh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("justify.center"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return a(t,e),t.prototype.exec=function(e,t){co.setNodes(e,{textAlign:"center"},{match:function(t){return Kn.isElement(t)&&!e.isInline(t)}})},t}(Ah),xh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("justify.justify"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>',t}return a(t,e),t.prototype.exec=function(e,t){co.setNodes(e,{textAlign:"justify"},{match:function(t){return Kn.isElement(t)&&!e.isInline(t)}})},t}(Ah),Nh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("justify.left"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return a(t,e),t.prototype.exec=function(e,t){co.setNodes(e,{textAlign:"left"},{match:function(t){return Kn.isElement(t)&&!e.isInline(t)}})},t}(Ah),Bh=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.title=ac("justify.right"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return a(t,e),t.prototype.exec=function(e,t){co.setNodes(e,{textAlign:"right"},{match:function(t){return Kn.isElement(t)&&!e.isInline(t)}})},t}(Ah);var Oh={renderStyle:function(e,t,n){if(!Kn.isElement(e))return t;var r=e.textAlign,o=t;return r&&("class"===Gf(n)?Kf(o,"textAlign",r,n,"render",{textAlign:r}):Lf(o,{textAlign:r})),o},styleToHtml:function(e,t,n){if(!Kn.isElement(e))return t;var r=e.textAlign;if(!r)return t;var o=Zi(t);return"class"===Gf(n)?qf(o,"textAlign",r,n,"toHtml",function(){o.css("text-align",r)}):o.css("text-align",r),pf(o)},parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Kn.isElement(t))return t;var o=t,i=gf(r,"text-align")||Yf(r,"textAlign",n);return i&&(o.textAlign=i),o},menus:[{key:"justifyLeft",factory:function(){return new Nh}},{key:"justifyRight",factory:function(){return new Bh}},{key:"justifyCenter",factory:function(){return new Sh}},{key:"justifyJustify",factory:function(){return new xh}}]},Th=function(){function e(){this.title=ac("lineHeight.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M964 788a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526zM198.93 144.306c6.668-5.798 16.774-5.094 22.573 1.574l122.26 140.582a16 16 0 0 1 3.927 10.5c0 8.836-7.164 16-16 16h-61.8a8 8 0 0 0-8 8v390.077h69.819a16 16 0 0 1 10.502 3.928c6.666 5.8 7.37 15.906 1.57 22.573L221.476 878.123a16 16 0 0 1-1.57 1.57c-6.668 5.8-16.774 5.097-22.574-1.57L75.051 737.538a16 16 0 0 1-3.928-10.5c0-8.837 7.163-16 16-16h69.822V312.96H87.127a16 16 0 0 1-10.502-3.928c-6.666-5.8-7.37-15.906-1.57-22.573l122.303-140.582a16 16 0 0 1 1.572-1.572zM964 465a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z m0-323a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z"></path></svg>',this.tag="select",this.width=80}return e.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig("lineHeight").lineHeightList,r=void 0===n?[]:n;t.push({text:ac("lineHeight.default"),value:""}),r.forEach(function(e){t.push({text:e,value:e})});var o=this.getValue(e);return t.forEach(function(e){e.value===o?e.selected=!0:e.selected=void 0}),t},e.prototype.getMatchNode=function(e){var t=d(Pr.nodes(e,{match:function(e){var t=Ss.getNodeType(e);return!!t.startsWith("header")||!!["paragraph","blockquote","list-item"].includes(t)},universal:!0,mode:"highest"}),1),n=t[0];return null==n?null:n[0]},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.getMatchNode(e);return null==t?"":Kn.isElement(t)&&t.lineHeight||""},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getMatchNode(e)},e.prototype.exec=function(e,t){co.setNodes(e,{lineHeight:t.toString()},{mode:"highest"})},e}();var kh={renderStyle:function(e,t,n){if(!Kn.isElement(e))return t;var r=e.lineHeight,o=t;return r&&("class"===Gf(n)?Kf(o,"lineHeight",r,n,"render",{lineHeight:r}):Lf(o,{lineHeight:r})),o},styleToHtml:function(e,t,n){if(!Kn.isElement(e))return t;var r=e.lineHeight;if(!r)return t;var o=Zi(t);return"class"===Gf(n)?qf(o,"lineHeight",r,n,"toHtml",function(){o.css("line-height",r)}):o.css("line-height",r),pf(o)},parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Kn.isElement(t))return t;var o=t,i=n.getMenuConfig("lineHeight").lineHeightList,a=void 0===i?[]:i,s=gf(r,"line-height")||Yf(r,"lineHeight",n);return s&&a.includes(s)&&(o.lineHeight=s),o},menus:[{key:"lineHeight",factory:function(){return new Th},config:{lineHeightList:["1","1.15","1.5","2","2.5","3"]}}]};var Fh={type:"link",elemToHtml:function(e,t){var n=e,r=n.url,o=n.target,i=void 0===o?"_blank":o;return'<a href="'.concat(r,'" target="').concat(i,'">').concat(t,"</a>")}};var Ih=/[\t\n\f\r]+/g,Ph=/ /g;function _h(e){var t=e.replace(Ih,"").trim();return t.indexOf(" ")<0?t:t.replace(Ph,"%20")}function Rh(e,t,n,r){return u(this,void 0,void 0,function(){var o,i,a;return l(this,function(s){switch(s.label){case 0:return o=_h(r),(i=t.getMenuConfig(e).checkLink)?[4,i(n,o)]:[3,2];case 1:if("string"==typeof(a=s.sent()))return t.alert(a,"error"),[2,!1];if(null==a)return[2,!1];s.label=2;case 2:return[2,!0]}})})}function Lh(e,t,n){return u(this,void 0,void 0,function(){var r,o;return l(this,function(i){switch(i.label){case 0:return r=_h(n),(o=t.getMenuConfig(e).parseLinkUrl)?[4,o(r)]:[3,2];case 1:return[2,_h(i.sent())];case 2:return[2,r]}})})}function Mh(e){return null==e.selection||!!Ss.getSelectedElems(e).some(function(t){var n=t.type;return!!e.isVoid(t)||!!["pre","code","link"].includes(n)})}function jh(e,t){return{type:"link",url:Zp(e),children:t?[{text:t}]:[]}}function Hh(e,t,n){return u(this,void 0,void 0,function(){var r,o,i,a,s;return l(this,function(u){switch(u.label){case 0:return t||(t=n),e.restoreSelection(),Mh(e)?[2]:[4,Rh("insertLink",e,t,n)];case 1:return u.sent()?[4,Lh("insertLink",e,n)]:[2];case 2:if(!(r=u.sent()))return[2];if(null==(o=e.selection))return[2];if(Gn.isCollapsed(o)){if((a=Ss.getLeftLengthOfMaxLength(e))<=0)return[2];e.insertText(" "),a<t.length+1&&(t=t.slice(0,a-1)),s=jh(r,t),co.insertNodes(e,s),e.insertFragment([{text:" "}])}else if((i=Pr.string(e,o))!==t){if((a=Ss.getLeftLengthOfMaxLength(e))<=0)return[2];a<i.length-t.length&&(t=t.slice(0,a)),e.deleteFragment(),s=jh(r,t),co.insertNodes(e,s)}else s=jh(r),co.wrapNodes(e,s,{split:!0}),co.collapse(e,{edge:"end"});return[2]}})})}function zh(){return Xp("w-e-update-link")}var $h=function(){function e(){this.title=ac("link.edit"),this.iconSvg=sf,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.urlInputId=zh(),this.buttonId=zh()}return e.prototype.getSelectedLinkElem=function(e){var t=Ss.getSelectedNodeByType(e,"link");return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectedLinkElem(e);return t&&t.url||""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedLinkElem(e)},e.prototype.getModalPositionNode=function(e){return Ss.getSelectedNodeByType(e,"link")},e.prototype.getModalContentElem=function(e){var t=this.urlInputId,n=this.buttonId,r=d(mc(ac("link.url"),t),2),o=r[0],i=Zi(r[1]),a=d(bc(n,ac("common.ok")),1)[0];if(null==this.$content){var s=Zi("<div></div>");s.on("click","#".concat(n),function(n){n.preventDefault(),e.restoreSelection();var r=Ss.getSelectedNodeByType(e,"link"),o=r?Qn.string(r):"",i=s.find("#".concat(t)).val();!function(e,t,n){u(this,void 0,void 0,function(){var r,o;return l(this,function(i){switch(i.label){case 0:return[4,Rh("editLink",e,t,n)];case 1:return i.sent()?[4,Lh("editLink",e,n)]:[2];case 2:return(r=i.sent())?(o={url:Zp(r)},co.setNodes(e,o,{match:function(e){return Ss.checkNodeType(e,"link")}}),[2]):[2]}})})}(e,o,i),e.hidePanelOrModal()}),this.$content=s}var c=this.$content;c.empty(),c.append(o),c.append(a);var f=this.getValue(e);return i.val(f),setTimeout(function(){i.focus()}),c[0]},e}();function Uh(){return Xp("w-e-insert-link")}var Vh=function(){function e(){this.title=ac("link.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M440.224 635.776a51.84 51.84 0 0 1-36.768-15.232c-95.136-95.136-95.136-249.92 0-345.056l192-192C641.536 37.408 702.816 12.032 768 12.032s126.432 25.376 172.544 71.456c95.136 95.136 95.136 249.92 0 345.056l-87.776 87.776a51.968 51.968 0 1 1-73.536-73.536l87.776-87.776a140.16 140.16 0 0 0 0-197.984c-26.432-26.432-61.6-40.992-99.008-40.992s-72.544 14.56-99.008 40.992l-192 192a140.16 140.16 0 0 0 0 197.984 51.968 51.968 0 0 1-36.768 88.768z"></path><path d="M256 1012a242.4 242.4 0 0 1-172.544-71.456c-95.136-95.136-95.136-249.92 0-345.056l87.776-87.776a51.968 51.968 0 1 1 73.536 73.536l-87.776 87.776a140.16 140.16 0 0 0 0 197.984c26.432 26.432 61.6 40.992 99.008 40.992s72.544-14.56 99.008-40.992l192-192a140.16 140.16 0 0 0 0-197.984 51.968 51.968 0 1 1 73.536-73.536c95.136 95.136 95.136 249.92 0 345.056l-192 192A242.4 242.4 0 0 1 256 1012z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=Uh(),this.urlInputId=Uh(),this.buttonId=Uh()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return Mh(e)},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=e.selection,n=this,r=n.textInputId,o=n.urlInputId,i=n.buttonId,a=d(mc(ac("link.text"),r),2),s=a[0],u=Zi(a[1]),l=d(mc(ac("link.url"),o),2),c=l[0],f=Zi(l[1]),p=d(bc(i,ac("common.ok")),1)[0];if(null==this.$content){var h=Zi("<div></div>");h.on("click","#".concat(i),function(t){t.preventDefault();var n=h.find("#".concat(r)).val(),i=h.find("#".concat(o)).val();Hh(e,n,i),e.hidePanelOrModal()}),this.$content=h}var g=this.$content;if(g.empty(),g.append(s),g.append(c),g.append(p),null==t||Gn.isCollapsed(t))u.val("");else{var v=Pr.string(e,t);u.val(v)}return f.val(""),setTimeout(function(){u.focus()}),g[0]},e}(),Wh=function(){function e(){this.title=ac("link.unLink"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M608.16328 811.815036c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.347563 89.347564c-118.525421 118.523421-311.38448 118.531421-429.919901 0-118.527421-118.529421-118.527421-311.39048 0-429.917901l89.349564-89.349563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.195613 79.195613c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.349563 89.347564c-56.143726 56.145726-56.143726 147.49928 0 203.645005 56.143726 56.143726 147.49928 56.145726 203.647005 0l89.347564-89.347563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.193613 79.195613z m-113.135447-520.429459c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.347564-89.347564c56.143726-56.149726 147.49928-56.145726 203.647006 0 56.143726 56.145726 56.143726 147.49928 0 203.645006l-89.349564 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.195613 79.195613c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.349564-89.349563c118.529421-118.529421 118.529421-311.38848 0-429.917901-118.531421-118.527421-311.38848-118.527421-429.919901 0l-89.347563 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.193613 79.195613z m469.653707 718.556492l45.253779-45.253779c18.745908-18.745908 18.745908-49.13776 0-67.881669L127.195629 14.062931c-18.745908-18.745908-49.13776-18.745908-67.881669 0L14.058181 59.31871c-18.745908 18.745908-18.745908 49.13776 0 67.881669l882.74169 882.74169c18.745908 18.743908 49.13776 18.743908 67.881669 0z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==Ss.getSelectedNodeByType(e,"link")},e.prototype.exec=function(e,t){this.isDisabled(e)||co.unwrapNodes(e,{match:function(e){return Ss.checkNodeType(e,"link")}})},e}(),Gh=function(){function e(){this.title=ac("link.view"),this.iconSvg=uf,this.tag="button"}return e.prototype.getSelectedLinkElem=function(e){var t=Ss.getSelectedNodeByType(e,"link");return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectedLinkElem(e);return t&&t.url||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedLinkElem(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("View link failed, link url is '".concat(t,"'"));window.open(t,"_blank")}},e}(),qh={checkLink:function(e,t){return!0},parseLinkUrl:function(e){return e}},Kh={key:"insertLink",factory:function(){return new Vh},config:qh},Yh={key:"editLink",factory:function(){return new $h},config:qh},Xh={key:"unLink",factory:function(){return new Wh}},Zh={key:"viewLink",factory:function(){return new Gh}};var Jh,Qh,eg={selector:"a:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=Zi(e);return 0===(t=t.filter(function(e){return!!Wr.isText(e)||!!n.isInline(e)})).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"link",url:_h(r.attr("href")||""),target:r.attr("target")||"",children:t}}};var tg=function(){if(Qh)return Jh;Qh=1,Jh=function(r){if("string"!=typeof r)return!1;var o=r.match(e);if(!o)return!1;var i=o[1];if(!i)return!1;if(t.test(i)||n.test(i))return!0;return!1};var e=/^(?:\w+:)?\/\/(\S+)$/,t=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;return Jh}(),ng=g(tg);var rg={type:"link",renderElem:function(e,t,n){var r=e,o=r.url,i=r.target;return Pd("a",{href:o,target:void 0===i?"_blank":i},t)}},og={renderElems:[rg],elemsToHtml:[Fh],parseElemsHtml:[eg],menus:[Kh,Yh,Xh,Zh],editorPlugin:function(e){var t=e.isInline,n=e.insertData,r=e.normalizeNode,o=e;return o.isInline=function(e){return"link"===e.type||t(e)},o.insertData=function(e){var t=e.getData("text/plain");if(ng(t)){if(/<img[^>]+>/.test(e.getData("text/html")))n(e);else if(!Mh(o)){var r=o.selection;if(null!=r){var i=Pr.string(o,r);Hh(o,i,t)}}}else n(e)},o.normalizeNode=function(e){var t=d(e,2),n=t[0],i=t[1];return"link"!==Ss.getNodeType(n)?r([n,i]):""===Qn.string(n)?co.removeNodes(o,{at:i}):r([n,i])},o}};var ig={selector:"p:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=Zi(e);return 0===(t=t.filter(function(e){return!!Wr.isText(e)||!!n.isInline(e)})).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"paragraph",children:t}}};function ag(e){var t=d(Pr.nodes(e,{match:function(t){return e.children[0]===t},mode:"highest"}),1),n=t[0];if(null==n)return!1;var r=n[0];if(!Kn.isElement(r))return!1;if("paragraph"===r.type)return!1;if(""!==Qn.string(r))return!1;var o=r.children,i=void 0===o?[]:o;return!!Wr.isText(i[0])&&(co.setNodes(e,{type:"paragraph"}),!0)}var sg={type:"paragraph",renderElem:function(e,t,n){return Pd("p",null,t)}},ug={renderElems:[sg],elemsToHtml:[{type:"paragraph",elemToHtml:function(e,t){return""===t?"<p><br></p>":"<p>".concat(t,"</p>")}}],parseElemsHtml:[ig],editorPlugin:function(e){var t=e.deleteBackward,n=e.deleteForward,r=e;return r.deleteBackward=function(e){ag(r)||t(e)},r.deleteForward=function(e){ag(r)||n(e)},r}};function lg(e,t){if(null==e.selection)return!0;var n=d(Pr.nodes(e,{match:function(t){return"pre"===Ss.getNodeType(t)||!(!Kn.isElement(t)||!Pr.isVoid(e,t))},universal:!0}),1);return!!n[0]}function cg(e,t){Object.keys(t).forEach(function(t){"text"!==t&&Pr.removeMark(e,t)})}var dg=function(){function e(){this.marksNeedToRemove=[],this.tag="button"}return e.prototype.getValue=function(e){var t=this.mark,n=Pr.marks(e);if(n)return n[t];var r=d(Pr.nodes(e,{match:function(e){return!0===e[t]}}),1);return!!r[0]},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){return lg(e,this.mark)},e.prototype.exec=function(e,t){var n=this.mark,r=this.marksNeedToRemove;t?e.removeMark(n):(e.addMark(n,!0),r&&r.forEach(function(t){return e.removeMark(t)}))},e}(),fg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="bold",t.title=ac("textStyle.bold"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M707.872 484.64A254.88 254.88 0 0 0 768 320c0-141.152-114.848-256-256-256H192v896h384c141.152 0 256-114.848 256-256a256.096 256.096 0 0 0-124.128-219.36zM384 192h101.504c55.968 0 101.504 57.408 101.504 128s-45.536 128-101.504 128H384V192z m159.008 640H384v-256h159.008c58.464 0 106.016 57.408 106.016 128s-47.552 128-106.016 128z"></path></svg>',t.hotkey="mod+b",t}return a(t,e),t}(dg),pg=function(){function e(){this.title=ac("textStyle.clear"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M969.382408 288.738615l-319.401123-270.852152a67.074236 67.074236 0 0 0-96.459139 5.74922l-505.931379 574.922021a68.35184 68.35184 0 0 0-17.886463 47.910169 74.101061 74.101061 0 0 0 24.274486 47.910168l156.50655 132.232065h373.060512L975.131628 383.281347a67.074236 67.074236 0 0 0-5.74922-96.459139z m-440.134747 433.746725H264.144729l-90.071117-78.572676c-5.74922-5.74922-12.137243-12.137243-12.137243-17.886463a36.411728 36.411728 0 0 1 5.749221-24.274485l210.804741-240.828447 265.102932 228.691204z m-439.495945 180.781036h843.218964a60.047411 60.047411 0 1 1 0 120.733624H89.751716a60.047411 60.047411 0 1 1 0-120.733624z m0 0"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return lg(e)},e.prototype.exec=function(e,t){var n,r,o=Pr.nodes(e,{match:function(e){return Wr.isText(e)},universal:!0});try{for(var i=c(o),a=i.next();!a.done;a=i.next()){cg(e,a.value[0])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e}(),hg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="code",t.title=ac("textStyle.code"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M576 736l96 96 320-320L672 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224z"></path></svg>',t.hotkey="mod+e",t}return a(t,e),t}(dg),gg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="italic",t.title=ac("textStyle.italic"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M896 64v64h-128L448 896h128v64H128v-64h128L576 128h-128V64z"></path></svg>',t.hotkey="mod+i",t}return a(t,e),t}(dg),vg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="sub",t.marksNeedToRemove=["sup"],t.title=ac("textStyle.sub"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 910.016v50.016h128v64h-192v-146.016l128-60V768h-128v-64h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',t.hotkey="",t}return a(t,e),t}(dg),mg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="sup",t.marksNeedToRemove=["sub"],t.title=ac("textStyle.sup"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 206.016v50.016h128v64h-192V174.016l128-60V64h-128V0h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',t.hotkey="",t}return a(t,e),t}(dg),yg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="through",t.title=ac("textStyle.through"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M1024 512v64h-234.496c27.52 38.496 42.496 82.688 42.496 128 0 70.88-36.672 139.04-100.576 186.976C672.064 935.488 594.144 960 512 960s-160.064-24.512-219.424-69.024C228.64 843.04 192 774.88 192 704h128c0 69.376 87.936 128 192 128s192-58.624 192-128-87.936-128-192-128H0v-64h299.52a385.984 385.984 0 0 1-6.944-5.024C228.64 459.04 192 390.88 192 320s36.672-139.04 100.576-186.976C351.936 88.512 429.856 64 512 64s160.064 24.512 219.424 69.024C795.328 180.96 832 249.12 832 320h-128c0-69.376-87.936-128-192-128s-192 58.624-192 128 87.936 128 192 128c78.976 0 154.048 22.688 212.48 64H1024z"></path></svg>',t.hotkey="mod+shift+x",t}return a(t,e),t}(dg),bg=function(e){function t(){var t=e.apply(this,f([],d(arguments),!1))||this;return t.mark="underline",t.title=ac("textStyle.underline"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M704 64l128 0 0 416c0 159.072-143.264 288-320 288s-320-128.928-320-288l0-416 128 0 0 416c0 40.16 18.24 78.688 51.36 108.512 36.896 33.216 86.848 51.488 140.64 51.488s103.744-18.304 140.64-51.488c33.12-29.792 51.36-68.352 51.36-108.512l0-416zM192 832l640 0 0 128-640 0z"></path></svg>',t.hotkey="mod+u",t}return a(t,e),t}(dg);function Eg(e,t){return 0!==e.length&&e[0].matches(t)}function wg(e,t){var n=gf(e,"text-decoration"),r=gf(e,"text-decoration-line");return n.includes(t)||r.includes(t)}function Cg(e,t){var n=t,r=e,o=r.bold,i=r.italic,a=r.underline,s=r.code,u=r.through,l=r.sub,c=r.sup;return o&&(n="<strong>".concat(n,"</strong>")),s&&(n="<code>".concat(n,"</code>")),i&&(n="<em>".concat(n,"</em>")),a&&(n="<u>".concat(n,"</u>")),u&&(n="<s>".concat(n,"</s>")),l&&(n="<sub>".concat(n,"</sub>")),c&&(n="<sup>".concat(n,"</sup>")),n}var Dg={renderStyle:function(e,t){var n=e,r=n.bold,o=n.italic,i=n.underline,a=n.code,s=n.through,u=n.sub,l=n.sup,c=t;return r&&(c=Pd("strong",null,c)),a&&(c=Pd("code",null,c)),o&&(c=Pd("em",null,c)),i&&(c=Pd("u",null,c)),s&&(c=Pd("s",null,c)),u&&(c=Pd("sub",null,c)),l&&(c=Pd("sup",null,c)),c},menus:[{key:"bold",factory:function(){return new fg}},{key:"underline",factory:function(){return new bg}},{key:"italic",factory:function(){return new gg}},{key:"through",factory:function(){return new yg}},{key:"code",factory:function(){return new hg}},{key:"sub",factory:function(){return new vg}},{key:"sup",factory:function(){return new mg}},{key:"clearStyle",factory:function(){return new pg}}],styleToHtml:function(e,t){if(!Wr.isText(e))return t;if(ff(t))return Cg(e,t);var n=Zi(t),r=n.html();return r=Cg(e,r),n.html(r),pf(n)},parseStyleHtml:function(e,t,n){var r=Zi(e);if(!Wr.isText(t))return t;var o=t;return gf(r,"font-weight")?o.bold=function(e){var t=gf(e,"font-weight");if(!t)return!1;if("bold"===t||"bolder"===t)return!0;var n=Number(t);return!Number.isNaN(n)&&n>=600}(r):Eg(r,"b,strong")&&(o.bold=!0),(Eg(r,"i,em")||["italic","oblique"].includes(gf(r,"font-style")))&&(o.italic=!0),(Eg(r,"u")||wg(r,"underline"))&&(o.underline=!0),(Eg(r,"s,strike")||wg(r,"line-through"))&&(o.through=!0),(Eg(r,"sub")||"sub"===gf(r,"vertical-align"))&&(o.sub=!0),(Eg(r,"sup")||"super"===gf(r,"vertical-align"))&&(o.sup=!0),Eg(r,"code")&&(o.code=!0),o}};var Ag={type:"todo",elemToHtml:function(e,t){var n=e.checked;return'<div data-w-e-type="todo"><input type="checkbox" disabled '.concat(n?"checked":"",">").concat(t,"</div>")}},Sg=function(){function e(){this.title=ac("todo.todo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M278.755556 403.911111l-79.644445 79.644445L455.111111 739.555556l568.888889-568.888889-79.644444-79.644445L455.111111 580.266667l-176.355555-176.355556zM910.222222 910.222222H113.777778V113.777778h568.888889V0H113.777778C51.2 0 0 51.2 0 113.777778v796.444444c0 62.577778 51.2 113.777778 113.777778 113.777778h796.444444c62.577778 0 113.777778-51.2 113.777778-113.777778V455.111111h-113.777778v455.111111z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!!Ss.getSelectedNodeByType(e,"todo")},e.prototype.isDisabled=function(e){return null==e.selection||!!Ss.getSelectedElems(e).some(function(t){if(Pr.isVoid(e,t)&&Pr.isBlock(e,t))return!0;var n=t.type;return!!["pre","table","list-item"].includes(n)})},e.prototype.exec=function(e,t){var n=this.isActive(e);co.setNodes(e,{type:n?"paragraph":"todo"})},e}();var xg={selector:'div[data-w-e-type="todo"]',parseElemHtml:function(e,t,n){var r=Zi(e);0===(t=t.filter(function(e){return!!Wr.isText(e)||!!n.isInline(e)})).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]);var o=!1;return null!=r.find('input[type="checkbox"]').attr("checked")&&(o=!0),{type:"todo",checked:o,children:t}}};var Ng={type:"todo",renderElem:function(e,t,n){var r=!1;n.isDisabled()&&(r=!0);var o=Pd("div",{style:{margin:"5px 0"}},Pd("span",{contentEditable:!1,style:{marginRight:"0.5em"}},Pd("input",{type:"checkbox",checked:e.checked,disabled:r,on:{change:function(t){var r=Ss.findPath(n,e),o={checked:t.target.checked};co.setNodes(n,o,{at:r})}}})),Pd("span",null,t));return o}},Bg={renderElems:[Ng],elemsToHtml:[Ag],preParseHtml:[{selector:"ul.w-e-todo",preParseHtml:function(e){var t=Zi(e).find("li"),n=Zi('<div data-w-e-type="todo"></div>'),r=t.find("input[type]");return n.append(r),t.children()[0].remove(),n[0].innerHTML+=t[0].innerHTML,n[0]}}],parseElemsHtml:[xg],menus:[{key:"todo",factory:function(){return new Sg}}],editorPlugin:function(e){var t=e.deleteBackward,n=e;return n.deleteBackward=function(n){var r=e.selection;if(r&&Gn.isCollapsed(r)){var o=Ss.getSelectedNodeByType(e,"todo");if(o&&0===Qn.string(o).length)return void co.setNodes(e,{type:"paragraph"},{mode:"highest"})}t(n)},n}},Og=function(){function e(){this.title=ac("undo.redo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0.00032 576a510.72 510.72 0 0 0 173.344 384l84.672-96A383.136 383.136 0 0 1 128.00032 576C128.00032 363.936 299.93632 192 512.00032 192c106.048 0 202.048 42.976 271.52 112.48L640.00032 448h384V64l-149.984 149.984A510.272 510.272 0 0 0 512.00032 64C229.21632 64 0.00032 293.216 0.00032 576z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection},e.prototype.exec=function(e,t){"function"==typeof e.redo&&e.redo()},e}(),Tg=function(){function e(){this.title=ac("undo.undo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 64A510.272 510.272 0 0 0 149.984 213.984L0.032 64v384h384L240.512 304.48A382.784 382.784 0 0 1 512.032 192c212.064 0 384 171.936 384 384 0 114.688-50.304 217.632-130.016 288l84.672 96a510.72 510.72 0 0 0 173.344-384c0-282.784-229.216-512-512-512z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection},e.prototype.exec=function(e,t){"function"==typeof e.undo&&e.undo()},e}(),kg=[Dg,Zf,lp,Dh,Oh,kh,yh,np,op,og,Of,Ef,qp,ug,Bg,dp,{menus:[{key:"redo",factory:function(){return new Og}},{key:"undo",factory:function(){return new Tg}}]},pp,Qf];nc("en",{highLightModule:{selectLang:"Language"}}),nc("zh-CN",{highLightModule:{selectLang:"选择语言"}});var Fg,Ig={exports:{}};var Pg=(Fg||(Fg=1,function(e){var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},o.util.type(t)){case"Object":if(i=o.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=o.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,o){r[o]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var o=e.classList;if(o.contains(t))return!0;if(o.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=o.util.clone(o.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||o.languages)[e],a={};for(var s in i)if(i.hasOwnProperty(s)){if(s==t)for(var u in n)n.hasOwnProperty(u)&&(a[u]=n[u]);n.hasOwnProperty(s)||(a[s]=i[s])}var l=r[e];return r[e]=a,o.languages.DFS(o.languages,function(t,n){n===l&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,r,i){i=i||{};var a=o.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var u=t[s],l=o.util.type(u);"Object"!==l||i[a(u)]?"Array"!==l||i[a(u)]||(i[a(u)]=!0,e(u,n,s,i)):(i[a(u)]=!0,e(u,n,null,i))}}},plugins:{},highlightAll:function(e,t){o.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),o.hooks.run("before-all-elements-highlight",r);for(var i,a=0;i=r.elements[a++];)o.highlightElement(i,!0===t,r.callback)},highlightElement:function(t,n,r){var i=o.util.getLanguage(t),a=o.languages[i];o.util.setLanguage(t,i);var s=t.parentElement;s&&"pre"===s.nodeName.toLowerCase()&&o.util.setLanguage(s,i);var u={element:t,language:i,grammar:a,code:t.textContent};function l(e){u.highlightedCode=e,o.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,o.hooks.run("after-highlight",u),o.hooks.run("complete",u),r&&r.call(u.element)}if(o.hooks.run("before-sanity-check",u),(s=u.element.parentElement)&&"pre"===s.nodeName.toLowerCase()&&!s.hasAttribute("tabindex")&&s.setAttribute("tabindex","0"),!u.code)return o.hooks.run("complete",u),void(r&&r.call(u.element));if(o.hooks.run("before-highlight",u),u.grammar)if(n&&e.Worker){var c=new Worker(o.filename);c.onmessage=function(e){l(e.data)},c.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else l(o.highlight(u.code,u.grammar,u.language));else l(o.util.encode(u.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(o.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=o.tokenize(r.code,r.grammar),o.hooks.run("after-tokenize",r),i.stringify(o.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new u;return l(o,o.head,e),s(e,o,t,o.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=o.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=o.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function a(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function s(e,t,n,r,u,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var h=0;h<p.length;++h){if(d&&d.cause==f+","+h)return;var g=p[h],v=g.inside,m=!!g.lookbehind,y=!!g.greedy,b=g.alias;if(y&&!g.pattern.global){var E=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,E+"g")}for(var w=g.pattern||g,C=r.next,D=u;C!==t.tail&&!(d&&D>=d.reach);D+=C.value.length,C=C.next){var A=C.value;if(t.length>e.length)return;if(!(A instanceof i)){var S,x=1;if(y){if(!(S=a(w,D,e,m))||S.index>=e.length)break;var N=S.index,B=S.index+S[0].length,O=D;for(O+=C.value.length;N>=O;)O+=(C=C.next).value.length;if(D=O-=C.value.length,C.value instanceof i)continue;for(var T=C;T!==t.tail&&(O<B||"string"==typeof T.value);T=T.next)x++,O+=T.value.length;x--,A=e.slice(D,O),S.index-=D}else if(!(S=a(w,0,A,m)))continue;N=S.index;var k=S[0],F=A.slice(0,N),I=A.slice(N+k.length),P=D+A.length;d&&P>d.reach&&(d.reach=P);var _=C.prev;if(F&&(_=l(t,_,F),D+=F.length),c(t,_,x),C=l(t,_,new i(f,v?o.tokenize(k,v):k,b,k)),I&&l(t,C,I),x>1){var R={cause:f+","+h,reach:P};s(e,t,n,C.prev,D,R),d&&R.reach>d.reach&&(d.reach=R.reach)}}}}}}function u(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function c(e,t,n){for(var r=t.next,o=0;o<n&&r!==e.tail;o++)r=r.next;t.next=r,r.prev=t,e.length-=o}if(e.Prism=o,i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach(function(t){r+=e(t,n)}),r}var i={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},a=t.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(i.classes,a):i.classes.push(a)),o.hooks.run("wrap",i);var s="";for(var u in i.attributes)s+=" "+u+'="'+(i.attributes[u]||"").replace(/"/g,"&quot;")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+s+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,a=n.immediateClose;e.postMessage(o.highlight(i,o.languages[r],r)),a&&e.close()},!1),o):o;var d=o.util.currentScript();function f(){o.manual||o.highlightAll()}if(d&&(o.filename=d.src,d.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});
13
13
  /**
14
14
  * Prism: Lightweight, robust, elegant syntax highlighting
15
15
  *