TaskSystem/public/admin/assets/@wangeditor.afd76521.js

47 lines
256 KiB
JavaScript
Raw Normal View History

2023-08-15 09:44:59 +08:00
import{d as g9,r as v2,s as HP,j as UP,w as VP,l as WP,t as qP,o as v9,c as m9}from"./@vue.51d7f2d8.js";var Pv;if(typeof global>"u"){if("ActiveXObject"in window){var d5="\u62B1\u6B49\uFF0CwangEditor V5+ \u7248\u672C\u5F00\u59CB\uFF0C\u4E0D\u5728\u652F\u6301 IE \u6D4F\u89C8\u5668";d5+=`
2023-07-15 10:16:32 +08:00
Sorry, wangEditor V5+ versions do not support IE browser.`,console.error(d5)}p5(),h5()}else global&&((Pv=global.navigator)===null||Pv===void 0?void 0:Pv.userAgent.match("QQBrowser"))&&(p5(),h5());function p5(){typeof globalThis>"u"&&(window.globalThis=window)}function h5(){typeof AggregateError>"u"&&(window.AggregateError=function(e,t){var n=new Error(t);return n.errors=e,n})}if(typeof global=="object"){var GP=Object.getOwnPropertyDescriptor(global,"window");(!global.window||GP.set)&&(global.window=global,global.requestAnimationFrame=function(){},global.navigator={userAgent:""},global.location={hostname:"0.0.0.0",port:0,protocol:"http:"},global.btoa=function(){},global.crypto={getRandomValues:function(e){return nodeCrypto.randomFillSync(e)}}),global.document!=null&&global.document.getElementsByTagName==null&&(global.document.getElementsByTagName=function(){return[]})}/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/function g5(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zt(e){var t,n;return g5(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(g5(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}function Ht(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];{var i=tN[e],o=i?typeof i=="function"?i.apply(null,n):i:"unknown error nr: "+e;throw Error("[Immer] "+o)}}function Oa(e){return!!e&&!!e[xn]}function Ba(e){return!!e&&(function(t){if(!t||typeof t!="object")return!1;var n=Object.getPrototypeOf(t);if(n===null)return!0;var r=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return r===Object||typeof r=="function"&&Function.toString.call(r)===nN}(e)||Array.isArray(e)||!!e[C5]||!!e.constructor[C5]||E$(e)||C$(e))}function qc(e,t,n){n===void 0&&(n=!1),Ts(e)===0?(n?Object.keys:O$)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,i){return t(i,r,e)})}function Ts(e){var t=e[xn];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:E$(e)?2:C$(e)?3:0}function m2(e,t){return Ts(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function KP(e,t){return Ts(e)===2?e.get(t):e[t]}function y9(e,t,n){var r=Ts(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function YP(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function E$(e){return QP&&e instanceof Map}function C$(e){return eN&&e instanceof Set}function Xo(e){return e.o||e.t}function D$(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=rN(e);delete t[xn];for(var n=O$(t),r=0;r<n.length;r++){var i=n[r],o=t[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function S$(e,t){return t===void 0&&(t=!1),x$(e)||Oa(e)||!Ba(e)||(Ts(e)>1&&(e.set=e.add=e.clear=e.delete=XP),Object.freeze(e),t&&qc(e,function(n,r){return S$(r,!0)},!0)),e}function XP(){Ht(2)}function x$(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function si(e){var t=iN[e];return t||Ht(18,e),t}function v5(){return os||Ht(0),os}function Nv(e,t){t&&(si("Patches"),e.u=[],e.s=[],e.v=t)}function nh(e){y2(e),e.p.forEach(JP),e.p=null}function y2(e){e===os&&(os=e.l)}function m5(e){return os={p:[],l:os,h:e,m:!0,_:0}}function JP(e){var t=e[xn];t.i===0||t.i===1?t.j():t.O=!0}function Iv(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||si("ES5").S(t,e,r),r?(n[xn].P&&(nh(t),Ht(4)),Ba(e)&&(e=rh(t,e),t.l||ih(t,e)),t.u&&si("Patches").M(n[xn],e,t.u,t.s)):e=rh(t,n,[]),nh(t),t.u&&t.v(t.u,t.s),e!==b9?e:void 0}function rh(e,t,n){if(x$(t))return t;var r=t[xn];if(!r)return qc(t,function(o,a){return y5(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return ih(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=D$(r.k):r.o;qc(r.i===3?new Set(i):i,function(o,a){return y5(e,r,i,o,a,n)}),ih(e,i,!1),n&&e.u&&si("Patches").R(r,n,e.u,e.s)}return r.o}function y5(e,t,n,r,i,o){if(i===n&&Ht(5),Oa(i)){var a=rh(e,i,o&&t&&t.i!==3&&!m2(t.D,r)?o.concat(r):void 0);if(y9(n,r,a),!Oa(a))return;e.m=!1}if(Ba(i)&&!x$(i)){if(!e.h.F&&e._<1)return;rh(e,i),t&&t.A.l||ih(e,i)}}function ih(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&S$(t,n)}function Rv(e,t){var n=e[xn];return(n?Xo(n):e)[t]}function b5(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function b2(e){e.P||(e.P=!0,e.l&&b2(e.l))}function jv(e){e.o||(e.o=D$(e.t))}function $2(e,t,n){var r=E$(t)?si("MapSet").N(t,n):C$(t)?si("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),u={i:a?1:0,A:o?o.A:v5(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},s=u,l=Bp;a&&(s=[u],l=Fp);var c=Proxy.revocable(s,l),f=c.revoke,d=c.proxy;return u.k=d,u.j=f,d}(t,n):si("ES5").J(t,n);return(n?n.A:v5()).p.push(r),r}function ZP(e){return Oa(e)||Ht(22,e),function t(n){if(!Ba(n))return n;var r,i=n[xn],o=Ts(n);if(i){if(!i.P&&(i.i<4||!si("ES5").K(i)))return i.t;i.I=!0,r=$5(n,o),i.I=!1}else r=$5(n,o);return qc(r,function(a,u){i&&KP(i.t,a)===u||y9(r,a,t(u))}),o===3?new S
Could not completely normalize the editor after `.concat(l,` iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state.
`));var f=r(e).pop();if(W.has(e,f)){var d=E.node(e,f);e.normalizeNode(d)}c++}})}},parent(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=E.path(e,t,n),i=_.parent(r),o=E.node(e,i);return o},path(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:r,edge:i}=n;if(_.isPath(t)){if(i==="start"){var[,o]=W.first(e,t);t=o}else if(i==="end"){var[,a]=W.last(e,t);t=a}}return R.isRange(t)&&(i==="start"?t=R.start(t):i==="end"?t=R.end(t):t=_.common(t.anchor.path,t.focus.path)),$e.isPoint(t)&&(t=t.path),r!=null&&(t=t.slice(0,r)),t},hasPath(e,t){return W.has(e,t)},pathRef(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:r="forward"}=n,i={current:t,affinity:r,unref(){var{current:a}=i,u=E.pathRefs(e);return u.delete(i),i.current=null,a}},o=E.pathRefs(e);return o.add(i),i},pathRefs(e){var t=A5.get(e);return t||(t=new Set,A5.set(e,t)),t},point(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:r="start"}=n;if(_.isPath(t)){var i;if(r==="end"){var[,o]=W.last(e,t);i=o}else{var[,a]=W.first(e,t);i=a}var u=W.get(e,i);if(!X.isText(u))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:i,offset:r==="end"?u.text.length:0}}if(R.isRange(t)){var[s,l]=R.edges(t);return r==="start"?s:l}return t},pointRef(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:r="forward"}=n,i={current:t,affinity:r,unref(){var{current:a}=i,u=E.pointRefs(e);return u.delete(i),i.current=null,a}},o=E.pointRefs(e);return o.add(i),i},pointRefs(e){var t=O5.get(e);return t||(t=new Set,O5.set(e,t)),t},*positions(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:n=e.selection,unit:r="offset",reverse:i=!1,voids:o=!1}=t;if(!n)return;var a=E.range(e,n),[u,s]=R.edges(a),l=i?s:u,c=!1,f="",d=0,p=0,g=0;for(var[v,m]of E.nodes(e,{at:n,reverse:i,voids:o})){if(te.isElement(v)){if(!o&&e.isVoid(v)){yield E.start(e,m);continue}if(e.isInline(v))continue;if(E.hasInlines(e,v)){var y=_.isAncestor(m,s.path)?s:E.end(e,m),h=_.isAncestor(m,u.path)?u:E.start(e,m);f=E.string(e,{anchor:h,focus:y},{voids:o}),c=!0}}if(X.isText(v)){var $=_.equals(m,l.path);for($?(p=i?l.offset:v.text.length-l.offset,g=l.offset):(p=v.text.length,g=i?p:0),($||c||r==="offset")&&(yield{path:m,offset:g},c=!1);;){if(d===0){if(f==="")break;d=w(f,r,i),f=F$(f,d,i)[1]}if(g=i?g-d:g+d,p=p-d,p<0){d=-p;break}d=0,yield{path:m,offset:g}}}}function w(C,D,A){return D==="character"?B$(C,A):D==="word"?dN(C,A):D==="line"||D==="block"?C.length:1}},previous(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:i,at:o=e.selection}=t;if(!!o){var a=E.before(e,o,{voids:r});if(!!a){var[,u]=E.first(e,[]),s=[a.path,u];if(_.isPath(o)&&o.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(_.isPath(o)){var[l]=E.parent(e,o);i=f=>l.children.includes(f)}else i=()=>!0;var[c]=E.nodes(e,{reverse:!0,at:s,match:i,mode:n,voids:r});return c}}},range(e,t,n){if(R.isRange(t)&&!n)return t;var r=E.start(e,t),i=E.end(e,n||t);return{anchor:r,focus:i}},rangeRef(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:r="forward"}=n,i={current:t,affinity:r,unref(){var{current:a}=i,u=E.rangeRefs(e);return u.delete(i),i.current=null,a}},o=E.rangeRefs(e);return o.add(i),i},rangeRefs(e){var t=B5.get(e);return t||(t=new Set,B5.set(e,t)),t},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){x5.set(e,t)},start(e,t){return E.point(e,t,{edge:"start"})},string(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:r=!1}=n,i=E.range(e,t),[o,a]=R.edges(i),u="";for(var[s,l]of E.nodes(e,{at:i,match:X.isText,voids:r})){var c=s.text;_.equals(l,a.path)&&(c=c.slice(0,a.offset)),_.equals(l,o.path)&&(c=c.slice(o.offset)),u+=c}return u},unhangRange(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:r=!1}=n,[i,o]=R.edges(t);if(i.offset!==0||o.offset!==0||R.isCollapsed(t))return t;var a=E.above(e,
* Takes a string with placeholder variables like `%{smart_count} file selected`
* and replaces it with values from options `{smart_count: 5}`
*
* @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
* taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
*
* @param {string} phrase that needs interpolation, with placeholders
* @param {object} options with values that will be used to replace placeholders
* @returns {any[]} interpolated
*/function S6(e,t){const n=/\$/g,r="$$$$";let i=[e];if(t==null)return i;for(const o of Object.keys(t))if(o!=="_"){let a=t[o];typeof a=="string"&&(a=n[Symbol.replace](a,r)),i=JL(i,new RegExp(`%\\{${o}\\}`,"g"),a)}return i}var gO=(uu=XL("apply"),class{constructor(t){Object.defineProperty(this,uu,{value:ZL}),this.locale={strings:{},pluralize(n){return n===1?0:1}},Array.isArray(t)?t.forEach(D6(this,uu)[uu],this):D6(this,uu)[uu](t)}translate(t,n){return this.translateArray(t,n).join("")}translateArray(t,n){if(!KL(this.locale.strings,t))throw new Error(`missing string: ${t}`);const r=this.locale.strings[t];if(typeof r=="object"){if(n&&typeof n.smart_count<"u"){const o=this.locale.pluralize(n.smart_count);return S6(r[o],n)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return S6(r,n)}});function ZL(e){if(!(e!=null&&e.strings))return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}var vO=function(){var t={},n=t._fns={};t.emit=function(a,u,s,l,c,f,d){var p=r(a);p.length&&i(a,p,[u,s,l,c,f,d])},t.on=function(a,u){n[a]||(n[a]=[]),n[a].push(u)},t.once=function(a,u){function s(){u.apply(this,arguments),t.off(a,s)}this.on(a,s)},t.off=function(a,u){var s=[];if(a&&u){var l=this._fns[a],c=0,f=l?l.length:0;for(c;c<f;c++)l[c]!==u&&s.push(l[c])}s.length?this._fns[a]=s:delete this._fns[a]};function r(o){var a=n[o]?n[o]:[],u=o.indexOf(":"),s=u===-1?[o]:[o.substring(0,u),o.substring(u+1)],l=Object.keys(n),c=0,f=l.length;for(c;c<f;c++){var d=l[c];if(d==="*"&&(a=a.concat(n[d])),s.length===2&&s[0]===d){a=a.concat(n[d]);break}}return a}function i(o,a,u){var s=0,l=a.length;for(s;s<l&&a[s];s++)a[s].event=o,a[s].apply(a[s],u)}return t};let QL="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var eM={urlAlphabet:QL};let{urlAlphabet:tM}=eM;{if(typeof navigator<"u"&&navigator.product==="ReactNative"&&typeof crypto>"u")throw new Error("React Native does not have a built-in secure random generator. If you don\u2019t need unpredictable IDs use `nanoid/non-secure`. For secure IDs, import `react-native-get-random-values` before Nano ID.");if(typeof msCrypto<"u"&&typeof crypto>"u")throw new Error("Import file with `if (!window.crypto) window.crypto = window.msCrypto` before importing Nano ID to fix IE 11 support");if(typeof crypto>"u")throw new Error("Your browser does not have secure random generator. If you don\u2019t need unpredictable IDs, you can use nanoid/non-secure.")}let mO=e=>crypto.getRandomValues(new Uint8Array(e)),yO=(e,t,n)=>{let r=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*r*t/e.length);return()=>{let o="";for(;;){let a=n(i),u=i;for(;u--;)if(o+=e[a[u]&r]||"",o.length===t)return o}}},nM=(e,t)=>yO(e,t,mO),rM=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=n[e]&63;r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r<63?t+="_":t+="-"}return t};var iM={nanoid:rM,customAlphabet:nM,customRandom:yO,urlAlphabet:tM,random:mO},Gv=function(t){if(typeof t!="number"||isNaN(t))throw new TypeError("Expected a number, got "+typeof t);var n=t<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(n&&(t=-t),t<1)return(n?"-":"")+t+" B";var i=Math.min(Math.floor(Math.log(t)/Math.log(1024)),r.length-1);t=Number(t/Math.pow(1024,i));var o=r[i];return t>=10||t%1===0?(n?"-":"")+t.toFixed(0)+" "+o:(n?"-":"")+t.toFixed(1)+" "+o};function bO(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}bO.prototype.match=function(e){var t=!0,n=this.parts,r,i=n.length,o;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(o=(e||"").split(this.separator),r=0;t&&r<i;r++)n[r]!=="*"&&(r<o.length?t=n[r]===o[r]:t=!1);t=t&&o}else if(typeof e.splice=="function")for(t=[],r=e.length;r--;)this.match(e[r])&&(t[t.length]=e[r]);else if(typeof e=="object"){t={};for(var a in e)this.match(a)&&(t[a]=e[a])}return t};var oM=function(e,t,n){var r=new bO(e,n||/[\/\.]/);return typeof t<"u"?r.match(t):r},aM=/[\/\+\.]/,uM=function(e,t){functi
id: ${r[o].id}
type: ${r[o].type}`)}),r.length>0&&ne(this,fl)[fl](),i.length>0){let o=`Multiple errors occurred while adding files:
`;if(i.forEach(a=>{o+=`
* ${a.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:i.length}),details:o},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(i,o);{const a=new Error(o);throw a.errors=i,a}}}removeFiles(t,n){const{files:r,currentUploads:i}=this.getState(),o={...r},a={...i},u=Object.create(null);t.forEach(f=>{r[f]&&(u[f]=r[f],delete o[f])});function s(f){return u[f]===void 0}Object.keys(a).forEach(f=>{const d=i[f].fileIDs.filter(s);if(d.length===0){delete a[f];return}a[f]={...i[f],fileIDs:d}});const l={currentUploads:a,files:o};Object.keys(o).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const c=Object.keys(u);c.forEach(f=>{this.emit("file-removed",u[f],n)}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(t,n){n===void 0&&(n=null),this.removeFiles([t],n)}pauseResume(t){if(!this.getState().capabilities.resumableUploads||this.getFile(t).uploadComplete)return;const r=!(this.getFile(t).isPaused||!1);return this.setFileState(t,{isPaused:r}),this.emit("upload-pause",t,r),r}pauseAll(){const t={...this.getState().files};Object.keys(t).filter(r=>!t[r].progress.uploadComplete&&t[r].progress.uploadStarted).forEach(r=>{const i={...t[r],isPaused:!0};t[r]=i}),this.setState({files:t}),this.emit("pause-all")}resumeAll(){const t={...this.getState().files};Object.keys(t).filter(r=>!t[r].progress.uploadComplete&&t[r].progress.uploadStarted).forEach(r=>{const i={...t[r],isPaused:!1,error:null};t[r]=i}),this.setState({files:t}),this.emit("resume-all")}retryAll(){const t={...this.getState().files},n=Object.keys(t).filter(i=>t[i].error);if(n.forEach(i=>{const o={...t[i],isPaused:!1,error:null};t[i]=o}),this.setState({files:t,error:null}),this.emit("retry-all",n),n.length===0)return Promise.resolve({successful:[],failed:[]});const r=ne(this,ni)[ni](n,{forceAllowNewUpload:!0});return ne(this,ri)[ri](r)}cancelAll(){this.emit("cancel-all");const{files:t}=this.getState(),n=Object.keys(t);n.length&&this.removeFiles(n,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}retryUpload(t){this.setFileState(t,{error:null,isPaused:!1}),this.emit("upload-retry",t);const n=ne(this,ni)[ni]([t],{forceAllowNewUpload:!0});return ne(this,ri)[ri](n)}reset(){this.cancelAll()}logout(){this.iteratePlugins(t=>{t.provider&&t.provider.logout&&t.provider.logout()})}calculateProgress(t,n){if(!this.getFile(t.id)){this.log(`Not setting progress for a file that has been removed: ${t.id}`);return}const r=Number.isFinite(n.bytesTotal)&&n.bytesTotal>0;this.setFileState(t.id,{progress:{...this.getFile(t.id).progress,bytesUploaded:n.bytesUploaded,bytesTotal:n.bytesTotal,percentage:r?Math.round(n.bytesUploaded/n.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const n=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(n.length===0){this.emit("progress",0),this.setState({totalProgress:0});return}const r=n.filter(l=>l.progress.bytesTotal!=null),i=n.filter(l=>l.progress.bytesTotal==null);if(r.length===0){const l=n.length*100,c=i.reduce((d,p)=>d+p.progress.percentage,0),f=Math.round(c/l*100);this.setState({totalProgress:f});return}let o=r.reduce((l,c)=>l+c.progress.bytesTotal,0);const a=o/r.length;o+=a*i.length;let u=0;r.forEach(l=>{u+=l.progress.bytesUploaded}),i.forEach(l=>{u+=a*(l.progress.percentage||0)/100});let s=o===0?0:Math.round(u/o*100);s>100&&(s=100),this.setState({totalProgress:s}),this.emit("progress",s)}updateOnlineStatus(){(typeof window.navigator.onLine<"u"?window.navigator.onLine:!0)?(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(t,n){if(typeof t!="function"){const a=`Expected a plugin class, but got ${t===null?"null":typeof t}. Please verify that the plugin was impor
Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(a)}return t.VERSION&&this.log(`Using ${i} v${t.VERSION}`),r.type in ne(this,zt)[zt]?ne(this,zt)[zt][r.type].push(r):ne(this,zt)[zt][r.type]=[r],r.install(),this}getPlugin(t){for(const n of Object.values(ne(this,zt)[zt])){const r=n.find(i=>i.id===t);if(r!=null)return r}}[DO](t){return ne(this,zt)[zt][t]}iteratePlugins(t){Object.values(ne(this,zt)[zt]).flat(1).forEach(t)}removePlugin(t){this.log(`Removing plugin ${t.id}`),this.emit("plugin-remove",t),t.uninstall&&t.uninstall();const n=ne(this,zt)[zt][t.type],r=n.findIndex(a=>a.id===t.id);r!==-1&&n.splice(r,1);const o={plugins:{...this.getState().plugins,[t.id]:void 0}};this.setState(o)}close(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.reset(),ne(this,sl)[sl](),this.iteratePlugins(t=>{this.removePlugin(t)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",ne(this,rr)[rr]),window.removeEventListener("offline",ne(this,rr)[rr]))}hideInfo(){const{info:t}=this.getState();this.setState({info:t.slice(1)}),this.emit("info-hidden")}info(t,n,r){n===void 0&&(n="info"),r===void 0&&(r=3e3);const i=typeof t=="object";this.setState({info:[...this.getState().info,{type:n,message:i?t.message:t,details:i?t.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(t,n){const{logger:r}=this.opts;switch(n){case"error":r.error(t);break;case"warning":r.warn(t);break;default:r.debug(t);break}}restore(t){return this.log(`Core: attempting to restore upload "${t}"`),this.getState().currentUploads[t]?ne(this,ri)[ri](t):(ne(this,aa)[aa](t),Promise.reject(new Error("Nonexistent upload")))}[SO](){return ne(this,ni)[ni](...arguments)}addResultData(t,n){if(!ne(this,Qv)[Qv](t)){this.log(`Not setting result for an upload that has been removed: ${t}`);return}const{currentUploads:r}=this.getState(),i={...r[t],result:{...r[t].result,...n}};this.setState({currentUploads:{...r,[t]:i}})}upload(){var t;(t=ne(this,zt)[zt].uploader)!=null&&t.length||this.log("No uploader type plugins are used","warning");let{files:n}=this.getState();const r=this.opts.onBeforeUpload(n);return r===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&typeof r=="object"&&(n=r,this.setState({files:n})),Promise.resolve().then(()=>{ne(this,Xv)[Xv](n),ne(this,Jv)[Jv](n)}).catch(i=>{ne(this,Tt)[Tt](i)}).then(()=>{const{currentUploads:i}=this.getState(),o=Object.values(i).flatMap(s=>s.fileIDs),a=[];Object.keys(n).forEach(s=>{const l=this.getFile(s);!l.progress.uploadStarted&&o.indexOf(s)===-1&&a.push(l.id)});const u=ne(this,ni)[ni](a);return ne(this,ri)[ri](u)}).catch(i=>{ne(this,Tt)[Tt](i,{showInformer:!1})}))}}function xM(e,t){t===void 0&&(t=this.getFiles());const{maxFileSize:n,minFileSize:r,maxTotalFileSize:i,maxNumberOfFiles:o,allowedFileTypes:a}=this.opts.restrictions;if(o&&t.length+1>o)throw new Tr(`${this.i18n("youCanOnlyUploadX",{smart_count:o})}`);if(a&&!a.some(s=>s.indexOf("/")>-1?e.type?uM(e.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&e.extension?e.extension.toLowerCase()===s.substr(1).toLowerCase():!1)){const s=a.join(", ");throw new Tr(this.i18n("youCanOnlyUploadFileTypes",{types:s}))}if(i&&e.size!=null){let u=0;if(u+=e.size,t.forEach(s=>{u+=s.size}),u>i)throw new Tr(this.i18n("exceedsSize",{size:Gv(i),file:e.name}))}if(n&&e.size!=null&&e.size>n)throw new Tr(this.i18n("exceedsSize",{size:Gv(n),file:e.name}));if(r&&e.size!=null&&e.size<r)throw new Tr(this.i18n("inferiorSize",{size:Gv(r)}))}function AM(e){const{minNumberOfFiles:t}=this.opts.restrictions;if(Object.keys(e).length<t)throw new Tr(`${this.i18n("youHaveToAtLeastSelectX",{smart_count:t})}`)}function OM(e){const{requiredMetaFields:t}=this.opts.restrictions,{hasOwnProperty:n}=Object.prototype,r=[],i=[];for(let o=0;o<t.length;o++)if(!n.call(e.meta,t[o])||e.meta[t[o]]===""){const a=new Tr(`${this.i18n("missingRequiredMetaFieldOnFile",{fileName:e.name})}`);r.push(a),i.push(t[o]),ne(this,Tt)[Tt](a,{file:e,showInformer:!1,
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/function o8(e){return Object.prototype.toString.call(e)==="[object Object]"}at({target:"Object",stat:!0,forced:MH},{keys:function(e){return Ku(Ao(e))}});var zH={isHistory(e){return o8(t=e)!==!1&&((n=t.constructor)===void 0||o8(r=n.prototype)!==!1&&r.hasOwnProperty("isPrototypeOf")!==!1)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||Gi.isOperationList(e.redos[0]))&&(e.undos.length===0||Gi.isOperationList(e.undos[0]));var t,n,r}},c1=new WeakMap,f1=new WeakMap,Hu={isHistoryEditor:e=>zH.isHistory(e.history)&&E.isEditor(e),isMerging:e=>f1.get(e),isSaving:e=>c1.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=Hu.isMerging(e);f1.set(e,!1),t(),f1.set(e,n)},withoutSaving(e,t){var n=Hu.isSaving(e);c1.set(e,!1),t(),c1.set(e,n)}},HH=(e,t)=>e.type==="set_selection"||!(!t||e.type!=="insert_text"||t.type!=="insert_text"||e.offset!==t.offset+t.text.length||!_.equals(e.path,t.path))||!(!t||e.type!=="remove_text"||t.type!=="remove_text"||e.offset+e.text.length!==t.offset||!_.equals(e.path,t.path)),UH=(e,t)=>e.type!=="set_selection"||e.properties!=null&&e.newProperties!=null,VH=(e,t)=>!(!t||e.type!=="set_selection"||t.type!=="set_selection"),WH=e=>e.type!=="set_selection",qH=U.String,Ge=function(e){if(r0(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return qH(e)},ew=function(){var e=mt(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},GH=ks.PROPER,V2=RegExp.prototype,WO=V2.toString,KH=re(ew),YH=je(function(){return WO.call({source:"a",flags:"b"})!="/a/b"}),XH=GH&&WO.name!="toString";(YH||XH)&&pn(RegExp.prototype,"toString",function(){var e=mt(this),t=Ge(e.source),n=e.flags;return"/"+t+"/"+Ge(n===void 0&&Ta(V2,e)&&!("flags"in V2)?KH(e):n)},{unsafe:!0});var jd,JH=Nt?Object.defineProperties:function(e,t){mt(e);for(var n,r=Oo(t),i=Ku(t),o=i.length,a=0;o>a;)gr.f(e,n=i[a++],r[n]);return e},W2=qa("document","documentElement"),qO=Z$("IE_PROTO"),d1=function(){},GO=function(e){return"<script>"+e+"<\/script>"},a8=function(e){e.write(GO("")),e.close();var t=e.parentWindow.Object;return e=null,t},Np=function(){try{jd=new ActiveXObject("htmlfile")}catch{}var e,t;Np=typeof document<"u"?document.domain&&jd?a8(jd):((t=Xc("iframe")).style.display="none",W2.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(GO("document.F=Object")),e.close(),e.F):a8(jd);for(var n=Eh.length;n--;)delete Np.prototype[Eh[n]];return Np()};n0[qO]=!0;var a0=Object.create||function(e,t){var n;return e!==null?(d1.prototype=mt(e),n=new d1,d1.prototype=null,n[qO]=e):n=Np(),t===void 0?n:JH(n,t)},q2=st("unscopables"),G2=Array.prototype;G2[q2]==null&&gr.f(G2,q2,{configurable:!0,value:a0(null)});var xc=function(e){G2[q2][e]=!0},ZH=HO.includes;at({target:"Array",proto:!0},{includes:function(e){return ZH(this,e,arguments.length>1?arguments[1]:void 0)}}),xc("includes");var QH=st("match"),tw=function(e){var t;return Ye(e)&&((t=e[QH])!==void 0?!!t:lr(e)=="RegExp")},eU=U.TypeError,nw=function(e){if(tw(e))throw eU("The method doesn't accept regular expressions");return e},tU=st("match"),rw=function(e){var t=/./;try{"/./"[e](t)}catch{try{return t[tU]=!1,"/./"[e](t)}catch{}}return!1},nU=re("".indexOf);at({target:"String",proto:!0,forced:!rw("includes")},{includes:function(e){return!!~nU(Ge(Xn(this)),Ge(nw(e)),arguments.length>1?arguments[1]:void 0)}});var u8,rU=/"/g,iU=re("".replace);at({target:"String",proto:!0,forced:(u8="anchor",je(function(){var e=""[u8]('"');return e!==e.toLowerCase()||e.split('"').length>3}))},{anchor:function(e){return t="a",n="name",r=e,i=Ge(Xn(this)),o="<"+t,n!==""&&(o+=" "+n+'="'+iU(Ge(r),rU,"&quot;")+'"'),o+">"+i+"</"+t+">";var t,n,r,i,o}});var K2=function(e,t,n){var r,i;mt(e);try{if(!(r=ka(e,"return"))){if(t==="throw")throw n;return n}r=Be(r,e)}catch(o){i=!0,r=o}if(t==="throw")throw n;if(i)throw r;return mt(r),n},oU=function(e,t,n,r){try{return r?t(mt(n)[0],n[1]):t(n)}catch(i){K2(e,"throw",i)}},ms={},aU=st("iterator"),uU=Array.prototype,KO=function(e){return e!==void
`)&&e.flags==="s")}),MU=U.RegExp,cw=je(function(){var e=MU("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),zU=tn.get,HU=G$("native-string-replace",String.prototype.replace),Sh=RegExp.prototype.exec,Z2=Sh,UU=re("".charAt),VU=re("".indexOf),WU=re("".replace),h1=re("".slice),g1=function(){var e=/a/,t=/b*/g;return Be(Sh,e,"a"),Be(Sh,t,"a"),e.lastIndex!==0||t.lastIndex!==0}(),y8=s0.BROKEN_CARET,v1=/()??/.exec("")[1]!==void 0;(g1||v1||y8||lw||cw)&&(Z2=function(e){var t,n,r,i,o,a,u,s=this,l=zU(s),c=Ge(e),f=l.raw;if(f)return f.lastIndex=s.lastIndex,t=Be(Z2,f,c),s.lastIndex=f.lastIndex,t;var d=l.groups,p=y8&&s.sticky,g=Be(ew,s),v=s.source,m=0,y=c;if(p&&(g=WU(g,"y",""),VU(g,"g")===-1&&(g+="g"),y=h1(c,s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&UU(c,s.lastIndex-1)!==`
`)&&(v="(?: "+v+")",y=" "+y,m++),n=new RegExp("^(?:"+v+")",g)),v1&&(n=new RegExp("^"+v+"$(?!\\s)",g)),g1&&(r=s.lastIndex),i=Be(Sh,p?n:s,y),p?i?(i.input=h1(i.input,m),i[0]=h1(i[0],m),i.index=s.lastIndex,s.lastIndex+=i[0].length):s.lastIndex=0:g1&&i&&(s.lastIndex=s.global?i.index+i[0].length:r),v1&&i&&i.length>1&&Be(HU,i[0],n,function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(i[o]=void 0)}),i&&d)for(i.groups=a=a0(null),o=0;o<d.length;o++)a[(u=d[o])[0]]=i[u[1]];return i});var ef=Z2;at({target:"RegExp",proto:!0,forced:/./.exec!==ef},{exec:ef});var fw=Function.prototype,b8=fw.apply,qU=fw.bind,$8=fw.call,dw=typeof Reflect=="object"&&Reflect.apply||(qU?$8.bind(b8):function(){return $8.apply(b8,arguments)}),GU=st("species"),m1=RegExp.prototype,pw=function(e,t,n,r){var i=st(e),o=!je(function(){var l={};return l[i]=function(){return 7},""[e](l)!=7}),a=o&&!je(function(){var l=!1,c=/a/;return e==="split"&&((c={}).constructor={},c.constructor[GU]=function(){return c},c.flags="",c[i]=/./[i]),c.exec=function(){return l=!0,null},c[i](""),!l});if(!o||!a||n){var u=re(/./[i]),s=t(i,""[e],function(l,c,f,d,p){var g=re(l),v=c.exec;return v===ef||v===m1.exec?o&&!p?{done:!0,value:u(c,f,d)}:{done:!0,value:g(f,c,d)}:{done:!1}});pn(String.prototype,e,s[0]),pn(m1,i,s[1])}r&&sr(m1[i],"sham",!0)},KU=ZO.charAt,hw=function(e,t,n){return t+(n?KU(e,t).length:1)},YU=Math.floor,y1=re("".charAt),XU=re("".replace),b1=re("".slice),JU=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ZU=/\$([$&'`]|\d{1,2})/g,QU=function(e,t,n,r,i,o){var a=n+e.length,u=r.length,s=ZU;return i!==void 0&&(i=Ao(i),s=JU),XU(o,s,function(l,c){var f;switch(y1(c,0)){case"$":return"$";case"&":return e;case"`":return b1(t,0,n);case"'":return b1(t,a);case"<":f=i[b1(c,1,-1)];break;default:var d=+c;if(d===0)return l;if(d>u){var p=YU(d/10);return p===0?l:p<=u?r[p-1]===void 0?y1(c,1):r[p-1]+y1(c,1):l}f=r[d-1]}return f===void 0?"":f})},eV=U.TypeError,tf=function(e,t){var n=e.exec;if(Ue(n)){var r=Be(n,e,t);return r!==null&&mt(r),r}if(lr(e)==="RegExp")return Be(ef,e,t);throw eV("RegExp#exec called on incompatible receiver")},Q2=st("replace"),tV=Math.max,nV=Math.min,rV=re([].concat),$1=re([].push),w8=re("".indexOf),E8=re("".slice),iV="a".replace(/./,"$0")==="$0",C8=!!/./[Q2]&&/./[Q2]("a","$0")==="";pw("replace",function(e,t,n){var r=C8?"$":"$0";return[function(i,o){var a=Xn(this),u=i==null?void 0:ka(i,Q2);return u?Be(u,i,a,o):Be(t,Ge(a),i,o)},function(i,o){var a=mt(this),u=Ge(i);if(typeof o=="string"&&w8(o,r)===-1&&w8(o,"$<")===-1){var s=n(t,a,u,o);if(s.done)return s.value}var l=Ue(o);l||(o=Ge(o));var c=a.global;if(c){var f=a.unicode;a.lastIndex=0}for(var d=[];;){var p=tf(a,u);if(p===null||($1(d,p),!c))break;Ge(p[0])===""&&(a.lastIndex=hw(u,_s(a.lastIndex),f))}for(var g,v="",m=0,y=0;y<d.length;y++){for(var h=Ge((p=d[y])[0]),$=tV(nV(Uf(p.index),u.length),0),w=[],C=1;C<p.length;C++)$1(w,(g=p[C])===void 0?g:String(g));var D=p.groups;if(l){var A=rV([h],w,$,u);D!==void 0&&$1(A,D);var I=Ge(dw(o,void 0,A))}else I=QU(h,u,$,w,D,o);$>=m&&(v+=E8(u,m,$)+I,m=$+h.length)}return v+E8(u,m)}]},!!je(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$<a>")!=="7"})||!iV||C8);/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var eb=function(e,t){return eb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},eb(e,t)};function Ns(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}eb(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Wn=function(){return Wn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Wn.apply(this,arguments)};function zn(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Oe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(u){i={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function tb(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}var oV=0,D8=function(){this.id=""+oV++},aV=tn.set,uV=tn.getterFor("Array Iterator"),mc=uw(Array,"Array",function(e,t){aV(this,{type:"Array Iterator",target:Oo(e),index:0,kind:t})},function(){var e=uV(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):n=="keys"?{value:r,done:!1}:n=="values"?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},"values");ms.Arguments=ms.Array,xc("keys"),xc("values"),xc("entries");var bs=function(e,t,n){for(var r in t)pn(e,r,t[r],n);return e},sV=U.Array,lV=Math.max,nb=function(e,t,n){for(var r=Ga(e),i=vs(t,r),o=vs(n===void 0?r:n,r),a=sV(lV(o-i,0)),u=0;i<o;i++,u++)Qc(a,u,e[i]);return a.length=u,a},S8=Jc.f,x8=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],cV={f:function(e){return x8&&lr(e)=="Window"?function(t){try{return S8(t)}catch{return nb(x8)}}(e):S8(Oo(e))}},A8=je(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),Md=Object.isExtensible,ua=je(function(){Md(1)})||A8?function(e){return!!Ye(e)&&(!A8||lr(e)!="ArrayBuffer")&&(!Md||Md(e))}:Md,fV=!je(function(){return Object.isExtensible(Object.preventExtensions({}))}),l0=Hf(function(e){var t=gr.f,n=!1,r=K$("meta"),i=0,o=function(u){t(u,r,{value:{objectID:"O"+i++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},n=!0;var u=Jc.f,s=re([].splice),l={};l[r]=1,u(l).length&&(Jc.f=function(c){for(var f=u(c),d=0,p=f.length;d<p;d++)if(f[d]===r){s(f,d,1);break}return f},at({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:cV.f}))},fastKey:function(u,s){if(!Ye(u))return typeof u=="symbol"?u:(typeof u=="string"?"S":"P")+u;if(!vt(u,r)){if(!ua(u))return"F";if(!s)return"E";o(u)}return u[r].objectID},getWeakData:function(u,s){if(!vt(u,r)){if(!ua(u))return!0;if(!s)return!1;o(u)}return u[r].weakData},onFreeze:function(u){return fV&&n&&ua(u)&&!vt(u,r)&&o(u),u}};n0[r]=!0}),dV=U.TypeError,Ip=function(e,t){this.stopped=e,this.result=t},O8=Ip.prototype,nf=function(e,t,n){var r,i,o,a,u,s,l,c=n&&n.that,f=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),g=_a(t,c),v=function(y){return r&&K2(r,"normal",y),new Ip(!0,y)},m=function(y){return f?(mt(y),p?g(y[0],y[1],v):g(y[0],y[1])):p?g(y,v):g(y)};if(d)r=e;else{if(!(i=iw(e)))throw dV(Qg(e)+" is not iterable");if(KO(i)){for(o=0,a=Ga(e);a>o;o++)if((u=m(e[o]))&&Ta(O8,u))return u;return new Ip(!1)}r=YO(e,i)}for(s=r.next;!(l=Be(s,r)).done;){try{u=m(l.value)}catch(y){K2(r,"throw",y)}if(typeof u=="object"&&u&&Ta(O8,u))return u}return new Ip(!1)},pV=U.TypeError,c0=function(e,t){if(Ta(t,e))return e;throw pV("Incorrect invo
`)}return i};function cB(e,t){if(!(e instanceof HTMLElement&&e.dataset.slateVoid==="true"))for(var n=e.childNodes,r=n.length;r--;){var i=n[r],o=i.nodeType;o==3?t(i,e):o!=1&&o!=9&&o!=11||cB(i,t)}}function M8(e){if(e.length===0)return"";var t=e[0];return t.nodeType!==Zi.ELEMENT_NODE?"":t.tagName.toLowerCase()}(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"})(Zi||(Zi={})),globalThis.navigator!==void 0&&globalThis.window!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&globalThis.window.MSStream;var sb=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),Ac=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent);var El=typeof navigator<"u"&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),xV=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),AV=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),lb=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent);typeof navigator<"u"&&/.*QQBrowser/.test(navigator.userAgent);var Cl=!AV&&!xV&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",x={getWindow:function(e){var t=uB.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=jp.get(t);return n||(n=new D8,jp.set(t,n)),n},setNewKey:function(e){var t=new D8;jp.set(e,t)},findPath:function(e,t){for(var n=[],r=t;;){var i=$s.get(r);if(i==null){if(E.isEditor(r))return n;break}var o=rf.get(r);if(o==null)break;n.unshift(o),r=i}throw new Error("Unable to find the path for Slate node: "+JSON.stringify(t))},findDocumentOrShadowRoot:function(e){if(e.isDestroyed)return window.document;var t=x.toDOMNode(e,e),n=t.getRootNode();return(n instanceof Document||n instanceof ShadowRoot)&&n.getSelection!=null?n:t.ownerDocument},getParentNode:function(e,t){return $s.get(t)||null},getParentsNodes:function(e,t){for(var n=[],r=t;r!==e&&r!=null;){var i=x.getParentNode(e,r);if(i==null)break;n.push(i),r=i}return n},getTopNode:function(e,t){var n=[x.findPath(e,t)[0]];return W.get(e,n)},toDOMNode:function(e,t){var n;if(E.isEditor(t))n=mw.get(e);else{var r=x.findKey(e,t);n=yw.get(r)}if(!n)throw new Error("Cannot resolve a DOM node from Slate node: "+JSON.stringify(t));return n},hasDOMNode:function(e,t,n){n===void 0&&(n={});var r,i=n.editable,o=i!==void 0&&i,a=x.toDOMNode(e,e);try{r=nr(t)?t:t.parentElement}catch(u){if(!u.message.includes('Permission denied to access property "nodeType"'))throw u}return!!r&&r.closest("[data-slate-editor]")===a&&(!o||r.isContentEditable||!!r.getAttribute("data-slate-zero-width"))},toDOMRange:function(e,t){var n=t.anchor,r=t.focus,i=R.isBackward(t),o=x.toDOMPoint(e,n),a=R.isCollapsed(t)?o:x.toDOMPoint(e,r),u=x.getWindow(e).document.createRange(),s=Oe(i?a:o,2),l=s[0],c=s[1],f=Oe(i?o:a,2),d=f[0],p=f[1],g=!!(nr(l)?l:l.parentElement).getAttribute("data-slate-zero-width"),v=!!(nr(d)?d:d.parentElement).getAttribute("data-slate-zero-width");return u.setStart(l,g?1:c),u.setEnd(d,v?1:p),u},toDOMPoint:function(e,t){var n,r,i,o=Oe(E.node(e,t.path),1)[0],a=x.toDOMNode(e,o);E.void(e,{at:t})&&(t={path:t.path,offset:0});var u=Array.from(a.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),s=0;try{for(var l=zn(u),c=l.next();!c.done;c=l.next()){var f=c.value,d=f.childNodes[0];if(d!=null&&d.textContent!=null){var p=d.textContent.length,g=f.getAttribute("data-slate-length"),v=s+(g==null?p:parseInt(g,10));if(t.offset<=v){i=[d,Math.min(p,Math.max(0,t.offset-s))];break}s=v}}}catch(m){n={error:m}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.err
`)))&&f--}if(!c){if(o)return null;throw new Error("Cannot resolve a Slate point from DOM point: "+t)}var y=x.toSlateNode(e,c);return{path:x.findPath(e,y),offset:f}},hasRange:function(e,t){var n=t.anchor,r=t.focus;return E.hasPath(e,n.path)&&E.hasPath(e,r.path)},getNodeType:function(e){return te.isElement(e)?e.type:""},checkNodeType:function(e,t){return this.getNodeType(e)===t},getNodesStr:function(e){return e.map(function(t){return W.string(t)}).join("")},getSelectedElems:function(e){var t,n,r=[],i=E.nodes(e,{universal:!0});try{for(var o=zn(i),a=o.next();!a.done;a=o.next()){var u=Oe(a.value,1)[0];te.isElement(u)&&r.push(u)}}catch(s){t={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},getSelectedNodeByType:function(e,t){var n=this,r=Oe(E.nodes(e,{match:function(o){return n.checkNodeType(o,t)},universal:!0}),1),i=r[0];return i==null?null:i[0]},getSelectedTextNode:function(e){var t=Oe(E.nodes(e,{match:function(r){return X.isText(r)},universal:!0}),1),n=t[0];return n==null?null:n[0]},isNodeSelected:function(e,t){var n=Oe(E.nodes(e,{match:function(i){return i===t},universal:!0}),1),r=n[0];return r!=null&&Oe(r,1)[0]===t},isSelectionAtLineEnd:function(e,t){var n=e.selection;return!!n&&(E.isEnd(e,n.anchor,t)||E.isEnd(e,n.focus,t))},getTextarea:function(e){var t=rb.get(e);if(t==null)throw new Error("Cannot find textarea instance by editor");return t},getToolbar:function(e){return f0.get(e)||null},getHoverbar:function(e){return xh.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(typeof n!="number"||n<=0)return 1/0;var i=n-e.getText().replace(/\r|\n|(\r\n)/g,"").length;return i<=0&&r&&r(e),i},cleanExposedTexNodeInSelectionBlock:function(e){var t,n,r,i,o=x.getTextarea(e).$textArea,a=o==null?void 0:o[0].childNodes;if(a)try{for(var u=zn(Array.from(a)),s=u.next();!s.done;s=u.next()){var l=s.value;if(l.nodeType!==3)break;l.remove()}}catch(v){t={error:v}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}var c=E.nodes(e,{match:function(v){return!(!te.isElement(v)||e.isInline(v))},universal:!0});try{for(var f=zn(c),d=f.next();!d.done;d=f.next()){var p=d.value;if(p!=null){var g=p[0];cB(x.toDOMNode(e,g),function(v,m){var y=O(m);y.attr("data-slate-string")||y.attr("data-slate-zero-width")||m.removeChild(v)})}}}catch(v){r={error:v}}finally{try{d&&!d.done&&(i=f.return)&&i.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=E.nodes(e,{match:function(u){return e.isVoid(u)}}),i=0;try{for(var o=zn(r),a=o.next();!a.done;a=o.next())a.value,i++}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i>0},isSelectedEmptyParagraph:function(e){var t=e.selection;if(t==null||R.isExpanded(t))return!1;var n=x.getSelectedNodeByType(e,"paragraph");if(n===null)return!1;var r=n.children;return r.length===1&&(r[0].text===""||void 0)},isEmptyPath:function(e,t){var n=E.node(e,t);if(n==null)return!1;var r=Oe(n,1)[0].children;return r.length===1&&r[0].text===""}},OV=1,fB={},of={};function BV(e,t){var n=e.key,r=e.factory,i=e.config,o=Wn(Wn({},i),t||{});if(of[n]!=null)throw new Error("Duplicated key '"+n+"' in menu items");of[n]=r,function(a,u){u!=null&&(fB[a]=u)}(n,o)}var z8=st("species"),ww=function(e){var t=qa(e),n=gr.f;Nt&&t&&!t[z8]&&n(t,z8,{configurable:!0,get:function(){return this}})},FV=gr.f,H8=l0.fastKey,U8=tn.set,x1=tn.getterFor,TV={getConstructor:function(e,t,n,r){var i=e(function(l,c){c0(l,o),U8(l,{type:t,index:a0(null),first:void 0,last:void 0,size:0}),Nt||(l.size=0),c!=null&&nf(c,l[r],{that:l,AS_ENTRIES:n})}),o=i.prototype,a=x1(t),u=function(l,c,f){var d,p,g=a(l),v=s(l,c);return v?v.value=f:(g.last=v={index:p=H8(c,!0),key:c,value:f,previous:d=g.last,next:void 0,removed:!1},g.first||(g.first=v),d&&(d.next=v),Nt?g.size++:l.s
2023-09-04 16:51:01 +08:00
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,V8=re("".replace),Ah="["+cb+"]",PV=RegExp("^"+Ah+Ah+"*"),NV=RegExp(Ah+Ah+"*$"),A1=function(e){return function(t){var n=Ge(Xn(t));return 1&e&&(n=V8(n,PV,"")),2&e&&(n=V8(n,NV,"")),n}},IV={start:A1(1),end:A1(2),trim:A1(3)},RV=ks.PROPER,jV=IV.trim;at({target:"String",proto:!0,forced:function(e){return je(function(){return!!cb[e]()||"\u200B\x85\u180E"[e]()!=="\u200B\x85\u180E"||RV&&cb[e].name!==e})}("trim")},{trim:function(){return jV(this)}});var Ew=[];function LV(e){Ew.push(e)}var dB={};function MV(e){var t=e.type,n=e.elemToHtml;dB[t||""]=n}function zV(e,t,n){var r=n.isInline(e)?"span":"div";return"<"+r+">"+t+"</"+r+">"}function HV(e,t){var n=e.type,r=n===void 0?"":n,i=e.children,o=i===void 0?[]:i,a=E.isVoid(t,e),u="";a||(u=o.map(function(c){return AB(c,t)}).join(""));var s=function(c){return dB[c]||zV}(r),l=s(e,u,t);return a||Ew.forEach(function(c){return l=c(e,l)}),l}var af,cu,W8,O1,Oh=U.Promise,UV=U.TypeError,VV=st("species"),pB=function(e,t){var n,r=mt(e).constructor;return r===void 0||(n=mt(r)[VV])==null?t:function(i){if(o0(i))return i;throw UV(Qg(i)+" is not a constructor")}(n)},hB=re([].slice),gB=/(?:ipad|iphone|ipod).*applewebkit/i.test(Gu),Qi=lr(U.process)=="process",fb=U.setImmediate,db=U.clearImmediate,WV=U.process,B1=U.Dispatch,qV=U.Function,q8=U.MessageChannel,GV=U.String,F1=0,Oc={};try{af=U.location}catch{}var Cw=function(e){if(vt(Oc,e)){var t=Oc[e];delete Oc[e],t()}},T1=function(e){return function(){Cw(e)}},G8=function(e){Cw(e.data)},K8=function(e){U.postMessage(GV(e),af.protocol+"//"+af.host)};fb&&db||(fb=function(e){var t=hB(arguments,1);return Oc[++F1]=function(){dw(Ue(e)?e:qV(e),void 0,t)},cu(F1),F1},db=function(e){delete Oc[e]},Qi?cu=function(e){WV.nextTick(T1(e))}:B1&&B1.now?cu=function(e){B1.now(T1(e))}:q8&&!gB?(O1=(W8=new q8).port2,W8.port1.onmessage=G8,cu=_a(O1.postMessage,O1)):U.addEventListener&&Ue(U.postMessage)&&!U.importScripts&&af&&af.protocol!=="file:"&&!je(K8)?(cu=K8,U.addEventListener("message",G8,!1)):cu="onreadystatechange"in Xc("script")?function(e){W2.appendChild(Xc("script")).onreadystatechange=function(){W2.removeChild(this),Cw(e)}}:function(e){setTimeout(T1(e),0)});var Dl,ra,Bc,Iu,k1,_1,P1,Y8,vB={set:fb,clear:db},KV=/ipad|iphone|ipod/i.test(Gu)&&U.Pebble!==void 0,YV=/web0s(?!.*chrome)/i.test(Gu),XV=Vf.f,N1=vB.set,X8=U.MutationObserver||U.WebKitMutationObserver,J8=U.document,Z8=U.process,Wd=U.Promise,Q8=XV(U,"queueMicrotask"),mB=Q8&&Q8.value;mB||(Dl=function(){var e,t;for(Qi&&(e=Z8.domain)&&e.exit();ra;){t=ra.fn,ra=ra.next;try{t()}catch(n){throw ra?Iu():Bc=void 0,n}}Bc=void 0,e&&e.enter()},gB||Qi||YV||!X8||!J8?!KV&&Wd&&Wd.resolve?((P1=Wd.resolve(void 0)).constructor=Wd,Y8=_a(P1.then,P1),Iu=function(){Y8(Dl)}):Qi?Iu=function(){Z8.nextTick(Dl)}:(N1=_a(N1,U),Iu=function(){N1(Dl)}):(k1=!0,_1=J8.createTextNode(""),new X8(Dl).observe(_1,{characterData:!0}),Iu=function(){_1.data=k1=!k1}));var I1,eC,yB,tC,bB=mB||function(e){var t={fn:e,next:void 0};Bc&&(Bc.next=t),ra||(ra=t,Iu()),Bc=t},JV=function(e){var t,n;this.promise=new e(function(r,i){if(t!==void 0||n!==void 0)throw TypeError("Bad Promise constructor");t=r,n=i}),this.resolve=mo(t),this.reject=mo(n)},Dw={f:function(e){return new JV(e)}},pb=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},ZV=typeof window=="object",$B=vB.set,QV=st("species"),xr="Promise",nC=tn.getterFor(xr),eW=tn.set,tW=tn.getterFor(xr),Zo=Oh&&Oh.prototype,kr=Oh,Sl=Zo,wB=U.TypeError,hb=U.document,Sw=U.process,Yu=Dw.f,nW=Yu,rW=!!(hb&&hb.createEvent&&U.dispatchEvent),EB=Ue(U.PromiseRejectionEvent),CB=!1,Fc=Zc(xr,function(){var e=t0(kr),t=e!==String(kr);if(!t&&Yc===66)return!0;if(Yc>=51&&/native code/.test(e))return!1;var n=new kr(function(i){i(1)}),r=function(i){i(function(){},function(){})};return(n.constructor={})[QV]=r,!(CB=n.then(function(){})instanceof r)||!t&&ZV&&!EB}),iW=Fc||!ow(function(e){kr.all(e).catch(function(){})}),DB=function(e){var t;return!(!Ye(e)||!Ue(t=e.then))&&t},xw=function(e,t){if(!e.notified){e.notifie